From ab47a75befc85ac8e1120c2280347ccfefb4cc59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sayeth=20Rodr=C3=ADguez?= Date: Fri, 29 Nov 2019 23:05:59 +0000 Subject: [PATCH] Upload New File --- uart.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 uart.h diff --git a/uart.h b/uart.h new file mode 100644 index 0000000..f0db2c9 --- /dev/null +++ b/uart.h @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2019 Akshay Patwardhan + * akshay.patwardhan@outlook.com + * + * Please go through readme.md for usage and other instructions, if any. + * + * 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 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Guarding macro start +#ifndef UART_H +#define UART_H + +// Includes begin +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Error codes and return values +#define UART_FUNCTION_SUCCESSFUL 0 +#define UART_NUMBER_INCORRECT 1 +#define UART_BAUDRATE_INCORRECT 2 +#define UART_FIFO_ERROR 3 +#define UART_INCORRECT_PATH 4 + +// Function declarations +int uartConf(unsigned char uartNumber, int baudRate); +int uartClose(unsigned char uartNumber); +int uartTransmit(unsigned char uartNumber, unsigned char message[]); +int uartReceive(unsigned char uartNumber); + +// Guarding macro end +#endif // UART_H