SAE Teensy ECU
IIT SAE Microcontroller programming
Loading...
Searching...
No Matches
Pins Namespace Reference

Get and set values to predefined pins. More...

Typedefs

typedef void(* PinHandler) (uint8_t CAN_GPIO_Pin, int &value)
 A typedef for pin handler functions.
 

Functions

int getCanPinValue (uint8_t CAN_GPIO_Pin)
 Get the pin value of a predefined canbus pin.
 
int getPinValue (uint8_t GPIO_Pin)
 Get the pin value of a predefined pin.
 
void setPinValue (uint8_t GPIO_Pin, int value)
 Set the pin value of a predefined pin.
 
void setInternalValue (uint8_t Internal_Pin, int value)
 Set the value of an internal pin.
 
void resetPhysicalPins ()
 Resets physical pins to their inital state.
 
void update (void)
 Poll analog pin values.
 
void stopCanPins (void)
 Stops background interrupts from sending canPins.
 
void startCanPins (void)
 Starts background interrupts to send canPins, if any are to be sent.
 
void initialize (void)
 Initialize all predefined pins.
 
void debugPrint (void)
 Used for debugging.
 

Detailed Description

Get and set values to predefined pins.

Manage defined pins and ensure only defined pins are accessed

Refer to Pins.h for more info.

Typedef Documentation

◆ PinHandler

typedef void(* Pins::PinHandler) (uint8_t CAN_GPIO_Pin, int &value)

A typedef for pin handler functions.

Definition at line 90 of file Pins.h.

Function Documentation

◆ getCanPinValue()

int Pins::getCanPinValue ( uint8_t  CAN_GPIO_Pin)

Get the pin value of a predefined canbus pin.

Note
Pins must first be defined in PinConfig.def
Parameters
CAN_GPIO_PinThe canbus GPIO pin to get a value from
Returns
int Returns an int that represents either a digital or analog value

◆ getPinValue()

int Pins::getPinValue ( uint8_t  GPIO_Pin)

Get the pin value of a predefined pin.

Parameters
GPIO_PinThe GPIO pin to get a value from
Returns
int Returns an int that represents either a digital or analog value

◆ resetPhysicalPins()

void Pins::resetPhysicalPins ( )

Resets physical pins to their inital state.

This function sets pins as input/output and, if an output pin, sets them to their given init value. This is defined in PinConfig.def

◆ setInternalValue()

void Pins::setInternalValue ( uint8_t  Internal_Pin,
int  value 
)

Set the value of an internal pin.

These are fake pins that are usefully for sending gpio like values over canbus, See PinConfig.def for more info

Parameters
Internal_PinThe Internal pin to set
valueThe value to set the analog/digital pin to

◆ setPinValue()

void Pins::setPinValue ( uint8_t  GPIO_Pin,
int  value 
)

Set the pin value of a predefined pin.

Parameters
GPIO_PinThe GPIO pin to set
valueThe value to set the analog/digital pin to

◆ update()

void Pins::update ( void  )

Poll analog pin values.

Note
WIP