CryptoAuthLib
Atmel CryptoAuthentication Library
hal_i2c_bitbang.c File Reference

ATCA Hardware abstraction layer for I2C bit banging. More...

#include <asf.h>
#include <string.h>
#include <stdio.h>
#include "atca_hal.h"
#include "hal_i2c_bitbang.h"

Functions

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...
 
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
 total in-use count across buses More...
 

Detailed Description

ATCA Hardware abstraction layer for I2C bit banging.

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