i2ctocan
2.0.0.0
|
API for configuring and manipulating I2C to CAN Click driver. More...
Modules | |
I2C to CAN Registers Settings | |
Settings for registers of I2C to CAN Click driver. | |
I2C to CAN MikroBUS Map | |
MikroBUS pin mapping of I2C to CAN Click driver. | |
Functions | |
void | i2ctocan_cfg_setup (i2ctocan_cfg_t *cfg) |
I2C to CAN configuration object setup function. More... | |
err_t | i2ctocan_init (i2ctocan_t *ctx, i2ctocan_cfg_t *cfg) |
I2C to CAN initialization function. More... | |
err_t | i2ctocan_default_cfg (i2ctocan_t *ctx) |
I2C to CAN default configuration function. More... | |
err_t | i2ctocan_enable_device (i2ctocan_t *ctx) |
I2C to CAN enable the device function. More... | |
err_t | i2ctocan_shutdown (i2ctocan_t *ctx) |
I2C to CAN shutdown the device function. More... | |
err_t | i2ctocan_set_slave_address (i2ctocan_t *ctx, uint8_t slave_addr) |
Set I2C Slave address function. More... | |
err_t | i2ctocan_generic_write (i2ctocan_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len) |
I2C to CAN I2C writing function. More... | |
err_t | i2ctocan_generic_read (i2ctocan_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len) |
I2C to CAN I2C reading function. More... | |
API for configuring and manipulating I2C to CAN Click driver.
void i2ctocan_cfg_setup | ( | i2ctocan_cfg_t * | cfg | ) |
I2C to CAN configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See i2ctocan_cfg_t object definition for detailed explanation. |
err_t i2ctocan_default_cfg | ( | i2ctocan_t * | ctx | ) |
I2C to CAN default configuration function.
This function executes a default configuration of I2C to CAN click board.
[in] | ctx | : Click context object. See i2ctocan_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t i2ctocan_enable_device | ( | i2ctocan_t * | ctx | ) |
I2C to CAN enable the device function.
This function enable the LT3960, I2C to CAN-Physical Transceiver on the I2C to CAN click boardâ„¢.
[in] | ctx | : Click context object. See i2ctocan_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t i2ctocan_generic_read | ( | i2ctocan_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | rx_buf, | ||
uint8_t | rx_len | ||
) |
I2C to CAN I2C reading function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See i2ctocan_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | rx_buf | : Output read data. |
[in] | rx_len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t i2ctocan_generic_write | ( | i2ctocan_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | tx_buf, | ||
uint8_t | tx_len | ||
) |
I2C to CAN I2C writing function.
This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See i2ctocan_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | tx_buf | : Data to be written. |
[in] | tx_len | : Number of bytes to be written. |
0
- Success, -1
- Error.err_t i2ctocan_init | ( | i2ctocan_t * | ctx, |
i2ctocan_cfg_t * | cfg | ||
) |
I2C to CAN initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See i2ctocan_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See i2ctocan_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t i2ctocan_set_slave_address | ( | i2ctocan_t * | ctx, |
uint8_t | slave_addr | ||
) |
Set I2C Slave address function.
Sets I2C address of the subordinate I2C device to address
which is targeted by read and write operations.
[in] | ctx | : Click context object. See i2ctocan_t object definition for detailed explanation. |
[in] | address | Specified I2C slave address. |
0
- Success, -1
- Error.err_t i2ctocan_shutdown | ( | i2ctocan_t * | ctx | ) |
I2C to CAN shutdown the device function.
This function turn off the LT3960, I2C to CAN-Physical Transceiver on the I2C to CAN click boardâ„¢.
[in] | ctx | : Click context object. See i2ctocan_t object definition for detailed explanation. |
0
- Success, -1
- Error.