MetaWear C++ API
0.18.0
C++ implementation of the MetaWear protocol
|
Communicates with sensors on the I2C bus. More...
#include "sensor_common.h"
Go to the source code of this file.
Classes | |
struct | MblMwI2cReadParameters |
Parameters required for an i2c read. More... | |
Functions | |
METAWEAR_API MblMwDataSignal * | mbl_mw_i2c_get_data_signal (MblMwMetaWearBoard *board, uint8_t length, uint8_t id) |
Retrieves the data signal representing i2c data. More... | |
METAWEAR_API void | mbl_mw_i2c_write (const MblMwMetaWearBoard *board, uint8_t device_addr, uint8_t register_addr, const uint8_t *value, uint8_t length) |
Writes data via the i2c bus. More... | |
Communicates with sensors on the I2C bus.
METAWEAR_API MblMwDataSignal* mbl_mw_i2c_get_data_signal | ( | MblMwMetaWearBoard * | board, |
uint8_t | length, | ||
uint8_t | id | ||
) |
Retrieves the data signal representing i2c data.
The data signal is identified by the id value and if the id is not present, a new data signal will be created using the length parameter.
board | Board the i2c bus resides on |
length | Number of bytes to read |
id | Numerical value identifying the data |
METAWEAR_API void mbl_mw_i2c_write | ( | const MblMwMetaWearBoard * | board, |
uint8_t | device_addr, | ||
uint8_t | register_addr, | ||
const uint8_t * | value, | ||
uint8_t | length | ||
) |
Writes data via the i2c bus.
board | Board the i2c bus resides on |
device_addr | Device to write to |
register_addr | Address of the register to write |
value | Payload, as a byte array |
length | Number of bytes |