#include <stdbool.h>
#include <stdint.h>
#include "stdint.h"
#include "app_uart.h"
#include "simple_uart.h"
#include "nrf_uarte.h"
#include "app_timer.h"
#include "nrf_drv_gpiote.h"
#include "nrf_delay.h"
/*
Function introduction
Serial port has the function of Automatic wake-up
receive data : other device send any data--->other device wait 2ms for device wake up --->other device send data
send data: direct send data
*/
void uart_init(uint32_t io_tx,uint32_t io_rx,uint8_t baud_select);/*Power on initialization primary serial port*/
void active_uart(void);/*Call once when receiving a frame of serial port data to prevent sleep*/
void task_uart_power_manage(bool en_sleep,uint16_t sec_to_sleep);/*Put it into the main loop. If it is enabled to sleep, it will shut down the serial port in sec_to_sleep) seconds without serial port activity*/
void uart_send(uint8_t *str,uint16_t len);
uint32_t app_uart_get(uint8_t * p_byte);
#endif