CryptoAuthLib v3.7.4
Microchip CryptoAuthentication Library
 
Loading...
Searching...
No Matches
hal_linux_i2c_userspace.c File Reference

ATCA Hardware abstraction layer for Linux using I2C. More...

#include <cryptoauthlib.h>
#include <linux/i2c-dev.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include "atca_hal.h"

Data Structures

struct  atca_i2c_host_s
 

Typedefs

typedef struct atca_i2c_host_s atca_i2c_host_t
 

Functions

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 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
 

Detailed Description

ATCA Hardware abstraction layer for Linux using I2C.