CryptoAuthLib
Atmel CryptoAuthentication Library
hal_xmega_a3bu_i2c_asf.c File Reference

ATCA Hardware abstraction layer for XMEGA-A3BU I2C over ASF drivers. More...

#include <asf.h>
#include <string.h>
#include <stdio.h>
#include "atca_hal.h"
#include "hal_xmega_a3bu_i2c_asf.h"
#include "atca_device.h"

Functions

ATCA_STATUS hal_i2c_discover_buses (int i2c_buses[], int max_buses)
 This HAL implementation assumes you've included the ASF TWI libraries in your project, otherwise, the HAL layer will not compile because the ASF TWI drivers are a dependency. More...
 
ATCA_STATUS hal_i2c_discover_devices (int busNum, ATCAIfaceCfg cfg[], int *found)
 discover any CryptoAuth devices on a given logical bus number More...
 
ATCA_STATUS hal_i2c_init (void *hal, 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. 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)
 Send byte(s) via I2C. More...
 
ATCA_STATUS hal_i2c_receive (ATCAIface iface, uint8_t *rxdata, uint16_t *rxlength)
 Receive byte(s) via I2C. More...
 
void change_i2c_speed (ATCAIface iface, uint32_t speed)
 method to change the bus speed of I2C More...
 
ATCA_STATUS hal_i2c_wake (ATCAIface iface)
 Send Wake flag via I2C. More...
 
ATCA_STATUS hal_i2c_idle (ATCAIface iface)
 Send Idle flag via I2C. More...
 
ATCA_STATUS hal_i2c_sleep (ATCAIface iface)
 Send Sleep flag via I2C. More...
 
ATCA_STATUS hal_i2c_release (void *hal_data)
 Manages reference count on given bus and releases resource if no more reference(s) exist. More...
 

Variables

ATCAI2CMaster_ti2c_hal_data [MAX_I2C_BUSES]
 logical to physical bus mapping structure More...
 
int i2c_bus_ref_ct = 0
 

Detailed Description

ATCA Hardware abstraction layer for XMEGA-A3BU I2C over ASF drivers.

Prerequisite: add I2C Master Polled support to application in Atmel Studio

Copyright (c) 2015 Atmel Corporation. All rights reserved.