You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.5 KiB
42 lines
1.5 KiB
#pragma once
|
|
#include <stdbool.h> //定义布尔
|
|
|
|
#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 port_unused_gpio_init(void);
|
|
void port_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_level_key_state(void);
|
|
bool port_gpio_get_interval_key_state(void);
|
|
bool port_gpio_get_power_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);
|
|
|
|
//
|
|
#define ZASSERT(condition) \
|
|
if (!condition) { \
|
|
printf("%s:%d:ASSERT(%s) fail\n", __FILE__, __LINE__, #condition); \
|
|
while (true) { \
|
|
} \
|
|
}
|