busvoodoo_uart_generic.h
Go to the documentation of this file.
/* 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 <http://www.gnu.org/licenses/>.
*
*/
struct busvoodoo_uart_generic_specific_t {
uint32_t usart;
uint32_t usart_rcc;
uint32_t usart_rst;
bool multidrive;
uint32_t tx_port;
uint32_t tx_pin;
uint32_t tx_rcc;
void (*tx_pre)(void);
void (*tx_post)(void);
uint32_t rx_port;
uint32_t rx_pin;
uint32_t rx_rcc;
void (*rx_pre)(void);
void (*rx_post)(void);
bool hwflowctl;
uint32_t rts_port;
uint32_t rts_pin;
uint32_t rts_rcc;
uint32_t cts_port;
uint32_t cts_pin;
uint32_t cts_rcc;
};
bool busvoodoo_uart_generic_configure(const struct busvoodoo_uart_generic_specific_t* conf);
bool busvoodoo_uart_generic_setup(char** prefix, const char* line);
void busvoodoo_uart_generic_exit(void);
#define busvoodoo_uart_generic_commands_nb 5
extern const struct menu_command_t busvoodoo_uart_generic_commands[busvoodoo_uart_generic_commands_nb];
menu_command_t
command menu entry
Definition: menu.h:31
busvoodoo_uart_generic_specific_t::tx_post
void(* tx_post)(void)
method to be called after transmitting data
Definition: busvoodoo_uart_generic.h:32
busvoodoo_uart_generic_setup
bool busvoodoo_uart_generic_setup(char **prefix, const char *line)
setup generic UART mode
Definition: busvoodoo_uart_generic.c:88
busvoodoo_uart_generic_configure
bool busvoodoo_uart_generic_configure(const struct busvoodoo_uart_generic_specific_t *conf)
provide the generic USART with mode specific information
Definition: busvoodoo_uart_generic.c:69
busvoodoo_uart_generic_specific_t::rx_pin
uint32_t rx_pin
GPIO pin address of receive pin.
Definition: busvoodoo_uart_generic.h:34
busvoodoo_uart_generic_specific_t::rts_port
uint32_t rts_port
GPIO port address of request to send pin.
Definition: busvoodoo_uart_generic.h:39
busvoodoo_uart_generic_specific_t::rx_pre
void(* rx_pre)(void)
method to be called before receiving data
Definition: busvoodoo_uart_generic.h:36
busvoodoo_uart_generic_specific_t::usart
uint32_t usart
USART peripheral base address.
Definition: busvoodoo_uart_generic.h:24
busvoodoo_uart_generic_specific_t::rx_rcc
uint32_t rx_rcc
GPIO RCC address of receive pin.
Definition: busvoodoo_uart_generic.h:35
busvoodoo_uart_generic_specific_t::multidrive
bool multidrive
if multiple drive modes are supported (push-pull, open-drain with internal resistors, open-drain with external resistors), or just push-pull
Definition: busvoodoo_uart_generic.h:27
busvoodoo_uart_generic_specific_t::rx_port
uint32_t rx_port
GPIO port address of receive pin.
Definition: busvoodoo_uart_generic.h:33
busvoodoo_uart_generic_specific_t::tx_pin
uint32_t tx_pin
GPIO pin address of transmit pin.
Definition: busvoodoo_uart_generic.h:29
busvoodoo_uart_generic_specific_t::rx_post
void(* rx_post)(void)
method to be called after receiving data
Definition: busvoodoo_uart_generic.h:37
busvoodoo_uart_generic_specific_t::tx_rcc
uint32_t tx_rcc
GPIO RCC address of transmit pin.
Definition: busvoodoo_uart_generic.h:30
busvoodoo_uart_generic_specific_t
UART specific methods that will be called by the generic methods.
Definition: busvoodoo_uart_generic.h:23
busvoodoo_uart_generic_specific_t::tx_pre
void(* tx_pre)(void)
method to be called before transmitting data
Definition: busvoodoo_uart_generic.h:31
busvoodoo_uart_generic_specific_t::rts_rcc
uint32_t rts_rcc
GPIO RCC address of request to send pin.
Definition: busvoodoo_uart_generic.h:41
busvoodoo_uart_generic_specific_t::cts_port
uint32_t cts_port
GPIO port address of clear to send pin.
Definition: busvoodoo_uart_generic.h:42
busvoodoo_uart_generic_commands_nb
#define busvoodoo_uart_generic_commands_nb
number of commands supported by the generic UART mode
Definition: busvoodoo_uart_generic.h:64
busvoodoo_uart_generic_specific_t::usart_rst
uint32_t usart_rst
USART RST address.
Definition: busvoodoo_uart_generic.h:26
busvoodoo_uart_generic_specific_t::rts_pin
uint32_t rts_pin
GPIO pin address of request to send pin.
Definition: busvoodoo_uart_generic.h:40
busvoodoo_uart_generic_specific_t::usart_rcc
uint32_t usart_rcc
USART RCC address.
Definition: busvoodoo_uart_generic.h:25
busvoodoo_uart_generic_specific_t::cts_rcc
uint32_t cts_rcc
GPIO RCC address of clear to send pin.
Definition: busvoodoo_uart_generic.h:44
busvoodoo_uart_generic_exit
void busvoodoo_uart_generic_exit(void)
exit genetic UART mode
Definition: busvoodoo_uart_generic.c:274
busvoodoo_uart_generic_specific_t::hwflowctl
bool hwflowctl
if RTC/CTS hardware flow control is supported
Definition: busvoodoo_uart_generic.h:38
busvoodoo_uart_generic_specific_t::tx_port
uint32_t tx_port
GPIO port address of transmit pin.
Definition: busvoodoo_uart_generic.h:28
busvoodoo_uart_generic_specific_t::cts_pin
uint32_t cts_pin
GPIO pin address of clear to send pin.
Definition: busvoodoo_uart_generic.h:43
busvoodoo_uart_generic_commands
const struct menu_command_t busvoodoo_uart_generic_commands[busvoodoo_uart_generic_commands_nb]
commands supported by the generic UART mode
Definition: busvoodoo_uart_generic.c:655