Formula Student Electronics & Software
The code for the embedded software
Loading...
Searching...
No Matches
DigitalSender Class Reference

Class responsible for controlling digital outputs in the Master Teensy. More...

#include <digitalSender.hpp>

Collaboration diagram for DigitalSender:
Collaboration graph

Public Member Functions

 DigitalSender ()
 Constructor for the DigitalSender class.
 
void enterEmergencyState ()
 ASSI LEDs blue flashing, sdc open and buzzer ringing.
 
void enterDrivingState ()
 ASSI LEDs yellow flashing, ebs valves deactivated, sdc closed.
 
void blinkLED (int pin)
 Blinks the LED at the given pin.
 
void toggleWatchdog ()
 Toggles the watchdog pin, to ensure certify of masters' liveness.
 

Static Public Member Functions

static void openSDC ()
 Opens the SDC in Master and SDC Logic.
 
static void closeSDC ()
 Closes the SDC in Master and SDC Logic.
 
static void activateEBS ()
 Activates the solenoid EBS valves.
 
static void deactivateEBS ()
 Deactivates the solenoid EBS valves.
 
static void enterManualState ()
 Everything off, sdc closed.
 
static void enterOffState ()
 Everything off, sdc open.
 
static void enterReadyState ()
 ASSI yellow LED on, ebs valves activated, sdc closed.
 
static void enterFinishState ()
 ASSI blue LED on, ebs valves activated, sdc open.
 

Static Public Attributes

static constexpr std::array< int, 9 > validOutputPins
 

Detailed Description

Class responsible for controlling digital outputs in the Master Teensy.

The DigitalSender class handles various operations such as controlling LEDs, EBS valves, SDC state, and watchdog signals. It also manages different operational states such as emergency, manual, ready, driving, and finish.

Definition at line 14 of file digitalSender.hpp.

Constructor & Destructor Documentation

◆ DigitalSender()

DigitalSender::DigitalSender ( )
inline

Constructor for the DigitalSender class.

Initializes the pins for output as defined in validOutputPins.

Definition at line 41 of file digitalSender.hpp.

Member Function Documentation

◆ activateEBS()

void DigitalSender::activateEBS ( )
inlinestatic

Activates the solenoid EBS valves.

Definition at line 119 of file digitalSender.hpp.

Here is the caller graph for this function:

◆ blinkLED()

void DigitalSender::blinkLED ( int  pin)
inline

Blinks the LED at the given pin.

Parameters
pinThe pin to blink.

Definition at line 174 of file digitalSender.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ closeSDC()

void DigitalSender::closeSDC ( )
inlinestatic

Closes the SDC in Master and SDC Logic.

Definition at line 114 of file digitalSender.hpp.

Here is the caller graph for this function:

◆ deactivateEBS()

void DigitalSender::deactivateEBS ( )
inlinestatic

Deactivates the solenoid EBS valves.

Definition at line 124 of file digitalSender.hpp.

Here is the caller graph for this function:

◆ enterDrivingState()

void DigitalSender::enterDrivingState ( )
inline

ASSI LEDs yellow flashing, ebs valves deactivated, sdc closed.

Definition at line 160 of file digitalSender.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ enterEmergencyState()

void DigitalSender::enterEmergencyState ( )
inline

ASSI LEDs blue flashing, sdc open and buzzer ringing.

Definition at line 134 of file digitalSender.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ enterFinishState()

void DigitalSender::enterFinishState ( )
inlinestatic

ASSI blue LED on, ebs valves activated, sdc open.

Definition at line 167 of file digitalSender.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ enterManualState()

void DigitalSender::enterManualState ( )
inlinestatic

Everything off, sdc closed.

Definition at line 141 of file digitalSender.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ enterOffState()

void DigitalSender::enterOffState ( )
inlinestatic

Everything off, sdc open.

Definition at line 147 of file digitalSender.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ enterReadyState()

void DigitalSender::enterReadyState ( )
inlinestatic

ASSI yellow LED on, ebs valves activated, sdc closed.

these 2 should be redundant since we do it during initial checkup

Definition at line 153 of file digitalSender.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ openSDC()

void DigitalSender::openSDC ( )
inlinestatic

Opens the SDC in Master and SDC Logic.

Definition at line 109 of file digitalSender.hpp.

Here is the caller graph for this function:

◆ toggleWatchdog()

void DigitalSender::toggleWatchdog ( )
inline

Toggles the watchdog pin, to ensure certify of masters' liveness.

Definition at line 182 of file digitalSender.hpp.

Here is the call graph for this function:

Member Data Documentation

◆ validOutputPins

constexpr std::array<int, 9> DigitalSender::validOutputPins
staticconstexpr
Initial value:
= {
}
#define SDC_LOGIC_CLOSE_SDC_PIN
#define EBS_VALVE_2_PIN
#define EBS_VALVE_1_PIN
#define SDC_LOGIC_WATCHDOG_OUT_PIN
#define MASTER_SDC_OUT_PIN
#define ASSI_BLUE_PIN
#define ASSI_YELLOW_PIN

Definition at line 26 of file digitalSender.hpp.


The documentation for this class was generated from the following file: