Topic: tech dcc pc src prev next
tech dcc pc src > controller.h
#ifndef HERMES_CONTROLLER_H
#define HERMES_CONTROLLER_H
#include "cfg.h"
#include "menu.h"
unsigned char pot_to_speed(adc_type pot, bool steps_128);
/*
* Transmit a speed packet using the number of speed steps expected by the
* locomotive.
*/
void transmit_speed(
const cfg_loco *loco,
unsigned char speed,
bool direction
);
/*
* Check for a current draw greater than the allowable current for the board.
* Stop the DCC signal, display a message and reset the controller if the
* current draw is too high.
*/
void Controller_CheckOverCurrent(adc_type current);
// Choose a function number from the locomotive's enabled functions.
// Returns CFG_NULL_INDEX if no function was selected.
unsigned char Controller_FunctionMenu(
const cfg_loco *loco,
functions_type *function_state
);
// Choose an accessory from the list of accessories programmed into the
// controller.
cfg_address_type Controller_AccessoryMenu(cfg_address_type *on_accessories);
unsigned char Controller_FunctionGroup(unsigned char function_no);
void Controller_TransmitFunctionGroup(
cfg_address_type address,
functions_type function_state,
unsigned char group,
unsigned char repeats
);
#endif