2018-08-22 07:11 AM
When i looked into the doc , i found that "To be usable on any MCU, this driver calls several IOBus functions. The IOBus functions are implemented outside this driver, and are in charge of accessing the MCU peripherals used for the communication with the tag",
could you pls share if any document steps available to port driver on different micro ?
Solved! Go to Solution.
2018-09-13 06:55 AM
Hello,
The ST25DV Cube driver has been designed for STMicroelectronics MCUs but it may be adapted to any hardware by modifying the "IOBus" layer, namely:
NFCTAG_StatusTypeDef ST25DV_IO_Init( void );
NFCTAG_StatusTypeDef ST25DV_IO_MemWrite( const uint8_t * const pData, const uint8_t DevAddr, const uint16_t TarAddr, const uint16_t Size );
NFCTAG_StatusTypeDef ST25DV_IO_Write( const uint8_t * const pData, const uint8_t DevAddr, const uint16_t Size );
NFCTAG_StatusTypeDef ST25DV_IO_MemRead( uint8_t * const pData, const uint8_t DevAddr, const uint16_t TarAddr, const uint16_t Size );
NFCTAG_StatusTypeDef ST25DV_IO_Read( uint8_t * const pData, const uint8_t DevAddr, const uint16_t Size );
uint8_t ST25DV_IO_IsNacked( void );
NFCTAG_StatusTypeDef ST25DV_IO_IsDeviceReady( const uint8_t DevAddr, const uint32_t Trials );
Those functions are defined in the st25_discovery.c file and they are calling the I2C Cube HAL layer (i.e. the STM32 I2C drivers). You basically need to replace those HAL calls by the calls to your MCU I2C driver.
You should have a look to the stm32duino GitHub: https://github.com/stm32duino/X-NUCLEO-NFC04A1
(Especially the x_nucleo_nfc04a1.cpp file, which is the equivalent to the st25_discovery.c for Nucleo board, defining the IOBus: https://github.com/stm32duino/X-NUCLEO-NFC04A1/blob/master/src/BSP/x_nucleo_nfc04a1.cpp)
This is a good example of how to modify the IOBus for non-ST MCU.
2018-09-13 06:55 AM
Hello,
The ST25DV Cube driver has been designed for STMicroelectronics MCUs but it may be adapted to any hardware by modifying the "IOBus" layer, namely:
NFCTAG_StatusTypeDef ST25DV_IO_Init( void );
NFCTAG_StatusTypeDef ST25DV_IO_MemWrite( const uint8_t * const pData, const uint8_t DevAddr, const uint16_t TarAddr, const uint16_t Size );
NFCTAG_StatusTypeDef ST25DV_IO_Write( const uint8_t * const pData, const uint8_t DevAddr, const uint16_t Size );
NFCTAG_StatusTypeDef ST25DV_IO_MemRead( uint8_t * const pData, const uint8_t DevAddr, const uint16_t TarAddr, const uint16_t Size );
NFCTAG_StatusTypeDef ST25DV_IO_Read( uint8_t * const pData, const uint8_t DevAddr, const uint16_t Size );
uint8_t ST25DV_IO_IsNacked( void );
NFCTAG_StatusTypeDef ST25DV_IO_IsDeviceReady( const uint8_t DevAddr, const uint32_t Trials );
Those functions are defined in the st25_discovery.c file and they are calling the I2C Cube HAL layer (i.e. the STM32 I2C drivers). You basically need to replace those HAL calls by the calls to your MCU I2C driver.
You should have a look to the stm32duino GitHub: https://github.com/stm32duino/X-NUCLEO-NFC04A1
(Especially the x_nucleo_nfc04a1.cpp file, which is the equivalent to the st25_discovery.c for Nucleo board, defining the IOBus: https://github.com/stm32duino/X-NUCLEO-NFC04A1/blob/master/src/BSP/x_nucleo_nfc04a1.cpp)
This is a good example of how to modify the IOBus for non-ST MCU.