Home | History | Annotate | only in /device/google/contexthub/firmware/os/drivers/st_acc44
Up to higher level directory
NameDateSize
README21-Aug-20181.7K
st_acc44.c21-Aug-201822.2K

README

      1 STMicroelectronics acc44 accelerometer sensor device driver for Google nanohub.
      2 The driver uses the device in high-resolution mode  with FS=8g.
      3 
      4 This drivers support following devices:
      5     - LIS2DW12
      6 
      7 - Supported features:
      8 
      9 A. Reports accelerometer data
     10 B. Different data rates:
     11 C. I2C protocol
     12 D. Data ready reported by interrupt
     13 
     14 
     15 - Platform/variant porting:
     16 
     17 The driver requires that following macros are defined in the variant.h
     18 file of the specific variant:
     19 
     20   ST_ACC44_I2C_BUS_ID    /* specify I2C Bus ID */
     21   ST_ACC44_I2C_SPEED     /* specify I2C Bus speed in hz */
     22   ST_ACC44_I2C_ADDR      /* specify device I2C address */
     23 
     24   ST_ACC44_INT_PIN       /* specify the gpio used for the DRDY irq */
     25   ST_ACC44_INT_IRQ       /* specify the exti interrupt of ST_ACC44_INT_PIN */
     26 
     27   ST_ACC44_TO_ANDROID_COORDINATE(x, y, z)
     28                          /* specify how axis has to be rotated according to variant platform
     29                           * orientation.
     30                           */
     31 
     32 Example:
     33 
     34   /*
     35    * Define platform/variant dependent ST_ACC44 device macros
     36    */
     37   #define ST_ACC44_DBG_ENABLED 1
     38 
     39   /* I2C defs to be used when device is plugged to I2C bus */
     40   #define ST_ACC44_I2C_BUS_ID      0
     41   #define ST_ACC44_I2C_SPEED       400000
     42   #define ST_ACC44_I2C_ADDR        0x19
     43 
     44   #define ST_ACC44_INT_PIN         GPIO_PC(5)
     45   #define ST_ACC44_INT_IRQ         EXTI9_5_IRQn
     46 
     47 #define ST_ACC44_TO_ANDROID_COORDINATE(x, y, z)   \
     48     do {                                        \
     49         float xi = x, yi = y, zi = z;           \
     50         x = xi; y = yi; z = zi;                 \
     51     } while (0)
     52 
     53 If these macros are not defined in the current variant the driver forces a compilation
     54 error.
     55