zoukankan      html  css  js  c++  java
  • Read UNIQUE ID and flash size method for stm32

    /*
      读取stm32的unique id 与 flash size
    */
    /*
     func: unsigned int Read_UniqueID_Byte(unsigned char offset)  
     desc: This function is used to read the unique ID in flash.
            parameter offset is the byte offset ,the max is 96/8= 12.
     return: the return value is indicated part of the unique ID.
    */
    unsigned char Read_UniqueID_Byte(unsigned char offset)  
    {  
        unsigned char id_byte;
    
            id_byte = *(unsigned char*)(0x1FFFF7E8+offset);           //ID基地址是0x1FFFF7E8
    
            return id_byte; 
    }
    
    /*
     func: unsigned short Read_Flash_Byte(void)  
     desc: This function is used to read flash size .This field value indicates 
        the Flash memory size of the device in Kbytes.
        example:0x100 means this flash size is 256 Kbytes.
            0x080 means this flash size is 128 Kbytes.
     return: the return value is flash size.
    */
    unsigned short Read_Flash_Byte(void)  
    {  
        unsigned short id_byte;
    
            id_byte = *(unsigned int*)(0x1FFFF7E0);           //flash size基地址是0x1FFFF7E0 
    
            return id_byte; 
    }
  • 相关阅读:
    laravel 服务提供者
    乐观锁和悲观锁
    MySQL索引原理及慢查询优化
    Laravel Session保存机制和terminate中间件
    laravel session踩坑
    理解 JavaScript 的 async/await(转)
    知识点
    js异步
    Office使用笔记
    YUM常用命令
  • 原文地址:https://www.cnblogs.com/shangdawei/p/3386777.html
Copyright © 2011-2022 走看看