![]() |
Linduino
1.3.0
Linear Technology Arduino-Compatible Demonstration Board
|
LTC4155 lightweight, hardware ambiguous, embeddable C Communication Library. More...
LTC4155 lightweight, hardware ambiguous, embeddable C Communication Library.
Communication is bit-field based as well as whole-register based. This library automatically masks and right-justifies bit fields to ease programmer workload.
This C library provides a header file with the complete definitions of registers and bit fields within those registers, and routines to read and write those registers and individual bit-fields.
Outside of the Linduino environment, this library can be built with any standard C compiler and can be used with different I2C/SMBus communication hardware simply by swapping out the pointers to appropriate user-supplied functions *smbus_write_register and *smbus_read_register. An example is provided using the i2c-tools Linux kernel driver which has been tested on the BeagleBone Black Linux single board computer. It can also be readily adapted to common microcontrollers with minimal memory impact on embedded systems.
A higher level hardware ambiguous Python communication library is also available.
Please visit http://www.linear.com/product/LTC4155#code or contact the factory at 408-432-1900 or www.linear.com for further information.
Definition in file LTC4155.c.
Go to the source code of this file.
Functions | |
LTC4155 | LTC4155_alloc (void) |
LTC4155 | LTC4155_init (LTC4155_chip_cfg_t *cfg) |
Returns a pointer to a LTC4155 structure used by LTC4155_write_register and LTC4155_read_register. More... | |
static uint8_t | get_size (uint16_t registerinfo) |
static uint8_t | get_subaddr (uint16_t registerinfo) |
static uint8_t | get_offset (uint16_t registerinfo) |
static uint8_t | get_mask (uint16_t registerinfo) |
int | LTC4155_write_register (LTC4155 chip_handle, uint16_t registerinfo, uint8_t data) |
Function to modify a bit field within a register while preserving the unaddressed bit fields. More... | |
int | LTC4155_read_register (LTC4155 chip_handle, uint16_t registerinfo, uint8_t *data) |
Retrieves a bit field data into *data. More... | |
Variables | |
int | LTC4155_instances = 0 |
LTC4155_chip_cfg_t | LTC4155_chip_array [MAX_NUM_LTC4155_INSTANCES] |
|
static |
LTC4155 LTC4155_init | ( | LTC4155_chip_cfg_t * | cfg | ) |
int LTC4155_read_register | ( | LTC4155 | chip_handle, |
uint16_t | registerinfo, | ||
uint8_t * | data | ||
) |
int LTC4155_write_register | ( | LTC4155 | chip_handle, |
uint16_t | registerinfo, | ||
uint8_t | data | ||
) |
LTC4155_chip_cfg_t LTC4155_chip_array[MAX_NUM_LTC4155_INSTANCES] |