<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>README.md - +/rtos @ master</title>
<meta name="description" content="README.md in +/rtos at master.">
<meta property="og:title" content="README.md - +/rtos @ master">
<meta property="og:description" content="README.md in +/rtos at master.">
<meta property="og:type" content="website">
<meta property="og:site_name" content="git.julia.blue">
<link rel="stylesheet" href="/css/style.css?v=62">
<script type="module" src="/js/main.js?v=62"></script>
</head>
<body>
<main data-ref="master" data-tip="5e01da24f628fee1fb364640871ed59039ffbc99">
<noscript>
  <div class="callout">
    <p>
      hey! this is a static git repo viewer. commit diffs, file history,
      older commits and other revisions won't load without javascript.
    </p>
    <p>
      you are still able to view source files on branch/tag tips,
      but the experience is degraded.
    </p>
  </div>
</noscript>
<header class="repo"><div>
<h1>+/rtos</h1>
</div>
<pre class="clone">git clone https://git.julia.blue/+/rtos</pre>
</header>
<p class="snapshot-commit"><span class="commit-author">Joseph Ryan</span><span class="commit-message" data-commit="5e01da24f628fee1fb364640871ed59039ffbc99">Update README with Lab7 description</span><span class="snapshot-sha sha" data-commit="5e01da24f628fee1fb364640871ed59039ffbc99">5e01da2</span><time datetime="2020-05-06T14:48:47-04:00" title="2020-05-06 14:48:47 -0400">2020-05-06</time></p>
<header class="topbar"><details class="switcher"><summary>master</summary><div class="menu"><strong>branches</strong><a class="current" href="/%2B/rtos/ref/master/">master</a><a class="all" href="/%2B/rtos/refs">all refs →</a></div></details><nav class="crumbs"><a href="/%2B/rtos/">rtos</a> / <span class="cur">README.md</span></nav>
<span class="view-stats"><span>7.6 KiB</span><span>159 lines</span></span><span class="actions"><a class="raw" href="/%2B/rtos/raw/74951290cda564c140757774784f80dcd544186f/README.md">raw</a></span></header>
<div class="markdown-view"><input type="radio" name="markdown-view" id="markdown-rendered" checked><label for="markdown-rendered">rendered</label><input type="radio" name="markdown-view" id="markdown-code"><label for="markdown-code">code</label><section class="readme rendered"><h2>Features</h2>
<p>Our OS implements the features covered in
<a href="http://users.ece.utexas.edu/~gerstl/ee445m_s20/">EE445M</a> with some
modifications and additions. We rewrote the provided hardware drivers to use the
driverlib code embedded in the TM4C's ROM rather than Dr. Valvano's code. Here
are some notable features that extend upon the ones required for the class.</p>
<ul>
<li>We use the MPU to provide stack protection for all threads. The region is
swapped out on every context switch to ensure that interrupts or preemption
can't get around the protection and when a stack overflow occurs the system
is halted and debug information is provided.</li>
<li>We use <a href="https://github.com/ARMmbed/littlefs">littlefs</a> instead of the
provided FAT filesystem. We added a lot of file related functionality to our
interpreter so the user can do unix-y commands like <code>ls</code>, <code>cat</code>, <code>rm</code>, <code>mv</code>,
<code>touch</code>, etc. and we provide a utility to do file transfers to the SD card
over UART.</li>
<li>In general our interpreter is more robust than required. We provide a
stripped down readline implementation for basic line editing, allow lots of
command aliases, include extra functionality like heap profiling and core
temp monitoring, and put some effort into making it "pretty" with colored
text. In addition we extended the remote interpreter support to allow
concurrent execution of multiple interpreters (one running locally over
serial and one running remotely through the ESP over TCP).</li>
<li>Rather than doing load time relocation of ELFs to allow code sharing between
the OS and user programs, we re-purposed the system call interface to allow
dynamic loading from any thread at runtime which allows greater flexibility
as well as the potential to update function definitions in place without
requiring restarts.</li>
<li>We support an arbitrary number of priority levels for foreground threads
(currently limited to 256 because we only use 1 byte to store the field)
because we only maintain a linked list for the threads of the "current"
priority level in the system so no additional space is wasted by having many
levels.</li>
<li>We support an arbitrary number of periodic tasks (with a maximum number
chosen at compile time) and rather than wasting CPU time with a naive
periodic timer interrupt that manages the tasks by subtracting from multiple
counters, we arrange our tasks in an order that allows us to use precise
timer values that need only one interrupt per task.</li>
<li>We aggressively heap allocate data structures and buffers rather than having
dedicated parts of memory reserved for them. This means that if you're not
using a certain feature (like the filesystem, UART, or ESP), you don't waste
any RAM on it. This allows the OS to use very little of the overall system
memory (less than 10% even with a USB device stack) which makes more of it
available to the actual workload running on the OS.</li>
<li>Our heap optimizes for long running workloads without needing a "stop the
world" defragmentation pass. As blocks are freed it merges them with
adjacent ones, and doesn't over allocate (other than for alignment purposes)
regardless of the requested size. This means that we get pretty good heap
utilization at the cost of slow allocation and freeing. Performance could be
increased using a doubly linked list implementation, but we didn't see it as
necessary because timing critical workloads shouldn't be relying on heap
interaction in their hot path, and our simpler singly linked list wastes
less space on block metadata.</li>
<li>Our OS is relatively compiler independent. We have used both the LLVM and
GNU toolchains, and since we don't link to external libraries (including the
C standard library) it should be relatively easy to compile our OS on a new
toolchain.</li>
</ul>
<h2>Final Lab</h2>
<p>To demonstrate the capabilities of our OS, our final lab project was to
integrate a USB device stack and use it to remotely control each other's mice
through the remote interpreter. We did this in a way that allowed multiple
movements in different threads to be performed simultaneously such as linear and
circular motions combining to create a spiral. Here is the list of commands
available for our project demo:</p>
<pre>led COLOR [on, off, or toggle]  control the onboard RGB led
adc                             read a single sample from the ADC
temp                            get the internal system temperature
time [get/reset]                OS time helpers

jitter                          show periodic task jitter stats
heap                            show heap usage information

mount                           mount the sd card
unmount                         unmount the sd card
format yes really               format the sd card
upload FILENAME                 transfer a file over UART
exec FILENAME                   load and run process from file
touch FILENAME                  creates a new file
cat FILENAME                    display the contents of a file
append FILENAME WORD            append a word to a file
ls                              list the files in the directory
mv FILENAME NEWNAME             move a file
cp FILENAME NEWNAME             copy a file
rm FILENAME                     delete a file
checksum FILENAME               compute a checksum of a file

connect [SSID PASS]             connect to a wifi network.
server                          spawn remote interpreter
client IPV4                     spawn remote client
mouse_server                    spawn remote mouse server
mouse_client IPV4               spawn remote mouse controller
mouse                           control the mouse locally
exit                            leave this session
</pre>
<p>And these are the controls from within the mouse control app:</p>
<pre>q w e      These keys all make the mouse move a straight direction
a s d      Holding shift allows you to make slight adjustments to
z x c      the cursor position. s stops this movement.

, . and / act as the left, middle, and right mouse buttons
normally they perform a single click, but holding shift (so &lt; &gt; and ?)
makes them toggle holding the button.

+ and - increase and decrease the speed of continuous movements

o makes the mouse start circling (press again to stop)

Space makes the cursor move to the center of the screen,
stops all mouse movement, and releases all mouse buttons
</pre>
<h2>Hardware</h2>
<h3>GPIO Pins:</h3>
<table><thead><tr><th>Pin #</th><th>Description</th></tr></thead><tbody>
<tr><td>A0</td><td>Main UART Rx</td></tr>
<tr><td>A1</td><td>Main UART Tx</td></tr>
<tr><td>A2</td><td>LCD/SDC SPI Clock</td></tr>
<tr><td>A3</td><td>LCD SPI Chip Select</td></tr>
<tr><td>A4</td><td>LCD/SDC SPI MISO</td></tr>
<tr><td>A5</td><td>LCD/SDC SPI MOSI</td></tr>
<tr><td>A6</td><td>LCD/SDC SPI D/C</td></tr>
<tr><td>A7</td><td>LCD Reset</td></tr>
<tr><td>B0</td><td>SDC SPI Chip Select</td></tr>
<tr><td>B1</td><td>ESP Reset</td></tr>
<tr><td>D4</td><td>USB0 D-</td></tr>
<tr><td>D5</td><td>USB0 D+</td></tr>
<tr><td>D6</td><td>ESP UART Rx</td></tr>
<tr><td>D7</td><td>ESP UART Tx</td></tr>
<tr><td>F0</td><td>Launchpad Left Button</td></tr>
<tr><td>F1</td><td>Launchpad Red LED</td></tr>
</tbody></table>
<p>In addition we allow use of any of the 12 ADC channels that don't conflict with
the above pins.</p>
<h3>Peripherals</h3>
<ul>
<li>UART0 is the main UART</li>
<li>UART2 is the ESP UART</li>
<li>SPI0 is for the LCD and SDC</li>
<li>SysTick is for preemptive thread scheduling</li>
<li>Timer1 is for thread sleep timing</li>
<li>Timer2 is for periodic task scheduling</li>
<li>Timer3 and WideTimer1 are for internal OS busy waiting</li>
<li>WideTimer5 is for tracking OS uptime</li>
<li>ADC0 Sequence 2 is for core temperature monitoring</li>
<li>ADC0 Sequence 3 is reserved for OS processor triggering</li>
<li>ADC1 Sequence 0 is reserved for OS timer triggered periodic reads</li>
<li>USB0 is for the HID</li>
</ul>
</section><div class="code-panel"><pre class="code src language-markdown"><span class="code-line"><a class="ln" id="L1" href="#L1">1</a><span class="code-text"><a-p>##</a-p> <a-tt>Features</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L2" href="#L2">2</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L3" href="#L3">3</a><span class="code-text">Our OS implements the features covered in</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L4" href="#L4">4</a><span class="code-text">[EE445M](http://users.ece.utexas.edu/~gerstl/ee445m_s20/) with some</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L5" href="#L5">5</a><span class="code-text">modifications and additions. We rewrote the provided hardware drivers to use the</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L6" href="#L6">6</a><span class="code-text">driverlib code embedded in the TM4C&#39;s ROM rather than Dr. Valvano&#39;s code. Here</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L7" href="#L7">7</a><span class="code-text">are some notable features that extend upon the ones required for the class.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L8" href="#L8">8</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L9" href="#L9">9</a><span class="code-text"><a-p>-   </a-p>We use the MPU to provide stack protection for all threads. The region is</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L10" href="#L10">10</a><span class="code-text"><a-p>    </a-p>swapped out on every context switch to ensure that interrupts or preemption</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L11" href="#L11">11</a><span class="code-text"><a-p>    </a-p>can&#39;t get around the protection and when a stack overflow occurs the system</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L12" href="#L12">12</a><span class="code-text"><a-p>    </a-p>is halted and debug information is provided.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L13" href="#L13">13</a><span class="code-text"><a-p>-   </a-p>We use [littlefs](https://github.com/ARMmbed/littlefs) instead of the</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L14" href="#L14">14</a><span class="code-text"><a-p>    </a-p>provided FAT filesystem. We added a lot of file related functionality to our</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L15" href="#L15">15</a><span class="code-text"><a-p>    </a-p>interpreter so the user can do unix-y commands like `ls`, `cat`, `rm`, `mv`,</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L16" href="#L16">16</a><span class="code-text"><a-p>    </a-p>`touch`, etc. and we provide a utility to do file transfers to the SD card</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L17" href="#L17">17</a><span class="code-text"><a-p>    </a-p>over UART.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L18" href="#L18">18</a><span class="code-text"><a-p>-   </a-p>In general our interpreter is more robust than required. We provide a</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L19" href="#L19">19</a><span class="code-text"><a-p>    </a-p>stripped down readline implementation for basic line editing, allow lots of</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L20" href="#L20">20</a><span class="code-text"><a-p>    </a-p>command aliases, include extra functionality like heap profiling and core</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L21" href="#L21">21</a><span class="code-text"><a-p>    </a-p>temp monitoring, and put some effort into making it &quot;pretty&quot; with colored</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L22" href="#L22">22</a><span class="code-text"><a-p>    </a-p>text. In addition we extended the remote interpreter support to allow</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L23" href="#L23">23</a><span class="code-text"><a-p>    </a-p>concurrent execution of multiple interpreters (one running locally over</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L24" href="#L24">24</a><span class="code-text"><a-p>    </a-p>serial and one running remotely through the ESP over TCP).</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L25" href="#L25">25</a><span class="code-text"><a-p>-   </a-p>Rather than doing load time relocation of ELFs to allow code sharing between</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L26" href="#L26">26</a><span class="code-text"><a-p>    </a-p>the OS and user programs, we re-purposed the system call interface to allow</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L27" href="#L27">27</a><span class="code-text"><a-p>    </a-p>dynamic loading from any thread at runtime which allows greater flexibility</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L28" href="#L28">28</a><span class="code-text"><a-p>    </a-p>as well as the potential to update function definitions in place without</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L29" href="#L29">29</a><span class="code-text"><a-p>    </a-p>requiring restarts.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L30" href="#L30">30</a><span class="code-text"><a-p>-   </a-p>We support an arbitrary number of priority levels for foreground threads</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L31" href="#L31">31</a><span class="code-text"><a-p>    </a-p>(currently limited to 256 because we only use 1 byte to store the field)</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L32" href="#L32">32</a><span class="code-text"><a-p>    </a-p>because we only maintain a linked list for the threads of the &quot;current&quot;</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L33" href="#L33">33</a><span class="code-text"><a-p>    </a-p>priority level in the system so no additional space is wasted by having many</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L34" href="#L34">34</a><span class="code-text"><a-p>    </a-p>levels.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L35" href="#L35">35</a><span class="code-text"><a-p>-   </a-p>We support an arbitrary number of periodic tasks (with a maximum number</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L36" href="#L36">36</a><span class="code-text"><a-p>    </a-p>chosen at compile time) and rather than wasting CPU time with a naive</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L37" href="#L37">37</a><span class="code-text"><a-p>    </a-p>periodic timer interrupt that manages the tasks by subtracting from multiple</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L38" href="#L38">38</a><span class="code-text"><a-p>    </a-p>counters, we arrange our tasks in an order that allows us to use precise</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L39" href="#L39">39</a><span class="code-text"><a-p>    </a-p>timer values that need only one interrupt per task.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L40" href="#L40">40</a><span class="code-text"><a-p>-   </a-p>We aggressively heap allocate data structures and buffers rather than having</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L41" href="#L41">41</a><span class="code-text"><a-p>    </a-p>dedicated parts of memory reserved for them. This means that if you&#39;re not</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L42" href="#L42">42</a><span class="code-text"><a-p>    </a-p>using a certain feature (like the filesystem, UART, or ESP), you don&#39;t waste</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L43" href="#L43">43</a><span class="code-text"><a-p>    </a-p>any RAM on it. This allows the OS to use very little of the overall system</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L44" href="#L44">44</a><span class="code-text"><a-p>    </a-p>memory (less than 10% even with a USB device stack) which makes more of it</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L45" href="#L45">45</a><span class="code-text"><a-p>    </a-p>available to the actual workload running on the OS.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L46" href="#L46">46</a><span class="code-text"><a-p>-   </a-p>Our heap optimizes for long running workloads without needing a &quot;stop the</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L47" href="#L47">47</a><span class="code-text"><a-p>    </a-p>world&quot; defragmentation pass. As blocks are freed it merges them with</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L48" href="#L48">48</a><span class="code-text"><a-p>    </a-p>adjacent ones, and doesn&#39;t over allocate (other than for alignment purposes)</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L49" href="#L49">49</a><span class="code-text"><a-p>    </a-p>regardless of the requested size. This means that we get pretty good heap</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L50" href="#L50">50</a><span class="code-text"><a-p>    </a-p>utilization at the cost of slow allocation and freeing. Performance could be</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L51" href="#L51">51</a><span class="code-text"><a-p>    </a-p>increased using a doubly linked list implementation, but we didn&#39;t see it as</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L52" href="#L52">52</a><span class="code-text"><a-p>    </a-p>necessary because timing critical workloads shouldn&#39;t be relying on heap</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L53" href="#L53">53</a><span class="code-text"><a-p>    </a-p>interaction in their hot path, and our simpler singly linked list wastes</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L54" href="#L54">54</a><span class="code-text"><a-p>    </a-p>less space on block metadata.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L55" href="#L55">55</a><span class="code-text"><a-p>-   </a-p>Our OS is relatively compiler independent. We have used both the LLVM and</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L56" href="#L56">56</a><span class="code-text"><a-p>    </a-p>GNU toolchains, and since we don&#39;t link to external libraries (including the</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L57" href="#L57">57</a><span class="code-text"><a-p>    </a-p>C standard library) it should be relatively easy to compile our OS on a new</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L58" href="#L58">58</a><span class="code-text"><a-p>    </a-p>toolchain.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L59" href="#L59">59</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L60" href="#L60">60</a><span class="code-text"><a-p>## </a-p><a-tt>Final Lab</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L61" href="#L61">61</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L62" href="#L62">62</a><span class="code-text"><a-p>To demonstrate the capabilities of our OS, our final lab project was to</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L63" href="#L63">63</a><span class="code-text"><a-p>integrate a USB device stack and use it to remotely control each other&#39;s mice</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L64" href="#L64">64</a><span class="code-text"><a-p>through the remote interpreter. We did this in a way that allowed multiple</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L65" href="#L65">65</a><span class="code-text"><a-p>movements in different threads to be performed simultaneously such as linear and</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L66" href="#L66">66</a><span class="code-text"><a-p>circular motions combining to create a spiral. Here is the list of commands</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L67" href="#L67">67</a><span class="code-text"><a-p>available for our project demo:</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L68" href="#L68">68</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L69" href="#L69">69</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L70" href="#L70">70</a><span class="code-text"><a-p>led COLOR [on, off, or toggle]  control the onboard RGB led</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L71" href="#L71">71</a><span class="code-text"><a-p>adc                             read a single sample from the ADC</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L72" href="#L72">72</a><span class="code-text"><a-p>temp                            get the internal system temperature</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L73" href="#L73">73</a><span class="code-text"><a-p>time [get/reset]                OS time helpers</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L74" href="#L74">74</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L75" href="#L75">75</a><span class="code-text"><a-p>jitter                          show periodic task jitter stats</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L76" href="#L76">76</a><span class="code-text"><a-p>heap                            show heap usage information</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L77" href="#L77">77</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L78" href="#L78">78</a><span class="code-text"><a-p>mount                           mount the sd card</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L79" href="#L79">79</a><span class="code-text"><a-p>unmount                         unmount the sd card</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L80" href="#L80">80</a><span class="code-text"><a-p>format yes really               format the sd card</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L81" href="#L81">81</a><span class="code-text"><a-p>upload FILENAME                 transfer a file over UART</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L82" href="#L82">82</a><span class="code-text"><a-p>exec FILENAME                   load and run process from file</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L83" href="#L83">83</a><span class="code-text"><a-p>touch FILENAME                  creates a new file</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L84" href="#L84">84</a><span class="code-text"><a-p>cat FILENAME                    display the contents of a file</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L85" href="#L85">85</a><span class="code-text"><a-p>append FILENAME WORD            append a word to a file</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L86" href="#L86">86</a><span class="code-text"><a-p>ls                              list the files in the directory</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L87" href="#L87">87</a><span class="code-text"><a-p>mv FILENAME NEWNAME             move a file</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L88" href="#L88">88</a><span class="code-text"><a-p>cp FILENAME NEWNAME             copy a file</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L89" href="#L89">89</a><span class="code-text"><a-p>rm FILENAME                     delete a file</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L90" href="#L90">90</a><span class="code-text"><a-p>checksum FILENAME               compute a checksum of a file</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L91" href="#L91">91</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L92" href="#L92">92</a><span class="code-text"><a-p>connect [SSID PASS]             connect to a wifi network.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L93" href="#L93">93</a><span class="code-text"><a-p>server                          spawn remote interpreter</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L94" href="#L94">94</a><span class="code-text"><a-p>client IPV4                     spawn remote client</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L95" href="#L95">95</a><span class="code-text"><a-p>mouse_server                    spawn remote mouse server</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L96" href="#L96">96</a><span class="code-text"><a-p>mouse_client IPV4               spawn remote mouse controller</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L97" href="#L97">97</a><span class="code-text"><a-p>mouse                           control the mouse locally</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L98" href="#L98">98</a><span class="code-text"><a-p>exit                            leave this session</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L99" href="#L99">99</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L100" href="#L100">100</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L101" href="#L101">101</a><span class="code-text"><a-p>And these are the controls from within the mouse control app:</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L102" href="#L102">102</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L103" href="#L103">103</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L104" href="#L104">104</a><span class="code-text"><a-p>q w e      These keys all make the mouse move a straight direction</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L105" href="#L105">105</a><span class="code-text"><a-p>a s d      Holding shift allows you to make slight adjustments to</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L106" href="#L106">106</a><span class="code-text"><a-p>z x c      the cursor position. s stops this movement.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L107" href="#L107">107</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L108" href="#L108">108</a><span class="code-text"><a-p>, . and / act as the left, middle, and right mouse buttons</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L109" href="#L109">109</a><span class="code-text"><a-p>normally they perform a single click, but holding shift (so &lt; &gt; and ?)</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L110" href="#L110">110</a><span class="code-text"><a-p>makes them toggle holding the button.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L111" href="#L111">111</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L112" href="#L112">112</a><span class="code-text"><a-p>+ and - increase and decrease the speed of continuous movements</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L113" href="#L113">113</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L114" href="#L114">114</a><span class="code-text"><a-p>o makes the mouse start circling (press again to stop)</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L115" href="#L115">115</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L116" href="#L116">116</a><span class="code-text"><a-p>Space makes the cursor move to the center of the screen,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L117" href="#L117">117</a><span class="code-text"><a-p>stops all mouse movement, and releases all mouse buttons</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L118" href="#L118">118</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L119" href="#L119">119</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L120" href="#L120">120</a><span class="code-text"><a-p>## </a-p><a-tt>Hardware</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L121" href="#L121">121</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L122" href="#L122">122</a><span class="code-text"><a-p>### </a-p><a-tt>GPIO Pins:</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L123" href="#L123">123</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L124" href="#L124">124</a><span class="code-text"><a-p>| Pin # | Description           |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L125" href="#L125">125</a><span class="code-text"><a-p>| ----- | --------------------- |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L126" href="#L126">126</a><span class="code-text"><a-p>| A0    | Main UART Rx          |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L127" href="#L127">127</a><span class="code-text"><a-p>| A1    | Main UART Tx          |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L128" href="#L128">128</a><span class="code-text"><a-p>| A2    | LCD/SDC SPI Clock     |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L129" href="#L129">129</a><span class="code-text"><a-p>| A3    | LCD SPI Chip Select   |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L130" href="#L130">130</a><span class="code-text"><a-p>| A4    | LCD/SDC SPI MISO      |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L131" href="#L131">131</a><span class="code-text"><a-p>| A5    | LCD/SDC SPI MOSI      |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L132" href="#L132">132</a><span class="code-text"><a-p>| A6    | LCD/SDC SPI D/C       |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L133" href="#L133">133</a><span class="code-text"><a-p>| A7    | LCD Reset             |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L134" href="#L134">134</a><span class="code-text"><a-p>| B0    | SDC SPI Chip Select   |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L135" href="#L135">135</a><span class="code-text"><a-p>| B1    | ESP Reset             |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L136" href="#L136">136</a><span class="code-text"><a-p>| D4    | USB0 D-               |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L137" href="#L137">137</a><span class="code-text"><a-p>| D5    | USB0 D+               |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L138" href="#L138">138</a><span class="code-text"><a-p>| D6    | ESP UART Rx           |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L139" href="#L139">139</a><span class="code-text"><a-p>| D7    | ESP UART Tx           |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L140" href="#L140">140</a><span class="code-text"><a-p>| F0    | Launchpad Left Button |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L141" href="#L141">141</a><span class="code-text"><a-p>| F1    | Launchpad Red LED     |</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L142" href="#L142">142</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L143" href="#L143">143</a><span class="code-text"><a-p>In addition we allow use of any of the 12 ADC channels that don&#39;t conflict with</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L144" href="#L144">144</a><span class="code-text"><a-p>the above pins.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L145" href="#L145">145</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L146" href="#L146">146</a><span class="code-text"><a-p>### </a-p><a-tt>Peripherals</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L147" href="#L147">147</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L148" href="#L148">148</a><span class="code-text"><a-p>-   UART0 is the main UART</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L149" href="#L149">149</a><span class="code-text"><a-p>-   UART2 is the ESP UART</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L150" href="#L150">150</a><span class="code-text"><a-p>-   SPI0 is for the LCD and SDC</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L151" href="#L151">151</a><span class="code-text"><a-p>-   SysTick is for preemptive thread scheduling</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L152" href="#L152">152</a><span class="code-text"><a-p>-   Timer1 is for thread sleep timing</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L153" href="#L153">153</a><span class="code-text"><a-p>-   Timer2 is for periodic task scheduling</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L154" href="#L154">154</a><span class="code-text"><a-p>-   Timer3 and WideTimer1 are for internal OS busy waiting</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L155" href="#L155">155</a><span class="code-text"><a-p>-   WideTimer5 is for tracking OS uptime</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L156" href="#L156">156</a><span class="code-text"><a-p>-   ADC0 Sequence 2 is for core temperature monitoring</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L157" href="#L157">157</a><span class="code-text"><a-p>-   ADC0 Sequence 3 is reserved for OS processor triggering</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L158" href="#L158">158</a><span class="code-text"><a-p>-   ADC1 Sequence 0 is reserved for OS timer triggered periodic reads</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L159" href="#L159">159</a><span class="code-text"><a-p>-   </a-p>USB0 is for the HID</span></span></pre></div></div>
</main>
</body>
</html>
