CuVoodoo STM32F1 firmware template
Enumerations | Functions | Variables
busvoodoo_uart_generic.c File Reference

BusVoodoo generic UART mode (code) More...

Go to the source code of this file.

Enumerations

enum  busvoodoo_uart_generic_setting_t {
  BUSVOODOO_UART_SETTING_NONE, BUSVOODOO_UART_SETTING_BAUDRATE, BUSVOODOO_UART_SETTING_DATABITS, BUSVOODOO_UART_SETTING_PARITY,
  BUSVOODOO_UART_SETTING_STOPBITS, BUSVOODOO_UART_SETTING_HWFLOWCTL, BUSVOODOO_UART_SETTING_DRIVE, BUSVOODOO_UART_SETTING_DONE
}
 mode setup stage
 

Functions

bool busvoodoo_uart_generic_configure (const struct busvoodoo_uart_generic_specific_t *conf)
 provide the generic USART with mode specific information More...
 
bool busvoodoo_uart_generic_setup (char **prefix, const char *line)
 setup generic UART mode More...
 
void busvoodoo_uart_generic_exit (void)
 exit genetic UART mode
 
static void busvoodoo_uart_generic_write (uint8_t value)
 write to UART More...
 
static void busvoodoo_uart_generic_read (void)
 read from UART
 
static bool busvoodoo_uart_generic_action (const char *action, uint32_t repetition, bool perform)
 perform UART action More...
 
static void busvoodoo_uart_generic_command_actions (void *argument)
 command to perform actions More...
 
static void busvoodoo_uart_generic_command_transmit (void *argument)
 command to transmit a string More...
 
static void busvoodoo_uart_generic_command_receive (void *argument)
 command to receive data More...
 
static void busvoodoo_uart_generic_command_transceive (void *argument)
 command to transmit and receive data More...
 
static void busvoodoo_uart_generic_command_error (void *argument)
 command to verify incoming transmission for error More...
 

Variables

static const struct busvoodoo_uart_generic_specific_tbusvoodoo_uart_generic_specific = NULL
 the USART mode specific information
 
static enum busvoodoo_uart_generic_setting_t busvoodoo_uart_generic_setting = BUSVOODOO_UART_SETTING_NONE
 current mode setup stage
 
static uint32_t busvoodoo_uart_generic_baudrate = 115200
 UART baud rate (in bps)
 
static uint8_t busvoodoo_uart_generic_databits = 8
 UART data bits.
 
static enum usart_enhanced_parity_t busvoodoo_uart_generic_parity = USART_ENHANCED_PARITY_NONE
 UART parity setting.
 
static uint32_t busvoodoo_uart_generic_stopbits = USART_STOPBITS_1
 UART stop bits setting.
 
static bool busvoodoo_uart_generic_hwflowctl = false
 UART hardware flow control setting (true = with hardware flow control, false = without hardware flow control.
 
static bool busvoodoo_uart_generic_drive = true
 pin drive mode (true = push-pull, false = open-drain)
 
static bool busvoodoo_uart_generic_pullup = false
 if embedded pull-up resistors are used
 
const struct menu_command_t busvoodoo_uart_generic_commands [busvoodoo_uart_generic_commands_nb]
 commands supported by the generic UART mode
 

Detailed Description

BusVoodoo generic UART mode (code)

Note
this only contains the common UART methods and should be supplied with mode specific methods and information
Author
King Kévin kingk.nosp@m.evin.nosp@m.@cuvo.nosp@m.odoo.nosp@m..info
Date
2018

Definition in file busvoodoo_uart_generic.c.

Function Documentation

◆ busvoodoo_uart_generic_action()

static bool busvoodoo_uart_generic_action ( const char *  action,
uint32_t  repetition,
bool  perform 
)
static

perform UART action

Parameters
[in]actionaction to perform
[in]repetitionhow many times to perform the action
[in]performthe action (true) or just check it (false)
Returns
true if the action has been performed, false if it is malformed

Definition at line 369 of file busvoodoo_uart_generic.c.

◆ busvoodoo_uart_generic_command_actions()

static void busvoodoo_uart_generic_command_actions ( void *  argument)
static

command to perform actions

Parameters
[in]argumentactions to perform

Definition at line 470 of file busvoodoo_uart_generic.c.

◆ busvoodoo_uart_generic_command_error()

static void busvoodoo_uart_generic_command_error ( void *  argument)
static

command to verify incoming transmission for error

Parameters
[in]argumentargument not required

Definition at line 645 of file busvoodoo_uart_generic.c.

◆ busvoodoo_uart_generic_command_receive()

static void busvoodoo_uart_generic_command_receive ( void *  argument)
static

command to receive data

Parameters
[in]argumentin which format to display

Definition at line 541 of file busvoodoo_uart_generic.c.

◆ busvoodoo_uart_generic_command_transceive()

static void busvoodoo_uart_generic_command_transceive ( void *  argument)
static

command to transmit and receive data

Parameters
[in]argumentno argument required

Definition at line 585 of file busvoodoo_uart_generic.c.

◆ busvoodoo_uart_generic_command_transmit()

static void busvoodoo_uart_generic_command_transmit ( void *  argument)
static

command to transmit a string

Parameters
[in]argumentstring to transmit (CR+LF when none provided)

Definition at line 506 of file busvoodoo_uart_generic.c.

◆ 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

Parameters
[in]confUSART mode specific information
Returns
if configuration is valid

Definition at line 69 of file busvoodoo_uart_generic.c.

◆ busvoodoo_uart_generic_setup()

bool busvoodoo_uart_generic_setup ( char **  prefix,
const char *  line 
)

setup generic UART mode

Parameters
[out]prefixterminal prompt prefix
[in]lineterminal prompt line to configure mode
Returns
if setup is complete
Note
run busvoodoo_uart_generic_configure before

Definition at line 88 of file busvoodoo_uart_generic.c.

◆ busvoodoo_uart_generic_write()

static void busvoodoo_uart_generic_write ( uint8_t  value)
static

write to UART

Parameters
[in]valuevalue to write

Definition at line 296 of file busvoodoo_uart_generic.c.