zoukankan      html  css  js  c++  java
  • STM32数据类型定义

     1 #ifndef __STM32F10x_TYPE_H
     2 #define __STM32F10x_TYPE_H
     3 
     4 
     5 typedef signed long  s32;
     6 typedef signed short s16;
     7 typedef signed char  s8;
     8 typedef signed long  const sc32; 
     9 typedef signed short const sc16; 
    10 typedef signed char  const sc8;  
    11 typedef volatile signed long  vs32;
    12 typedef volatile signed short vs16;
    13 typedef volatile signed char  vs8;
    14 typedef volatile signed long  const vsc32; 
    15 typedef volatile signed short const vsc16; 
    16 typedef volatile signed char  const vsc8;  
    17 typedef unsigned long  u32;
    18 typedef unsigned short u16;
    19 typedef unsigned char  u8;
    20 typedef unsigned long  const uc32; 
    21 typedef unsigned short const uc16; 
    22 typedef unsigned char  const uc8;  
    23 typedef volatile unsigned long  vu32;
    24 typedef volatile unsigned short vu16;
    25 typedef volatile unsigned char  vu8;
    26 typedef volatile unsigned long  const vuc32; 
    27 typedef volatile unsigned short const vuc16; 
    28 typedef volatile unsigned char  const vuc8;  
    29 typedef enum {FALSE = 0, TRUE = !FALSE} bool;
    30 typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus;
    31 typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
    32 #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
    33 typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus;
    34 #define U8_MAX     ((u8)255)
    35 #define S8_MAX     ((s8)127)
    36 #define S8_MIN     ((s8)-128)
    37 #define U16_MAX    ((u16)65535u)
    38 #define S16_MAX    ((s16)32767)
    39 #define S16_MIN    ((s16)-32768)
    40 #define U32_MAX    ((u32)4294967295uL)
    41 #define S32_MAX    ((s32)2147483647)
    42 #define S32_MIN    ((s32)-2147483648)
    43 
    44 
    45 #endif
  • 相关阅读:
    简单工厂模式、工厂模式、抽象工厂模式
    直接插入排序
    简单选择排序的陷阱
    面试3 题目二,不修改数组找到重复的数字
    二进制中1的个数(读不懂题目怎么办)
    用两个栈实现队列
    斐波那契数列
    替换空格
    python 实现杨辉三角(依旧遗留问题)
    递归实现二分查找
  • 原文地址:https://www.cnblogs.com/kb342/p/3745541.html
Copyright © 2011-2022 走看看