PicoLC Arduino Library Arduino library for PicoLC hardware |
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. | |
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.
| 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.
| 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.
| 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.
Definition at line 171 of file PicoLC.cpp.
| 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.
Definition at line 175 of file PicoLC.cpp.
| 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.
| 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.
| bool PicoLC::outputFault | ( | ) | const |
Reports the current output-driver fault indication.
Definition at line 191 of file PicoLC.cpp.
| bool PicoLC::outputsEnabled | ( | ) | const |
Reports whether physical outputs are globally enabled.
Definition at line 187 of file PicoLC.cpp.
| 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.
| 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().
Definition at line 199 of file PicoLC.cpp.
| 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.
| PicoLCButton PicoLC::BootButton |
Definition at line 54 of file PicoLCClass.h.
| PicoLCLED PicoLC::CommLED |
Definition at line 51 of file PicoLCClass.h.
| PicoLCLED PicoLC::FaultLED |
Definition at line 51 of file PicoLCClass.h.
| PicoLCPair PicoLC::P0 |
Paired-output controllers for Y0/Y1 and Y2/Y3.
Definition at line 48 of file PicoLCClass.h.
| PicoLCPair PicoLC::P1 |
Definition at line 48 of file PicoLCClass.h.
| PicoLCButton PicoLC::RunStopButton |
Board-defined control buttons.
Definition at line 54 of file PicoLCClass.h.
| PicoLCSerial PicoLC::Serial |
RS-485 serial interface.
Definition at line 57 of file PicoLCClass.h.
| PicoLCLED PicoLC::StatusLED |
Board indicator LEDs.
Definition at line 51 of file PicoLCClass.h.
| PicoLCStorage PicoLC::Storage |
User-accessible nonvolatile storage.
Definition at line 60 of file PicoLCClass.h.
| PicoLCButton PicoLC::UserButton |
Definition at line 54 of file PicoLCClass.h.
| PicoLCInput PicoLC::X0 |
Hardware inputs X0 through X3.
Definition at line 45 of file PicoLCClass.h.
| PicoLCInput PicoLC::X1 |
Definition at line 45 of file PicoLCClass.h.
| PicoLCInput PicoLC::X2 |
Definition at line 45 of file PicoLCClass.h.
| PicoLCInput PicoLC::X3 |
Definition at line 45 of file PicoLCClass.h.
| PicoLCOutput PicoLC::Y0 |
Hardware outputs Y0 through Y3.
Definition at line 42 of file PicoLCClass.h.
| PicoLCOutput PicoLC::Y1 |
Definition at line 42 of file PicoLCClass.h.
| PicoLCOutput PicoLC::Y2 |
Definition at line 42 of file PicoLCClass.h.
| PicoLCOutput PicoLC::Y3 |
Definition at line 42 of file PicoLCClass.h.