PS_Fgen_FW  4da88f4073c1cc65ea45c3a652a2751e495e50db
Firmware for an Power Supply and Function Generator build from an ATX power supply
Loading...
Searching...
No Matches
OnOffControls.h
Go to the documentation of this file.
1
7
8#ifndef ONOFFCONTROLS_H_
9#define ONOFFCONTROLS_H_
10
11#include "../Pins/Pins.h"
12
13// button pins on the MCP23S08 IO expander
14#define ONOFFBUTTON_MCP23S08_PIN_PS 5
15#define ONOFFBUTTON_MCP23S08_PIN_DDS1 3
16#define ONOFFBUTTON_MCP23S08_PIN_DDS2 1
17#define ONOFFBUTTON_MCP23S08_PIN_MASK ((1<<ONOFFBUTTON_MCP23S08_PIN_PS) | (1<<ONOFFBUTTON_MCP23S08_PIN_DDS1) | (1<<ONOFFBUTTON_MCP23S08_PIN_DDS2))
18
19// LED pins on the MCP23S08 IO expander
20#define ONOFFLED_MCP23S08_PIN_PS 4
21#define ONOFFLED_MCP23S08_PIN_PS_ERROR 6
22#define ONOFFLED_MCP23S08_PIN_DDS1 2
23#define ONOFFLED_MCP23S08_PIN_DDS2 0
24
35
46
51
57
64
70
76void OnOffControls_SetLEDState(OnOffLEDs_t led, bool state);
77
78
89
90#endif /* ONOFFCONTROLS_H_ */
void OnOffControls_UpdatePSLeds()
Update the PS and PS error LEDs depending on the output enabled and protection states of the PS chann...
Definition OnOffControls.cpp:122
OnOffLEDs
Enumeration with all available on/off LEDs.
Definition OnOffControls.h:40
@ ONOFFLED_PS_ERROR
on/off LED for the PS channel error
Definition OnOffControls.h:42
@ ONOFFLED_PS
on/off LED for the PS channel
Definition OnOffControls.h:41
@ ONOFFLED_DDS1
on/off LED for the DDS1 channel
Definition OnOffControls.h:43
@ ONOFFLED_DDS2
on/off LED for the DDS2 channel
Definition OnOffControls.h:44
void OnOffControls_DoButtonAction(OnOffButtons_t button)
Do some action depending on the pressed on/off button.
Definition OnOffControls.cpp:71
OnOffButtons_t OnOffControls_GetButton()
Get the last pressed on/off button.
Definition OnOffControls.cpp:39
enum OnOffLEDs OnOffLEDs_t
Enumeration with all available on/off LEDs.
void OnOffControls_Init()
Initialize the IO expander used to access the on/off controls.
Definition OnOffControls.cpp:13
OnOffButtons
Enumeration with all available on/off buttons.
Definition OnOffControls.h:29
@ ONOFFBUTTON_DDS2
on/off button for the DDS2 channel
Definition OnOffControls.h:33
@ ONOFFBUTTON_NONE
no on/off button is pressed
Definition OnOffControls.h:30
@ ONOFFBUTTON_PS
on/off button for the PS channel
Definition OnOffControls.h:31
@ ONOFFBUTTON_DDS1
on/off button for the DDS1 channel
Definition OnOffControls.h:32
void OnOffControls_SetLEDState(OnOffLEDs_t led, bool state)
Set the state of the on/off LED.
Definition OnOffControls.cpp:101
bool OnOffControls_IsButtonChanged()
Check if the state of any on/off button has changed (was pressed or was released).
Definition OnOffControls.cpp:33
enum OnOffButtons OnOffButtons_t
Enumeration with all available on/off buttons.
Containing defines and functions for basic pin initialization and handling.