From 3e05ec4519ceba379e742a1c817a7a1cdfa64e25 Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Sun, 5 Mar 2017 20:25:56 +0100 Subject: [PATCH] write a little bit more --- appendix-device-interface.tex | 1 + appendix-protocol.tex | 4 +--- introduction.tex | 10 +++++----- listings/interface.h | 32 ++++++++++++++++++++++++++++++++ methods.tex | 15 +++++++++++++++ thesis.tex | 6 ++++++ 6 files changed, 60 insertions(+), 8 deletions(-) create mode 100644 appendix-device-interface.tex create mode 100644 listings/interface.h diff --git a/appendix-device-interface.tex b/appendix-device-interface.tex new file mode 100644 index 0000000..8786570 --- /dev/null +++ b/appendix-device-interface.tex @@ -0,0 +1 @@ +\lstinputlisting[language=C]{listings/interface.h} diff --git a/appendix-protocol.tex b/appendix-protocol.tex index 4f1672d..d3d2f42 100644 --- a/appendix-protocol.tex +++ b/appendix-protocol.tex @@ -20,9 +20,7 @@ the message is not acknowledged or responded upon. byte & value\\ \midrule 1 & \texttt{'t'}\\ - 2,3 & interval. If the first bit is 1 the other 15 indicate the - interrupt on which the task should be run. If the first bit is 0 - the other 15 indicate the interval in milliseconds\\ + 2,3 & interval or interrupt\\ 4,5 & length (\texttt{n})\\ 6 to n+6 & bytecode\\ \midrule\midrule diff --git a/introduction.tex b/introduction.tex index dd538b9..d2c34b5 100644 --- a/introduction.tex +++ b/introduction.tex @@ -11,11 +11,11 @@ lifted \gls{iTasks} from a single server model to a distributed server architecture~\todo{Add cite} that is also runnable on smaller devices like \acrshort{ARM}. However, this is limited to fairly high performance devices that are equipped with high speed communication lines. Devices in \gls{IoT} -often only have LPLB communication with low bandwidth and a very limited amount -of processing power. \glspl{mTask} will bridge this gap. It can run on devices -as small as Arduino microcontrollers and operates via the same paradigms as -regular \glspl{Task}. The \glspl{mTask} have access to \glspl{SDS} and can run -small imperative programs. +often only have \gls{LTN} communication with low bandwidth and a very limited +amount of processing power. \glspl{mTask} will bridge this gap. It can run on +devices as small as Arduino microcontrollers and operates via the same +paradigms as regular \glspl{Task}. The \glspl{mTask} have access to \glspl{SDS} +and can run small imperative programs. \section{Document structure} The structure of the thesis is as follows. diff --git a/listings/interface.h b/listings/interface.h new file mode 100644 index 0000000..24e369a --- /dev/null +++ b/listings/interface.h @@ -0,0 +1,32 @@ +#ifndef INTERFACE_H +#define INTERFACE_H + +#include +#include +#include + +#define read16() 256*(uint8_t)read_byte() + (uint8_t)read_byte() +#define from16(a, b) 256*a+b +#define write16(i) { write_byte((uint8_t)i/256); write_byte((uint8_t)i%256); } +uint8_t read_byte(void); +void write_byte(uint8_t b); + +void write_dpin(uint8_t i, bool b); +bool read_dpin(uint8_t i); + +void write_apin(uint8_t i, uint8_t a); +uint8_t read_apin(uint8_t i); + +void led_on(uint8_t i); +void led_off(uint8_t i); + +long millis(void); +bool input_available(void); +void delay(long ms); + +void setup(void); +void debug(char *fmt, ...); +void pdie(char *s); +void die(char *fmt, ...); + +#endif diff --git a/methods.tex b/methods.tex index ae92075..11fc5b5 100644 --- a/methods.tex +++ b/methods.tex @@ -8,10 +8,25 @@ The lazy functional programming language based on graph rewriting \gls{Clean}~\cite{brus_cleanlanguage_1987} \section{\acrlong{EDSL}s} +\glspl{mTask} are expressed in a class based shallowly embedded \gls{EDSL}. +There are two main types of \glspl{EDSL}. +\todo{Small shallow embedded dsl intro} +\todo{Small deep embedded dsl} +\todo{Show that class based has the best of both worlds} \section{Devices} +The client code for the devices is compiled from one codebase. For a device to +be eligible for \glspl{mTask} it must be able to compile the shared codebase +and implement (part of) the device specific interface. The shared codebase only +uses standard \gls{C} and no special libraries or tricks are used. Therefore +the code is compilable for almost any device or system. Note that it is not +needed to implement a full interface\todo{handshake}. The full interface, +listed in Appendix~\label{app:device-interface}, also includes functions for +accessing the peripherals that not every device might have. \subsection{Specification} +Devices are stored in a record type and all devices in the system are stored in +a \gls{SDS} containing all devices. \subsection{Communication} diff --git a/thesis.tex b/thesis.tex index 3a7477e..7b114bb 100644 --- a/thesis.tex +++ b/thesis.tex @@ -8,6 +8,7 @@ \newacronym{EDSL}{(E)DSL}{(Embedded) Design Specific Language} \newacronym{RISC}{RISC}{Reduced Instruction Set Computer} \newacronym{ARM}{ARM}{Acorn \acrshort{RISC} Machine} +\newacronym{LTN}{LTN}{Low Throughput Network} \newglossaryentry{Clean}{name=Clean, description={is a pure lazy functional programming language based on graph rewriting}} @@ -18,6 +19,8 @@ description={is the basic building block of a \acrshort{TOP} system}} \newglossaryentry{mTask}{name=mTask, description={is an abstraction for \glspl{Task} living on \acrshort{IoT} devices}} +\newglossaryentry{C}{name=C, + description={is low-level programming language suitable for embedded devices}} \begin{document} \frontmatter{} @@ -66,6 +69,9 @@ \chapter{Communication protocol}\label{app:communication-protocol} \input{appendix-protocol.tex} +\chapter{Device client interface}\label{app:device-interface} +\input{appendix-device-interface.tex} + \lstlistoflistings{} \listoffigures{} \listoftables{} -- 2.20.1