GPIO_Pin_5 选中引脚5 GPIO_Pin_6 选中引脚6 GPIO_Pin_7 选中引脚7 GPIO_Pin_8 选中引脚8 GPIO_Pin_9 选中引脚9 GPIO_Pin_10 选中引脚10 GPIO_Pin_11 选中引脚11 GPIO_Pin_12 选中引脚12 GPIO_Pin_13 选中引脚13 GPIO_Pin_14 选中引脚14 GPIO_Pin_15 选中引脚15 GPIO_Pin_All 选中全部引脚 ---...
GPIO_SetBits(GPIOA, GPIO_Pin_5); } else { GPIO_ResetBits(GPIOA, GPIO_Pin_5); } } 3.基于课程代码的思想概括 首先进行LED、按键的初始化(涉及时钟⏰ ,结构体等) 然后是自定义函数Key_Init()等 接着是了解,为了实现按键按下到松手 瞬间实现LED亮灭变化,自然而然可以运用 GPIO_ReadOutputDataBit...
void GPIO_SetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin) { /* Check the parameters */ assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); assert_param(IS_GPIO_PIN(GPIO_Pin)); GPIOx->BSRR = GPIO_Pin; } /** * @brief Clears the selected data port bits. * @param GPIOx: where x can ...
voidGPIO_SetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin) { /* Check the parameters */ assert_param(IS_GPIO_ALL_PERIPH(GPIOx)); assert_param(IS_GPIO_PIN(GPIO_Pin)); GPIOx->BSRR = GPIO_Pin; } /** * @brief Clears the selected data port bits. * @param GPIOx: where x can be...
GPIOD, GPIO_Pin_4);LCD_RD_data()显示未被定义,我想问的是GPIO_ResetBits()和GPIO_SetBits()...
uint16_t GPIO_ReadOutputData(GPIO_TypeDef* GPIOx); 4个设置输出电平函数: void GPIO_SetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin); void GPIO_ResetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin); void GPIO_WriteBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, BitAction BitVal); ...
GPIO_SetBits(GPIOC,GPIO_Pin_1);//置1 GPIO_ResetBits(GPIOC,GPIO_Pin_1);//置0 2.RCC:单片机时钟管理。 管理外部、内部和外设的时钟,设置、打开和关闭这些时钟。 用法: 函数初始化 voidRCC_Configuration(void)//时钟初始化函数 { ErrorStatusHSEStartUpStatus;//等待时钟的稳定 ...
void GPIO_SetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);作用:设置某个IO口输出为高电平(1)。实际操作BSRR寄存器 void GPIO_ResetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin); 作用:设置某个IO口输出为低电平(0)。实际操作的BRR寄存器。
1.4 GPIO流水灯寄存器分析 每个GPIO端口都有两个32位配置寄存器(GPIOx_CRL ,GPIOx_CRH) ,两个32位数据寄存器 (GPIOx_IDR和GPIOx_ODR),一个32位置位/ 复位寄存器(GPIOx_BSRR),一个16位复位寄存器(GPIOx_BRR),一个32位锁定寄存器(GPIOx_LCKR)。每个I/O端口位可以自由编程,然而I/O端口寄存器必须按32位字...