STM32 问题解决单
USE_STDPERIPH_DRIVER, 若果不定义这个宏的报错
..\OBJ\application.axf: Error: L6218E: Undefined symbol assert_param (referred from misc.o).
查看这个宏定义的作用如下:
可以看到出没有宏,那么底层文件stm32f10x.h是无法调用stm32f10x——conf.h文件的,
所以要添宏 如下图;
在STM32f10x.h 文件中的一些常用 结构体
u32 a; //定义32位无符号变量 u16 a; //定义16位无符号变量 u8 a; //定义8位无符号变量 vu32 a; //定义易变32位无符号变量 vu16 a; //定义易变16位无符号变量 vu8 a; //定义易变8位无符号变量 uc32 a; //定义只读32位无符号变量 uc16 a; //定义只读16位无符号变量 uc8 a; //定义只读8位无符号变量 //stdint.h 文件 重新定义了变量名 typedef signed char int8_t; typedef signed short int int16_t; typedef signed int int32_t; typedef signed __INT64 int64_t; /* exact-width unsigned integer types */ typedef unsigned char uint8_t; typedef unsigned short int uint16_t; typedef unsigned int uint32_t; typedef unsigned __INT64 uint64_t; .................................................. ...............好多的! //stm32f10x.h 文件 typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus; //stm32f10x_gpio.h 文件 typedef enum { Bit_RESET = 0, Bit_SET }BitAction; //stm32f10x_exti.h 文件 中断配置结构体 typedef struct { uint32_t EXTI_Line; /*!< Specifies the EXTI lines to be enabled or disabled. This parameter can be any combination of @ref EXTI_Lines */ EXTIMode_TypeDef EXTI_Mode; /*!< Specifies the mode for the EXTI lines. This parameter can be a value of @ref EXTIMode_TypeDef */ EXTITrigger_TypeDef EXTI_Trigger; /*!< Specifies the trigger signal active edge for the EXTI lines. This parameter can be a value of @ref EXTIMode_TypeDef */ FunctionalState EXTI_LineCmd; /*!< Specifies the new state of the selected EXTI lines. This parameter can be set either to ENABLE or DISABLE */ }EXTI_InitTypeDef;