Contiki-NG
|
Files | |
file | sensor-common.c |
Utilities common among SensorTag sensors. | |
file | sensor-common.h |
Header file for the Sensortag Common sensor utilities. | |
Functions | |
bool | sensor_common_read_reg (uint8_t addr, uint8_t *buf, uint8_t len) |
Reads a sensor's register over I2C. More... | |
bool | sensor_common_write_reg (uint8_t addr, uint8_t *buf, uint8_t len) |
Write to a sensor's register over I2C. More... | |
void | sensor_common_set_error_data (uint8_t *buf, uint8_t len) |
Fill a result buffer with dummy error data. More... | |
bool sensor_common_read_reg | ( | uint8_t | addr, |
uint8_t * | buf, | ||
uint8_t | len | ||
) |
Reads a sensor's register over I2C.
addr | The address of the register to read |
buf | Pointer to buffer to place data |
len | Number of bytes to read |
The sensor must be selected before this routine is called.
Definition at line 48 of file sensor-common.c.
void sensor_common_set_error_data | ( | uint8_t * | buf, |
uint8_t | len | ||
) |
Fill a result buffer with dummy error data.
buf | Pointer to the buffer where to write the data |
len | Number of bytes to fill |
Definition at line 71 of file sensor-common.c.
bool sensor_common_write_reg | ( | uint8_t | addr, |
uint8_t * | buf, | ||
uint8_t | len | ||
) |
Write to a sensor's register over I2C.
addr | The address of the register to read |
buf | Pointer to buffer containing data to be written |
len | Number of bytes to write |
The sensor must be selected before this routine is called.
Definition at line 54 of file sensor-common.c.