software:firmware
MakAir Firmware
EolTest Class Reference

Controls the running of the embedded auto tests. More...

#include <end_of_line_test.h>

Public Member Functions

 EolTest ()
 Default constructor. More...
 
void activate ()
 Enable test mode. More...
 
bool isRunning ()
 Check if test mode is enabled. More...
 
void onConfirm ()
 Handle EOL confirm control setting from telemetry. More...
 
void setupAndStart ()
 Run test mode. More...
 

Private Attributes

uint32_t testActive
 Test mode activation state. More...
 

Detailed Description

Controls the running of the embedded auto tests.

Definition at line 80 of file end_of_line_test.h.

Constructor & Destructor Documentation

◆ EolTest()

EolTest::EolTest ( )

Default constructor.

Definition at line 43 of file end_of_line_test.cpp.

43 { testActive = 0; }
uint32_t testActive
Test mode activation state.

Member Function Documentation

◆ activate()

void EolTest::activate ( )

Enable test mode.

Definition at line 46 of file end_of_line_test.cpp.

46  {
48  ::clockEOLTimer = 0;
49  ::eolTimer = new HardwareTimer(TIM9);
50 }
uint32_t clockEOLTimer
HardwareTimer * eolTimer
#define EOL_TEST_ACTIVE
This an arbitrary value allowing to check if test mode is active.

◆ isRunning()

bool EolTest::isRunning ( )

Check if test mode is enabled.

Returns
True if test mode is enabled

Definition at line 52 of file end_of_line_test.cpp.

52 { return (EOL_TEST_ACTIVE == testActive); }

◆ onConfirm()

void EolTest::onConfirm ( )

Handle EOL confirm control setting from telemetry.

Definition at line 621 of file end_of_line_test.cpp.

621  {
622  eolStepConfirmed = true;
623 }
boolean eolStepConfirmed

◆ setupAndStart()

void EolTest::setupAndStart ( )

Run test mode.

Definition at line 625 of file end_of_line_test.cpp.

625  {
626  // Set a 1 ms timer for the event loop
627  // Prescaler at 10 kHz; stm32f411 clock is 100 mHz
628  ::eolTimer->setPrescaleFactor((::eolTimer->getTimerClkFreq() / 10000) - 1);
629  // Set the period at 1 ms
630  ::eolTimer->setOverflow(10);
631  ::eolTimer->setMode(1, TIMER_OUTPUT_COMPARE, NC);
632  ::eolTimer->attachInterrupt(millisecondTimerEOL);
633  ::eolTimer->resume();
634 
639 
640  // define the 3x3 matrix keyboard input and output
641  pinMode(PIN_OUT_COL1, OUTPUT);
642  pinMode(PIN_OUT_COL2, OUTPUT);
643  pinMode(PIN_OUT_COL3, OUTPUT);
644  digitalWrite(PIN_OUT_COL1, LOW);
645  digitalWrite(PIN_OUT_COL2, LOW);
646  digitalWrite(PIN_OUT_COL3, LOW);
647  pinMode(PIN_IN_ROW1, INPUT);
648  pinMode(PIN_IN_ROW2, INPUT);
649  pinMode(PIN_IN_ROW3, INPUT);
650 }
void execute()
Command the valve to go to the requested aperture.
void close()
Request closing of the Pressure Valve.
void millisecondTimerEOL(HardwareTimer *)
#define PIN_OUT_COL2
Definition: parameters.h:236
#define PIN_IN_ROW3
Definition: parameters.h:240
#define PIN_IN_ROW1
Definition: parameters.h:238
#define PIN_OUT_COL1
Definition: parameters.h:235
#define PIN_IN_ROW2
Definition: parameters.h:239
#define PIN_OUT_COL3
Definition: parameters.h:237
PressureValve inspiratoryValve
PressureValve expiratoryValve

Member Data Documentation

◆ testActive

uint32_t EolTest::testActive
private

Test mode activation state.

Definition at line 103 of file end_of_line_test.h.


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