PicoLC Arduino Library
Arduino library for PicoLC hardware
Loading...
Searching...
No Matches
PicoLCTypes.h
1#pragma once
2
3/**
4 * @brief Selects the electrical drive configuration for a PicoLC output.
5 *
6 * The output mode determines how the output driver applies logical active and
7 * inactive states to the connected load. It is independent of PatternMode,
8 * which controls steady, pulse, and blink behavior.
9 *
10 * Physical output drive remains globally disabled until
11 * PicoLC::enableOutputs() is called.
12 */
13enum class OutputMode : uint8_t {
14 /** Drives the load from the positive supply when logically active. */
15 HighSide,
16
17 /** Drives the load toward ground when logically active. */
18 LowSide,
19
20 /** Actively drives both logical states. */
21 PushPull,
22
23 /**
24 * Places the output under the control of its associated PicoLCPair.
25 *
26 * An output in this mode should not be controlled independently.
27 */
28 Paired,
29};
30
31/**
32 * @brief Selects the timed behavior applied to a logical output command.
33 *
34 * Pulse and blink configuration values are retained when changing modes.
35 * PWM duty is applied while the output pattern is active.
36 */
37enum class PatternMode : uint8_t {
38 /** The logical state is applied continuously. */
39 Steady,
40
41 /**
42 * A true command starts or restarts a fixed-duration pulse.
43 *
44 * The logical state returns to false immediately after the pulse is
45 * triggered, while the timed pulse continues internally. Writing false
46 * stops an active pulse immediately.
47 */
48 Pulse,
49
50 /**
51 * A true logical state enables a repeating on/off pattern.
52 *
53 * A false-to-true transition starts a new blink cycle in the on phase.
54 * Writing false stops blinking and disables the output immediately.
55 */
56 Blink
57};
58
59enum class PairMode : uint8_t {
60 Coast = 0b00,
61 Reverse = 0b01,
62 Forward = 0b10,
63 Brake = 0b11
64};
65
66enum class TimerMode : uint8_t {
67 TON,
68 TOF,
69 TP
70};
71