#pragma once #include //定义布尔 #include "lib_config.h" #include "system_ES8P5066.h" // #define UART0_RXD0_PIN GPIO_Pin_A22 // #define UART0_TXD0_PIN GPIO_Pin_A23 #define UART0_RXD0_PIN GPIO_Pin_A24 #define UART0_TXD0_PIN GPIO_Pin_A25 #define GPIO_GET(port, pin, mirror) (mirror(GPIO_ReadBit(GPIO_Pin_##port##pin) == 1)) #define GPIO_SET(port, pin, mirror, _state) GPIO_WriteBit(GPIO_Pin_##port##pin, mirror _state ? 1 : 0); void unused_gpio_init(void); void gpio_init(void); //声明 void port_debug_set(bool state); void port_led0_set(bool state); void port_led1_set(bool state); void port_led2_set(bool state); void port_led3_set(bool state); void port_led_r_set(bool state); void port_led_g_set(bool state); void port_led_b_set(bool state); void port_fan_set(bool state); bool port_gpio_get_timer_key_state(void); bool port_gpio_get_gears_key_state(void); bool port_gpio_get_interval_key_state(void); bool port_gpio_get_switch_key_state(void); bool port_led0_get_state(void); bool port_led1_get_state(void); bool port_led2_get_state(void); bool port_led3_get_state(void); /* GPIO_Pin_B0 = 0, //未使用 GPIO_Pin_B1 = 1,//风扇 GPIO_Pin_B8 = 8,//ADC GPIO_Pin_B9 = 9,//ADC GPIO_Pin_B10 = 10,//OSCI GPIO_Pin_B11 = 11,//OSCO GPIO_Pin_B12 = 12,//MRSTN GPIO_Pin_B13 = 13,//LED1 GPIO_Pin_A1 = 15,//VCC GPIO_Pin_A2 = 16,//ADC GPIO_Pin_A3 = 17,//LED0 GPIO_Pin_A4 = 18,//PWM GPIO_Pin_A5 = 19,//LED2 GPIO_Pin_A6 = 20,//LED3 GPIO_Pin_A7 = 21,//LED_R GPIO_Pin_A8 = 22,//LED_G GPIO_Pin_A9 = 23,//LED_B GPIO_Pin_A10 = 24, //未使用 GPIO_Pin_A11 = 25,//KEY1 GPIO_Pin_A12 = 26,//KEY2 GPIO_Pin_A13 = 27,//KEY3 GPIO_Pin_A14 = 28,//ISPSCK GPIO_Pin_A15 = 29,//ISPSDA GPIO_Pin_A16 = 30,//KEY4 GPIO_Pin_A22 = 36,//DEBUG GPIO_Pin_A23 = 37, //未使用 GPIO_Pin_A24 = 38,//RX0 GPIO_Pin_A25 = 39,//RX1 GPIO_Pin_A27 = 41, //未使用 GPIO_Pin_A28 = 42, //未使用 引脚分配 FUN0 主键H PA11 定时按键 主键M PA16 高低档的选择和关闭(1开机高档红,2绿色,3蓝色,4关闭) 间歇 PA13 开关 PA12 LED0 PA3 LED1 PB13 LED2 PA5 LED3 PA6 LED_R PA7 LED_G PA8 LED_B PA9 PWM PA4 风扇 PB1 时间的设置 |√ --------------------|------ 档位的设置 | √ --------------------|------ 对应led的亮灭 | √ --------------------|------ RGB灯 | --------------------|------ 设置PWM频率 | --------------------|------ 设置pwm占空比 |√ --------------------|------ 倒计时 |√ --------------------|------ */ /* 未使用: PA10 PA23 PA26 PA27 PB0 */