[英]I am Currently using PSoC 5LP. I want to read 8 Byte of HexaDecimal data from 1st row of EEPROM of Psoc 5Lp
I am able to Write 8 Byte of Hexadecimal data in 1st row of EEPROM but I am not able to understand how to read 8 Byte data from EEPROM and convert 8 Byte Hexadecimal into decimal and save that decimal value into any unsigned integer.我能够在 EEPROM 的第一行写入 8 字节的十六进制数据,但我无法理解如何从 EEPROM 读取 8 字节数据并将 8 字节十六进制转换为十进制并将该十进制值保存到任何无符号 integer 中。 Is there any easiest way to convert 8 Byte hexadecimal into decimal without using sprintf because sprintf convert value into character type and I want to store decimal value into unsigned integer?
有没有最简单的方法可以在不使用 sprintf 的情况下将 8 Byte 十六进制转换为十进制,因为 sprintf 将值转换为字符类型,并且我想将十进制值存储到无符号 integer 中?
I'm not sure about your use case, but why not write/read the 32 bit unsigned value as it is?我不确定您的用例,但为什么不按原样写入/读取 32 位无符号值呢? As 4 byte binary without any conversion needed.
作为 4 字节二进制文件,无需任何转换。 Endianess can be an issue, but not really when the same MCU write/reads to/from it's locally connected EEPROM.
Endianess 可能是一个问题,但当同一个 MCU 向/从其本地连接的 EEPROM 写入/读取时,情况并非如此。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.