首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用nucleo NFC02A1进行能量分配

如何使用nucleo NFC02A1进行能量分配
EN

Stack Overflow用户
提问于 2016-06-15 20:10:42
回答 1查看 160关注 0票数 0

我将从nucleo L476RG、MEMS和NFC02A1开始。我尝试将MEMS数据写入nfc tag及其工作。我的问题是,当我尝试使用能量收集模式,它不工作,我不知道为什么。我在nfc多维数据集中使用了这个示例,但它不起作用。

下面是不起作用的收获函数

代码语言:javascript
复制
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 )
   {

   }
}
EN

回答 1

Stack Overflow用户

发布于 2017-04-03 16:10:47

尝试使用此配置:

/*在非易失性存储器中存储配置*/

BSP_NFCTAG_GetExtended_Drv()->WriteEH_Cfg(M24LR_EH_Cfg_300UA);

可能是你的阅读器没有提供足够的能力。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37835088

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档