AEM
|
#include <app.h>
Public Member Functions | |
SlaveApp () | |
void | loop () |
Protected Types | |
enum | State { State::unstarted, State::started, State::initialized, State::working, State::readyToSend, State::sendingStructs } |
Protected Member Functions | |
void | handShake () |
void | setupHBLed () |
void | stepHB () const |
void | sayState () const |
void | checkCurrentState () const |
void | setupADCVectors (uint8_t board_nbADCS, const uint8_t *bordNbChannelVec) |
void | createTimeStamper () |
State | doWork () |
State | doSingleSend () |
Protected Attributes | |
u8u32f_struct | nullStruct = {255,0,0.0} |
State | previousState = State::unstarted |
Q< u8u32f_struct > * | q |
Board * | board |
uint8_t | nbActiveADCS |
uint8_t * | adcIndexVec |
State | currentState = State::started |
State | nextState = State::unstarted |
SlaveApp handles all SPI interactions with master and polls the board for ADC data
|
strongprotected |
SlaveApp::SlaveApp | ( | ) |
constructor: activates Serial creates all member variables provides output to Serial to inform sets up SPI slave mode
|
protected |
compare current state with previous state and dispaly error message if incorrect
|
protected |
Called to creat the instance of the timeStamper class and set t0 appropriately
|
protected |
as long as there are elts in the queue, pop and send via serial If there are noneleft on the queue, return State::working to inform the main loop, otherwise state remains same
|
protected |
as long as there is room on the queue, poll the adc/channels and push the data to the queue. If there is no room left on the queue, return State::readyToSend to inform the main loop
|
protected |
sync start up of serial comms
void SlaveApp::loop | ( | ) |
loop() is called by the main loop, manages the slave state machine by: updating state as needed then perform any actions required by the current state.
|
protected |
Display the heartbeat infor and current state if full data display is active
|
protected |
Called to initialize the nbActiveADCS and the adcIndexVector so that in the querying, there will be no wasted cycles
board_nbADCS | total number of adcs available on the board |
*bordNbChannelVec | a vector of all the adc channels available |
|
protected |
setup calls for heartbeat led pins
|
protected |
update the heartbeat flashing
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |