Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: ST_INTERFACES
Fork of M24SR by
Drv_M24SR
[M24SR_Driver]
This file contains the driver which implements all the M24SR commands. More...
Data Structures | |
| struct | C_APDU_Header |
| APDU-Header command structure. More... | |
| struct | C_APDU_Body |
| APDU-Body command structure. More... | |
| struct | C_APDU |
| APDU Command structure. More... | |
| struct | R_APDU |
| SC response structure. More... | |
Modules | |
| Lib_M24SR_Exported_Constants | |
Enumerations | |
| enum | M24SR_GPO_MODE |
GPO mode structure. More... | |
Functions | |
| static uint16_t | M24SR_UpdateCrc (uint8_t ch, uint16_t *lpwCrc) |
| This function updates the CRC. | |
| static uint16_t | M24SR_ComputeCrc (uint8_t *Data, uint8_t Length) |
| This function returns the CRC 16. | |
| static M24SR::StatusTypeDef | M24SR_IsCorrectCRC16Residue (uint8_t *DataIn, uint8_t Length) |
| This function computes the CRC16 residue as defined by CRC ISO/IEC 13239. | |
| static void | M24SR_BuildIBlockCommand (uint16_t CommandStructure, C_APDU *Command, uint8_t uDIDbyte, uint16_t *NbByte, uint8_t *pCommand) |
| This functions creates an I block command according to the structures CommandStructure and Command. | |
| static M24SR::StatusTypeDef | IsSBlock (uint8_t *pBuffer) |
| This function returns M24SR_STATUS_SUCCESS if the pBuffer is an s-block. | |
| M24SR (const uint8_t address, I2C &I2C, gpoEventCallback eventCallback, const PinName &GPOPinName, const PinName &RFDISPinName) | |
| Constructor. | |
| virtual | ~M24SR (void) |
| Destructor. | |
| StatusTypeDef | M24SR_SendFWTExtension (uint8_t FWTbyte) |
| This function sends the FWT extension command (S-Block format) | |
| StatusTypeDef | M24SR_Init (M24SR_InitTypeDef *) |
| This function initialize the M24SR device. | |
| StatusTypeDef | M24SR_ForceSession (void) |
| This function sends the KillSession command to the M24SR device. | |
| StatusTypeDef | M24SR_Deselect (void) |
| This function sends the Deselect command (S-Block format) | |
| StatusTypeDef | M24SR_GetSession (void) |
| This function sends the GetSession command to the M24SR device. | |
| StatusTypeDef | M24SR_SendSelectApplication (void) |
| This function sends the SelectApplication command. | |
| StatusTypeDef | M24SR_SendSelectCCfile (void) |
| This function sends the SelectCCFile command. | |
| StatusTypeDef | M24SR_SendSelectSystemfile (void) |
| This function sends the SelectSystemFile command. | |
| StatusTypeDef | M24SR_SendSelectNDEFfile (uint16_t NDEFfileId) |
| This function sends the SelectNDEFfile command. | |
| StatusTypeDef | M24SR_SendReadBinary (uint16_t Offset, uint8_t NbByteToRead, uint8_t *pBufferRead) |
| This function sends a read binary command. | |
| StatusTypeDef | M24SR_SendSTReadBinary (uint16_t Offset, uint8_t NbByteToRead, uint8_t *pBufferRead) |
| This function sends a ST read binary command (no error if access is not inside NDEF file) | |
| StatusTypeDef | M24SR_SendUpdateBinary (uint16_t Offset, uint8_t NbByteToWrite, uint8_t *pDataToWrite) |
| This function sends a Update binary command. | |
| StatusTypeDef | M24SR_SendVerify (uint16_t uPwdId, uint8_t NbPwdByte, const uint8_t *pPwd) |
| This function sends the Verify command. | |
| StatusTypeDef | M24SR_SendChangeReferenceData (uint16_t uPwdId, uint8_t *pPwd) |
| This function sends the ChangeReferenceData command. | |
| StatusTypeDef | M24SR_SendEnableVerificationRequirement (uint16_t uReadOrWrite) |
| This function sends the EnableVerificationRequirement command. | |
| StatusTypeDef | M24SR_SendDisableVerificationRequirement (uint16_t uReadOrWrite) |
| This function sends the DisableVerificationRequirement command. | |
| StatusTypeDef | M24SR_SendEnablePermanentState (uint16_t uReadOrWrite) |
| This function sends the EnablePermananentState command. | |
| StatusTypeDef | M24SR_SendDisablePermanentState (uint16_t uReadOrWrite) |
| This function sends the DisablePermanentState command. | |
| StatusTypeDef | M24SR_SendInterrupt (void) |
| This function generates an interrupt on GPO pin. | |
| StatusTypeDef | M24SR_StateControl (uint8_t uSetOrReset) |
| This function forces GPO pin to low state or high Z. | |
| StatusTypeDef | M24SR_IO_SendI2Ccommand (uint8_t NbByte, uint8_t *pBuffer) |
| Send a command to the component. | |
| StatusTypeDef | M24SR_IO_ReceiveI2Cresponse (uint8_t NbByte, uint8_t *pBuffer) |
| Read a command response. | |
| StatusTypeDef | M24SR_IO_PollI2C (void) |
| Do an active polling on the I2C bus until the answer is ready. | |
| StatusTypeDef | manage_event () |
| Function to call when the component fire an interrupt. | |
| NDefLib::NDefNfcTag & | get_NDef_tag () |
| Get an implementation of NDefNfcTag to use the library NDefLib. | |
Detailed Description
This file contains the driver which implements all the M24SR commands.
Enumeration Type Documentation
| enum M24SR_GPO_MODE |
GPO mode structure.
Definition at line 88 of file m24sr_def.h.
Function Documentation
| NDefLib::NDefNfcTag & get_NDef_tag | ( | ) | [inherited] |
| static M24SR::StatusTypeDef IsSBlock | ( | uint8_t * | pBuffer ) | [static] |
| M24SR | ( | const uint8_t | address, |
| I2C & | I2C, | ||
| gpoEventCallback | eventCallback, | ||
| const PinName & | GPOPinName, | ||
| const PinName & | RFDISPinName | ||
| ) | [inherited] |
| static void M24SR_BuildIBlockCommand | ( | uint16_t | CommandStructure, |
| C_APDU * | Command, | ||
| uint8_t | uDIDbyte, | ||
| uint16_t * | NbByte, | ||
| uint8_t * | pCommand | ||
| ) | [static] |
This functions creates an I block command according to the structures CommandStructure and Command.
- Parameters:
-
Command : structure which contains the field of the different parameters CommandStructure : structure of the command NbByte : number of bytes of the command pCommand : pointer to the command created
| static uint16_t M24SR_ComputeCrc | ( | uint8_t * | Data, |
| uint8_t | Length | ||
| ) | [static] |
| M24SR::StatusTypeDef M24SR_Deselect | ( | void | ) | [protected, inherited] |
| M24SR::StatusTypeDef M24SR_ForceSession | ( | void | ) | [protected, inherited] |
| M24SR::StatusTypeDef M24SR_GetSession | ( | void | ) | [protected, inherited] |
| M24SR::StatusTypeDef M24SR_Init | ( | M24SR_InitTypeDef * | notUsed ) | [protected, inherited] |
| M24SR::StatusTypeDef M24SR_IO_PollI2C | ( | void | ) | [protected, inherited] |
| M24SR::StatusTypeDef M24SR_IO_ReceiveI2Cresponse | ( | uint8_t | NbByte, |
| uint8_t * | pBuffer | ||
| ) | [protected, inherited] |
| M24SR::StatusTypeDef M24SR_IO_SendI2Ccommand | ( | uint8_t | NbByte, |
| uint8_t * | pBuffer | ||
| ) | [protected, inherited] |
| static M24SR::StatusTypeDef M24SR_IsCorrectCRC16Residue | ( | uint8_t * | DataIn, |
| uint8_t | Length | ||
| ) | [static] |
| M24SR::StatusTypeDef M24SR_SendChangeReferenceData | ( | uint16_t | uPwdId, |
| uint8_t * | pPwd | ||
| ) | [protected, inherited] |
This function sends the ChangeReferenceData command.
- Parameters:
-
uPwdId PasswordId ( 0x0001 : Read NDEF pwd or 0x0002 : Write NDEF pwd or 0x0003 : I2C pwd) pPwd pointer to the passwaord
- Return values:
-
Status (SW1&SW2) Satus of the operation to complete. M24SR_ERROR_I2CTIMEOUT I2C timeout occurred.
| M24SR::StatusTypeDef M24SR_SendDisablePermanentState | ( | uint16_t | uReadOrWrite ) | [protected, inherited] |
This function sends the DisablePermanentState command.
- Parameters:
-
uReadOrWrite enable the read or write protection ( 0x0001 : Read or 0x0002 : Write )
- Return values:
-
Status (SW1&SW2) Status of the operation to complete. M24SR_ERROR_I2CTIMEOUT I2C timeout occurred.
| M24SR::StatusTypeDef M24SR_SendDisableVerificationRequirement | ( | uint16_t | uReadOrWrite ) | [protected, inherited] |
This function sends the DisableVerificationRequirement command.
- Parameters:
-
uReadOrWrite enable the read or write protection ( 0x0001 : Read or 0x0002 : Write )
- Return values:
-
Status (SW1&SW2) Status of the operation to complete. M24SR_ERROR_I2CTIMEOUT I2C timeout occurred.
| M24SR::StatusTypeDef M24SR_SendEnablePermanentState | ( | uint16_t | uReadOrWrite ) | [protected, inherited] |
This function sends the EnablePermananentState command.
- Parameters:
-
uReadOrWrite enable the read or write protection ( 0x0001 : Read or 0x0002 : Write )
- Return values:
-
Status (SW1&SW2) Status of the operation to complete. M24SR_ERROR_I2CTIMEOUT I2C timeout occurred.
| M24SR::StatusTypeDef M24SR_SendEnableVerificationRequirement | ( | uint16_t | uReadOrWrite ) | [protected, inherited] |
This function sends the EnableVerificationRequirement command.
- Parameters:
-
uReadOrWrite enable the read or write protection ( 0x0001 : Read or 0x0002 : Write )
- Return values:
-
Status (SW1&SW2) Status of the operation to complete. M24SR_ERROR_I2CTIMEOUT I2C timeout occurred.
| M24SR::StatusTypeDef M24SR_SendFWTExtension | ( | uint8_t | FWTbyte ) | [protected, inherited] |
| M24SR::StatusTypeDef M24SR_SendInterrupt | ( | void | ) | [protected, inherited] |
| M24SR::StatusTypeDef M24SR_SendReadBinary | ( | uint16_t | Offset, |
| uint8_t | NbByteToRead, | ||
| uint8_t * | pBufferRead | ||
| ) | [protected, inherited] |
This function sends a read binary command.
- Parameters:
-
Offset first byte to read NbByteToRead number of bytes to read pBufferRead pointer to the buffer read from the M24SR device
- Return values:
-
Status (SW1&SW2) Status of the operation to complete. M24SR_ERROR_I2CTIMEOUT I2C timeout occurred.
| M24SR::StatusTypeDef M24SR_SendSelectApplication | ( | void | ) | [protected, inherited] |
| M24SR::StatusTypeDef M24SR_SendSelectCCfile | ( | void | ) | [protected, inherited] |
| M24SR::StatusTypeDef M24SR_SendSelectNDEFfile | ( | uint16_t | NDEFfileId ) | [protected, inherited] |
| M24SR::StatusTypeDef M24SR_SendSelectSystemfile | ( | void | ) | [protected, inherited] |
| M24SR::StatusTypeDef M24SR_SendSTReadBinary | ( | uint16_t | Offset, |
| uint8_t | NbByteToRead, | ||
| uint8_t * | pBufferRead | ||
| ) | [protected, inherited] |
This function sends a ST read binary command (no error if access is not inside NDEF file)
- Parameters:
-
Offset first byte to read NbByteToRead number of bytes to read pBufferRead pointer to the buffer read from the M24SR device
- Return values:
-
Status (SW1&SW2) Status of the operation to complete. M24SR_ERROR_I2CTIMEOUT I2C timeout occurred.
| M24SR::StatusTypeDef M24SR_SendUpdateBinary | ( | uint16_t | Offset, |
| uint8_t | NbByteToWrite, | ||
| uint8_t * | pDataToWrite | ||
| ) | [protected, inherited] |
This function sends a Update binary command.
- Parameters:
-
Offset first byte to read NbByteToWrite number of bytes to write pBufferRead pointer to the buffer read from the M24SR device
- Return values:
-
Status (SW1&SW2) Status of the operation to complete. M24SR_ERROR_I2CTIMEOUT I2C timeout occurred.
| M24SR::StatusTypeDef M24SR_SendVerify | ( | uint16_t | uPwdId, |
| uint8_t | NbPwdByte, | ||
| const uint8_t * | pPwd | ||
| ) | [protected, inherited] |
This function sends the Verify command.
- Parameters:
-
uPwdId PasswordId ( 0x0001 : Read NDEF pwd or 0x0002 : Write NDEF pwd or 0x0003 : I2C pwd) NbPwdByte Number of bytes ( 0x00 or 0x10) pPwd pointer to the password
- Return values:
-
Status (SW1&SW2) Status of the operation to complete. M24SR_ERROR_I2CTIMEOUT I2C timeout occurred.
| M24SR::StatusTypeDef M24SR_StateControl | ( | uint8_t | uSetOrReset ) | [protected, inherited] |
| static uint16_t M24SR_UpdateCrc | ( | uint8_t | ch, |
| uint16_t * | lpwCrc | ||
| ) | [static] |
| M24SR::StatusTypeDef manage_event | ( | void | ) | [inherited] |
Generated on Wed Jul 13 2022 05:23:50 by
1.7.2
