![]() |
Defines | |
#define | SI1147_ADDR 0xc0 |
I2C device address for Si1147 on weather station board. | |
Enumerations | |
enum | gesture_t { NONE, UP, DOWN, LEFT, RIGHT, TAP } |
Si114x gestures. More... | |
Functions | |
int | Si1147_Write_Register (I2C_TypeDef *i2c, uint8_t addr, uint8_t reg, uint8_t data) |
Writes register in the Si1147 sensor. | |
int | Si1147_Write_Block_Register (I2C_TypeDef *i2c, uint8_t addr, uint8_t reg, uint8_t length, uint8_t const *data) |
Writes a block of data to the Si1147 sensor. | |
int | Si1147_Read_Block_Register (I2C_TypeDef *i2c, uint8_t addr, uint8_t reg, uint8_t length, uint8_t *data) |
Reads a block of data from the Si1147 sensor. | |
int | Si1147_Read_Register (I2C_TypeDef *i2c, uint8_t addr, uint8_t reg, uint8_t *data) |
Reads register from the Si1147 sensor. | |
gesture_t | Si1147_NewSample (I2C_TypeDef *i2c, uint8_t addr, uint32_t timestamp) |
Reads new measurement data and processes a new sample. | |
int | Si1147_ConfigureDetection (I2C_TypeDef *i2c, uint8_t addr, int slow) |
Initializes and configures the Si1147 sensor. | |
int | Si1147_SetInterruptOutputEnable (I2C_TypeDef *i2c, uint8_t addr, int enable) |
Enables or disables the Si1147 interrupt pin. | |
int | Si1147_GetInterruptOutputEnable (I2C_TypeDef *i2c, uint8_t addr, int *enable) |
Get the enable status of the Si1147 interrupt pin. | |
int | Si1147_Detect_Device (I2C_TypeDef *i2c, uint8_t addr) |
Detects whether Si1147 is on the i2c bus. | |
int | Si1147_MeasureUVAndObjectPresent (I2C_TypeDef *i2c, uint8_t addr, uint16_t *uvIndex, int *objectDetect) |
Reads the UV measurement data and checks for object in proximity to the Si1147. |
#define SI1147_ADDR 0xc0 |
I2C device address for Si1147 on weather station board.
Definition at line 41 of file si114x_algorithm.h.
enum gesture_t |
Si114x gestures.
Definition at line 67 of file si114x_algorithm.h.
int Si1147_ConfigureDetection | ( | I2C_TypeDef * | i2c, | |
uint8_t | addr, | |||
int | lowpower | |||
) |
Initializes and configures the Si1147 sensor.
[in] | i2c | The I2C peripheral to use (not used). |
[in] | addr | The I2C address of the sensor. |
[in] | lowpower | Set to 1 to initialize without autonomous mode (low power) or set to 0 to enable autonomous mode. |
Definition at line 385 of file si114x_algorithm.c.
int Si1147_Detect_Device | ( | I2C_TypeDef * | i2c, | |
uint8_t | addr | |||
) |
Detects whether Si1147 is on the i2c bus.
[in] | i2c | The I2C peripheral to use (not used). |
[in] | addr | The I2C address of the sensor. |
Definition at line 55 of file si114x_algorithm.c.
int Si1147_GetInterruptOutputEnable | ( | I2C_TypeDef * | i2c, | |
uint8_t | addr, | |||
int * | enable | |||
) |
Get the enable status of the Si1147 interrupt pin.
[in] | i2c | The I2C peripheral to use (not used). |
[in] | addr | The I2C address of the sensor. |
[out] | enable | Will be set to 1 if the interrupt output pin is enabled or set to 0 if disabled. |
Definition at line 110 of file si114x_algorithm.c.
Referenced by Si1147_MeasureUVAndObjectPresent().
int Si1147_MeasureUVAndObjectPresent | ( | I2C_TypeDef * | i2c, | |
uint8_t | addr, | |||
uint16_t * | uvIndex, | |||
int * | objectDetect | |||
) |
Reads the UV measurement data and checks for object in proximity to the Si1147.
[in] | i2c | The I2C peripheral to use (not used). |
[in] | addr | The I2C address of the sensor. |
[out] | uvIndex | The UV index read from the sensor |
[out] | objectDetect | Returns true if an object is detected in front of the sensor, otherwise false. |
Definition at line 136 of file si114x_algorithm.c.
References Si1147_GetInterruptOutputEnable().
gesture_t Si1147_NewSample | ( | I2C_TypeDef * | i2c, | |
uint8_t | addr, | |||
uint32_t | timestamp | |||
) |
Reads new measurement data and processes a new sample.
This function should be called every time an interrupt for a new sample is received.
[in] | i2c | The I2C peripheral to use (not used). |
[in] | addr | The I2C address of the sensor. |
[in] | timestamp | The timestamp for when the sample interrupt was received. |
Definition at line 207 of file si114x_algorithm.c.
int Si1147_Read_Block_Register | ( | I2C_TypeDef * | i2c, | |
uint8_t | addr, | |||
uint8_t | reg, | |||
uint8_t | length, | |||
uint8_t * | data | |||
) |
Reads a block of data from the Si1147 sensor.
[in] | i2c | The I2C peripheral to use (not used). |
[in] | addr | The I2C address of the sensor. |
[out] | data | The data read from the sensor. |
[in] | length | The number of bytes to write to the sensor. |
[in] | reg | The first register to begin reading from. |
Definition at line 185 of file si1147_i2c.c.
References I2CDRV_Transfer().
int Si1147_Read_Register | ( | I2C_TypeDef * | i2c, | |
uint8_t | addr, | |||
uint8_t | reg, | |||
uint8_t * | data | |||
) |
Reads register from the Si1147 sensor.
[in] | i2c | The I2C peripheral to use (not used). |
[in] | addr | The I2C address of the sensor. |
[out] | data | The data read from the sensor. |
[in] | reg | The register address to read from in the sensor. |
Definition at line 47 of file si1147_i2c.c.
References I2CDRV_Transfer().
int Si1147_SetInterruptOutputEnable | ( | I2C_TypeDef * | i2c, | |
uint8_t | addr, | |||
int | enable | |||
) |
Enables or disables the Si1147 interrupt pin.
[in] | i2c | The I2C peripheral to use (not used). |
[in] | addr | The I2C address of the sensor. |
[in] | enable | Set to 1 to enable the interrupt output pin or set to 0 to disable the pin. |
Definition at line 81 of file si114x_algorithm.c.
int Si1147_Write_Block_Register | ( | I2C_TypeDef * | i2c, | |
uint8_t | addr, | |||
uint8_t | reg, | |||
uint8_t | length, | |||
uint8_t const * | data | |||
) |
Writes a block of data to the Si1147 sensor.
[in] | i2c | The I2C peripheral to use (not used). |
[in] | addr | The I2C address of the sensor. |
[in] | data | The data to write to the sensor. |
[in] | length | The number of bytes to write to the sensor. |
[in] | reg | The first register to begin writing to. |
Definition at line 136 of file si1147_i2c.c.
References I2CDRV_Transfer().
int Si1147_Write_Register | ( | I2C_TypeDef * | i2c, | |
uint8_t | addr, | |||
uint8_t | reg, | |||
uint8_t | data | |||
) |
Writes register in the Si1147 sensor.
[in] | i2c | The I2C peripheral to use (not used). |
[in] | addr | The I2C address of the sensor. |
[in] | data | The data to write to the sensor. |
[in] | reg | The register address to write to in the sensor. |
Definition at line 91 of file si1147_i2c.c.
References I2CDRV_Transfer().