PicoLC Arduino Library
Arduino library for PicoLC hardware
Loading...
Searching...
No Matches
PicoLC Class Reference

Main interface to PicoLC hardware and shared runtime services. More...

#include <PicoLCClass.h>

Public Member Functions

 PicoLC ()
 Constructs the PicoLC interface and its child hardware objects.
void begin ()
 Initializes PicoLC hardware and child objects.
void update ()
 Advances PicoLC by one application scan.
uint32_t currentMillis () const
 Returns the timestamp captured for the current scan.
uint32_t cycles () const
 Returns the number of completed update cycles.
void enableOutputs ()
 Enables physical output-driver operation.
void disableOutputs ()
 Disables all physical output-driver channels.
bool outputsEnabled () const
 Reports whether physical outputs are globally enabled.
bool outputFault () const
 Reports the current output-driver fault indication.
void resetOutputDriver ()
 Resets the hardware output driver.
float supplyVoltage () const
 Measures the PicoLC supply voltage.

Public Attributes

PicoLCOutput Y0
 Hardware outputs Y0 through Y3.
PicoLCOutput Y1
PicoLCOutput Y2
PicoLCOutput Y3
PicoLCInput X0
 Hardware inputs X0 through X3.
PicoLCInput X1
PicoLCInput X2
PicoLCInput X3
PicoLCPair P0
 Paired-output controllers for Y0/Y1 and Y2/Y3.
PicoLCPair P1
PicoLCLED StatusLED
 Board indicator LEDs.
PicoLCLED CommLED
PicoLCLED FaultLED
PicoLCButton RunStopButton
 Board-defined control buttons.
PicoLCButton UserButton
PicoLCButton BootButton
PicoLCSerial Serial
 RS-485 serial interface.
PicoLCStorage Storage
 User-accessible nonvolatile storage.

Detailed Description

Main interface to PicoLC hardware and shared runtime services.

PicoLC owns the board inputs, outputs, output pairs, indicators, buttons, serial interface, and storage objects. It also provides the shared scan timestamp used throughout the API.

Call begin() once during setup(), configure the required hardware objects, then call update() once at the beginning of each loop() iteration.

Definition at line 25 of file PicoLCClass.h.

Constructor & Destructor Documentation

◆ PicoLC()

PicoLC::PicoLC()

Constructs the PicoLC interface and its child hardware objects.

Hardware initialization is deferred until begin() is called.

Definition at line 77 of file PicoLC.cpp.

Member Function Documentation

◆ begin()

void PicoLC::begin()

Initializes PicoLC hardware and child objects.

Call this once from setup() before configuring or using PicoLC inputs, outputs, LEDs, buttons, serial, storage, or output pairs.

Physical outputs remain disabled until enableOutputs() is called.

Definition at line 85 of file PicoLC.cpp.

◆ currentMillis()

uint32_t PicoLC::currentMillis()const

Returns the timestamp captured for the current scan.

The value changes only when update() is called and is shared by timed API components such as timers, input filters, pulses, and blink patterns.

Returns
Current scan timestamp in milliseconds.

Definition at line 171 of file PicoLC.cpp.

◆ cycles()

uint32_t PicoLC::cycles()const

Returns the number of completed update cycles.

Cycle zero represents initialization. The first call to update() advances the counter to one.

Returns
Current PicoLC scan count.

Definition at line 175 of file PicoLC.cpp.

◆ disableOutputs()

void PicoLC::disableOutputs()

Disables all physical output-driver channels.

Logical output states are preserved, and the output indicator LEDs continue to show the states that would otherwise be applied to the hardware outputs.

Definition at line 183 of file PicoLC.cpp.

◆ enableOutputs()

void PicoLC::enableOutputs()

Enables physical output-driver operation.

Logical output states and indicator LEDs continue to operate regardless of this setting. Enabling outputs permits the configured logical output states to reach the physical output terminals.

Definition at line 179 of file PicoLC.cpp.

◆ outputFault()

bool PicoLC::outputFault()const

Reports the current output-driver fault indication.

Returns
true when the hardware output driver reports a fault.

Definition at line 191 of file PicoLC.cpp.

◆ outputsEnabled()

bool PicoLC::outputsEnabled()const

Reports whether physical outputs are globally enabled.

Returns
true when logical output states are permitted to drive the physical output terminals.

Definition at line 187 of file PicoLC.cpp.

◆ resetOutputDriver()

void PicoLC::resetOutputDriver()

Resets the hardware output driver.

This operation resets the driver hardware without changing the logical output configuration or commanded states.

Definition at line 195 of file PicoLC.cpp.

◆ supplyVoltage()

float PicoLC::supplyVoltage()const

Measures the PicoLC supply voltage.

The value is sampled directly from the board VIN sense circuit when this method is called and is independent of update().

Returns
Measured supply voltage in volts.

Definition at line 199 of file PicoLC.cpp.

◆ update()

void PicoLC::update()

Advances PicoLC by one application scan.

update() captures the shared millisecond timestamp, increments the scan counter, samples and filters logical inputs and buttons, and advances timed LED and output behavior.

Call this once at the beginning of each loop() iteration. Logical output commands issued after the call are applied during a subsequent update().

Definition at line 121 of file PicoLC.cpp.

Member Data Documentation

◆ BootButton

PicoLCButton PicoLC::BootButton

Definition at line 54 of file PicoLCClass.h.

◆ CommLED

PicoLCLED PicoLC::CommLED

Definition at line 51 of file PicoLCClass.h.

◆ FaultLED

PicoLCLED PicoLC::FaultLED

Definition at line 51 of file PicoLCClass.h.

◆ P0

PicoLCPair PicoLC::P0

Paired-output controllers for Y0/Y1 and Y2/Y3.

Definition at line 48 of file PicoLCClass.h.

◆ P1

PicoLCPair PicoLC::P1

Definition at line 48 of file PicoLCClass.h.

◆ RunStopButton

PicoLCButton PicoLC::RunStopButton

Board-defined control buttons.

Definition at line 54 of file PicoLCClass.h.

◆ Serial

PicoLCSerial PicoLC::Serial

RS-485 serial interface.

Definition at line 57 of file PicoLCClass.h.

◆ StatusLED

PicoLCLED PicoLC::StatusLED

Board indicator LEDs.

Definition at line 51 of file PicoLCClass.h.

◆ Storage

PicoLCStorage PicoLC::Storage

User-accessible nonvolatile storage.

Definition at line 60 of file PicoLCClass.h.

◆ UserButton

PicoLCButton PicoLC::UserButton

Definition at line 54 of file PicoLCClass.h.

◆ X0

PicoLCInput PicoLC::X0

Hardware inputs X0 through X3.

Definition at line 45 of file PicoLCClass.h.

◆ X1

PicoLCInput PicoLC::X1

Definition at line 45 of file PicoLCClass.h.

◆ X2

PicoLCInput PicoLC::X2

Definition at line 45 of file PicoLCClass.h.

◆ X3

PicoLCInput PicoLC::X3

Definition at line 45 of file PicoLCClass.h.

◆ Y0

PicoLCOutput PicoLC::Y0

Hardware outputs Y0 through Y3.

Definition at line 42 of file PicoLCClass.h.

◆ Y1

PicoLCOutput PicoLC::Y1

Definition at line 42 of file PicoLCClass.h.

◆ Y2

PicoLCOutput PicoLC::Y2

Definition at line 42 of file PicoLCClass.h.

◆ Y3

PicoLCOutput PicoLC::Y3

Definition at line 42 of file PicoLCClass.h.


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