In the Keil MDK development environment, for example, an unsigned 32-bit integer data has many ways of representation: 1, unsigned int 32 (standard expression in C language) 2, uint32_t; 3, u32; These three ways all express the same meaning, but why do ST developers make it so confusing? There are many other expressions that may seem strange to you and difficult to understand, such as: _IO int32_t is equivalent to vs32 (this is also unfamiliar to you), but it is also equivalent to volatile int32_t, and it is also equivalent to volatile signed int 32; the last expression is the standard expression in C language, which is confusing enough to confuse beginners.
In fact, ST has so many tricks, just to let developers write fewer symbols when defining data types when writing code, and because of the upgrade of the previous and later versions, so many representation methods will appear in order to be compatible with the old version (mainly V2.0). No matter how it is changed, it is based on standard C. Just look at the following files and you will be OK: core_cm3.h; stm32f10x.h; stdint.h; The functions of each file are as follows:
stdint.h Here is the standard expression of C language
//Starting from line 36
typedef signed char int8_t; // Standard expression signed char is equivalent to int8_t;
typedef signed short int int16_t;
typedef signed int int32_t; //In a 32-bit environment, int represents 4 bytes 32 bits! !
typedef signed __int64 int64_t;
typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;
typedef unsigned int uint32_t;
typedef unsigned __int64 uint64_t ; typedef
signed char int_least8_t;
typedef signed short int int_least16_t; __int64 int_least64_t;
typedef unsigned char uint_least8_t; typedef unsigned short int uint_least16_t; typedef unsigned int uint_least32_t; _t; typedef unsigned __int64 int_fast64_t; typedef unsigned int uint_fast8_t; typedef unsigned int uint_fast16_t; typedef unsigned int uint_fast32_t; typedef unsigned __int64 uint_fast64_t; typedef signed int intptr_t; typedef unsigned int uintptr_t; typedef signed __int64 intmax_t; typedef unsigned __int64 uintmax_t; The core_cm3.h file mainly makes type extensions for dynamic and static variable modifiers #ifdef __cplusplus #define __I volatile #else #define __I volatile const #endif #define __O volatile #define __IO volatile stm32f10x.h This file is mainly for compatibility with old versions typedef int32_t s32; typedef int16_t s16; typedef int8_t s8; typedef const int32_t sc32; typedef const int16_t sc16 ; typedef const int8_t sc8; typedef __IO int32_t vs32; __I int16_t vsc16 ; typedef __I int8_t vsc8;
typedef uint32_t u32;
typedef uint16_t u16;
typedef uint8_t u8;
typedef const uint32_t uc32;
typedef const uint16_t uc16;
typedef const uint8_t uc8;
typedef __IO uint32_t vu32;
typedef __IO uint16_t vu16;
typedef __IO uint8_t vu8;
typedef __I uint32_t vuc32;
typedef __I uint16_t vuc16;
typedef __I uint8_t vuc8;
Previous article:STM32 abbreviations explained
Next article:Usage instructions for assert_param in stm32
Recommended ReadingLatest update time:2024-11-16 16:52
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- 【TI recommended course】#What is I2C design tool? #
- How to determine the chip output current of the op amp
- Found a bug in threadx with stmcube
- [Simulation-Physical-Test] 790 to 960 MHz Broadband 600W LDMOS Asymmetric Doherty Amplifier
- TRUWB digital receiver performance based on ADC and its FPGA implementation.pdf
- Can the number of pulses of an ultrasonic generator driven by a transformer be accurately controlled?
- The helper2416 development board driver failed to create a device node
- 【Chuanglong TL570x-EVM】Review 01 - Unboxing
- Power Factor Correction
- Ultra-low standby power consumption < 90mW non-auxiliary AC/DC power supply reference design