busvoodoo_rs485.c File Reference

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

Go to the source code of this file.

## Macros

#define | BUSVOODOO_RS485_USART 2
| USART peripheral.

## Functions

static void | busvoodoo_rs485_drive_enable (void)
| enable RS-485 transceiver driver to allow transmitting
static void | busvoodoo_rs485_drive_disable (void)
| enable RS-485 transceiver driver to allow transmitting
static void | busvoodoo_rs485_receive_enable (void)
| enable RS-485 transceiver received to allow receiving
static void | busvoodoo_rs485_receive_disable (void)
| enable RS-485 transceiver received to allow receiving
static bool | busvoodoo_rs485_setup (char **prefix, const char *line)
| setup RS-485 mode More...
static void | busvoodoo_rs485_exit (void)
| exit RS-485 mode

## Variables

static const struct busvoodoo_uart_generic_specific_t | busvoodoo_uart_generic_rs485
| RS-485 specific methods that will be called by the generic methods. More...
const struct busvoodoo_mode_t | busvoodoo_rs485_mode
| RS-485 mode interface definition. More...

## Detailed Description

BusVoodoo RS-485 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 USART peripheral used for RS-485/422 communication, using a RS-485/422 transceiver

Definition in file busvoodoo_rs485.c.

## Function Documentation

## busvoodoo_rs485_setup()

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

static

setup RS-485 mode

Parameters

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

Returns
  if setup is complete

Definition at line 100 of file busvoodoo_rs485.c.

## Variable Documentation

## busvoodoo_rs485_mode

const struct busvoodoo_mode_t busvoodoo_rs485_mode

Initial value:
= {
.name = "rs485",
.description = "Recommended Standard 485/422",
.full_only = true,
.setup = &busvoodoo_rs485_setup,
.commands = busvoodoo_uart_generic_commands,
.commands_nb = busvoodoo_uart_generic_commands_nb,
.exit = &busvoodoo_rs485_exit,
}
busvoodoo_rs485_setup
static bool busvoodoo_rs485_setup(char **prefix, const char *line)
setup RS-485 mode
Definition: busvoodoo_rs485.c:100
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_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
busvoodoo_rs485_exit
static void busvoodoo_rs485_exit(void)
exit RS-485 mode
Definition: busvoodoo_rs485.c:136

RS-485 mode interface definition.

Definition at line 143 of file busvoodoo_rs485.c.

## busvoodoo_uart_generic_rs485

const struct busvoodoo_uart_generic_specific_t busvoodoo_uart_generic_rs485

static

Initial value:
= {
.usart = USART(BUSVOODOO_RS485_USART),
.usart_rcc = RCC_USART(BUSVOODOO_RS485_USART),
.usart_rst = RST_USART(BUSVOODOO_RS485_USART),
.multidrive = false,
.tx_port = USART_TX_PORT(BUSVOODOO_RS485_USART),
.tx_pin = USART_TX_PIN(BUSVOODOO_RS485_USART),
.tx_rcc = RCC_USART_PORT(BUSVOODOO_RS485_USART),
.tx_pre = &busvoodoo_rs485_drive_enable,
.tx_post = &busvoodoo_rs485_drive_disable,
.rx_port = USART_RX_PORT(BUSVOODOO_RS485_USART),
.rx_pin = USART_RX_PIN(BUSVOODOO_RS485_USART),
.rx_rcc = RCC_USART_PORT(BUSVOODOO_RS485_USART),
.rx_pre = &busvoodoo_rs485_receive_enable,
.rx_post = &busvoodoo_rs485_receive_disable,
.hwflowctl = false,
.rts_port = 0,
.rts_pin = 0,
.rts_rcc = 0,
.cts_port = 0,
.cts_pin = 0,
.cts_rcc = 0,
}
USART_TX_PORT
#define USART_TX_PORT(x)
get port for USART transmit pin based on USART identifier
Definition: global.h:194
RCC_USART
#define RCC_USART(x)
get RCC for USART based on USART identifier
Definition: global.h:186
busvoodoo_rs485_receive_enable
static void busvoodoo_rs485_receive_enable(void)
enable RS-485 transceiver received to allow receiving
Definition: busvoodoo_rs485.c:59
RCC_USART_PORT
#define RCC_USART_PORT(x)
get RCC for USART port based on USART identifier
Definition: global.h:210
busvoodoo_rs485_drive_enable
static void busvoodoo_rs485_drive_enable(void)
enable RS-485 transceiver driver to allow transmitting
Definition: busvoodoo_rs485.c:47
USART_RX_PIN
#define USART_RX_PIN(x)
get pin for USART receive pin based on USART identifier
Definition: global.h:204
USART_TX_PIN
#define USART_TX_PIN(x)
get pin for USART transmit pin based on USART identifier
Definition: global.h:202
RST_USART
#define RST_USART(x)
get RST for USART based on USART identifier
Definition: global.h:188
USART
#define USART(x)
get USART based on USART identifier
Definition: global.h:184
USART_RX_PORT
#define USART_RX_PORT(x)
get port for USART receive pin based on USART identifier
Definition: global.h:196
busvoodoo_rs485_receive_disable
static void busvoodoo_rs485_receive_disable(void)
enable RS-485 transceiver received to allow receiving
Definition: busvoodoo_rs485.c:65
busvoodoo_rs485_drive_disable
static void busvoodoo_rs485_drive_disable(void)
enable RS-485 transceiver driver to allow transmitting
Definition: busvoodoo_rs485.c:53
BUSVOODOO_RS485_USART
#define BUSVOODOO_RS485_USART
USART peripheral.
Definition: busvoodoo_rs485.c:43

RS-485 specific methods that will be called by the generic methods.

Definition at line 71 of file busvoodoo_rs485.c.