76 lines
2.3 KiB
C
76 lines
2.3 KiB
C
/*!
|
|
* \file uart.h
|
|
*
|
|
* \brief The head file of uart.c
|
|
*
|
|
* \copyright Revised BSD License, see section \ref LICENSE.
|
|
*
|
|
* \code
|
|
*
|
|
* _ __ _ ________ _
|
|
* | |/ /(_)___ / ____/ /_ (_)___
|
|
* | // / __ \/ / / __ \/ / __ \
|
|
* / |/ / / / / /___/ / / / / /_/ /
|
|
* /_/|_/_/_/ /_/\____/_/ /_/_/ .___/
|
|
* /_/
|
|
* (C) 2022-2025 XinChip
|
|
*
|
|
* \endcode
|
|
*
|
|
* \author ( XinChip ) Alex-J
|
|
*
|
|
* \author ( XinChip )
|
|
*/
|
|
|
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
|
#ifndef __UART_H__
|
|
#define __UART_H__
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/*-----------------------------------------------------------------------------------
|
|
INCLUDE HEADE FILES
|
|
------------------------------------------------------------------------------------*/
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <stdint.h>
|
|
#include "RINGBUFFER.h"
|
|
|
|
/*------------------------------------------------------------------------------------
|
|
Macros
|
|
-------------------------------------------------------------------------------------*/
|
|
|
|
/*------------------------------------------------------------------------------------
|
|
TypeDef
|
|
-------------------------------------------------------------------------------------*/
|
|
|
|
/*------------------------------------------------------------------------------------
|
|
Global Variables
|
|
-------------------------------------------------------------------------------------*/
|
|
|
|
/*------------------------------------------------------------------------------------
|
|
Exported Functions
|
|
-------------------------------------------------------------------------------------*/
|
|
#define UART0_BUFFER_LEN 255
|
|
#define OTA_DATA_SIZE (139) //0-138
|
|
#define CRC16_lentg (OTA_DATA_SIZE-2)
|
|
#define CRC16_H (OTA_DATA_SIZE-2)
|
|
#define CRC16_L (OTA_DATA_SIZE-1)
|
|
extern ring_buffer_t uart0_ring_buff;
|
|
extern uint8_t uart0_buff[UART0_BUFFER_LEN];
|
|
|
|
|
|
void scan_uart(uint8_t *arr);
|
|
void scan_uart_ota(uint8_t *arr);
|
|
void scan_uart_usr(uint8_t *arr);
|
|
void scan_uar_data(uint8_t *frame);
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* __UART_H__ */
|
|
|
|
|