Browse Source

added more explanations to units

Ondřej Hruška 1 year ago
parent
commit
84523241b0
Signed by: Ondřej Hruška <ondra@ondrovo.com> GPG key ID: 2C5FD5035250423D
16 changed files with 73 additions and 62 deletions
  1. 3 7
      ch.gex_units.tex
  2. 1 1
      ch.hw_buses.tex
  3. 1 0
      ch.pc_software.tex
  4. 4 3
      ch.unit.adc.tex
  5. 3 4
      ch.unit.dac.tex
  6. 7 10
      ch.unit.di.tex
  7. 2 2
      ch.unit.do.tex
  8. 1 1
      ch.unit.fcap.tex
  9. 8 6
      ch.unit.i2c.tex
  10. 7 7
      ch.unit.npx.tex
  11. 1 5
      ch.unit.pwmdim.tex
  12. 23 7
      ch.unit.sipo.tex
  13. 5 5
      ch.unit.spi.tex
  14. 1 2
      ch.unit.touch.tex
  15. 6 2
      ch.unit.usart.tex
  16. BIN
      thesis.pdf

+ 3 - 7
ch.gex_units.tex View File

@@ -2,17 +2,15 @@
2 2
 
3 3
 This chapter describes all functional blocks (units) implemented in GEX, version 1.0. The term ``unit'' will be used here to refer to both unit types (drivers) or their instances where the distinction is not important.
4 4
 
5
-Each unit's description will be accompanied by a corresponding snippet from the configuration file, and a list of supported commands and events. The commands and events described here form the payload of TinyFrame messages 0x10 (Unit Request) and 0x11 (Unit Report), as described in section \ref{sec:unit_requests_reports}. The number in the first column of the command (or event) tables, marked as ``Code'', is the command number (or report type) used in the payload to identify how the message data should be treated.
5
+Each unit's description will be accompanied by a corresponding snippet from the configuration file, and a list of supported commands and events. The commands and events described here form the payload of TinyFrame messages 0x10 (Unit Request) and 0x11 (Unit Report), as described in section \ref{sec:unit_requests_reports}. 
6 6
 
7
-When the request or response payload is empty, it's omitted from the table. The same applies to commands with no response, in which case adding 0x80 to the command number triggers a SUCCESS response after the command is finished.
8
-
9
-\section{Naming Conventions and Common Principles}
7
+The number in the first column of the command (or event) tables, marked as ``Code'', is the command number (or report type) used in the payload to identify how the message data should be treated. When the request or response payload is empty, it's omitted from the table. The same applies to commands with no response, in which case adding 0x80 to the command number triggers a SUCCESS response after the command is finished.
10 8
 
11 9
 \subsection{Unit Naming}
12 10
 
13 11
 Unit types are named in uppercase (e.g. SPI, 1WIRE, NPX) in the INI file and in the list of units. Unit instances can be named in any way the user desires; using lowercase makes it easier to distinguish them from unit types. It is advisable to use descriptive names, e.g. not ``pin1'' but rather ``button''.
14 12
 
15
-\subsection{Packed Pin Access}
13
+\subsection{Packed Pin Access} \label{sec:packedpins}
16 14
 
17 15
 Several units facilitate an access to a group of GPIO pins, such as the digital input and output units, or the SPI unit's slave select pins. The STM32 microcontroller's ports have 16 pins each, most of which can be configured to one of several alternate functions (e.g. SPI, PWM outputs, ADC input). As a consequence, it's common to be left with a discontiguous group of pins after assigning all the alternate functions needed by an application.
18 16
 
@@ -24,8 +22,6 @@ Several units facilitate an access to a group of GPIO pins, such as the digital
24 22
 
25 23
 For instance, we could only have the pins 0, 1, 12--15 available on a \gls{GPIO} port. GEX provides a helpful abstraction to bridge the gaps in the port: The selected pins are packed together and represented, in commands and events, as a block of six pins (0x3F) instead of their original positions in the register (0xF003). This scheme is shown in figure \ref{fig:pin-packing}. The translation is done in the unit driver and works transparently, as if the block of pins had no gaps---all the referenced pins are updated simultaneously without glitches. Where pin numbers are used, the order in the packed word should be provided---in our example, that would be 0--5, counting from the least significant bit.
26 24
 
27
-\todo[inline]{Expand unit descriptions, add diagrams... (text was written before the tables and ini snippets were added)}
28
-
29 25
 % here are the unit sections, all following a common pattern
30 26
 \input{ch.unit.do}
31 27
 \input{ch.unit.di}

+ 1 - 1
ch.hw_buses.tex View File

@@ -130,7 +130,7 @@ Since 1-Wire is a proprietary protocol, there is a much smaller choice of availa
130 130
 
131 131
 \section{NeoPixel} \label{sec:theory-neo}
132 132
 
133
-NeoPixel is a marketing name of the \textbf{WS2812} and compatible intelligent \gls{LED} drivers that are commonly used in ``addressable \gls{LED} strips''. Details about the protocol may be found in the WS2812B datasheet \cite{neopixel-ds}. Those chips include the control logic, PWM drivers and the \gls{LED} diodes all in one 5$\times$5\,mm SMD package. 
133
+NeoPixel is a marketing name of the \textbf{WS2812} and compatible intelligent \gls{LED} drivers that are commonly used in ``addressable \gls{LED} strips''. Additional technical details about the chips and their protocol may be found in the WS2812B datasheet \cite{neopixel-ds}. Those chips include the control logic, PWM drivers and the \gls{LED} diodes all in one 5$\times$5\,mm SMD package. 
134 134
 
135 135
 The NeoPixel protocol is unidirectional, using only one data pin. The \gls{LED} drivers are chained together. Ones and zeros are encoded by pulses of a defined length on the data pin; after the color data was loaded into the \gls{LED} string, a longer "reset" pulse (low level) is issued by the bus master and the set colors are displayed. The timing constraints are listed in table \ref{fig:ws2812-dia}.
136 136
 

+ 1 - 0
ch.pc_software.tex View File

@@ -42,6 +42,7 @@ The unit classes wrap the command and event \gls{API} described in chapter \ref{
42 42
 
43 43
 An example Python program showing a pattern with the \gls{LED} matrix driver IS31FL3730 is presented below as an illustration of the library usage. A photo of the produced pattern can be seen in figure \ref{fig:pydemo}.
44 44
 
45
+\todo[inline]{add left line next to this listing}
45 46
 \begin{minted}{python}
46 47
 #!/bin/env python3
47 48
 import gex  

+ 4 - 3
ch.unit.adc.tex View File

@@ -1,10 +1,10 @@
1 1
 \section{ADC Unit}
2 2
 
3
-The analog/digital converter unit is one of the most complicated units implemented in the project. The unit can measure the voltage on an input pin, either as its immediate value, or averaged with exponential forgetting. Isochronous sampling is available as well: It's possible to capture a fixed-length block of data on demand, or as a response to a triggering condition on any of the enabled input pins. The \gls{ADC} must continuously sample the inputs to make the averaging and level based triggering possible; as a consequence, a pre-trigger buffer is available that can be read together with the block of samples following a trigger. The \gls{ADC} unit can also be switched to a continuous streaming mode.
4
-
5
-It's possible to activate any number of the 16 analog inputs of the \gls{ADC} peripheral simultaneously. The maximum continuous sampling frequency, which reaches 70\,ksps with one channel, lowers with an increasing number of enabled channels as the amount of data to transfer to the host increases.
3
+The analog/digital converter unit is one of the most complicated and powerful units implemented in the project. The unit can measure the voltage on an input pin, either as its immediate value, or averaged with exponential forgetting. Isochronous sampling is available as well: it is possible to capture a fixed-length block of data on demand, or as a response to a triggering condition on any of the enabled input pins. The \gls{ADC} must continuously sample the inputs to make the averaging and level based triggering possible; as a consequence, a pre-trigger buffer is available that can be read together with the block of samples following a trigger. The \gls{ADC} unit can also be switched to a continuous streaming mode, a block capture which continues indefinitely, until the host decides to stop the stream.
6 4
 
5
+It is possible to activate any number of the 16 analog inputs of the \gls{ADC} peripheral simultaneously, together with the internal input channels. The maximum continuous sampling frequency, which reaches 70\,ksps with one channel, lowers with an increasing number of enabled channels, as the amount of data to transfer host increases. Those high speeds are achievable in shorter block captures, taking advantage of the (configurable) data buffer. A streamed or too long block capture may be aborted after the buffer is exhausted.
7 6
 
7
+\todo[inline]{add a diagram}
8 8
 
9 9
 \subsection{ADC Configuration}
10 10
 
@@ -68,6 +68,7 @@ avg_factor=500
68 68
 	\end{cmdpld}
69 69
 \end{cmdlist}
70 70
 
71
+
71 72
 \subsection{ADC Commands}
72 73
 
73 74
 \begin{cmdlist}

+ 3 - 4
ch.unit.dac.tex View File

@@ -1,9 +1,8 @@
1 1
 \section{DAC Unit}
2 2
 
3
-The digital/analog unit works with the two-channel \gls{DAC} peripheral of the microcontroller. It can be used in two modes: \gls{DC} output, and waveform generation.
4
-
5
-The waveform mode implements direct digital synthesis (explained in section \ref{sec:theory-dac-dds}) of a sine, rectangle, sawtooth or triangle wave. The generated frequency can be set with a sub-hertz precision up to the lower tens of kHz. The two outputs can use a different waveform shape, be synchronized, and their phase offset, as well as frequency, is dynamically adjustable.
3
+The digital/analog unit works with the two-channel \gls{DAC} hardware peripheral. It can be used in two modes: \gls{DC} output, and waveform generation.
6 4
 
5
+The waveform mode implements direct digital synthesis (explained in section \ref{sec:theory-dac-dds}) of a sine, rectangle, sawtooth or triangle wave. The generated frequency can be set with a sub-hertz precision up to the lower tens of kHz. The two outputs can use a different waveform shape, can be synchronized, and their phase offset and frequency are dynamically adjustable.
7 6
 
8 7
 \subsection{DAC Configuration}
9 8
 
@@ -24,7 +23,7 @@ ch2_noise-level=3
24 23
 
25 24
 \subsection{DAC Commands}
26 25
 
27
-Channels are specified in all commands as bit map:
26
+Channels are specified in all commands as a bit map:
28 27
 
29 28
 \begin{itemize}[nosep]
30 29
 	\item 0x01 - channel 1

+ 7 - 10
ch.unit.di.tex View File

@@ -1,11 +1,8 @@
1 1
 \section{Digital Input}
2 2
 
3
-The digital input unit is the input counterpart of the digital output unit.
4
-
5
-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.
6
-
7
-The pin change event can be configured independently for each pin. In order to receive a pin change event, we must arme the pin first; it 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.
3
+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 report asynchronous events on a pin change. 
8 4
 
5
+All pins of the unit may be configured either for a rising, falling, or any change detection; due to a hardware limitation, the same pin number may not be used for event detection on different ports (e.g. A1 and B1) at the same time. In order to receive a pin change event, we must arm the pin first, using a command; it can be armed for a single event, or it may be re-armed automatically with a hold-off time. It is, further, possible to automatically arm selected pins on start-up, removing the need to arm them e.g. after the module restarts or is re-connected.
9 6
 
10 7
 \subsection{Digital Input Configuration}
11 8
 
@@ -14,17 +11,17 @@ The pin change event can be configured independently for each pin. In order to r
14 11
 # Port name
15 12
 port=A
16 13
 # Pins (comma separated, supports ranges)
17
-pins=0
14
+pins=10-8,3-0
18 15
 # Pins with pull-up
19
-pull-up=
16
+pull-up=10,9
20 17
 # Pins with pull-down
21
-pull-down=
18
+pull-down=0
22 19
 
23 20
 # Trigger pins activated by rising/falling edge
24
-trig-rise=
21
+trig-rise=10
25 22
 trig-fall=
26 23
 # Trigger pins auto-armed by default
27
-auto-trigger=
24
+auto-trigger=10
28 25
 # Triggers hold-off time (ms)
29 26
 hold-off=100
30 27
 \end{inicode}

+ 2 - 2
ch.unit.do.tex View File

@@ -1,6 +1,6 @@
1 1
 \section{Digital Output}
2 2
 
3
-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}
3
+The digital output unit provides a write access to one or more pins of a \gls{GPIO} port. This unit additionally supports pulse generation on any of its pins; this is implemented in software, with timing derived from the system timebase, in order to support pulses on all pins regardless of hardware \gls{PWM} support. Pins in commands are expressed in the packed format (\ref{sec:packedpins}).
4 4
 
5 5
 \subsection{Digital Output Configuration}
6 6
 
@@ -41,7 +41,7 @@ open-drain=
41 41
 	\end{cmdreq} \\
42 42
 
43 43
 	4 & \cname{PULSE}
44
-	Generate a pulse on the selected pins. The $\mu$s scale may be used only for 0--999\,$\mu$s.
44
+	Generate a pulse on the selected pins. The microsecond scale may be used only for 0--999\,$\mu$s.
45 45
 	& \begin{cmdreq}
46 46
 		\cfield{u16} pins to pulse
47 47
 		\cfield{u8} active level (0, 1)

+ 1 - 1
ch.unit.fcap.tex View File

@@ -3,7 +3,7 @@
3 3
 
4 4
 The frequency capture unit implements both the frequency measurement methods explained in section \ref{sec:theory-fcap}: direct and reciprocal.
5 5
 
6
-The unit has several operational modes: idle, reciprocal continuous, reciprocal burst, direct continuous, direct burst, free counting, and single pulse. Burst mode is an on-demand measurement with possible averaging. Continuous mode doesn't support averaging, but the latest measurement can be read at any time without a delay.
6
+The unit has several operational modes: idle, reciprocal continuous, reciprocal burst, direct continuous, direct burst, free counting, and single pulse. Burst mode is an on-demand measurement with optional averaging. Continuous mode doesn't support averaging, but the latest measurement can be read at any time without a delay.
7 7
 
8 8
 \subsection{Value Conversion Formulas}
9 9
 

+ 8 - 6
ch.unit.i2c.tex View File

@@ -1,6 +1,8 @@
1 1
 \section{\IIC Unit}
2 2
 
3
-The \gls{I2C} unit provides access to one of the microcontroller's \gls{I2C} peripherals. It can be configured to use either of the three speeds (Standard, Fast and Fast+) and supports both 10-bit and 7-bit addressing. 10-bit addresses can be used in commands by setting their highest bit (0x8000), as a flag to the unit.
3
+The \gls{I2C} unit provides access to one of the microcontroller's \gls{I2C} peripherals. More on the \IIC bus can be found in section \ref{sec:theory-i2c}.
4
+
5
+The unit can be configured to use either of the three standard speeds (Standard, Fast and Fast+) and supports both 10-bit and 7-bit addressing. 10-bit addresses can be used in commands by setting their highest bit (0x8000), as a flag to the unit; the 7 or 10 least significant bits will be used as the actual address.
4 6
 
5 7
 \subsection{\IIC Configuration}
6 8
 
@@ -26,25 +28,25 @@ digital-filter=0
26 28
 \begin{cmdlist}
27 29
 
28 30
 	0 & \cname{WRITE}
29
-	Raw write transaction
31
+	Perform a raw write transaction
30 32
 	& \begin{cmdreq}
31 33
 		\cfield{u16} slave address
32 34
 		\cfield{u8[]} bytes to write
33 35
 	\end{cmdreq} \\
34 36
 
35 37
 	1 & \cname{READ}
36
-	Raw read transaction
38
+	Perform a raw read transaction.
37 39
 	& \begin{cmdreq}
38 40
 		\cfield{u16} slave address
39 41
 		\cfield{u16} number of read bytes
40 42
     \end{cmdreq}
41
-\cjoin
43
+	\cjoin
42 44
     \begin{cmdresp}
43 45
 		\cfield{u8[]} received bytes
44 46
     \end{cmdresp} \\
45 47
 
46 48
 	2 & \cname{WRITE\_REG}
47
-	Write to a slave register. Sends the register number and the data in the same \gls{I2C} transaction. Multiple registers can be written to slaves supporting auto-increment.
49
+	Write to a slave register. Sends the register number and the data in the same transaction. Multiple registers can be written at once if the slave supports auto-increment.
48 50
 	& \begin{cmdreq}
49 51
 		\cfield{u16} slave address
50 52
 		\cfield{u8} register number
@@ -52,7 +54,7 @@ digital-filter=0
52 54
     \end{cmdreq} \\
53 55
 
54 56
 	3 & \cname{READ\_REG}
55
-	Read from a slave register. Writes the register number and issues a read transaction of the given length. Multiple registers can be read from slaves supporting auto-increment.
57
+	Read from a slave register. Writes the register number and issues a read transaction of the given length. Multiple registers can be read at once if the slave supports auto-increment.
56 58
 	& \begin{cmdreq}
57 59
 		\cfield{u16} slave address
58 60
 		\cfield{u8} register number

+ 7 - 7
ch.unit.npx.tex View File

@@ -1,8 +1,8 @@
1 1
 \section{NeoPixel Unit}
2 2
 
3
-The NeoPixel unit implements the protocol needed to control a digital \gls{LED} strip with WS2812, WS2811, or compatible \gls{LED} driver chips. The protocol timing is implemented in software, therefore it is available on any GPIO pin of the module.
3
+The NeoPixel unit implements the protocol needed to control a digital \gls{LED} strip with WS2812, WS2811, or compatible \gls{LED} driver chips. The NeoPixel protocol (explained in section \ref{sec:theory-neo}) is implemented in software, therefore it is available on any \gls{GPIO} pin of the module.
4 4
 
5
-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.
5
+The color data can be loaded in five different format: as packed bytes (3$\times$8 bits color), or as the little- or big-endian encoding of colors in a 32-bit format: 0x00RRGGBB or 0x00BBGGRR. The 32-bit format is convenient when the colors are already represented as an array of 32-bit integers, e.g. extracted from a screen capture or an image.
6 6
 
7 7
 \subsection{NeoPixel Configuration}
8 8
 
@@ -23,7 +23,7 @@ pixels=32
23 23
 	1 & \cname{LOAD}
24 24
 	Load a sequence of R,G,B bytes
25 25
 	& \begin{cmdreq}
26
-		\item For each LED:
26
+		\item For each \glspl{LED}:
27 27
 		\begin{pldlist}
28 28
 			\cfield{u8} red
29 29
 			\cfield{u8} green
@@ -34,25 +34,25 @@ pixels=32
34 34
 	4 & \cname{LOAD\_U32\_ZRGB}
35 35
 	Load 32-bit big-endian 0xRRGGBB (0,R,G,B)
36 36
 	& \begin{cmdreq}
37
-		\cfield{u32[]} color data BE
37
+		\cfield{u32[]} color data (big-endian)
38 38
 	\end{cmdreq} \\
39 39
 
40 40
 	5 & \cname{LOAD\_U32\_ZBGR}
41 41
 	Load 32-bit big-endian 0xBBGGRR (0,B,G,R)
42 42
 	& \begin{cmdreq}
43
-		\cfield{u32[]} color data BE
43
+		\cfield{u32[]} color data (big-endian)
44 44
 	\end{cmdreq} \\
45 45
 
46 46
 	6 & \cname{LOAD\_U32\_RGBZ}
47 47
 	Load 32-bit little-endian 0xBBGGRR (R,G,B,0)
48 48
 	& \begin{cmdreq}
49
-		\cfield{u32[]} color data LE
49
+		\cfield{u32[]} color data (little-endian)
50 50
 	\end{cmdreq} \\
51 51
 
52 52
 	7 & \cname{LOAD\_U32\_BGRZ}
53 53
 	Load 32-bit little-endian 0xRRGGBB (B,G,R,0)
54 54
 	& \begin{cmdreq}
55
-		\cfield{u32[]} color data LE
55
+		\cfield{u32[]} color data (little-endian)
56 56
 	\end{cmdreq} \\
57 57
 
58 58
 	10 & \cname{GET\_LEN}

+ 1 - 5
ch.unit.pwmdim.tex View File

@@ -1,10 +1,6 @@
1 1
 \section{PWM Unit}
2 2
 
3
-The \gls{PWM} unit uses a timer/counter to generate a \gls{PWM} signal. There are four outputs with a common frequency and phase, but independent duty cycles. Each channel can be individually enabled or disabled.
4
-
5
-This unit is intended for applications like light dimming, heater regulation, or the control of H-bridges.
6
-
7
-\todo[inline]{diagram, also show what is duty cycle}
3
+The \gls{PWM} unit uses a timer/counter to generate a \gls{PWM} (pulse train) signal. There are four outputs with a common frequency and independent duty cycles. Each channel can be individually enabled or disabled. This unit is intended for applications such as light dimming, heater regulation, or the control of H-bridges.
8 4
 
9 5
 \subsection{PWM Configuration}
10 6
 

+ 23 - 7
ch.unit.sipo.tex View File

@@ -1,8 +1,22 @@
1 1
 \section{SIPO (Shift Register) Unit}
2 2
 
3
-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.
3
+The shift registers driver unit is designed for the loading of data into serial-in/parallel-out (SIPO) shift registers, such as 74xx4094 or 74xx595. Those are commonly used to control segmented LED displays, LED user interfaces, etc. 
4 4
 
5
-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.
5
+Those devices may be daisy-chained: the output of one is connected to the input of another, sharing the same clock and other signals, and they work together as one longer shift register.
6
+
7
+A SIPO shift register has the following pins (possibly named differently with chips from different vendors):
8
+
9
+\begin{itemize}
10
+	\item \textit{Shift} -- \gls{SCK}; shifts the data in the register by one bit
11
+	\item \textit{Data In} -- \gls{MOSI}; serial data to load into the register
12
+	\item \textit{Data Out} -- output for daisy-chaining with other shift registers
13
+	\item \textit{Store} -- latches the current register data and shows it on the output
14
+	\item \textit{Clear} -- erases the latched data and clears the display
15
+\end{itemize}
16
+
17
+This unit automatically handles both the \textit{Shift} and \textit{Store} signals, provides access to the \textit{Clear} output, and is capable of loading multiple shift registers in parallel (an arrangement sometimes used instead of daisy-chaining). The polarity (active level) of all signals can be configured.
18
+
19
+It is, additionally, possible to set the data lines to arbitrary ``idle'' level(s) before sending the \textit{Store} pulse; this may be latched and used for some additional feature on the user interface, such as a brightness control.
6 20
 
7 21
 
8 22
 \subsection{SIPO Configuration}
@@ -25,9 +39,11 @@ data-pins=3
25 39
 
26 40
 \subsection{SIPO Commands}
27 41
 
42
+The WRITE and CLEAR\_DIRECT commands are the only ones normally used. The others provide manual control over all the output signals for debugging or testing.
43
+
28 44
 \begin{cmdlist}
29 45
 	0 & \cname{WRITE}
30
-	Load the shift registers and leave the data outputs in the ``trailing data'' state before sending the Store pulse.
46
+	Load the shift registers and leave the data outputs in the ``trailing data'' state before sending the \textit{Store} pulse.
31 47
 	&
32 48
 	\begin{cmdreq}
33 49
 		\cfield{u16} trailing data
@@ -39,7 +55,7 @@ data-pins=3
39 55
 	\\
40 56
 
41 57
 	1 & \cname{DIRECT\_DATA}
42
-	Directly write to the data pins (same like the DO unit's WRITE command)
58
+	Directly write to the data pin(s)
43 59
 	&
44 60
     \begin{cmdreq}
45 61
 		\cfield{u16} values to write
@@ -47,15 +63,15 @@ data-pins=3
47 63
 
48 64
 	2 &
49 65
 	\cname{DIRECT\_CLEAR}
50
-	Pulse the Clear pin, erasing the registers' data & \\
66
+	Pulse the \textit{Clear} pin & \\
51 67
 
52 68
 	3 &
53 69
 	\cname{DIRECT\_SHIFT}
54
-	Pulse the Shift pin & \\
70
+	Pulse the \textit{Shift} pin & \\
55 71
 
56 72
 	4 &
57 73
 	\cname{DIRECT\_STORE}
58
-	Pulse the Store pin & \\
74
+	Pulse the \textit{Store} pin & \\
59 75
 \end{cmdlist}
60 76
 
61 77
 

+ 5 - 5
ch.unit.spi.tex View File

@@ -1,10 +1,10 @@
1 1
 \section{SPI Unit}
2 2
 
3
-The \gls{SPI} unit provides access to one of the microcontroller's \gls{SPI} peripherals. It can be configured to use any of the different speeds, clock polarity and phase settings available in its control registers.
3
+The \gls{SPI} unit provides access to one of the microcontroller's \gls{SPI} peripherals. The unit can be configured to any of the hardware-supported speeds, clock polarity, and clock phase settings. Explanation of those options, including diagrams, can be found in section \ref{sec:theory-spi}.
4 4
 
5
-The unit handles up to 16 slave select (\gls{NSS}) signals and supports message multi-cast (addressing more than one slaves at once). Protection resistors should be used if a multi-cast transaction is issued with \gls{MISO} connected.
5
+The unit handles up to 16 slave select (\gls{NSS}) signals and supports message multi-cast (addressing more than one slaves at once). Protection resistors should be used if a multi-cast transaction is issued with \gls{MISO} connected to prevent a short circuit between slaves transmitting the opposite logical level.
6 6
 
7
-The QUERY command of this unit, illustrated by figure \ref{fig:spi_query}, is flexible enough to support all types of \gls{SPI} transactions: read-only, write-only, and read-write with different request and response lengths. The slave select pin is held low during the entire transaction.
7
+The QUERY command of this unit, illustrated by figure \ref{fig:spi_query}, is flexible enough to support all types of \gls{SPI} transactions: read-only, write-only, and read-write, with different request and response lengths and paddings. The slave select signal is asserted during the entire transaction.
8 8
 
9 9
 \begin{figure}[h]
10 10
 	\centering
@@ -42,7 +42,7 @@ pins=0
42 42
 
43 43
 \begin{cmdlist}
44 44
 	0 & \cname{QUERY}
45
-	Exchange bytes with a slave device
45
+	Exchange bytes with a slave device; see the diagram in figure \ref{fig:spi_query}
46 46
 	& \begin{cmdreq}
47 47
 		\cfield{u8} slave number 0--16
48 48
 		\cfield{u16} response padding
@@ -55,7 +55,7 @@ pins=0
55 55
 	\end{cmdresp} \\
56 56
 
57 57
 	1 & \cname{MULTICAST}
58
-	Send a message to multiple slaves at once. The address is a bit map (e.g. 0x8002 = slaves 1 and 15).
58
+	Send a message to multiple slaves at once. The ``addressed slaves'' word uses the packed pins format (\ref{sec:packedpins}).
59 59
 	& \begin{cmdreq}
60 60
 		\cfield{u16} addressed slaves
61 61
 		\cfield{u8[]} bytes to write

+ 1 - 2
ch.unit.touch.tex View File

@@ -1,7 +1,6 @@
1 1
 \section{Touch Sense Unit}
2 2
 
3
-The touch sensing unit provides an access to the \gls{TSC} peripheral. Its function is explained in section \ref{sec:theory-touch}. The unit configures the \gls{TSC} and reads the output values of each enabled touch pad.
4
-
3
+The touch sensing unit provides an access to the \gls{TSC} peripheral, explained in section \ref{sec:theory-touch}. The unit configures the \gls{TSC} and reads the output values of each enabled touch pad. Additionally, a threshold-based digital input function is implemented to make the emulation of touch buttons easier. The hysteresis and debounce time can be configured in the configuration file or set using a command. The threshold of individual pads must be set using a command.
5 4
 
6 5
 \subsection{Touch Sense Configuration}
7 6
 

+ 6 - 2
ch.unit.usart.tex View File

@@ -1,8 +1,12 @@
1 1
 \section{USART Unit}
2 2
 
3
-The \gls{USART} unit provides access to one of the microcontroller's \gls{USART} peripherals. All \gls{USART} parameters can be configured to match the application's needs. The peripheral is capable of driving RS485 transceivers with the \gls{DE} output for switching between reception and transmission.
3
+The \gls{USART} unit provides access to one of the microcontroller's \gls{USART} peripherals. See section \ref{sec:theory-usart} for more information about the interface.
4 4
 
5
-The unit implements asynchronous reception and transmission using DMA and a circular buffer. Received data is sent to the host in asynchronous events when either half of the buffer is filled, or after a fixed timeout from the last received byte.
5
+Most \gls{USART} parameters available in the hardware peripheral's configuration registers can be adjusted to match the application's needs. The peripheral is capable of driving RS-485 transceivers, using the \gls{DE} output for switching between reception and transmission.
6
+
7
+The unit implements asynchronous reception and transmission with \gls{DMA} and a circular buffer. Received data is sent to the host in asynchronous events when a half of the buffer is filled, or after a fixed timeout from the last received byte. The write access is, likewise, implemented using \gls{DMA}.
8
+
9
+\todo[inline]{add a diagram of the dma-based reception}
6 10
 
7 11
 \subsection{USART Configuration}
8 12
 

BIN
thesis.pdf View File