CuVoodoo STM32F1 firmware template
|
BusVoodoo global definitions and methods (API) More...
Go to the source code of this file.
Data Structures | |
struct | busvoodoo_mode_t |
BusVoodoo mode interface. More... | |
Macros | |
#define | BUSVOODOO_5VPULLUP_PORT B |
5V pull-up enable pin (active low) | |
#define | BUSVOODOO_5VPULLUP_PIN 4 |
5V pull-up enable pin (active low) | |
#define | BUSVOODOO_OEPULLUP_PORT A |
bus switch output enable pin to enable embedded pull-ups (active low) | |
#define | BUSVOODOO_OEPULLUP_PIN 15 |
bus switch output enable pin to enable embedded pull-ups (active low) | |
#define | BUSVOODOO_LVEN_PORT A |
low voltage (LV) enable pin (active high) | |
#define | BUSVOODOO_LVEN_PIN 6 |
low voltage (LV) enable pin (active high) | |
#define | BUSVOODOO_HVEN_PORT A |
high voltage (HV) enable pin (active low) | |
#define | BUSVOODOO_HVEN_PIN 7 |
high voltage (HV) enable pin (active low) | |
#define | BUSVOODOO_VOUTEN_PORT B |
voltage output (5V and 3.3V) enable pin (active low) | |
#define | BUSVOODOO_VOUTEN_PIN 3 |
voltage output (5V and 3.3V) enable pin (active low) | |
#define | BUSVOODOO_3V3_CHANNEL 12 |
ADC channel to measure 5V rail. | |
#define | BUSVOODOO_5V_CHANNEL 9 |
ADC channel to measure 3.3V rail. | |
#define | BUSVOODOO_LV_CHANNEL 11 |
ADC channel to measure LV rail. | |
#define | BUSVOODOO_HV_CHANNEL 15 |
ADC channel to measure HV rail. | |
#define | BUSVOODOO_LVCTL_PORT A |
pin to control LV output voltage | |
#define | BUSVOODOO_LVCTL_PIN 4 |
pin to control LV output voltage | |
#define | BUSVOODOO_LVCTL_CHANNEL CHANNEL_1 |
DAC channel to control LV output voltage. | |
#define | BUSVOODOO_LV_SET(x) ((0.8*(1+30.0/10.0)-x)*(10.0/30.0)+0.8) |
voltage to output for the DAC to set the desired LV output voltage (based on resistor values on the LV adjust pins and LV voltage reference) | |
#define | BUSVOODOO_HVCTL_PORT A |
pin to control HV output voltage | |
#define | BUSVOODOO_HVCTL_PIN 5 |
pin to control HV output voltage | |
#define | BUSVOODOO_HVCTL_CHANNEL CHANNEL_2 |
DAC channel to control HV output voltage. | |
#define | BUSVOODOO_HV_SET(x) ((1.25*(1+100.0/10.0)-x)*(10.0/100.0)+1.25) |
voltage to output for the DAC to set the desired HV output voltage (based on resistor values on the HV adjust pins and HV voltage reference) | |
#define | BUSVOODOO_RS232_EN_PORT B |
RS-232 pin to enable receiver (active low, pulled up) | |
#define | BUSVOODOO_RS232_EN_PIN 5 |
RS-232 pin to enable receiver (active low, pulled up) | |
#define | BUSVOODOO_RS232_SHDN_PORT C |
RS-232 pin to enable transmitter (active high, pulled low) | |
#define | BUSVOODOO_RS232_SHDN_PIN 15 |
RS-232 pin to enable transmitter (active high, pulled low) | |
#define | BUSVOODOO_RS232_RTS_PORT A |
RS-232 Request-To-Send output pin. | |
#define | BUSVOODOO_RS232_RTS_PIN 1 |
RS-232 Request-To-Send output pin. | |
#define | BUSVOODOO_RS232_CTS_PORT A |
RS-232 Clear-To-Send input pin. | |
#define | BUSVOODOO_RS232_CTS_PIN 0 |
RS-232 Clear-To-Send input pin. | |
#define | BUSVOODOO_RS232_TX_PORT A |
RS-232 Transmit output pin. | |
#define | BUSVOODOO_RS232_TX_PIN 2 |
RS-232 Transmit output pin. | |
#define | BUSVOODOO_RS232_RX_PORT A |
RS-232 Receive input pin. | |
#define | BUSVOODOO_RS232_RX_PIN 3 |
RS-232 Receive input pin. | |
#define | BUSVOODOO_RS485_RE_PORT C |
RS-485 pin to enable receiver (active low, pulled up) | |
#define | BUSVOODOO_RS485_RE_PIN 13 |
RS-485 pin to enable receiver (active low, pulled up) | |
#define | BUSVOODOO_RS485_DE_PORT C |
RS-485 pin to enable transmitter (active high, pulled low) | |
#define | BUSVOODOO_RS485_DE_PIN 14 |
RS-485 pin to enable transmitter (active high, pulled low) | |
#define | BUSVOODOO_RS485_TX_PORT A |
RS-485 Transmit output pin. | |
#define | BUSVOODOO_RS485_TX_PIN 2 |
RS-485 Transmit output pin. | |
#define | BUSVOODOO_RS485_RX_PORT A |
RS-485 Receive input pin. | |
#define | BUSVOODOO_RS485_RX_PIN 3 |
RS-485 Receive input pin. | |
#define | BUSVOODOO_HW_VERSION_PORT B |
pin to identify hardware version | |
#define | BUSVOODOO_HW_VERSION_PIN 0 |
pin to identify hardware version | |
#define | BUSVOODOO_HW_VERSION_CHANNEL 8 |
ADC to identify hardware version. | |
#define | BUSVOODOO_LED_PULSE 100 |
recommended duration in ms for pulsing LEDs to show activity | |
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... | |
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... | |
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 | busvoodoo_leds_blink (double period, double duty) |
set LED blinking pattern 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... | |
Variables | |
const char * | busvoodoo_io_names [13] |
I/O individual signal names. | |
const uint32_t | busvoodoo_io_ports [13] |
port of individual signals | |
const uint32_t | busvoodoo_io_pins [13] |
pin of individual signals | |
const uint8_t | busvoodoo_io_groups [13] |
which I/O pin (group) does the signal belong to | |
bool | busvoodoo_full |
is the BusVoodoo board fully populated (with HV voltage regulator, RS-232, RS-485, CAN transceiver on the back side) | |
char | busvoodoo_version |
version of the hardware board | |
const struct menu_command_t | busvoodoo_global_commands [] |
list of supported commands for base BusVoodoo | |
const uint8_t | busvoodoo_global_commands_nb |
number supported commands for base BusVoodoo | |
const struct menu_command_t | busvoodoo_global_full_commands [] |
list of supported commands for BusVoodoo full only | |
const uint8_t | busvoodoo_global_full_commands_nb |
number supported commands for BusVoodoo full only | |
const char * | busvoodoo_global_pinout_io [10] |
I/O connector pinout. | |
const char * | busvoodoo_global_pinout_rscan [5] |
RS/CAN connector pinout. | |
char | busvoodoo_global_string [64] |
shared string buffer, i.e. More... | |
BusVoodoo global definitions and methods (API)
Definition in file busvoodoo_global.h.
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.
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.
char busvoodoo_global_string[64] |
shared string buffer, i.e.
used when configuring modes
Definition at line 72 of file busvoodoo_global.c.