SEcube
SEcube Open Source Library - Device
Enumerations | Functions
se3_proto.h File Reference

USB read/write handlers. More...

#include "se3c0.h"
#include "se3_common.h"

Go to the source code of this file.

Enumerations

enum  { SE3_PROTO_OK = 0, SE3_PROTO_FAIL = 1, SE3_PROTO_BUSY = 2 }
 

Functions

int32_t se3_proto_recv (uint8_t lun, const uint8_t *buf, uint32_t blk_addr, uint16_t blk_len)
 USB data receive handler. More...
 
int32_t se3_proto_send (uint8_t lun, uint8_t *buf, uint32_t blk_addr, uint16_t blk_len)
 USB data send handler. More...
 

Detailed Description

USB read/write handlers.

Author
Nicola Ferri

Enumeration Type Documentation

anonymous enum

USB data handlers return values

Enumerator
SE3_PROTO_OK 

Report OK to the USB HAL.

SE3_PROTO_FAIL 

Report FAIL to the USB HAL.

SE3_PROTO_BUSY 

Report BUSY to the USB HAL.

Function Documentation

int32_t se3_proto_recv ( uint8_t  lun,
const uint8_t *  buf,
uint32_t  blk_addr,
uint16_t  blk_len 
)

USB data receive handler.

SEcube API requests are filtered and data is stored in the request buffer. The function also takes care of the initialization of the special protocol file. Other requests are passed to the SDIO interface.

int32_t se3_proto_send ( uint8_t  lun,
uint8_t *  buf,
uint32_t  blk_addr,
uint16_t  blk_len 
)

USB data send handler.

SEcube API requests are filtered and data is sent from the response buffer Other requests are passed to the SDIO interface.