busvoodoo_rs232.c File Reference

BusVoodoo RS-232 mode (code) More...

Go to the source code of this file.

## Macros

#define | BUSVOODOO_RS232_USART 2
| USART peripheral.

## Enumerations

enum | busvoodoo_rs232_setting_t { BUSVOODOO_RS232_SETTING_NONE, BUSVOODOO_RS232_SETTING_BAUDRATE, BUSVOODOO_RS232_SETTING_DATABITS, BUSVOODOO_RS232_SETTING_PARITY, BUSVOODOO_RS232_SETTING_STOPBITS, BUSVOODOO_RS232_SETTING_HWFLOWCTL, BUSVOODOO_RS232_SETTING_DONE }
| mode setup stage

## Functions

static bool | busvoodoo_rs232_setup (char **prefix, const char *line)
| setup RS-232 mode More...
static void | busvoodoo_rs232_exit (void)
| exit RS-232 mode
static void | busvoodoo_rs232_write (uint16_t value)
| write to RS-232 More...
static void | busvoodoo_rs232_read (void)
| read from RS-232
static bool | busvoodoo_rs232_action (const char *action, uint32_t repetition, bool perform)
| perform RS-232 action More...
static void | busvoodoo_rs232_command_actions (void *argument)
| command to perform actions More...
static void | busvoodoo_rs232_command_transmit (void *argument)
| command to transmit a string More...
static void | busvoodoo_rs232_command_receive (void *argument)
| command to receive data More...
static void | busvoodoo_rs232_command_transceive (void *argument)
| command to transmit and receive data More...
static void | busvoodoo_rs232_command_error (void *argument)
| command to verify incoming transmission for error More...

## Variables

static enum busvoodoo_rs232_setting_t | busvoodoo_rs232_setting = BUSVOODOO_RS232_SETTING_NONE
| current mode setup stage
static uint32_t | busvoodoo_rs232_baudrate = 115200
| RS-232 baud rate (in bps)
static uint8_t | busvoodoo_rs232_databits = 8
| RS-232 data bits.
static uint32_t | busvoodoo_rs232_parity = USART_PARITY_NONE
| RS-232 parity setting.
static uint32_t | busvoodoo_rs232_stopbits = USART_STOPBITS_1
| RS-232 stop bits setting.
static bool | busvoodoo_rs232_hwflowctl = false
| RS-232 hardware flow control setting (true = with hardware flow control, false = without hardware flow control.
static const struct menu_command_t | busvoodoo_rs232_commands []
| RS-232 menu commands.
const struct busvoodoo_mode_t | busvoodoo_rs232_mode
| RS-232 mode interface definition. More...

## Detailed Description

BusVoodoo RS-232 mode (code)

Author
  King Kévin kingk.nosp@m.evin.nosp@m.@cuvo.nosp@m.odoo.nosp@m..info

Date
  2018

Note
  peripherals used: USART RS-232 transceiver connection definition

Definition in file busvoodoo_rs232.c.

## Function Documentation

## busvoodoo_rs232_action()

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

static

perform RS-232 action

Parameters

  [in] | action | action to perform
  [in] | repetition | how many times to perform the action
  [in] | perform | the action (true) or just check it (false)

Returns
  true if the action has been performed, false if it is malformed

Definition at line 330 of file busvoodoo_rs232.c.

## busvoodoo_rs232_command_actions()

static void busvoodoo_rs232_command_actions | ( | void * | argument | ) |

static

command to perform actions

Parameters

  [in] | argument | actions to perform

Definition at line 431 of file busvoodoo_rs232.c.

## busvoodoo_rs232_command_error()

static void busvoodoo_rs232_command_error | ( | void * | argument | ) |

static

command to verify incoming transmission for error

Parameters

  [in] | argument | argument not required

Definition at line 595 of file busvoodoo_rs232.c.

## busvoodoo_rs232_command_receive()

static void busvoodoo_rs232_command_receive | ( | void * | argument | ) |

static

command to receive data

Parameters

  [in] | argument | in which format to display

Definition at line 492 of file busvoodoo_rs232.c.

## busvoodoo_rs232_command_transceive()

static void busvoodoo_rs232_command_transceive | ( | void * | argument | ) |

static

command to transmit and receive data

Parameters

  [in] | argument | no argument required

Definition at line 557 of file busvoodoo_rs232.c.

## busvoodoo_rs232_command_transmit()

static void busvoodoo_rs232_command_transmit | ( | void * | argument | ) |

static

command to transmit a string

Parameters

  [in] | argument | string to transmit (CR+LF when none provided)

Definition at line 467 of file busvoodoo_rs232.c.

## busvoodoo_rs232_setup()

static bool busvoodoo_rs232_setup | ( | char ** | prefix,
|  | const char * | line
| ) |  |

static

setup RS-232 mode

Parameters

  [out] | prefix | terminal prompt prefix
  [in] | line | terminal prompt line to configure mode

Returns
  if setup is complete

Definition at line 71 of file busvoodoo_rs232.c.

## busvoodoo_rs232_write()

static void busvoodoo_rs232_write | ( | uint16_t | value | ) |

static

write to RS-232

Parameters

  [in] | value | value to write

Definition at line 243 of file busvoodoo_rs232.c.

## Variable Documentation

## busvoodoo_rs232_mode

const struct busvoodoo_mode_t busvoodoo_rs232_mode

Initial value:
= {
.name = "rs232",
.description = "Recommended Standard 232",
.full_only = true,
.setup = &busvoodoo_rs232_setup,
.commands = busvoodoo_rs232_commands,
.commands_nb = LENGTH(busvoodoo_rs232_commands),
.exit = &busvoodoo_rs232_exit,
}
busvoodoo_rs232_exit
static void busvoodoo_rs232_exit(void)
exit RS-232 mode
Definition: busvoodoo_rs232.c:228
busvoodoo_rs232_commands
static const struct menu_command_t busvoodoo_rs232_commands[]
RS-232 menu commands.
Definition: busvoodoo_rs232.c:606
busvoodoo_rs232_setup
static bool busvoodoo_rs232_setup(char **prefix, const char *line)
setup RS-232 mode
Definition: busvoodoo_rs232.c:71
LENGTH
#define LENGTH(x)
get the length of an array
Definition: global.h:26

RS-232 mode interface definition.

Definition at line 649 of file busvoodoo_rs232.c.