os-core/kernel/drivers/uart/uart.h

48 lines
1.0 KiB
C
Raw Normal View History

2019-05-29 11:10:01 +02:00
/******************************************************************************
*
* Copyright (c) 2017-2019 by Löwenware Ltd
* Please, refer LICENSE file for legal information
*
******************************************************************************/
/**
* @file uart.h
* @author Ilja Kartašov <ik@lowenware.com>
* @brief
*
* @see https://lowenware.com/
*/
#ifndef UART_H_8AFC47F9_2953_42C1_A5C1_1AE5A1F52CD0
#define UART_H_8AFC47F9_2953_42C1_A5C1_1AE5A1F52CD0
2019-12-01 22:57:02 +01:00
#include "uart_mini.h"
#include "uart_qemu.h"
2019-05-29 11:10:01 +02:00
2019-12-01 22:57:02 +01:00
#define UART_MINI 0
#define UART_QEMU 1
2019-05-29 11:10:01 +02:00
2019-12-01 22:57:02 +01:00
#ifndef UART_DEFAULT
#define UART_DEFAULT UART_MINI
2019-12-01 22:57:02 +01:00
#endif
2019-05-29 11:10:01 +02:00
2019-12-01 22:57:02 +01:00
#if UART_DEFAULT == UART_MINI
2020-01-15 10:56:04 +01:00
#define UART_init(...) UARTMini_init(__VA_ARGS__)
#define UART_get(...) UARTMini_get(__VA_ARGS__)
#define UART_put(...) UARTMini_put(__VA_ARGS__)
2019-05-29 11:10:01 +02:00
2019-12-01 22:57:02 +01:00
#elif UART_DEFAULT == UART_QEMU
2019-05-29 11:10:01 +02:00
2020-01-15 10:56:04 +01:00
#define UART_init(...)
#define UART_get(...)
#define UART_put(...) UARTQEMU_put(__VA_ARGS__)
2019-12-01 22:57:02 +01:00
#else
2020-01-15 10:56:04 +01:00
#warning "Unsupported UART"
2019-12-01 22:57:02 +01:00
#endif
2019-05-29 11:10:01 +02:00
#endif /* !UART_H */