parent
77b4ef66b1
commit
dabde5fd03
@ -1,7 +1,78 @@ |
|||||||
\section{Digital Input Unit} |
\section{DI: Digital Input} |
||||||
|
|
||||||
The digital input unit is the input counterpart of the digital output unit. |
The digital input unit is the input counterpart of the digital output unit. |
||||||
|
|
||||||
In addition to reading the immediate digital levels of the selected pins, this unit can generate asynchronous events on a pin change. The state of the entire input port, together with a microsecond timestamp (as is the case for all asynchronous events), is reported to the host either on a rising, falling, or any pin change. |
In addition to reading the immediate digital levels of the selected pins, this unit can generate asynchronous events on a pin change. The state of the entire input port, together with a microsecond timestamp (as is the case for all asynchronous events), is reported to the host either on a rising, falling, or any pin change. |
||||||
|
|
||||||
The pin change event can be configured independently for each pin. In order to receive a pin change event, it must be armed first; The pin can be armed for a single event, or it may be re-armed automatically with a hold-off time. It's further possible to automatically arm selected pin triggers on start-up. |
The pin change event can be configured independently for each pin. In order to receive a pin change event, it must be armed first; The pin can be armed for a single event, or it may be re-armed automatically with a hold-off time. It's further possible to automatically arm selected pin triggers on start-up. |
||||||
|
|
||||||
|
|
||||||
|
\subsection{DI Configuration} |
||||||
|
|
||||||
|
\begin{inicode} |
||||||
|
[DI:in@2] |
||||||
|
# Port name |
||||||
|
port=A |
||||||
|
# Pins (comma separated, supports ranges) |
||||||
|
pins=0 |
||||||
|
# Pins with pull-up |
||||||
|
pull-up= |
||||||
|
# Pins with pull-down |
||||||
|
pull-down= |
||||||
|
|
||||||
|
# Trigger pins activated by rising/falling edge |
||||||
|
trig-rise= |
||||||
|
trig-fall= |
||||||
|
# Trigger pins auto-armed by default |
||||||
|
auto-trigger= |
||||||
|
# Triggers hold-off time (ms) |
||||||
|
hold-off=100 |
||||||
|
\end{inicode} |
||||||
|
|
||||||
|
\subsection{DI Events} |
||||||
|
|
||||||
|
\begin{tabularx}{\textwidth}{p{\fldwcode}lXp{\fldwpld}} |
||||||
|
\toprule |
||||||
|
\textbf{Code} & \textbf{Name} & \textbf{Meaning} & \textbf{Payload} \\ |
||||||
|
\midrule |
||||||
|
|
||||||
|
0x00 & PIN\_CHANGE & A pin change event. The payload includes a snapshot of all configured pins captured immediately after the change was registered. |
||||||
|
& \makecell[tl]{ |
||||||
|
\fld{u16} changed pins \\ |
||||||
|
\fld{u16} port snapshot |
||||||
|
} \\ |
||||||
|
\bottomrule |
||||||
|
\end{tabularx} |
||||||
|
|
||||||
|
\subsection{DI Commands} |
||||||
|
|
||||||
|
\begin{tabularx}{\textwidth}{p{\fldwcode}lXp{\fldwpld}} |
||||||
|
\toprule |
||||||
|
\textbf{Code} & \textbf{Name} & \textbf{Function} & \textbf{Payload} \\ |
||||||
|
\midrule |
||||||
|
|
||||||
|
0x00 & READ & Read the pins |
||||||
|
& \makecell[tl]{ |
||||||
|
\fldresp |
||||||
|
\fld{u16} pin states |
||||||
|
} \\ |
||||||
|
|
||||||
|
0x01 & ARM\_SINGLE & Arm for a single event |
||||||
|
& \makecell[tl]{ |
||||||
|
\fldreq |
||||||
|
\fld{u16} pins to arm |
||||||
|
} \\ |
||||||
|
|
||||||
|
0x02 & ARM\_AUTO & Arm with automatic re-arming after each event |
||||||
|
& \makecell[tl]{ |
||||||
|
\fldreq |
||||||
|
\fld{u16} pins to arm |
||||||
|
} \\ |
||||||
|
|
||||||
|
0x03 & DISARM & Dis-arm selected pins |
||||||
|
& \makecell[tl]{ |
||||||
|
\fldreq |
||||||
|
\fld{u16} pins to dis-arm |
||||||
|
} \\ |
||||||
|
\bottomrule |
||||||
|
\end{tabularx} |
||||||
|
@ -1,6 +1,71 @@ |
|||||||
|
\section{NPX: NeoPixel} |
||||||
|
|
||||||
|
The NeoPixel unit implements the protocol needed to control a digital LED strip with WS2812, WS2811, or compatible LED driver chips. The protocol timing is implemented in software, therefore it is available on any GPIO pin of the module. |
||||||
|
|
||||||
|
The color data can be loaded in five different format: as packed bytes, or as the little-endian or big-endian encoding of colors in the 32-bit format 0x00RRGGBB or 0x00BBGGRR. This data format is convenient when the colors are already represented by an array of 32-bit integers. |
||||||
|
|
||||||
|
\subsection{NPX Configuration} |
||||||
|
|
||||||
|
\begin{inicode} |
||||||
|
[NPX:neo@3] |
||||||
|
# Data pin |
||||||
|
pin=A0 |
||||||
|
# Number of pixels |
||||||
|
pixels=32 |
||||||
|
\end{inicode} |
||||||
|
|
||||||
|
\subsection{NPX Events} |
||||||
|
|
||||||
|
This unit generates no events. |
||||||
|
|
||||||
|
\subsection{NPX Commands} |
||||||
|
|
||||||
|
\begin{tabularx}{\textwidth}{p{\fldwcode}lXp{\fldwpld}} |
||||||
|
\toprule |
||||||
|
\textbf{Code} & \textbf{Name} & \textbf{Function} & \textbf{Payload} \\ |
||||||
|
\midrule |
||||||
|
|
||||||
|
0x00 & CLEAR & Switch all LEDs off (sets them to black) & \\ |
||||||
|
0x01 & LOAD & Load a sequence of R,G,B bytes |
||||||
|
& \makecell[tl]{ |
||||||
|
\fldreq |
||||||
|
\tabitem For each LED: \\ |
||||||
|
~~\fldo{u8} red \\ |
||||||
|
~~\fldo{u8} green \\ |
||||||
|
~~\fldo{u8} blue \\ |
||||||
|
} \\ |
||||||
|
|
||||||
|
0x08 & LOAD\_U32\_ZRGB & Load 32-bit big-endian 0xRRGGBB (0,R,G,B) |
||||||
|
& \makecell[tl]{ |
||||||
|
\fldreq |
||||||
|
\fld{u32[]} color data BE |
||||||
|
} \\ |
||||||
|
|
||||||
|
0x09 & LOAD\_U32\_ZBGR & Load 32-bit big-endian 0xBBGGRR (0,B,G,R) |
||||||
|
& \makecell[tl]{ |
||||||
|
\fldreq |
||||||
|
\fld{u32[]} color data BE |
||||||
|
} \\ |
||||||
|
|
||||||
|
0x0A & LOAD\_U32\_RGBZ & Load 32-bit little-endian 0xBBGGRR (R,G,B,0) |
||||||
|
& \makecell[tl]{ |
||||||
|
\fldreq |
||||||
|
\fld{u32[]} color data LE |
||||||
|
} \\ |
||||||
|
|
||||||
|
0x0B & LOAD\_U32\_BGRZ & Load 32-bit little-endian 0xRRGGBB (B,G,R,0) |
||||||
|
& \makecell[tl]{ |
||||||
|
\fldreq |
||||||
|
\fld{u32[]} color data LE |
||||||
|
} \\ |
||||||
|
|
||||||
|
0x10 & GET\_LEN & Get number of LEDs in the strip |
||||||
|
& \makecell[tl]{ |
||||||
|
\fldresp |
||||||
|
\fld{u16} number of LEDs |
||||||
|
} \\ |
||||||
|
\bottomrule |
||||||
|
\end{tabularx} |
||||||
|
|
||||||
\section{NeoPixel Unit} |
|
||||||
|
|
||||||
The NeoPixel unit implements the protocol needed to control a digital LED strip with WS2812, WS2811, or compatible LED driver chips. The protocol timing is implemented in software, therefore it is available on any GPIO pin of the module. The unit accepts sequences of RGB color values from the host and loads them into the LED strip. |
|
||||||
|
|
||||||
|
@ -1,5 +1,58 @@ |
|||||||
\section{Shift Registers Driver Unit} |
\section{SIPO: Shift Registers Driver} |
||||||
|
|
||||||
The shift registers driver unit is designed for the loading of data into \textit{serial-in, parallel-out} (SIPO) shift registers, such as 74HC4094 or 74HC595. Those are commonly used to control segmented LED displays, LED matrices etc. |
The shift registers driver unit is designed for the loading of data into \textit{serial-in, parallel-out} (SIPO) shift registers, such as 74HC4094 or 74HC595. Those are commonly used to control segmented LED displays, LED matrices etc. |
||||||
|
|
||||||
This unit handles both the \textit{Shift} and \textit{Store} signals and is capable of loading multiple shift registers simultaneously, reducing visible glitches in the display. It's also possible to set the data lines to arbitrary level(s) before sending the Store pulse, which can be latched and used for some additional feature of the LED display, such as brightness control. |
This unit handles both the \textit{Shift} and \textit{Store} signals and is capable of loading multiple shift registers simultaneously, reducing visible glitches in the display. It's also possible to set the data lines to arbitrary level(s) before sending the Store pulse, which can be latched and used for some additional feature of the LED display, such as brightness control. |
||||||
|
|
||||||
|
|
||||||
|
\subsection{SIPO Configuration} |
||||||
|
|
||||||
|
\begin{inicode} |
||||||
|
[SIPO:display@9] |
||||||
|
# Shift pin & its active edge (1-rising,0-falling) |
||||||
|
shift-pin=A1 |
||||||
|
shift-pol=1 |
||||||
|
# Store pin & its active edge |
||||||
|
store-pin=A0 |
||||||
|
store-pol=1 |
||||||
|
# Clear pin & its active level |
||||||
|
clear-pin=A2 |
||||||
|
clear-pol=0 |
||||||
|
# Data port and pins |
||||||
|
data-port=A |
||||||
|
data-pins=3 |
||||||
|
\end{inicode} |
||||||
|
|
||||||
|
\subsection{SIPO Events} |
||||||
|
|
||||||
|
This unit generates no events. |
||||||
|
|
||||||
|
\subsection{SIPO Commands} |
||||||
|
|
||||||
|
\begin{tabularx}{\textwidth}{p{\fldwcode}lXp{\fldwpld}} |
||||||
|
\toprule |
||||||
|
\textbf{Code} & \textbf{Name} & \textbf{Function} & \textbf{Payload} \\ |
||||||
|
\midrule |
||||||
|
|
||||||
|
0x00 & WRITE & Load the shift registers and leave the data outputs in the "trailing data" state before sending the Store pulse. |
||||||
|
& \makecell[tl]{ |
||||||
|
\fldreq |
||||||
|
\fld{u16} trailing data \\ |
||||||
|
\tabitem For each output: \\ |
||||||
|
~~\fldo{u8[]} data to load |
||||||
|
} \\ |
||||||
|
|
||||||
|
0x01 & DIRECT\_DATA & Directly write to the data pins (same like the DO unit's WRITE command) |
||||||
|
& \makecell[tl]{ |
||||||
|
\fldreq |
||||||
|
\fld{u16} values to write |
||||||
|
} \\ |
||||||
|
|
||||||
|
0x02 & DIRECT\_CLEAR & Pulse the Clear pin, erasing the registers' data & \\ |
||||||
|
0x03 & DIRECT\_SHIFT & Pulse the Shift pin & \\ |
||||||
|
0x04 & DIRECT\_STORE & Pulse the Store pin & \\ |
||||||
|
\bottomrule |
||||||
|
\end{tabularx} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,14 @@ |
|||||||
|
|
||||||
\section{USART Unit} |
\section{USART Unit} |
||||||
|
|
||||||
The USART unit provides access to one of the microcontroller's USART peripherals. All USART parameters can be configured to match the application's needs. |
The USART unit provides access to one of the microcontroller's USART peripherals. All USART parameters can be configured to match the application's needs. |
||||||
|
|
||||||
The clock output and hardware flow control may be enabled, as well as the Driver Enable (DE) output used by RS485 transceivers to switch between a reception and transmission mode. |
The clock output and hardware flow control may be enabled, as well as the Driver Enable (DE) output used by RS485 transceivers to switch between a reception and transmission mode. |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue