#ifndef __BSP_H__
#define __BSP_H__

#include "usart.h"
#include <string.h>
#include <stdio.h>
#include <stdarg.h>

typedef struct{
	uint8_t tim10ms_flag;
	uint8_t tim100ms_flag;
	uint8_t tim1s_flag;
	uint16_t tim10ms_cnt;
	uint16_t tim100ms_cnt;
	uint16_t tim1s_cnt;
}bsp_t;

typedef struct
{
	uint16_t value;
	float value_f;
	uint16_t thresholdValueL;
	uint16_t thresholdValueH;
	uint8_t flag;
} sensor;

typedef struct
{
	uint8_t index;
	uint8_t mesg;
	uint8_t rx_buffer[256];
	uint16_t rx_size;
	uint8_t rx_flag;
	uint8_t rx_finish;
} uart_t;

extern bsp_t bsp;
extern uart_t uart1;

void uart_clean(uart_t *uart);
uint8_t myprintf(UART_HandleTypeDef *huart, const char *format, ...);

#endif
