适用于嵌入式系统的变量
以下定义来自stm32f10x.h
typedef int32_t s32;
typedef int16_t s16;
typedef int8_t s8;
typedef const int32_t sc32; /*!< Read Only /
typedef const int16_t sc16; /!< Read Only /
typedef const int8_t sc8; /!< Read Only */
typedef __IO int32_t vs32;
typedef __IO int16_t vs16;
typedef __IO int8_t vs8;
typedef __I int32_t vsc32; /*!< Read Only /
typedef __I int16_t vsc16; /!< Read Only /
typedef __I int8_t vsc8; /!< Read Only */
typedef uint32_t u32;
typedef uint16_t u16;
typedef uint8_t u8;
typedef const uint32_t uc32; /*!< Read Only /
typedef const uint16_t uc16; /!< Read Only /
typedef const uint8_t uc8; /!< Read Only */
typedef __IO uint32_t vu32;
typedef __IO uint16_t vu16;
typedef __IO uint8_t vu8;
typedef __I uint32_t vuc32; /*!< Read Only /
typedef __I uint16_t vuc16; /!< Read Only /
typedef __I uint8_t vuc8; /!< Read Only */
CMSIS IO类型限定词
| IO类限定词 | define | 描述 |
|---|---|---|
| _I | volatile const | 只读访问 |
| _O | volatile | 只写访问 |
| _IO | volatile | 读写访问 |
数据类型对比
| 固件库 | CMSIS类型 | 描述 |
|---|---|---|
| s32 | int32_t | 有符号32位数据 |
| sc32 | const int32_t | 只读有符号32位数据 |
| vs32 | _IO int32_t | 易挥发读写访问有符号32位数据 |
| vsc32 | _I int32_t | 易挥发只读有符号32位数据 |
| u32 | uint32_t | 无符号32位数据 |
| uc32 | const uint32_t | 只读无符号32位数据 |
| vu32 | _IO uint32_t | 易挥发读写访问无符号32位数据 |
| vuc32 | _I uint32_t | 易挥发只读无符号32位数据 |
2439

被折叠的 条评论
为什么被折叠?



