Definition of stm32 data type

Publisher:数字驿站Latest update time:2017-11-01 Source: eefocusKeywords:stm32 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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; 

Keywords:stm32 Reference address:Definition of stm32 data type

Previous article:STM32 abbreviations explained
Next article:Usage instructions for assert_param in stm32

Recommended ReadingLatest update time:2024-11-16 16:52

STM32 serial port idle interrupt receives data
for example: 1. Background data- USART1- USART2- other devices, other device data- USART2- USART1- background, these two data processes may also be carried out at the same time. 2. Due to hardware limitations, the transmission baud rates of USART1 and USART2 are different. For example, USART1 uses GPRS communication
[Microcontroller]
STM32 debugging support (DBG)
The STM32F10xxx uses the Cortex™-M3 core, which contains a hardware debug module that supports complex debugging operations. The hardware debug module allows the core to stop when fetching instructions (instruction breakpoints) or accessing data (data breakpoints). When the core stops, the internal state of the core
[Microcontroller]
STM32 debugging support (DBG)
[STM32] Power control, low power mode (example: standby mode)
STM32F1xx official information: "STM32 Chinese Reference Manual V10" - Chapter 4 Section 4.3 Low Power Mode Power control of STM32 STM32 power supply block diagram The operating voltage (VDD) of STM32 is 2.0~3.6V. The required 1.8V power supply is provided by the built-in voltage regulator. When the main power sup
[Microcontroller]
[STM32] Power control, low power mode (example: standby mode)
Self-understanding of the function of reading status flag bits in stm32
In order to allow the program to read the status of multiple status flags, the firmware designs a general function RCC_GetStatus() to read the status of each flag. The following are all the RCC flags: *                       - RCC_FLAG_HSIRDY: HSI oscillator clock ready   *                       - RCC_FLAG_HSERDY:
[Microcontroller]
STM32 TFT-LCD liquid crystal learning
TFT-LCD is a thin film transistor liquid crystal display. Its full English name is: Thin Film Transistor-Liquid Crystal Display. TFT-LCD is different from the simple matrix of passive TN-LCD and STN-LCD. It has a thin film transistor (TFT) on each pixel of the liquid crystal display screen, which can effectively over
[Microcontroller]
STM32 TFT-LCD liquid crystal learning
[STM32 motor vector control] Record 5 - FOC principle
FOC control algorithm: What FOC controls is actually the direction of the electromagnetic field of the motor. The rotor torque of the rotor is proportional to the vector product of the stator magnetic field vector and the rotor magnetic field vector. From the relationship between the vectors, it can be seen that if th
[Microcontroller]
[STM32 motor vector control] Record 5 - FOC principle
STM32 analog IIC read and write 24CXX
File (iic.h): #define SDA_IN()  {GPIOB- CRL&=0X0FFFFFFF;GPIOB- CRL|=0X80000000;} #define SDA_OUT() {GPIOB- CRL&=0X0FFFFFFF;GPIOB- CRL|=0X30000000;} #define IIC_SCL    PBout(6)  #define IIC_SDA    PBout(7)   #define READ_SDA   PBin(7)  void bsp_iic_init(void);                              void bsp_iic_start(void)
[Microcontroller]
STM32 interrupt priority grouping
The Cortex-M3 can have up to 8 interrupt priority grouping methods, because CM3 has a mandatory rule that SubPriority must occupy at least one bit (if there is no such mandatory rule, then there are up to 9 CM3 grouping methods). We know that STM32 makes the MSB4 bits of the register that specifies the interrupt prior
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号