/* 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 .
*
*/
/** library to control up to 4 independent receive and transmit software UART ports (API)
* @file uart_soft.h
* @author King Kévin
* @date 2016
* @note peripherals used: GPIO @ref uart_soft_gpio, timer @ref uart_soft_timer
*/
/** if data has been received from UART port and is available to be read */
extern volatile bool uart_soft_received[4];
/** setup software UART ports
* @param[in] rx_baurates baudrates of the 4 UART RX ports (0 if unused)
* @param[in] tx_baurates baudrates of the 4 UART TX ports (0 if unused)
* @return is setup succeeded, else the configuration is wrong
*/
bool uart_soft_setup(uint32_t *rx_baudrates, uint32_t *tx_baudrates);
/** get received byte from UART port
* @param[in] uart UART receive port to read byte from
* @return received byte (0 if no byte is available)
*/
uint8_t uart_soft_getbyte(uint8_t uart);