打印
[DemoCode下载]

MUG51 读取UID

[复制链接]
398|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
天灵灵地灵灵|  楼主 | 2022-12-22 17:16 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
/*---------------------------------------------------------------------------------------------------------*/
/*                                                                                                         */
/* SPDX-License-Identifier: Apache-2.0                                                                     */
/* Copyright(c) 2022 Nuvoton Technology Corp. All rights reserved.                                         */
/*                                                                                                         */
/*---------------------------------------------------------------------------------------------------------*/

//***********************************************************************************************************
//  File Function: MUG51 Read UID demo code
//***********************************************************************************************************
#include "MUG51.h"

/* For printf code only. Disable this define to reduce code size. */
#define print_function

/**********************************/
/* *only read one byte of UID    */
/*********************************/

void main(void)
{
  unsigned char READ;

#ifdef print_function  
    Enable_P31_UART0_VCOM_115200_printf();
#endif  

  UID_Read();
#ifdef print_function
  /*printf must in SFR page 0 */
    _push_(SFRS);
    SFRS = 0; printf ("\n UID = ");
    for(READ=0;READ<12;READ++)
    {
      printf (" 0x%bx",UIDBuffer[READ]);
    }
    _pop_(SFRS);
#endif
  while(1);


}


使用特权

评论回复
沙发
小明的同学| | 2022-12-22 19:38 | 只看该作者
这个用法真好,学会了。

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

167

主题

3341

帖子

13

粉丝