# Getting Started

***This page:** *structure of this subsystem**

##### `<span class="editor-theme-code">components/driving_board</span>`<span style="white-space: pre-wrap;"> folder contains 4 libraries:</span>

- firmware
- motor
- parser
- simulink

**Firmware** <span style="color: rgb(68, 68, 68); background-color: rgb(255, 255, 255); white-space: pre-wrap;">contains the generated CubeMX code. </span><span style="color: rgb(68, 68, 68); background-color: rgb(251, 238, 184);">Don't edit this after generating, it will be rewritten after you generate again</span><span style="color: rgb(68, 68, 68); background-color: rgb(255, 255, 255);">.</span>

<p class="callout info"><span style="color: rgb(68, 68, 68);">NOTE: do make sure that after generating your code in CubeMX, you run the post generation script. You can set a post generation script in CubeMX itself. However, if you use Windows run: scripts/post\_code\_generation.bash, if you use Mac run: scripts/post\_code\_generation\_mac.bash</span></p>

<span style="color: rgb(68, 68, 68); white-space: pre-wrap;">The </span>**Simulink**<span style="color: rgb(68, 68, 68); white-space: pre-wrap;"> folder contains code generated by the control team, and it </span><span style="color: rgb(68, 68, 68); background-color: rgb(251, 238, 184); white-space: pre-wrap;">shouldn't be modified by embedded. </span><span style="color: rgb(68, 68, 68);">This code is not used on the embedded side, but it provides a clear reference for the type of input we give to control algorithm and the output we receive from it.</span>

<span style="color: rgb(68, 68, 68); white-space: pre-wrap;">In </span>`<span class="editor-theme-code">control.h</span>`<span style="color: rgb(68, 68, 68); white-space: pre-wrap;">, struct </span>`<span class="editor-theme-code">ExtY</span>`<span style="color: rgb(68, 68, 68); white-space: pre-wrap;"> gives the external outputs and </span>`<span class="editor-theme-code">ExtU</span>`<span style="color: rgb(68, 68, 68); white-space: pre-wrap;"> is the struct for external inputs. </span>

---

##### `<span class="editor-theme-code">src/driving_board</span>`<span style="white-space: pre-wrap;"> contains </span>`<span class="editor-theme-code">main.c</span>`

This is the code that runs when we build and update to the board by pio. Main includes multiple threads for some tasks that need to run concurrently.

---

##### `<span class="editor-theme-code">ERC-Protobufs/components/driving_board</span>`<span style="white-space: pre-wrap;"> contains protobuffers for this subsystem</span>

Protobuffers are used to send information to software and debugging board and receiving information from software.