Speeduino
Loading...
Searching...
No Matches
Functions | Variables
utilities.cpp File Reference
#include <avr/pgmspace.h>
#include "globals.h"
#include "utilities.h"
#include "decoders.h"
#include "comms.h"
#include "logger.h"
#include "scheduler.h"
#include "scheduledIO.h"
#include "speeduino.h"

Functions

byte pinTranslate (byte rawPin)
 
byte pinTranslateAnalog (byte rawPin)
 
void setResetControlPinState (void)
 
void initialiseProgrammableIO (void)
 
void checkProgrammableIO (void)
 
int16_t ProgrammableIOGetData (uint16_t index)
 

Variables

uint8_t ioDelay [sizeof(configPage13.outputPin)]
 
uint8_t ioOutDelay [sizeof(configPage13.outputPin)]
 
uint8_t pinIsValid = 0
 
uint8_t currentRuleStatus = 0
 

Detailed Description

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

Function Documentation

◆ checkProgrammableIO()

void checkProgrammableIO ( void  )

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).

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

◆ initialiseProgrammableIO()

void initialiseProgrammableIO ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pinTranslate()

byte pinTranslate ( byte  rawPin)

Translate between the pin list that appears in TS and the actual pin numbers. For the digital IO, this will simply return the same number as the rawPin value as those are mapped directly. For analog pins, it will translate them into the correct internal pin number.

Parameters
rawPin- High level pin number
Returns
Translated / usable pin number
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pinTranslateAnalog()

byte pinTranslateAnalog ( byte  rawPin)

Translate a pin number (0 - 22) to the relevant Ax (analog) pin reference. This is required as some ARM chips do not have all analog pins in order (EG pin A15 != A14 + 1).

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

◆ ProgrammableIOGetData()

int16_t ProgrammableIOGetData ( uint16_t  index)

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

Parameters
index- Field index/number (?)
Returns
16 bit (int) result
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setResetControlPinState()

void setResetControlPinState ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ currentRuleStatus

uint8_t currentRuleStatus = 0

◆ ioDelay

uint8_t ioDelay[sizeof(configPage13.outputPin)]

◆ ioOutDelay

uint8_t ioOutDelay[sizeof(configPage13.outputPin)]

◆ pinIsValid

uint8_t pinIsValid = 0