some more nitpicks

master
Ondřej Hruška 6 years ago
parent 759bf91485
commit 88b30c2ba4
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 6
      ch.discussion.tex
  2. 4
      ch.fw_structure_toplevel.tex
  3. 52
      ch.pc_software.tex
  4. 4
      ch.summary.tex
  5. 2
      ctuth-templates.tex
  6. 19
      document_config.tex
  7. 4
      pre.ctuthesis_config.tex
  8. 12
      thesis.abstract.tex
  9. BIN
      thesis.pdf

@ -1,6 +1,6 @@
\chapter{Discussion}
The objective of this work was to develop an extensible platform allowing the user to interact with hardware modules and circuitry from high-level applications running on their \gls{PC}, or, to rephrase it, to ``bring the Raspberry Pi GPIO header to the \gls{PC}''. It was important to design the platform in such a way that a user without much experience with embedded electronics and low level circuitry could still use it with a reasonable level of comfort and confidence.
The objective of this work was to develop an extensible platform allowing the user to interact with hardware modules and circuitry from high-level applications running on their \gls{PC}, in other words, to ``bring the Raspberry Pi GPIO header to the \gls{PC}''. It was important to design the platform in such a way that a user without much experience with embedded electronics and low level circuitry could still use it with a reasonable level of comfort and confidence.
\section{Solution Summary}
@ -12,7 +12,7 @@ The initial version of the project presented in this paper provides access to di
We developed a transaction-based binary protocol that is used by all three communication interfaces. As the implementation of the protocol would be an inconvenience for the user, we also developed software libraries in languages C and Python that implement it and provide high level access to the hardware module. It has been tested and verified that the Python library can be used from MATLAB scripts, should the user need MATLAB, e.g., for data processing or visualization.
To make the devices easy to reconfigure for the user, the configuration options---such as, which features to enable and what pins to use for them---are represented by entries in INI configuration files. The user can access these files through a virtual mass storage with an emulated FAT16 file system presented to the host \gls{PC} on the \gls{USB} port. Because the file system emulation relies on a certain pattern of behavior from the host, it may not work well in all cases. This is mitigated by providing a programmatic access to the configuration files also through the communication interface.
To make the devices easy to reconfigure for the user, the configuration options---such as, which features to enable and what pins to use for them---are represented by entries in INI configuration files. The user can access these files through a virtual mass storage with an emulated FAT16 file system presented to the host \gls{PC} on the \gls{USB} port. Because the file system emulation relies on a certain pattern of behavior from the host, it may not work well in all cases. This is mitigated by making the files accessible also through the communication interface.
\section{Results and Possible Applications}
@ -46,7 +46,7 @@ Future development of the project might focus on expanding the number of support
The client libraries need to be tested on other operating systems, and the C library may be expanded to provide a higher level of comfort to the user. The library could be ported to more programming languages, such as Java or \CS, and graphical applications could be developed to make the device more approachable to users less familiar with programming.
GEX Zero, with the Raspberry Pi Zero form factor, introduced the possibility of using Raspberry Pi add-on boards. It would be interesting to test the compatibility with more such existing boards, and further to explore the possibility of designing custom ones. An add-on board could, for instance, provide access to the \gls{DALI} bus, RS-485, \gls{CAN}, or Ethernet.
GEX Zero, with the Raspberry Pi Zero form factor, introduced the possibility of using Raspberry Pi add-on boards. It would be interesting to test the compatibility with more such existing boards, and further to explore the possibility of designing custom ones. An add-on board could, for instance, add access to the \gls{DALI} bus, RS-485, \gls{CAN}, or Ethernet.

@ -58,9 +58,9 @@ The \gls{USB} connection is always enabled first on start-up. GEX waits its for
GEX is a platform providing access to low-level hardware to high-level applications. However, this ``high level'' is relative. As was shown in \cref{fig:conceptual}, the ``GEX stack'' ends with a \textit{client library}, a software library used by the \textit{user application}.
The communication protocol (one level lower in the diagram) is robust and well defined, making it possible to implement alternative client libraries in other programming languages, or for yet-unsupported platforms. This protocol is explained in \cref{sec:tinyframe}. The client library implements the communication protocol and gives the user application access to GEX units via \textit{unit handles}.
The communication protocol (one level lower in the diagram), which will be explained in \cref{sec:tinyframe}, may be implemented as part of the client library in any programming language and on any platform; in theory, it is even possible to control GEX from another microcontroller. The client library implements, besides the protocol itself, other higher-level logic, and gives the user access to individual units using an abstraction called \textit{unit handles}.
Any logic above the client library is in the hands of the user, which means that, to use GEX, they have to program a user application. Software libraries in languages C and Python are provided, and will be explained in \cref{sec:clientsw}. The Python library is easy to use even for beginner programmers, though we have to acknowledge that some users might not be familiar with programming at all. Making GEX more accessible to those users, e.g., through a graphical desktop application, is an appealing idea that is certainly worth pursuing in later work.
Any logic above the client library is in the hands of the user, which means that, to use GEX, they have to program a user application. Proof-of-concept client libraries in languages C and Python are provided for this purpose, and will be explained in \cref{sec:clientsw}.
\section{Device Configuration}

@ -49,27 +49,27 @@ An example Python program displaying a test pattern on a \gls{LED} matrix using
\begin{listing}[h]
\begin{pythoncode}
#!/bin/env python3
# The I2C unit, called 'i2c', is configured to use PB6 and PB7
import gex
with gex.Client(gex.TrxRawUSB()) as client:
bus = gex.I2C(client, 'i2c')
addr = 0x61
bus.write_reg(addr, 0x00, 0b00011000) # dual matrix
bus.write_reg(addr, 0x0D, 0b00001110) # 34 mA
bus.write_reg(addr, 0x19, 64) # set brightness
# matrix 1
bus.write_reg(addr, 0x01, [
0xAA, 0x55, 0xAA, 0x55,
0xAA, 0x55, 0xAA, 0x55
])
# matrix 2
bus.write_reg(addr, 0x0E, [
0xFF, 0x00, 0xFF, 0x00,
0xFF, 0x00, 0xFF, 0x00
])
# update display
bus.write_reg(addr, 0x0C, 0x01)
#!/bin/env python3
# The I2C unit, called 'i2c', is configured to use PB6 and PB7
import gex
with gex.Client(gex.TrxRawUSB()) as client:
bus = gex.I2C(client, 'i2c')
addr = 0x61
bus.write_reg(addr, 0x00, 0b00011000) # dual matrix
bus.write_reg(addr, 0x0D, 0b00001110) # 34 mA
bus.write_reg(addr, 0x19, 64) # set brightness
# matrix 1
bus.write_reg(addr, 0x01, [
0xAA, 0x55, 0xAA, 0x55,
0xAA, 0x55, 0xAA, 0x55
])
# matrix 2
bus.write_reg(addr, 0x0E, [
0xFF, 0x00, 0xFF, 0x00,
0xFF, 0x00, 0xFF, 0x00
])
# update display
bus.write_reg(addr, 0x0C, 0x01)
\end{pythoncode}
\caption{\label{lst:py_api} An example Python program using the GEX client library}
\end{listing}
@ -98,8 +98,7 @@ The example in \cref{lst:matlab_api} demonstrates the use of MATLAB to calculate
client = py.gex.Client(trx);
adc = py.gex.ADC(client, 'adc');
L = 1000;
Fs = 1000;
L = 1000; Fs = 1000;
adc.set_sample_rate(uint32(Fs)); % casting to unsigned integer
data = adc.capture(uint32(L));
data = double(py.array.array('f',data)); % numpy array to matlab format
@ -135,13 +134,11 @@ This low-level library is intended for applications where the performance of the
GexClient *gex = GEX_Init("/dev/ttyACM0", 200);
assert(NULL != gex);
GexUnit *bus = GEX_GetUnit(gex, "i2c", "I2C");
assert(NULL != bus);
assert(NULL != bus);
// Configure the matrix driver
GEX_Send(bus, 2, (uint8_t*) "\x61\x00\x00\x18", 4);
GEX_Send(bus, 2, (uint8_t*) "\x61\x00\x0d\x0e", 4);
GEX_Send(bus, 2, (uint8_t*) "\x61\x00\x19\x40", 4);
GEX_Send(bus, 2, (uint8_t*) "\x61\x00\x19\x40", 4);
// Load data
GEX_Send(bus, 2, (uint8_t*) "\x61\x00\x01"
"\xAA\x55\xAA\x55\xAA\x55\xAA\x55", 11);
@ -185,6 +182,7 @@ This low-level library is intended for applications where the performance of the
The structure-based method utilizes C structs to access individual fields in the payload. Simple payloads can be represented by a struct without problems, but payloads of a dynamic length pose a challenge; we can either define a new struct for each required length, or, when the variable-length array is located at the end of the payload, a struct with the largest needed payload size is defined and the real length is then specified when sending the message. The latter approach is illustrated in \cref{lst:c_api_struct}.
\vfill\newpage
\subsection{Using the Payload Builder Utility}
\begin{listing}

@ -1,8 +1,8 @@
\chapter{Conclusion}
We have developed an open-source software and hardware platform providing access to \gls{GPIO} pins, hardware buses, and signal acquisition and generation functions controlled by high-level user applications running on a \gls{PC}.
We have developed an open-source software and hardware platform providing high-level user applications running on a \gls{PC} with access to \gls{GPIO} pins, hardware buses, and signal acquisition and generation functions.
The platform consists of a FreeRTOS-based firmware for the STM32F072 microcontroller, three prototype hardware modules, and support software libraries in programming languages C and Python, the latter also compatible with MATLAB. The firmware may be used with the custom hardware, or with existing STM32 development boards.
The platform consists of a FreeRTOS-based firmware for the STM32F072 microcontroller, custom hardware modules, and support software libraries for programming languages C and Python, the latter also compatible with MATLAB. The firmware may be used with the custom hardware, or with existing STM32 development boards.
The devices are connected to the \gls{PC} by one of three interfaces: \gls{USB} as a virtual COM port or with raw endpoint access, a hardware \gls{UART}, or a radio link with the nRF24L01+ transceiver. Configuration is performed by editing INI files exposed in an emulated FAT16 file system through the \gls{USB} connection, or programmatically.

@ -180,7 +180,7 @@
\ctutemplate{twocolumn.abstract.in.titlelanguage}
%\newpage %CHANGED!!
\vspace{3cm} % ADDED!
\vspace{1cm} % ADDED!
\ctutemplate{twocolumn.abstract.in.secondlanguage}
\clearpage

@ -1,21 +1,23 @@
% extra balíky a jejich nastavení
% this fixes a latex bug with 'not enough writes'
\usepackage{morewrites}
\usepackage{calc}
\usepackage{calc} % fixes calculations in width params not working right
\usepackage{todonotes} % todos
\usepackage{blindtext} % lorem
\usepackage{csquotes} % quotes
\usepackage{wrapfig}
\usepackage{csquotes} % some macros for nice quotes or whatever
\usepackage{wrapfig} % figs floating next to text
\usepackage{svg}
\svgpath{img/}
\usepackage[all]{nowidow} % fix for orphaned lines of text
\usepackage{fancyvrb}
\usepackage{siunitx}
\usepackage{siunitx} % this was not used, but should have been
\usepackage{sectsty}
\usepackage{titlecaps}
\usepackage{cprotect}
\usepackage{cprotect} % this is for some hacks with math in caption or whatever
\usepackage{framed}
\usepackage{subcaption}
@ -24,10 +26,10 @@
\usepackage{longtable}
\usepackage{tabu} % longtabu
\usepackage{pmboxdraw}
\usepackage{pmboxdraw} % ???
\usepackage{xcolor}
\definecolor{RubineRed}{HTML}{C30067}
\definecolor{RubineRed}{HTML}{C30067} % used in command tables bc it's pretty
\usepackage{flafter} % ensures embeds won't go before their references
\usepackage{enumitem} % better list spacing
@ -37,6 +39,7 @@
\usepackage{tabto} % tabs, but kinda buggy
\usepackage{ragged2e} % this was supposed to improve text alignment
% typesetting C# lol
\newcommand{\CS}{C\nolinebreak\hspace{-.05em}\raisebox{.4ex}{\scriptsize\bf \#}}
% some symbols. skip integrals because asmmath also defines them and is loaded by the thesis class
@ -110,7 +113,7 @@
}
% this moves table captions above the float, which is apparently The Way to Do It
\usepackage{float}
\floatstyle{plaintop}
\restylefloat{table}

@ -25,8 +25,8 @@
%specification-file = {zadani-doc.pdf},
%specification-file = {zadani-doc.pdf},
%
keywords-czech = {},
keywords-english = {},
keywords-czech = {STM32, hardware, vestavěné systémy, elektronika, automatizace, USB, sběr dat},
keywords-english = {STM32, hardware design, electronics, embedded, automation, USB, data acquisition, gateway, wireless},
%
day = 0, % ???
month = 0, % ???

@ -1,19 +1,19 @@
% Abstrakt
\begin{abstract-english}
This thesis documents the development of a general-purpose software and hardware platform for the interfacing of low-level hardware from high-level programming languages and applications run on the PC, using USB and also wirelessly.
This thesis documents the development of a universal software and hardware platform providing high-level user applications running on a PC with access to GPIO pins, hardware buses, and signal acquisition and generation functions, using a USB, USART, or wireless connection.
The requirements of common engineering tasks and problems occurring in the university environment were evaluated to design an extensible, reconfigurable hardware module that would make a practical, versatile, and low-cost tool that in some cases eliminates the need for professional measurement and testing equipment.
The requirements of common engineering tasks and problems occurring in the university environment were evaluated to design an extensible, reconfigurable hardware module that would make a versatile and low-cost tool that in some cases eliminates the need for professional measurement and testing equipment.
Two hardware prototypes were designed and realized, accompanied by control libraries for programming languages C and Python. The Python library additionally integrates with MATLAB scripts. The devices provide access to hardware buses (\IIC, SPI, USART, 1-Wire) and microcontroller peripherals (ADC, DAC), implement frequency measurement and other useful features. The device is parametrised by a configuration file on a virtual disk accessible through USB, or written programmatically.
We designed custom hardware modules, an extensible microcontroller firmware, and PC support libraries for programming languages C and Python. The Python library may further be used in MATLAB scripts. The devices provide access to hardware buses (\IIC, SPI, USART, and 1-Wire) and microcontroller peripherals (GPIO, ADC, and DAC), implement frequency measurement and other useful features. They are configured in INI files accessed through on a virtual USB mass storage device, or programmatically.
\end{abstract-english}
\begin{abstract-czech}
\begin{otherlanguage}{czech}
Tato práce popisuje vývoj univerzální softwarové a~hardwarové platformy pro přístup k~hardwarovým sběrnicím a~elektrickým obvodům z~prostředí vysokoúrovňových programovacích jazyků a~aplikací běžících na PC, a~to za využití USB a~také bezdrátově.
Tato práce popisuje vývoj univerzální softwarové a~hardwarové platformy pro přístup k~hardwarovým sběrnicím a~elektrickým obvodům z~prostředí vysokoúrovňových programovacích jazyků a~aplikací běžících na PC, a~to za využití USB, UARTU a~také bezdrátově.
Byly vyhodnoceny požadavky typických problémů, vyskytujících se v~praxi při práci s~vestavěnými systémy a~ve výuce, pro návrh snadno rozšiřitelného a~přenastavitleného hardwarového modulu který bude praktickým, pohodlným a~dostupným nástrojem který navíc v~některých případech může nahradit profesionální laboratorní přístroje.
Byly vyhodnoceny požadavky typických problémů vyskytujících se při práci s~vestavěnými systémy a~ve výuce za účelem návrhu snadno rozšiřitelného a~přenastavitleného hardwarového modulu který bude praktickým, pohodlným a~dostupným nástrojem, který navíc v~některých případech může nahradit profesionální laboratorní přístroje.
Bylo navrženo několik prototypů hardwarových modulů, spolu s~obslužnými knihovnami v~jazycích C a~Python; k~modulu lze také přistupovat z~prostředí MATLAB. Přístroj umožňuje přístup k~většině běžných hardwarových sběrnic a~umožňuje také např. měřit frekvenci a~vzorkovat či generovat analogové signály.
Bylo navrženo několik prototypů hardwarových modulů spolu s~obslužnými knihovnami v~jazycích C a~Python; Python knihovnu lze dále používat z~prostředí MATLAB. Navržené moduly umožňují přístup k~většině běžných hardwarových sběrnic (\IIC, SPI, USART, 1-Wire) a~umožňuje také např. měřit frekvenci a~vzorkovat či generovat analogové signály.
\end{otherlanguage}
\end{abstract-czech}

Binary file not shown.
Loading…
Cancel
Save