CuVoodoo STM32F1 firmware template
|
BusVoodoo global definitions and methods (code) More...
Go to the source code of this file.
Macros | |
#define | BUSVOODOO_LED_TIMER 1 |
timer peripheral ID | |
Functions | |
void | busvoodoo_setup (void) |
setup BusVoodoo board | |
void | busvoodoo_safe_state (void) |
set safe state by disabling all outputs | |
bool | busvoodoo_vout_switch (bool on) |
switch 3V3 and 5V power outputs on I/O connector More... | |
float | busvoodoo_vreg_get (uint8_t channel) |
read voltage from power rail More... | |
float | busvoodoo_lv_set (float voltage) |
set voltage on low voltage adjustable voltage regulator More... | |
float | busvoodoo_hv_set (float voltage) |
set voltage on high voltage adjustable voltage regulator More... | |
float | busvoodoo_embedded_pullup (bool on) |
enable embedded pull-up resistors More... | |
static void | busvoodoo_leds_update (void) |
update LED status according to LED flags | |
void | busvoodoo_led_blue_on (void) |
switch on blue LED More... | |
void | busvoodoo_led_blue_off (void) |
switch off blue LED More... | |
void | busvoodoo_led_red_on (void) |
switch on red LED More... | |
void | busvoodoo_led_red_off (void) |
switch off red LED More... | |
void | busvoodoo_leds_off (void) |
switch off blue and red LEDs More... | |
static void | busvoodoo_led_pulse_setup (void) |
setup the timer for pulsing LEDs | |
void | busvoodoo_led_blue_pulse (uint32_t ms) |
pulse blue LED for short duration More... | |
void | busvoodoo_led_red_pulse (uint32_t ms) |
pulse red LED for short duration More... | |
void | tim1_up_isr (void) |
interrupt service routine called on LED timeout | |
void | busvoodoo_leds_blink (double period, double duty) |
set LED blinking pattern More... | |
static void | busvoodoo_global_power_led_update (void) |
updates the red power LED status More... | |
bool | busvoodoo_global_actions (char *actions, bool perform, bool(*action_handler)(const char *action, uint32_t repetition, bool perform)) |
parse and perform actions More... | |
static void | busvoodoo_global_power (void *argument) |
switch 3V3 and 5V power rails on/off More... | |
static void | busvoodoo_global_lv (void *argument) |
set LV linear drop-out voltage regulator voltage More... | |
static void | busvoodoo_global_hv (void *argument) |
set HV step-up voltage regulator voltage More... | |
static void | busvoodoo_global_pinout (void *argument) |
display I/O and RS/CAN connector pinouts More... | |
Variables | |
static volatile uint32_t | busvoodoo_global_led_blue_timeout = 0 |
number of remaining milliseconds the blue LED should stay on | |
static volatile bool | busvoodoo_global_led_blue_timer = false |
if the timer for the blue LED is enabled | |
static volatile uint32_t | busvoodoo_global_led_red_timeout = 0 |
number of remaining milliseconds the red LED should stay on | |
static volatile bool | busvoodoo_global_led_red_timer = false |
if the timer for the red LED is enabled | |
static volatile bool | busvoodoo_global_led_blinking = false |
if the LEDs are in a blinking pattern | |
static const float | busvoodoo_version_voltages [] = {100.0/(10.0+100.0)*3.3} |
hardware version voltages, calculated from divider ratios, starting with version A | |
const char * | busvoodoo_global_pinout_io [10] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL} |
I/O connector pinout. | |
const char * | busvoodoo_global_pinout_rscan [5] = {NULL, NULL, NULL, NULL, NULL} |
RS/CAN connector pinout. | |
const char * | busvoodoo_io_names [13] = {"I2C_SMBA/SPI_NSS/I2S_WS/UART1_CK", "SDIO_CMD", "UART1_CTS/SPI_SCK/I2S_CK", "SDIO_D3/UART2_RX", "I2C_SDA/UART1_RX", "SDIO_D0", "SPI_MOSI/I2S_SD", "SDIO_CK", "I2C_SCL/UART1_TX", "SDIO_D1", "I2S_MCK", "UART1_RTS/SPI_MISO", "SDIO_D2/UART2_TX"} |
I/O individual signal names. | |
const uint32_t | busvoodoo_io_ports [13] = {GPIOB, GPIOD, GPIOB, GPIOC, GPIOB, GPIOC, GPIOB, GPIOC, GPIOB, GPIOC, GPIOC, GPIOB, GPIOC} |
port of individual signals | |
const uint32_t | busvoodoo_io_pins [13] = {GPIO12, GPIO2, GPIO13, GPIO11, GPIO11, GPIO8, GPIO15, GPIO12, GPIO10, GPIO9, GPIO6, GPIO14, GPIO10} |
pin of individual signals | |
const uint8_t | busvoodoo_io_groups [13] = {6, 6, 4, 4, 1, 1, 5, 5, 2, 2, 3, 3, 3} |
which I/O pin (group) does the signal belong to | |
bool | busvoodoo_full = false |
is the BusVoodoo board fully populated (with HV voltage regulator, RS-232, RS-485, CAN transceiver on the back side) | |
char | busvoodoo_version = '0' |
version of the hardware board | |
char | busvoodoo_global_string [64] |
shared string buffer, i.e. More... | |
const struct menu_command_t | busvoodoo_global_commands [] |
list of supported commands for base BusVoodoo More... | |
const uint8_t | busvoodoo_global_commands_nb = LENGTH(busvoodoo_global_commands) |
number supported commands for base BusVoodoo | |
const struct menu_command_t | busvoodoo_global_full_commands [] |
list of supported commands for BusVoodoo full only More... | |
const uint8_t | busvoodoo_global_full_commands_nb = LENGTH(busvoodoo_global_full_commands) |
number supported commands for BusVoodoo full only | |
BusVoodoo global definitions and methods (code)
Definition in file busvoodoo_global.c.
float busvoodoo_embedded_pullup | ( | bool | on | ) |
enable embedded pull-up resistors
[in] | on | enable (true) or disable (false) embedded pull-up resistors |
Definition at line 373 of file busvoodoo_global.c.
bool busvoodoo_global_actions | ( | char * | actions, |
bool | perform, | ||
bool(*)(const char *action, uint32_t repetition, bool perform) | action_handler | ||
) |
parse and perform actions
[in] | actions | actions to perform |
[in] | perform | the action (true) or just check it (false) |
[in] | action_handler | function handling the individual actions |
Definition at line 561 of file busvoodoo_global.c.
|
static |
set HV step-up voltage regulator voltage
[in] | argument | voltage to set (0 to switch off, NULL to get voltage) |
Definition at line 699 of file busvoodoo_global.c.
|
static |
set LV linear drop-out voltage regulator voltage
[in] | argument | voltage to set (0 to switch off, NULL to get voltage) |
Definition at line 661 of file busvoodoo_global.c.
|
static |
display I/O and RS/CAN connector pinouts
[in] | argument | not used |
Definition at line 736 of file busvoodoo_global.c.
|
static |
switch 3V3 and 5V power rails on/off
[in] | argument | string: "on" to switch on, "off" to switch off, NULL to get status |
Definition at line 626 of file busvoodoo_global.c.
|
static |
updates the red power LED status
Definition at line 545 of file busvoodoo_global.c.
float busvoodoo_hv_set | ( | float | voltage | ) |
set voltage on high voltage adjustable voltage regulator
[in] | voltage | voltage to set on adjustable voltage regulator (0, 3.3-24V) |
Definition at line 343 of file busvoodoo_global.c.
void busvoodoo_led_blue_off | ( | void | ) |
switch off blue LED
Definition at line 426 of file busvoodoo_global.c.
void busvoodoo_led_blue_on | ( | void | ) |
switch on blue LED
Definition at line 419 of file busvoodoo_global.c.
void busvoodoo_led_blue_pulse | ( | uint32_t | ms | ) |
pulse blue LED for short duration
[in] | ms | duration in ms |
Definition at line 468 of file busvoodoo_global.c.
void busvoodoo_led_red_off | ( | void | ) |
switch off red LED
Definition at line 440 of file busvoodoo_global.c.
void busvoodoo_led_red_on | ( | void | ) |
switch on red LED
Definition at line 433 of file busvoodoo_global.c.
void busvoodoo_led_red_pulse | ( | uint32_t | ms | ) |
pulse red LED for short duration
[in] | ms | duration in ms |
Definition at line 481 of file busvoodoo_global.c.
void busvoodoo_leds_blink | ( | double | period, |
double | duty | ||
) |
set LED blinking pattern
[in] | period | blue+red pattern duration in seconds (up to 3+3) |
[in] | duty | blue LED on duty cycle, before switching to red (0-1) |
Definition at line 511 of file busvoodoo_global.c.
void busvoodoo_leds_off | ( | void | ) |
switch off blue and red LEDs
Definition at line 447 of file busvoodoo_global.c.
float busvoodoo_lv_set | ( | float | voltage | ) |
set voltage on low voltage adjustable voltage regulator
[in] | voltage | voltage to set on adjustable voltage regulator (0, 0.3-4.8, 5V) |
Definition at line 315 of file busvoodoo_global.c.
bool busvoodoo_vout_switch | ( | bool | on | ) |
switch 3V3 and 5V power outputs on I/O connector
[in] | on | switch on (true) or off (false) power output |
Definition at line 226 of file busvoodoo_global.c.
float busvoodoo_vreg_get | ( | uint8_t | channel | ) |
read voltage from power rail
[in] | channel | which power rail to read voltage from ADC inputs to measure voltages from voltage regulators |
Definition at line 247 of file busvoodoo_global.c.
const struct menu_command_t busvoodoo_global_commands[] |
list of supported commands for base BusVoodoo
Definition at line 880 of file busvoodoo_global.c.
const struct menu_command_t busvoodoo_global_full_commands[] |
list of supported commands for BusVoodoo full only
Definition at line 909 of file busvoodoo_global.c.
char busvoodoo_global_string[64] |
shared string buffer, i.e.
used when configuring modes
Definition at line 72 of file busvoodoo_global.c.