STM32f10x_type.h文件--变量类型

本文详细介绍了STM32F10x系列微控制器中使用的各种数据类型定义,包括基本类型如s32、u32及其常量和易失型变体,布尔类型bool,状态类型FlagStatus等,并给出了各类型的最大最小值定义。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F10x_TYPE_H
#define __STM32F10x_TYPE_H

/* Includes ------------------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
typedef signed long  s32;
typedef signed short s16;
typedef signed char  s8;

typedef signed long  const sc32;  /* Read Only */
typedef signed short const sc16;  /* Read Only */
typedef signed char  const sc8;   /* Read Only */

typedef volatile signed long  vs32;
typedef volatile signed short vs16;
typedef volatile signed char  vs8;

typedef volatile signed long  const vsc32;  /* Read Only */
typedef volatile signed short const vsc16;  /* Read Only */
typedef volatile signed char  const vsc8;   /* Read Only */

typedef unsigned long  u32;
typedef unsigned short u16;
typedef unsigned char  u8;

typedef unsigned long  const uc32;  /* Read Only */
typedef unsigned short const uc16;  /* Read Only */
typedef unsigned char  const uc8;   /* Read Only */

typedef volatile unsigned long  vu32;
typedef volatile unsigned short vu16;
typedef volatile unsigned char  vu8;

typedef volatile unsigned long  const vuc32;  /* Read Only */
typedef volatile unsigned short const vuc16;  /* Read Only */
typedef volatile unsigned char  const vuc8;   /* Read Only */

typedef enum {FALSE = 0, TRUE = !FALSE} bool;

typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus;

typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
#define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))

typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus;

#define U8_MAX     ((u8)255)
#define S8_MAX     ((s8)127)
#define S8_MIN     ((s8)-128)
#define U16_MAX    ((u16)65535u)
#define S16_MAX    ((s16)32767)
#define S16_MIN    ((s16)-32768)
#define U32_MAX    ((u32)4294967295uL)
#define S32_MAX    ((s32)2147483647)
#define S32_MIN    ((s32)-2147483648)

/* Exported constants --------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */

#endif /* __STM32F10x_TYPE_H */

Rebuild started: Project: Template *** Using Compiler 'V5.06 update 6 (build 750)', folder: 'C:\qiancode\ARM\ARMCC\Bin' Rebuild target 'Target 1' assembling startup_stm32f10x_hd_vl.s... compiling main.c... compiling stm32f10x_it.c... User\stm32f10x.h(343): error: #67: expected a "}" ADC1_IRQn = 18, /*!< ADC1 global Interrupt */ User\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error } IRQn_Type; User\stm32f10x_it.c: 1 warning, 1 error compiling stm32f10x_gpio.c... .\User\stm32f10x.h(343): error: #67: expected a "}" ADC1_IRQn = 18, /*!< ADC1 global Interrupt */ .\User\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error } IRQn_Type; Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c: 1 warning, 1 error compiling core_cm3.c... compiling system_stm32f10x.c... .\User\stm32f10x.h(343): error: #67: expected a "}" ADC1_IRQn = 18, /*!< ADC1 global Interrupt */ .\User\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error } IRQn_Type; Libraries\CMSIS\system_stm32f10x.c: 1 warning, 1 error compiling stm32f10x_adc.c... .\User\stm32f10x.h(343): error: #67: expected a "}" ADC1_IRQn = 18, /*!< ADC1 global Interrupt */ .\User\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error } IRQn_Type; Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_adc.c: 1 warning, 1 error compiling stm32f10x_usart.c... .\User\stm32f10x.h(343): error: #67: expected a "}" ADC1_IRQn = 18, /*!< ADC1 global Interrupt */ .\User\stm32f10x.h(472): warning: #12-D: parsing restarts here after previous syntax error } IRQn_Type; Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_usart.c:
03-10
出现以下报错Rebuild started: Project: SmartCar *** Using Compiler 'V5.06 update 6 (build 750)', folder: 'D:\keil(C51+MDK)\KEIL_MDK\ARM\ARMCC\Bin' Rebuild target 'SmartCar' compiling main.c... User\main.c(58): warning: #223-D: function "sprintf" declared implicitly sprintf(modeMsg, "Mode: AVOID\r\n"); User\main.c(110): error: #65: expected a ";" { User\main.c(139): warning: #12-D: parsing restarts here after previous syntax error break; User\main.c(141): error: #121: a case label may only be used within a switch case 2: // 杞集 User\main.c(142): error: #20: identifier "last_action_time" is undefined if(Delay_GetDiffMS(last_action_time) >= 500) User\main.c(144): error: #20: identifier "avoid_state" is undefined avoid_state = 0; // 杩斿洖妫€娴嬬姸鎬? User\main.c(146): error: #116: a break statement may only be used within a loop or switch break; User\main.c(148): error: #169: expected a declaration } User\main.c(173): warning: #12-D: parsing restarts here after previous syntax error Gradual_Turn(SHARP_TURN_SPEED, -SHARP_TURN_SPEED); // 鎬ュ乏杞? User\main.c(174): error: #77-D: this declaration has no storage class or type specifier last_turn_time = Delay_GetTick(); User\main.c(174): error: #59: function call is not allowed in a constant expression last_turn_time = Delay_GetTick(); User\main.c(175): error: #77-D: this declaration has no storage class or type specifier turn_state = 1; User\main.c(176): error: #169: expected a declaration return; User\main.c(177): error: #169: expected a declaration } User\main.c(279): warning: #12-D: parsing restarts here after previous syntax error Delay_ms(5); User\main.c(280): error: #169: expected a declaration } User\main.c: 4 warnings, 12 errors compiling stm32f10x_dac.c... compiling stm32f10x_it.c... compiling stm32f10x_adc.c... compiling stm32f10x_crc.c... compiling stm32f10x_can.c... compiling stm32f10x_exti.c... compiling misc.c... compiling stm32f10x_dbgmcu.c... compiling stm32f10x_cec.c... compiling stm32f10x_bkp.c... compiling stm32f10x_dma.c... compiling stm32f10x_fsmc.c... compiling stm32f10x_gpio.c... compiling stm32f10x_flash.c... compiling stm32f10x_i2c.c... compiling stm32f10x_iwdg.c... compiling stm32f10x_pwr.c... compiling stm32f10x_rcc.c... compiling stm32f10x_rtc.c... compiling stm32f10x_sdio.c... compiling stm32f10x_spi.c... compiling stm32f10x_usart.c... compiling stm32f10x_tim.c... assembling startup_stm32f10x_md.s... compiling stm32f10x_wwdg.c... compiling system_stm32f10x.c... compiling bluetooth.c... compiling Delay.c... compiling pwm.c... compiling servo.c... compiling motor.c... compiling core_cm3.c... compiling pwm_motor.c... compiling ultrasound.c... compiling sys.c... compiling trace.c... ".\OBJ\project.axf" - 12 Error(s), 4 Warning(s). Target not created. Build Time Elapsed: 00:00:07
最新发布
06-18
*** Using Compiler 'V5.06 update 4 (build 422)', folder: 'D:\Kile5\Core\ARM\ARMCC\Bin' Rebuild target 'Target 1' assembling startup_stm32f10x_md.s... compiling core_cm3.c... compiling stm32f10x_dbgmcu.c... compiling misc.c... compiling stm32f10x_bkp.c... compiling system_stm32f10x.c... compiling stm32f10x_crc.c... compiling stm32f10x_cec.c... compiling stm32f10x_can.c... compiling stm32f10x_adc.c... compiling stm32f10x_dac.c... compiling stm32f10x_dma.c... compiling stm32f10x_exti.c... compiling stm32f10x_flash.c... compiling stm32f10x_fsmc.c... compiling stm32f10x_iwdg.c... compiling stm32f10x_gpio.c... compiling stm32f10x_pwr.c... compiling stm32f10x_rtc.c... compiling stm32f10x_i2c.c... compiling stm32f10x_rcc.c... compiling stm32f10x_sdio.c... compiling stm32f10x_spi.c... compiling stm32f10x_usart.c... compiling stm32f10x_wwdg.c... compiling stm32f10x_tim.c... compiling Key.c... Hardware\Key.c(12): error: #101: "KEY_EVENT_NONE" has already been declared in the current scope KEY_EVENT_NONE, Hardware\Key.c(13): error: #101: "KEY_EVENT_CLICK" has already been declared in the current scope KEY_EVENT_CLICK, Hardware\Key.c(61): error: #20: identifier "key_event" is undefined key_event = KEY_EVENT_LONG_PRESS; Hardware\Key.c(79): error: #20: identifier "key_event" is undefined key_event = KEY_EVENT_DOUBLE_CLICK; Hardware\Key.c: 0 warnings, 4 errors compiling Delay.c... compiling LEDSEG.c... Hardware\LEDSEG.c(25): warning: #188-D: enumerated type mixed with another type GPIO_WriteBit( PIOA,GPIO_PIN_x[i],display_val>>i & 0x01); Hardware\LEDSEG.c: 1 warning, 0 errors compiling robot.c... compiling PWM.c... compiling Incontrol.c... compiling Irobstacle.c... compiling Serial.c... compiling timer.c... compiling UltrasonicWave.c... compiling Irtracking.c... compiling Servo.c... compiling Buzzer.c... compiling ServoPWM.c... compiling sys.c... compiling beep.c... compiling IR.c... compiling Uart3.c... compiling ma
03-23
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值