21 #ifndef SL_LOGGER_I2C_H
22 #define SL_LOGGER_I2C_H
97 const float scale,
const float offset,
const float minV,
float(* i2c_dev_read_fn)(const int, const int, const void *)
Device specific callback functions.
void * i2c_shutdown(void *ptargs)
I2C shutdown.
void * i2c_channels(void *ptargs)
Generate I2C channel map.
void * i2c_logging(void *ptargs)
I2C main logging loop.
bool i2c_chanmap_add_ina219(i2c_params *ip, const uint8_t devAddr, const uint8_t baseID)
Add INA219 voltage and current readings to channel map.
bool i2c_validate_chanmap(i2c_params *ip)
Check channel mapping is valid.
bool i2c_parseConfig(log_thread_args_t *lta, config_section *s)
Take a configuration section, parse parameters and register devices.
device_callbacks i2c_getCallbacks(void)
Fill out device callback functions for logging.
void * i2c_setup(void *ptargs)
I2C Connection setup.
i2c_params i2c_getParams(void)
Fill out default I2C parameters.
bool i2c_chanmap_add_ads1015(i2c_params *ip, const uint8_t devAddr, const uint8_t baseID, const float scale, const float offset, const float minV, const float maxV)
Add ADS1015 single ended voltage measurements to channel map.
Configuration file section.
Device specific function information.
Map device functions to message IDs.
uint8_t messageID
Message ID to report.
void * ext
If not NULL, pointer to additional device data.
uint8_t deviceAddr
I2C Device address.
i2c_dev_read_fn func
Pointer to device read function.
string message_name
Message name to report.
I2C Source device specific parameters.
int en_count
Number of messages in chanmap.
char * busName
Target port name.
int frequency
Aim to sample this many times per second.
char * sourceName
Reported source name.
uint8_t sourceNum
Source ID for messages.
i2c_msg_map * chanmap
Map of device functions to poll.
int handle
Handle for currently opened device.
Logging thread information.