39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_i2c_master.h"
73#define I2CTOCAN_SET_DEV_ADDR 0x00
91#define I2CTOCAN_MAP_MIKROBUS( cfg, mikrobus ) \
92 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
93 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
94 cfg.shd = MIKROBUS( mikrobus, MIKROBUS_CS )
err_t i2ctocan_shutdown(i2ctocan_t *ctx)
I2C to CAN shutdown the device function.
err_t i2ctocan_default_cfg(i2ctocan_t *ctx)
I2C to CAN default configuration function.
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.
err_t i2ctocan_init(i2ctocan_t *ctx, i2ctocan_cfg_t *cfg)
I2C to CAN initialization function.
err_t i2ctocan_enable_device(i2ctocan_t *ctx)
I2C to CAN enable the device function.
err_t i2ctocan_set_slave_address(i2ctocan_t *ctx, uint8_t slave_addr)
Set I2C Slave address function.
void i2ctocan_cfg_setup(i2ctocan_cfg_t *cfg)
I2C to CAN configuration object setup function.
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.
i2ctocan_return_value_t
I2C to CAN Click return value data.
Definition i2ctocan.h:140
@ I2CTOCAN_OK
Definition i2ctocan.h:141
@ I2CTOCAN_ERROR
Definition i2ctocan.h:142
I2C to CAN Click configuration object.
Definition i2ctocan.h:124
uint32_t i2c_speed
Definition i2ctocan.h:130
pin_name_t shd
Definition i2ctocan.h:128
pin_name_t scl
Definition i2ctocan.h:125
pin_name_t sda
Definition i2ctocan.h:126
uint8_t i2c_address
Definition i2ctocan.h:131
I2C to CAN Click context object.
Definition i2ctocan.h:104
i2c_master_t i2c
Definition i2ctocan.h:111
uint8_t slave_address
Definition i2ctocan.h:115
digital_out_t shd
Definition i2ctocan.h:107