ATCA Hardware abstraction layer for SAMD21 I2C over Harmony PLIB. More...
Functions | |
ATCA_STATUS | hal_i2c_discover_buses (int i2c_buses[], int max_buses) |
discover i2c buses available for this hardware this maintains a list of logical to physical bus mappings freeing the application of the a-prior knowledge | |
ATCA_STATUS | hal_i2c_discover_devices (int bus_num, ATCAIfaceCfg cfg[], int *found) |
discover any CryptoAuth devices on a given logical bus number | |
ATCA_STATUS | hal_i2c_init (ATCAIface iface, ATCAIfaceCfg *cfg) |
hal_i2c_init manages requests to initialize a physical interface. it manages use counts so when an interface has released the physical layer, it will disable the interface for some other use. You can have multiple ATCAIFace instances using the same bus, and you can have multiple ATCAIFace instances on multiple i2c buses, so hal_i2c_init manages these things and ATCAIFace is abstracted from the physical details. | |
ATCA_STATUS | hal_i2c_post_init (ATCAIface iface) |
HAL implementation of I2C post init. | |
ATCA_STATUS | hal_i2c_send (ATCAIface iface, uint8_t word_address, uint8_t *txdata, int txlength) |
HAL implementation of I2C send over START. | |
ATCA_STATUS | hal_i2c_receive (ATCAIface iface, uint8_t address, uint8_t *rxdata, uint16_t *rxlength) |
HAL implementation of I2C receive function for START I2C. | |
ATCA_STATUS | change_i2c_speed (ATCAIface iface, uint32_t speed) |
method to change the bus speec of I2C | |
ATCA_STATUS | hal_i2c_control (ATCAIface iface, uint8_t option, void *param, size_t paramlen) |
Perform control operations for the kit protocol. | |
ATCA_STATUS | hal_i2c_release (void *hal_data) |
manages reference count on given bus and releases resource if no more refences exist | |
ATCA Hardware abstraction layer for SAMD21 I2C over Harmony PLIB.
This code is structured in two parts. Part 1 is the connection of the ATCA HAL API to the physical I2C implementation. Part 2 is the Harmony I2C primitives to set up the interface.
Prerequisite: add SERCOM I2C Master Polled support to application in Atmel Studio