busvoodoo: add mode interface definition

This commit is contained in:
King Kévin 2018-01-23 15:17:43 +01:00
parent 33a847b8e7
commit d2734a6fd7
2 changed files with 10 additions and 2 deletions

View File

@ -285,9 +285,9 @@ static void busvoodoo_global_power(void* argument) {
}
power_on:
voltage = busvoodoo_vreg_get(BUSVOODOO_5V_CHANNEL); // get 5V power rail voltage
printf("5V power rail: %.2f\n", voltage);
printf("5V power rail: %.2fV\n", voltage);
voltage = busvoodoo_vreg_get(BUSVOODOO_3V3_CHANNEL); // get 3.3V power rail voltage
printf("3V3 power rail: %.2f\n", voltage);
printf("3V3 power rail: %.2fV\n", voltage);
} else if (0==strcmp(argument, "off")) {
busvoodoo_vout_switch(false); // switch power rail off
printf("power rails switched off\n");

View File

@ -86,6 +86,14 @@
#define BUSVOODOO_CAN_RX_PIN 8 /**< CAN Receive input pin */
/** @} */
/** BusVoodoo mode interface */
struct busvoodoo_mode_t {
bool (*setup)(char** prefix, const char* line);
const struct menu_command_t* commands;
const uint8_t commands_nb;
void (*exit)(void);
};
/** @defgroup busvoodoo_io I/O connector pin definition
* @{
*/