当前位置:网站首页>STM32 stores float data in flash
STM32 stores float data in flash
2022-06-25 12:39:00 【Who am I?】
Float Type numbers are used in computers 4 Byte store , follow IEEE-754 Format standard :
| Float data | The symbolic part (S) | The base part (M) | Index part (E) |
| explain | 0 Express positive 1 Negative | Use binary numbers to represent the actual value of this floating point number , The base part is actually occupied 24 bit A value of , But the highest bit is not stored , Share in storage 23 bit Science and Technology Law . | Occupy 8 bit Binary number of , The range of values that can be expressed is 0~255. Because the index can be positive or negative , So, in accordance with the IEEE Specify the calculated index minus 127 Is the real index ,float The real range of the type of index is -127 To 128. |
So the format is :SEEE EEEE EMMM MMMM MMMM MMMM MMMM MMMM
stay flash Medium access float There are two ways of data , The first way to use pointers
hold float Data stored in flash in
float data;
uint32_t temp;
temp = *(uint32_t *)&data;
Flash_WriteWordData(Flash_Save_Adder, temp);
from flash Read it out
Flash_ReadWordData(Flash_Write_Adder, temp);
data = *(float *)&temp;Second common body , Use the common body to share a section of memory for storage
float data;
union
{
float a;
uint32_t b;
}temp;
temp.a = data;
Flash_WriteWordData(Flash_Save_Adder, temp.b);
from flash Read it out
Flash_ReadWordData(Flash_Write_Adder, temp.b);
data = temp.a;
Link to the original text :https://blog.csdn.net/qq_41836400/article/details/121964054
边栏推荐
- Laravel echart statistical chart line chart
- Lighten the source code -- lighten the app system development function introduction to the beautiful world lighten the app system development source code in China
- Flutter common commands and problems
- Ten commandments of self-learning in machine learning
- The first techo day Tencent technology open day in 2022 will be held online on June 28
- flutter 收到推送后自动消失问题
- PHP appends the same elements to a two-dimensional array
- The R language uses the follow up The plot function visualizes the longitudinal follow-up map of multiple ID (case) monitoring indicators, and uses stress The type parameter specifies the line type of
- Error while sending STMT_ PREPARE packet. PID=29294
- Initialize the project using the express framework
猜你喜欢

Guess Tongyuan B

GPS receiver design (1)

Happy shopkeeper source code -- Introduction to happy shopkeeper system development mode

SDN system method | 9 Access network

Explain AHP in human language (very detailed principle + simple tool implementation)

MySQL common interview questions

2022 meisai topic C idea sharing + translation

Total number of MySQL statistics, used and unused

Zhangxiaobai's road to penetration (7) -sql injection detailed operation steps -union joint query injection

Zhangxiaobai's way of penetration (VIII) - detailed operation steps of SQL injection - Boolean blind injection of blind injection
随机推荐
Today, I will explain to you what is DFI and its development prospects
Common software numerical filtering methods (I) have been applied
Node child processes and threads
GPS NMEA protocol, 0183 positioning data format dual mode positioning: gnxxx gps+bd full version
[on]learning dynamic and hierarchical traffic spatiotemporal features with transformer
GNSS receiver technology and application review
2022 meisai e topic ideas sharing + translation
PHP parsing QR code content
(2) Pyqt5 tutorial -- > using qtdesigner to separate interface code
Install MySQL client
flutter 收到推送后自动消失问题
Installation and removal of MySQL under Windows
Dynamic proxy
How can we differ LEFT OUTER JOIN vs Left Join [duplicate]
Go novice exploration road 2
Repair the error that ECSHOP background orders prompt insufficient inventory when adding goods. Please reselect
node. JS architecture optimization: reverse proxy and cache service
Why do we do autocorrelation analysis? Explain application scenarios and specific operations
Thinkphp3 use phpword to modify the template and download it
Laravel task scheduling