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. | |
bool | sensor_common_write_reg (uint8_t addr, uint8_t *buf, uint8_t len) |
Write to a sensor's register over I2C. | |
void | sensor_common_set_error_data (uint8_t *buf, uint8_t len) |
Fill a result buffer with dummy error data. | |
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.
References addr, and board_i2c_write_read().
Referenced by acc_read(), gyro_read(), init(), int_status(), read_data(), read_data(), read_data(), and sensor_wakeup().
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.
Referenced by acc_read(), gyro_read(), read_data(), read_data(), and read_data().
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.
References addr, and board_i2c_write().
Referenced by acc_set_range(), enable_sensor(), enable_sensor(), enable_sensor(), init(), select_axes(), sensor_init(), sensor_sleep(), and sensor_wakeup().