Speeduino
Loading...
Searching...
No Matches
Functions | Variables
programmableIOControl.cpp File Reference
#include "programmableIOControl.h"
#include "programmableIOControl_details.h"
#include "../../../logger.h"
#include "../../../units.h"
#include "../../../unit_testing.h"
#include "../../../globals.h"
#include "../../../preprocessor.h"

Functions

void initialiseProgrammableIO (config13 &page13)
 Initialise the programmable I/O system.
 
TESTABLE_INLINE_STATIC bool applyOutputTimeLimit (const processing_channel_t &channel, bool ruleActive)
 
TESTABLE_INLINE_STATIC bool isRuleActive (const rule_t &rule, const processing_channel_t &channel, getDataFn pGetData) noexcept
 
static void updateChannelStatus (processing_channel_t &channel, bool ruleActive) noexcept
 
static void processChannelActive (processing_channel_t &channel)
 
static void processChannelInactive (processing_channel_t &channel)
 
static void processChannel (processing_channel_t &channel, const config13 &page13, getDataFn pGetData)
 
TESTABLE_INLINE_STATIC void programmableIOControl (const config13 &page13, getDataFn pGetData)
 
void programmableIOControl (const config13 &page13)
 Control function for the programmable I/O system. Should be called regularly (e.g. in main loop) to check the rules and update outputs accordingly.
 
TESTABLE_INLINE_STATIC int16_t programmableIOGetData (uint16_t index, byte(*pGetLogEntry)(uint16_t byteNum))
 Get single I/O data var (from current) for comparison.
 
int16_t programmableIOGetData (uint16_t index)
 Get single I/O data var (from current) for comparison.
 
uint8_t getProgrammableIOOutputStatus (void)
 Get the output status of the programmable I/O system.
 

Variables

TESTABLE_STATIC state_t state
 

Detailed Description

Custom Programmable I/O. The config related to Programmable I/O is found on page13 (of type config13).

Function Documentation

◆ applyOutputTimeLimit()

TESTABLE_INLINE_STATIC bool applyOutputTimeLimit ( const processing_channel_t channel,
bool  ruleActive 
)

◆ getProgrammableIOOutputStatus()

uint8_t getProgrammableIOOutputStatus ( void  )

Get the output status of the programmable I/O system.

Returns
The compressed output status.

◆ initialiseProgrammableIO()

void initialiseProgrammableIO ( config13 page13)

Initialise the programmable I/O system.

Parameters
page13The tune

◆ isRuleActive()

TESTABLE_INLINE_STATIC bool isRuleActive ( const rule_t rule,
const processing_channel_t channel,
getDataFn  pGetData 
)
noexcept

◆ processChannel()

static void processChannel ( processing_channel_t channel,
const config13 page13,
getDataFn  pGetData 
)
inlinestatic

◆ processChannelActive()

static void processChannelActive ( processing_channel_t channel)
inlinestatic

◆ processChannelInactive()

static void processChannelInactive ( processing_channel_t channel)
inlinestatic

◆ programmableIOControl() [1/2]

void programmableIOControl ( const config13 page13)

Control function for the programmable I/O system. Should be called regularly (e.g. in main loop) to check the rules and update outputs accordingly.

Parameters
page13The tune

◆ programmableIOControl() [2/2]

TESTABLE_INLINE_STATIC void programmableIOControl ( const config13 page13,
getDataFn  pGetData 
)

Check all (8) programmable I/O:s and carry out action on output pin as needed. Compare 2 (16 bit) vars in a way configured by cmpOperation (see also config13::operation). Use programmableIOGetData() to get 2 vars to compare. Skip all programmable I/O:s where output pin is set 0 (meaning: not programmed).

◆ programmableIOGetData() [1/2]

int16_t programmableIOGetData ( uint16_t  index)

Get single I/O data var (from current) for comparison.

Parameters
indexField index/number (?)

◆ programmableIOGetData() [2/2]

TESTABLE_INLINE_STATIC int16_t programmableIOGetData ( uint16_t  index,
byte(*)(uint16_t byteNum)  pGetLogEntry 
)

Get single I/O data var (from current) for comparison.

◆ updateChannelStatus()

static void updateChannelStatus ( processing_channel_t channel,
bool  ruleActive 
)
inlinestaticnoexcept

Variable Documentation

◆ state