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.
 
 
 

35 lines
1.5 KiB

#pragma once
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include "tim.h"
#include "usart.h"
#include "zboard.h"
#define GPIO_SET(port, pin, mirror, _state) \
HAL_GPIO_WritePin(GPIO##port, GPIO_PIN_##pin, mirror _state ? GPIO_PIN_SET : GPIO_PIN_RESET);
#define GPIO_GET(port, pin, mirror) (mirror(HAL_GPIO_ReadPin(GPIO##port, GPIO_PIN_##pin) == GPIO_PIN_SET))
/***********************************************************************************************************************
* ====================================================调试指示灯===================================================== *
***********************************************************************************************************************/
void port_do_debug_light_state(void);
/***********************************************************************************************************************
* =======================================================UART======================================================== *
***********************************************************************************************************************/
typedef struct {
UART_HandleTypeDef* uarthandler;
uint8_t rxbuf;
} uart_t;
void port_mock_on_uart_rx(uart_t* uart);
void port_uart_start_all_uart_receive(void);
bool port_electric_relay_get_state(int relayindex);
void port_electric_relay_set_state(int relayindex, bool state);
static inline bool port_get_gpio_int(int index) {
return false;
}