CryptoAuthLib
Microchip CryptoAuthentication Library
|
ATCA Hardware abstraction layer for PIC32MZ2048. More...
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "atca_hal.h"
#include "atca_device.h"
#include "hal/hal_pic32mz2048efm_i2c.h"
#include "driver/i2c/drv_i2c.h"
#include "system_definitions.h"
#include "driver/i2c/src/drv_i2c_local.h"
Functions | |
ATCA_STATUS | hal_i2c_discover_devices (int bus_num, ATCAIfaceCfg cfg[], int *found) |
discover any CryptoAuth devices on a given logical bus number More... | |
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-priori knowledge More... | |
ATCA_STATUS | hal_i2c_init (void *hal, ATCAIfaceCfg *cfg) |
initialize an I2C interface using given config More... | |
ATCA_STATUS | hal_i2c_post_init (ATCAIface iface) |
HAL implementation of I2C post init. More... | |
ATCA_STATUS | hal_i2c_send (ATCAIface iface, uint8_t *txdata, int txlength) |
ATCA_STATUS | hal_i2c_receive (ATCAIface iface, uint8_t *rxdata, uint16_t *rxlength) |
HAL implementation of I2C receive function. More... | |
ATCA_STATUS | hal_i2c_wake (ATCAIface iface) |
wake up CryptoAuth device using I2C bus More... | |
ATCA_STATUS | hal_i2c_idle (ATCAIface iface) |
idle CryptoAuth device using I2C bus More... | |
ATCA_STATUS | hal_i2c_sleep (ATCAIface iface) |
sleep CryptoAuth device using I2C bus More... | |
ATCA_STATUS | hal_i2c_release (void *hal_data) |
manages reference count on given bus and releases resource if no more refences exist More... | |
Variables | |
DRV_HANDLE | drvI2CMasterHandle |
DRV_HANDLE | drvI2CMasterHandle1 |
DRV_I2C_BUFFER_HANDLE | write_bufHandle |
DRV_I2C_BUFFER_HANDLE | read_bufHandle |
uint32_t | Debug_count = 0 |
HAL implementation of I2C send over ASF. More... | |
uint32_t | bytes_transferred = 0 |
ATCA Hardware abstraction layer for PIC32MZ2048.
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-priori knowledge
[in] | i2c_buses | an array of logical bus numbers |
[in] | max_buses | maximum number of buses the app wants to attempt to discover |
ATCA_STATUS hal_i2c_discover_devices | ( | int | bus_num, |
ATCAIfaceCfg | cfg[], | ||
int * | found | ||
) |
discover any CryptoAuth devices on a given logical bus number
[in] | bus_num | logical bus number on which to look for CryptoAuth devices |
[out] | cfg | pointer to head of an array of interface config structures which get filled in by this method |
[out] | found | number of devices found on this bus |
ATCA_STATUS hal_i2c_idle | ( | ATCAIface | iface | ) |
idle CryptoAuth device using I2C bus
[in] | iface | interface to logical device to idle |
ATCA_STATUS hal_i2c_init | ( | void * | hal, |
ATCAIfaceCfg * | cfg | ||
) |
initialize an I2C interface using given config
[in] | hal | opaque ptr to HAL data |
[in] | cfg | interface configuration |
ATCA_STATUS hal_i2c_post_init | ( | ATCAIface | iface | ) |
HAL implementation of I2C post init.
[in] | iface | instance |
ATCA_STATUS hal_i2c_receive | ( | ATCAIface | iface, |
uint8_t * | rxdata, | ||
uint16_t * | rxlength | ||
) |
HAL implementation of I2C receive function.
[in] | iface | Device to interact with. |
[out] | rxdata | Data received will be returned here. |
[in,out] | rxlength | As input, the size of the rxdata buffer. As output, the number of bytes received. |
ATCA_STATUS hal_i2c_release | ( | void * | hal_data | ) |
manages reference count on given bus and releases resource if no more refences exist
[in] | hal_data | opaque pointer to hal data structure - known only to the HAL implementation |
ATCA_STATUS hal_i2c_send | ( | ATCAIface | iface, |
uint8_t * | txdata, | ||
int | txlength | ||
) |
ATCA_STATUS hal_i2c_sleep | ( | ATCAIface | iface | ) |
sleep CryptoAuth device using I2C bus
[in] | iface | interface to logical device to sleep |
ATCA_STATUS hal_i2c_wake | ( | ATCAIface | iface | ) |
wake up CryptoAuth device using I2C bus
[in] | iface | interface to logical device to wakeup |
uint32_t bytes_transferred = 0 |
uint32_t Debug_count = 0 |
HAL implementation of I2C send over ASF.
[in] | iface | instance |
[in] | txdata | pointer to space to bytes to send |
[in] | txlength | number of bytes to send |
DRV_HANDLE drvI2CMasterHandle |
DRV_HANDLE drvI2CMasterHandle1 |
DRV_I2C_BUFFER_HANDLE read_bufHandle |
DRV_I2C_BUFFER_HANDLE write_bufHandle |