我将从nucleo L476RG、MEMS和NFC02A1开始。我尝试将MEMS数据写入nfc tag及其工作。我的问题是,当我尝试使用能量收集模式,它不工作,我不知道为什么。我在nfc多维数据集中使用了这个示例,但它不起作用。
下面是不起作用的收获函数
void Enable_EnergyHarvesting( void )
{
NFCTAG_ExtDrvTypeDef toto;
/* Initialise M24LR Board */
if( BSP_NFCTAG_GetExtended_Drv() != NULL )
{
/* Enable Energy Harvesting */
BSP_NFCTAG_GetExtended_Drv()->Enable_EH_mode();
BSP_NFCTAG_GetExtended_Drv()->SetEH( );
/* Store configuration in non Volatile Memory */
BSP_NFCTAG_GetExtended_Drv()->WriteEH_Cfg( M24LR_EH_Cfg_6MA);
}
}
int main( void )
{
HAL_Init();
/* Configure the system clock */
SystemClock_Config();
/* Init of the Nucleo Board led */
BSP_LED_Init(LED2);
//M24lr_IO_Init();
/* Init of the Leds on X-NUCLEO-NFC02A1 board */
NFC02A1_LED_Init( );
NFC02A1_LED_ON( GREEN_LED );
wait_ms( 500 );
NFC02A1_LED_ON( BLUE_LED );
wait_ms( 500 );
NFC02A1_LED_ON( ORANGE_LED );
wait_ms( 500 );
NFC02A1_LED_OFF( GREEN_LED );
wait_ms( 500 );
NFC02A1_LED_OFF( BLUE_LED );
wait_ms( 500 );
NFC02A1_LED_OFF( ORANGE_LED );
/* Init M24LR driver */
while( BSP_NFCTAG_Init( ) != NFCTAG_OK );
Enable_EnergyHarvesting( );
/* Check if no NDEF detected, init mem in Tag Type 5 */
if( NfcType5_NDEFDetection( ) != NDEF_OK )
{
CCFileStruct.MagicNumber = NFCT5_MAGICNUMBER_E1_CCFILE;
CCFileStruct.Version = NFCT5_VERSION_V1_0;
CCFileStruct.MemorySize = ( M24LR_MAX_SIZE / 8 ) & 0xFF;
CCFileStruct.TT5Tag = 0x05;
/* Init of the Type Tag 5 component (M24LR) */
while( NfcType5_TT5Init( ) != NFCTAG_OK );
}
/* Set the LED2 on to indicate Init done */
NFC02A1_LED_ON( BLUE_LED );
/* Prepare URI NDEF message content */
strcpy( URI.protocol,URI_ID_0x01_STRING );
strcpy( URI.URI_Message,/"google.com");
strcpy( URI.Information,"\0" );
/* Write NDEF to EEPROM */
while( NDEF_WriteURI( &URI ) != NDEF_OK );
/* Set the LED3 on to indicate Programing done */
NFC02A1_LED_ON( ORANGE_LED );
while( 1 )
{
}
}发布于 2017-04-03 16:10:47
尝试使用此配置:
/*在非易失性存储器中存储配置*/
BSP_NFCTAG_GetExtended_Drv()->WriteEH_Cfg(M24LR_EH_Cfg_300UA);
可能是你的阅读器没有提供足够的能力。
https://stackoverflow.com/questions/37835088
复制相似问题