application.c File Reference

STM32F1 BusVoodoo application. More...

Go to the source code of this file.

## Functions

size_t | putc (char c)
| print a single character on user output More...
static void | switch_mode (const struct busvoodoo_mode_t *mode)
| switch BusVoddoo mode More...
static void | command_help (void *argument)
| command to show help More...
static void | command_mode (void *argument)
| command to select mode More...
static void | command_quit (void *argument)
| command to quit current BusVoodoo mode More...
static void | command_reset (void *argument)
| command to reset board More...
static void | process_command (char *str)
| process user command More...
void | main (void)
| program entry point this is the firmware function started by the micro-controller

## Variables

static const struct busvoodoo_mode_t * | busvoodoo_modes []
| all supported BusVoodoo modes More...
static struct busvoodoo_mode_t const * | busvoodoo_mode = NULL
| current BusVoodoo mode
static bool | busvoodoo_mode_complete = false
| is mode setup complete
static const struct menu_command_t | menu_commands []
| command to reboot into bootloader More...

## Detailed Description

STM32F1 BusVoodoo application.

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

Date
  2016-2018

Definition in file application.c.

## Function Documentation

## command_help()

static void command_help | ( | void * | argument | ) |

static

command to show help

Parameters

  [in] | argument | no argument required

Definition at line 162 of file application.c.

## command_mode()

static void command_mode | ( | void * | argument | ) |

static

command to select mode

Parameters

  [in] | argument | mode to select

Definition at line 176 of file application.c.

## command_quit()

static void command_quit | ( | void * | argument | ) |

static

command to quit current BusVoodoo mode

Parameters

  [in] | argument | no argument required

Definition at line 204 of file application.c.

## command_reset()

static void command_reset | ( | void * | argument | ) |

static

command to reset board

Parameters

  [in] | argument | no argument required

Definition at line 210 of file application.c.

## process_command()

static void process_command | ( | char * | str | ) |

static

process user command

Parameters

  [in] | str | user command string (\0 ended)

Definition at line 220 of file application.c.

## putc()

size_t putc | ( | char | c | ) |

print a single character on user output

Warning
  this must be implemented by the user (using the desired output interface)

Parameters

  [in] | c | character to be printed

Returns
  number of characters printed

Definition at line 60 of file application.c.

## switch_mode()

static void switch_mode | ( | const struct busvoodoo_mode_t * | mode | ) |

static

switch BusVoddoo mode

Parameters

  [in] | mode | mode to switch to

Definition at line 81 of file application.c.

## Variable Documentation

## busvoodoo_modes

const struct busvoodoo_mode_t* busvoodoo_modes[]

static

Initial value:
= {
&busvoodoo_hiz_mode,
&busvoodoo_uart_mode,
&busvoodoo_i2c_mode,
&busvoodoo_spi_mode,
&busvoodoo_rs232_mode,
}
busvoodoo_spi_mode
const struct busvoodoo_mode_t busvoodoo_spi_mode
SPI mode interface definition.
Definition: busvoodoo_spi.c:499
busvoodoo_hiz_mode
const struct busvoodoo_mode_t busvoodoo_hiz_mode
HiZ mode interface definition.
Definition: busvoodoo_hiz.c:896
busvoodoo_uart_mode
const struct busvoodoo_mode_t busvoodoo_uart_mode
UART mode interface definition.
Definition: busvoodoo_uart.c:686
busvoodoo_rs232_mode
const struct busvoodoo_mode_t busvoodoo_rs232_mode
RS-232 mode interface definition.
Definition: busvoodoo_rs232.c:649
busvoodoo_i2c_mode
const struct busvoodoo_mode_t busvoodoo_i2c_mode
I2C mode interface definition.
Definition: busvoodoo_i2c.c:551

all supported BusVoodoo modes

Definition at line 47 of file application.c.

## menu_commands

const struct menu_command_t menu_commands[]

static

command to reboot into bootloader

Parameters

  [in] | argument | no argument requiredlist of all supported commands

Definition at line 127 of file application.c.