baiyibin0530的专栏通过本文主要向大家介绍了stm32等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
const GPIO_CONF SBC_io_conf_b[COLOR_BIT_NUM]= { {SBC_B0_GPIO_PORT,SBC_B0_PIN}, {SBC_B1_GPIO_PORT,SBC_B1_PIN}, {SBC_B2_GPIO_PORT,SBC_B2_PIN}, {SBC_B3_GPIO_PORT,SBC_B3_PIN}, {SBC_B4_GPIO_PORT,SBC_B4_PIN}, {SBC_B5_GPIO_PORT,SBC_B5_PIN}, {SBC_B6_GPIO_PORT,SBC_B6_PIN}, {SBC_B7_GPIO_PORT,SBC_B7_PIN} }; for(bit_cnt=0;bit_cnt<COLOR_BIT_NUM;bit_cnt++) { if(HAL_GPIO_ReadPin(SBC_io_conf_b[bit_cnt].io_type, SBC_io_conf_b[bit_cnt].io_pin)) { setbit(rgb,bit_cnt+16); } else { clrbit(rgb,bit_cnt+16); } } for(bit_cnt=0;bit_cnt<COLOR_BIT_NUM;bit_cnt++) { GPIO_InitStructure.Pin = SBC_io_conf_b[bit_cnt].io_pin; HAL_GPIO_Init(SBC_io_conf_b[bit_cnt].io_type, &GPIO_InitStructure); }