busvoodoo_global.h
Go to the documentation of this file.
/* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#define BUSVOODOO_5VPULLUP_PORT B
#define BUSVOODOO_5VPULLUP_PIN 4
#define BUSVOODOO_OEPULLUP_PORT A
#define BUSVOODOO_OEPULLUP_PIN 15
#define BUSVOODOO_LVEN_PORT A
#define BUSVOODOO_LVEN_PIN 6
#define BUSVOODOO_HVEN_PORT A
#define BUSVOODOO_HVEN_PIN 7
#define BUSVOODOO_VOUTEN_PORT B
#define BUSVOODOO_VOUTEN_PIN 3
#define BUSVOODOO_3V3_CHANNEL 12
#define BUSVOODOO_5V_CHANNEL 9
#define BUSVOODOO_LV_CHANNEL 11
#define BUSVOODOO_HV_CHANNEL 15
#define BUSVOODOO_LVCTL_PORT A
#define BUSVOODOO_LVCTL_PIN 4
#define BUSVOODOO_LVCTL_CHANNEL CHANNEL_1
#define BUSVOODOO_LV_SET(x) ((0.8*(1+30.0/10.0)-x)*(10.0/30.0)+0.8)
#define BUSVOODOO_HVCTL_PORT A
#define BUSVOODOO_HVCTL_PIN 5
#define BUSVOODOO_HVCTL_CHANNEL CHANNEL_2
#define BUSVOODOO_HV_SET(x) ((1.25*(1+100.0/10.0)-x)*(10.0/100.0)+1.25)
#define BUSVOODOO_RS232_EN_PORT B
#define BUSVOODOO_RS232_EN_PIN 5
#define BUSVOODOO_RS232_SHDN_PORT C
#define BUSVOODOO_RS232_SHDN_PIN 15
#define BUSVOODOO_RS232_RTS_PORT A
#define BUSVOODOO_RS232_RTS_PIN 1
#define BUSVOODOO_RS232_CTS_PORT A
#define BUSVOODOO_RS232_CTS_PIN 0
#define BUSVOODOO_RS232_TX_PORT A
#define BUSVOODOO_RS232_TX_PIN 2
#define BUSVOODOO_RS232_RX_PORT A
#define BUSVOODOO_RS232_RX_PIN 3
#define BUSVOODOO_RS485_RE_PORT C
#define BUSVOODOO_RS485_RE_PIN 13
#define BUSVOODOO_RS485_DE_PORT C
#define BUSVOODOO_RS485_DE_PIN 14
#define BUSVOODOO_RS485_TX_PORT A
#define BUSVOODOO_RS485_TX_PIN 2
#define BUSVOODOO_RS485_RX_PORT A
#define BUSVOODOO_RS485_RX_PIN 3
#define BUSVOODOO_HW_VERSION_PORT B
#define BUSVOODOO_HW_VERSION_PIN 0
#define BUSVOODOO_HW_VERSION_CHANNEL 8
#define BUSVOODOO_LED_PULSE 100
struct busvoodoo_mode_t {
const char* name;
const char* description;
bool (*setup)(char** prefix, const char* line);
const struct menu_command_t* commands;
const uint8_t commands_nb;
void (*exit)(void);
};
extern const char* busvoodoo_io_names[13];
extern const uint32_t busvoodoo_io_ports[13];
extern const uint32_t busvoodoo_io_pins[13];
extern const uint8_t busvoodoo_io_groups[13];
extern bool busvoodoo_full;
extern char busvoodoo_version;
extern const struct menu_command_t busvoodoo_global_commands[];
extern const uint8_t busvoodoo_global_commands_nb;
extern const char* busvoodoo_global_pinout_io[10];
extern const char* busvoodoo_global_pinout_rscan[5];
extern char busvoodoo_global_string[64];
void busvoodoo_setup(void);
void busvoodoo_safe_state(void);
bool busvoodoo_vout_switch(bool on);
float busvoodoo_vreg_get(uint8_t channel);
float busvoodoo_lv_set(float voltage);
float busvoodoo_hv_set(float voltage);
float busvoodoo_embedded_pullup(bool on);
void busvoodoo_led_blue_pulse(uint16_t ms);
void busvoodoo_led_red_pulse(uint16_t ms);
bool busvoodoo_global_actions(char* actions, bool perform, bool (*action_handler)(const char* action, uint32_t repetition, bool perform));
busvoodoo_vout_switch
bool busvoodoo_vout_switch(bool on)
switch 3V3 and 5V power outputs on I/O connector
Definition: busvoodoo_global.c:201
busvoodoo_mode_t::commands
const struct menu_command_t * commands
list of menu commands provided by mode
Definition: busvoodoo_global.h:105
menu_command_t
command menu entry
Definition: menu.h:31
busvoodoo_hv_set
float busvoodoo_hv_set(float voltage)
set voltage on high voltage adjustable voltage regulator
Definition: busvoodoo_global.c:312
busvoodoo_mode_t::name
const char * name
name of the mode (i.e.
Definition: busvoodoo_global.h:102
busvoodoo_mode_t::description
const char * description
human readable description of the mode (i.e.
Definition: busvoodoo_global.h:103
busvoodoo_io_pins
const uint32_t busvoodoo_io_pins[13]
pin of individual signals
Definition: busvoodoo_global.c:61
busvoodoo_lv_set
float busvoodoo_lv_set(float voltage)
set voltage on low voltage adjustable voltage regulator
Definition: busvoodoo_global.c:284
busvoodoo_global_commands
const struct menu_command_t busvoodoo_global_commands[]
list of supported commands
Definition: busvoodoo_global.c:721
busvoodoo_io_ports
const uint32_t busvoodoo_io_ports[13]
port of individual signals
Definition: busvoodoo_global.c:60
busvoodoo_setup
void busvoodoo_setup(void)
setup BusVoodoo board
Definition: busvoodoo_global.c:68
busvoodoo_global_actions
bool busvoodoo_global_actions(char *actions, bool perform, bool(*action_handler)(const char *action, uint32_t repetition, bool perform))
parse and perform actions
Definition: busvoodoo_global.c:404
busvoodoo_io_groups
const uint8_t busvoodoo_io_groups[13]
which I/O pin (group) does the signal belong to
Definition: busvoodoo_global.c:62
busvoodoo_global_pinout_io
const char * busvoodoo_global_pinout_io[10]
I/O connector pinout.
Definition: busvoodoo_global.c:56
busvoodoo_vreg_get
float busvoodoo_vreg_get(uint8_t channel)
read voltage from power rail
Definition: busvoodoo_global.c:222
busvoodoo_io_names
const char * busvoodoo_io_names[13]
I/O individual signal names.
Definition: busvoodoo_global.c:59
busvoodoo_mode_t::exit
void(* exit)(void)
function to exit from mode (i.e.
Definition: busvoodoo_global.h:107
busvoodoo_global_string
char busvoodoo_global_string[64]
shared string buffer, i.e.
Definition: busvoodoo_global.c:66
busvoodoo_global_commands_nb
const uint8_t busvoodoo_global_commands_nb
number supported commands
Definition: busvoodoo_global.c:756
busvoodoo_mode_t::commands_nb
const uint8_t commands_nb
number of menu commands provided by mode
Definition: busvoodoo_global.h:106
busvoodoo_global_pinout_rscan
const char * busvoodoo_global_pinout_rscan[5]
RS/CAN connector pinout.
Definition: busvoodoo_global.c:57
busvoodoo_mode_t::setup
bool(* setup)(char **prefix, const char *line)
function to setup mode (menu prefix can be used to ask parameter, and line will be the user provided ...
Definition: busvoodoo_global.h:104
busvoodoo_version
char busvoodoo_version
version of the hardware board
Definition: busvoodoo_global.c:65
busvoodoo_led_blue_pulse
void busvoodoo_led_blue_pulse(uint16_t ms)
pulse blue LED for short duration
Definition: busvoodoo_global.c:366
busvoodoo_safe_state
void busvoodoo_safe_state(void)
set safe state by disabling all outputs
Definition: busvoodoo_global.c:154
busvoodoo_full
bool busvoodoo_full
is the BusVoodoo board fully populated (with HV voltage regulator, RS-232, RS-485, CAN transceiver on the back side)
Definition: busvoodoo_global.c:64
busvoodoo_embedded_pullup
float busvoodoo_embedded_pullup(bool on)
enable embedded pull-up resistors
Definition: busvoodoo_global.c:342
busvoodoo_mode_t
BusVoodoo mode interface.
Definition: busvoodoo_global.h:101
busvoodoo_led_red_pulse
void busvoodoo_led_red_pulse(uint16_t ms)
pulse red LED for short duration
Definition: busvoodoo_global.c:385