mirror of
https://github.com/adrcs/ip400.git
synced 2025-04-21 03:03:43 +03:00
55 lines
1.6 KiB
C
55 lines
1.6 KiB
C
![]() |
/*---------------------------------------------------------------------------
|
||
|
Project: WL33_NUCLEO_UART
|
||
|
|
||
|
File Name: usart.h
|
||
|
|
||
|
Author: MartinA
|
||
|
|
||
|
Creation Date: Jan 12, 2025
|
||
|
|
||
|
Description: <decription here?
|
||
|
|
||
|
This program is free software: you can redistribute it and/or modify
|
||
|
it under the terms of the GNU General Public License as published by
|
||
|
the Free Software Foundation, either version 2 of the License, or
|
||
|
(at your option) any later version, provided this copyright notice
|
||
|
is included.
|
||
|
|
||
|
Copyright (c) 2024-25 Alberta Digital Radio Communications Society
|
||
|
|
||
|
Revision History:
|
||
|
|
||
|
---------------------------------------------------------------------------*/
|
||
|
|
||
|
#ifndef INC_USART_H_
|
||
|
#define INC_USART_H_
|
||
|
|
||
|
#include "types.h"
|
||
|
#include "main.h"
|
||
|
|
||
|
// definitions
|
||
|
typedef uint32_t UART_TIMEOUT_T; // uart timer type
|
||
|
typedef uint16_t BUFFER_SIZE_T; // buffer size type
|
||
|
typedef uint8_t DATA_ELEMENT; // buffer data element
|
||
|
|
||
|
// uart HAL handle
|
||
|
extern UART_HandleTypeDef huart1;
|
||
|
|
||
|
// logger defines
|
||
|
#define LOG_NOTICE 0 // notice
|
||
|
#define LOG_ERROR 1 // error
|
||
|
#define LOG_SEVERE 2 // severe error
|
||
|
|
||
|
void logger(int severity, char *format, ...);
|
||
|
|
||
|
// API calls
|
||
|
void USART_RxBuffer_reset(void);
|
||
|
size_t databuffer_bytesInBuffer(void);
|
||
|
DATA_ELEMENT databuffer_get(UART_TIMEOUT_T timeout);
|
||
|
BOOL databuffer_contains(const char *tag, UART_TIMEOUT_T rx_timeout, BOOL saveData, char *SaveBuffer);
|
||
|
BOOL USART_Send_String(const char *string, size_t len);
|
||
|
BOOL USART_Send_Char(const char c);
|
||
|
void USART_Print_string(char *format, ...);
|
||
|
|
||
|
#endif /* INC_USART_H_ */
|