CryptoAuthLib
Microchip CryptoAuthentication Library
hal_linux_kit_cdc.c File Reference

ATCA Hardware abstraction layer for Linux using kit protocol over a USB CDC device. More...

#include <stdio.h>
#include <string.h>
#include <termios.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include "atca_hal.h"
#include "kit_phy.h"
#include "hal_linux_kit_cdc.h"
#include "kit_protocol.h"

Macros

#define max(a, b)   (((a) > (b)) ? (a) : (b))
 
#define min(a, b)   (((a) < (b)) ? (a) : (b))
 

Functions

ATCA_STATUS hal_cdc_discover_buses (int cdc_buses[], int max_buses)
 discover cdc buses available for this hardware this maintains a list of logical to physical bus mappings freeing the application of the a-priori knowledge.This function is currently not implemented. More...
 
ATCA_STATUS hal_cdc_discover_devices (int bus_num, ATCAIfaceCfg cfg[], int *found)
 discover any CryptoAuth devices on a given logical bus number More...
 
ATCA_STATUS hal_kit_cdc_init (void *hal, ATCAIfaceCfg *cfg)
 HAL implementation of Kit USB CDC init. More...
 
ATCA_STATUS hal_kit_cdc_post_init (ATCAIface iface)
 HAL implementation of Kit USB CDC post init. More...
 
ATCA_STATUS kit_phy_send (ATCAIface iface, const char *txdata, int txlength)
 HAL implementation of kit protocol send .It is called by the top layer. More...
 
ATCA_STATUS kit_phy_receive (ATCAIface iface, char *rxdata, int *rxsize)
 HAL implementation of kit protocol receive data.It is called by the top layer. More...
 
ATCA_STATUS hal_kit_phy_num_found (int8_t *num_found)
 Number of USB CDC devices found. More...
 
ATCA_STATUS hal_kit_cdc_send (ATCAIface iface, uint8_t *txdata, int txlength)
 HAL implementation of kit protocol send over USB CDC. More...
 
ATCA_STATUS hal_kit_cdc_receive (ATCAIface iface, uint8_t *rxdata, uint16_t *rxsize)
 HAL implementation of kit protocol receive over USB CDC. More...
 
ATCA_STATUS hal_kit_cdc_wake (ATCAIface iface)
 Call the wake for kit protocol over USB CDC. More...
 
ATCA_STATUS hal_kit_cdc_idle (ATCAIface iface)
 Call the idle for kit protocol over USB CDC. More...
 
ATCA_STATUS hal_kit_cdc_sleep (ATCAIface iface)
 Call the sleep for kit protocol over USB CDC. More...
 
ATCA_STATUS hal_kit_cdc_release (void *hal_data)
 Close the physical port for CDC over USB CDC. More...
 
ATCA_STATUS hal_kit_cdc_discover_buses (int cdc_buses[], int max_buses)
 discover cdc buses available for this hardware this maintains a list of logical to physical bus mappings freeing the application of the a-priori knowledge.This function is currently not implemented. More...
 
ATCA_STATUS hal_kit_cdc_discover_devices (int bus_num, ATCAIfaceCfg *cfg, int *found)
 discover any CryptoAuth devices on a given logical bus number More...
 

Variables

atcacdc_t _gCdc
 
char * dev = "/dev/ttyACM0"
 
int speed = B115200
 

Detailed Description

ATCA Hardware abstraction layer for Linux using kit protocol over a USB CDC device.