Functions for accessing M24SR device.

Dependents:   Nucleo_NFC_Example I2C_NFC_Master Print_Entire_Nucleo_NFC01A1_Memory

Fork of lib_M24SR by Enrico Gregoratto

Embed: (wiki syntax)

« Back to documentation index

DrvM24SR_Private_Functions

DrvM24SR_Private_Functions
[Drv_M24SR]

Functions

static uint16_t M24SR_UpdateCrc (uint8_t ch, uint16_t *lpwCrc)
 This function updates the CRC.
static uint16_t M24SR_ComputeCrc (uc8 *Data, uint8_t Length)
 This function returns the CRC 16.
static uint16_t M24SR_IsCorrectCRC16Residue (uc8 *DataIn, uc8 Length)
 This function computes the CRC16 residue as defined by CRC ISO/IEC 13239.
static void M24SR_InitStructure (void)
 Initialize the command and response structure.
static void M24SR_BuildIBlockCommand (uc16 CommandStructure, C_APDU Command, uint16_t *NbByte, uint8_t *pCommand)
 This functions creates an I block command according to the structures CommandStructure and Command.
static int8_t IsIBlock (uc8 *pBuffer)
 This function return M24SR_STATUS_SUCCESS if the pBuffer is an I-block.
static int8_t IsRBlock (uc8 *pBuffer)
 This function return M24SR_STATUS_SUCCESS if the pBuffer is an R-block.
static int8_t IsSBlock (uc8 *pBuffer)
 This function return M24SR_STATUS_SUCCESS if the pBuffer is an s-block.
static uint16_t M24SR_FWTExtension (uint8_t FWTbyte)
 This function sends the FWT extension command (S-Block format)

Function Documentation

static int8_t IsIBlock ( uc8 *  pBuffer ) [static]

This function return M24SR_STATUS_SUCCESS if the pBuffer is an I-block.

Parameters:
pBuffer: pointer of the data
Return values:
M24SR_STATUS_SUCCESS: the data is a I-Block
M24SR_ERROR_DEFAULT: the data is not a I-Block

Definition at line 258 of file m24sr.c.

static int8_t IsRBlock ( uc8 *  pBuffer ) [static]

This function return M24SR_STATUS_SUCCESS if the pBuffer is an R-block.

Parameters:
pBuffer: pointer of the data
Return values:
M24SR_STATUS_SUCCESS: the data is a R-Block
M24SR_ERROR_DEFAULT: the data is not a R-Block

Definition at line 278 of file m24sr.c.

static int8_t IsSBlock ( uc8 *  pBuffer ) [static]

This function return M24SR_STATUS_SUCCESS if the pBuffer is an s-block.

Parameters:
pBuffer: pointer of the data
Return values:
M24SR_STATUS_SUCCESS: the data is a S-Block
M24SR_ERROR_DEFAULT: the data is not a S-Block

Definition at line 299 of file m24sr.c.

static void M24SR_BuildIBlockCommand ( uc16  CommandStructure,
C_APDU  Command,
uint16_t *  NbByte,
uint8_t *  pCommand 
) [static]

This functions creates an I block command according to the structures CommandStructure and Command.

Parameters:
Command: structue which contains the field of the different parameter
CommandStructure: structure that contain the structure of the command (if the different field are presnet or not
NbByte: number of byte of the command
pCommand: pointer of the command created

Definition at line 181 of file m24sr.c.

static uint16_t M24SR_ComputeCrc ( uc8 *  Data,
uint8_t  Length 
) [static]

This function returns the CRC 16.

Parameters:
Data: pointer on the data used to compute the CRC16
Length: number of byte of the data
Return values:
CRC16

Definition at line 96 of file m24sr.c.

static uint16_t M24SR_FWTExtension ( uint8_t  FWTbyte ) [static]

This function sends the FWT extension command (S-Block format)

Parameters:
FWTbyte: FWT value
Return values:
Status(SW1&SW2) : Status of the operation to complete.
M24SR_ERROR_I2CTIMEOUT: The I2C timeout occured.

Definition at line 319 of file m24sr.c.

static void M24SR_InitStructure ( void   ) [static]

Initialize the command and response structure.

Parameters:
None
Return values:
None

Definition at line 154 of file m24sr.c.

static uint16_t M24SR_IsCorrectCRC16Residue ( uc8 *  DataIn,
uc8  Length 
) [static]

This function computes the CRC16 residue as defined by CRC ISO/IEC 13239.

Parameters:
DataIn: input to data
Length: Number of bits of DataIn
Return values:
Status(SW1&SW2) : CRC16 residue is correct
M24SR_ERROR_CRC: CRC16 residue is false

Definition at line 119 of file m24sr.c.

static uint16_t M24SR_UpdateCrc ( uint8_t  ch,
uint16_t *  lpwCrc 
) [static]

This function updates the CRC.

Parameters:
None
Return values:
None

Definition at line 81 of file m24sr.c.