hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
* Sensor Controller
 
Required properties:
- compatible: the sensor name,exampel: "gs_mma8452";
- reg: i2c slave address;
- type: sensor type;
- irq-gpio: sensor interrupt gpio pin;
- irq_enable: 1 use irq; 0 use pull mode;
- poll_delay_ms: pull delay time if use pull mode;
- layout: sensor orientation, choose 1-8 to make product work fine;
 
Example:
 
   hall_sensor: hall-mh248 {
       compatible = "hall-mh248";
       pinctrl-names = "default";
       pinctrl-0 = <&mh248_irq_gpio>;
       irq-gpio = <&gpio1 2 IRQ_TYPE_EDGE_RISING>;
       hall-active = <1>;
       status = "okay";
   };
      sensor@1d {
       compatible = "gs_mma8452";
       reg = <0x1d>;
       type = <SENSOR_TYPE_ACCEL>;
       irq-gpio = <&gpio8 GPIO_A0 IRQ_TYPE_EDGE_FALLING>;
       irq_enable = <1>;
       poll_delay_ms = <30>;
       layout = <1>;
   };
       sensor@19 {
       compatible = "gs_lis3dh";
       reg = <0x19>;
       type = <SENSOR_TYPE_ACCEL>;
       irq-gpio = <&gpio0 GPIO_A0 IRQ_TYPE_LEVEL_LOW>;
       irq_enable = <1>;
       poll_delay_ms = <30>;
       layout = <1>;
   };
 
 
 
TYPE: 
      
    SENSOR_TYPE_NULL  0     
    SENSOR_TYPE_ANGLE 1
    SENSOR_TYPE_ACCEL 2
    SENSOR_TYPE_COMPASS 3   
    SENSOR_TYPE_GYROSCOPE 4 
    SENSOR_TYPE_LIGHT 5     
    SENSOR_TYPE_PROXIMITY 6
    SENSOR_TYPE_TEMPERATURE 7       
      SENSOR_TYPE_PRESSURE 8
    SENSOR_TYPE_HALL 9
    define SENSOR_NUM_TYPES 10