如何使用核NFC02A1进行能量测量

时间:2016-06-15 12:10:42

标签: stm32

我从核L476RG,MEMS和NFC02A1开始。 我尝试将MEMS数据写入nfc标签及其工作。 我的问题是当我尝试使用能量收集模式时,它不起作用,我不知道为什么。我在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 )
   {

   }
}

1 个答案:

答案 0 :(得分:0)

尝试使用此配置:

/ *将配置存储在非易失性存储器中* /
BSP_NFCTAG_GetExtended_Drv() - > WriteEH_Cfg(M24LR_EH_Cfg_300UA);

可能是你的读者没有提供足够的力量。