You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.4 KiB
52 lines
1.4 KiB
\section{Digital Output}
|
|
|
|
The digital output unit provides a write access to one or more pins of a GPIO port. This unit additionally supports pulse generation on any of its pins. This is implemented in software with the timing derived from the system timebase, as the hardware timer outputs, otherwise used for \gls{PWM} or pulse generation, are available only on several dedicated pins. The timing code is optimized to reduce jitter. \todo{Measure jitter and add it here}
|
|
|
|
\subsection{Digital Output Configuration}
|
|
|
|
\begin{inicode}
|
|
[DO:out@1]
|
|
# Port name
|
|
port=A
|
|
# Pins (comma separated, supports ranges)
|
|
pins=0
|
|
# Initially high pins
|
|
initial=
|
|
# Open-drain pins
|
|
open-drain=
|
|
\end{inicode}
|
|
|
|
\subsection{Digital Output Commands}
|
|
|
|
\begin{cmdlist}
|
|
|
|
0 & \cname{WRITE} Write to all pins
|
|
& \begin{cmdreq}
|
|
\cfield{u16} new value
|
|
\end{cmdreq} \\
|
|
|
|
1 & \cname{SET} Set selected pins to 1
|
|
& \begin{cmdreq}
|
|
\cfield{u16} pins to set
|
|
\end{cmdreq} \\
|
|
|
|
2 & \cname{CLEAR} Set selected pins to 0
|
|
& \begin{cmdreq}
|
|
\cfield{u16} pins to clear
|
|
\end{cmdreq} \\
|
|
|
|
3 & \cname{TOGGLE} Toggle selected pins
|
|
& \begin{cmdreq}
|
|
\cfield{u16} pins to toggle
|
|
\end{cmdreq} \\
|
|
|
|
4 & \cname{PULSE}
|
|
Generate a pulse on the selected pins. The $\mu$s scale may be used only for 0--999\,$\mu$s.
|
|
& \begin{cmdreq}
|
|
\cfield{u16} pins to pulse
|
|
\cfield{u8} active level (0, 1)
|
|
\cfield{u8} scale: 0-ms, 1-$\mu$s
|
|
\cfield{u16} duration
|
|
\end{cmdreq}
|
|
|
|
\end{cmdlist}
|
|
|