100 lines
2.9 KiB
C
100 lines
2.9 KiB
C
/**
|
|
******************************************************************************
|
|
* File Name : USART.h
|
|
* Description : This file provides code for the configuration
|
|
* of the USART instances.
|
|
******************************************************************************
|
|
* @attention
|
|
*
|
|
* <h2><center>© Copyright (c) 2020 STMicroelectronics.
|
|
* All rights reserved.</center></h2>
|
|
*
|
|
* This software component is licensed by ST under BSD 3-Clause license,
|
|
* the "License"; You may not use this file except in compliance with the
|
|
* License. You may obtain a copy of the License at:
|
|
* opensource.org/licenses/BSD-3-Clause
|
|
*
|
|
******************************************************************************
|
|
*/
|
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
|
#ifndef __usart_H
|
|
#define __usart_H
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* Includes ------------------------------------------------------------------*/
|
|
#include "main.h"
|
|
|
|
/* USER CODE BEGIN Includes */
|
|
#include "stdio.h"
|
|
#include "string.h"
|
|
/* USER CODE END Includes */
|
|
|
|
/* USER CODE BEGIN Private defines */
|
|
#define max_size 255
|
|
|
|
|
|
|
|
|
|
|
|
#define Preset_denominator 15
|
|
#define Preset_numerator Preset_denominator-5
|
|
|
|
//#define Preset_denominator 8
|
|
//#define Preset_numerator Preset_denominator-5
|
|
|
|
|
|
//#define Preset_denominator 1
|
|
//#define Preset_numerator 1
|
|
|
|
|
|
typedef struct{
|
|
uint16_t Start;
|
|
uint16_t End;
|
|
uint16_t Threshold;
|
|
uint8_t Gain;
|
|
}PCR;
|
|
|
|
|
|
|
|
/* USER CODE END Private defines */
|
|
|
|
void MX_USART1_UART_Init(void); // STS_O1 LoRa_WAN USART1
|
|
void MX_USART2_UART_Init(void);
|
|
void MX_USART3_UART_Init(void); // STS_O1 For Radar USART_RADAR
|
|
|
|
/* USER CODE BEGIN Prototypes */
|
|
void DMA_USART1_RX_Config(void); // STS_O1 LoRa_WAN USART1
|
|
void DMA_USART3_RX_Config(void); // STS_O1 For Radar USART_RADAR
|
|
void Usart_SendArray( USART_TypeDef * pUSARTx, uint8_t *array, uint16_t num);
|
|
void Usart_SendString( USART_TypeDef * pUSARTx, char *str);
|
|
uint8_t Check_Status(void);
|
|
void Online_Data_Analysis(volatile uint8_t *Color);
|
|
void hex2str(char* hex , char* str );
|
|
void Set_PCR_Parameter(char *str,uint8_t len); // STS_O1 For Radar
|
|
uint8_t Radar_Data_Analysis(void);
|
|
void Radar_Filtering_clutter(volatile uint8_t *color);
|
|
void M100C_Send_Data(uint8_t port,uint8_t confirm,uint8_t type); //send to USART1 LoRaWAN USART1 defined in fputc
|
|
void M100C_Send_HeartBeat(uint8_t color,uint8_t Mode); //send to USART1 LoRaWAN USART1 defined in fputc
|
|
|
|
void Node_Send_Data(uint8_t dataport, uint8_t confirm, uint8_t color, uint8_t workmode,uint8_t doorstatus, uint8_t presence_sensor_status);
|
|
|
|
/* USER CODE END Prototypes */
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif /*__ usart_H */
|
|
|
|
/**
|
|
* @}
|
|
*/
|
|
|
|
/**
|
|
* @}
|
|
*/
|
|
|
|
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|