************************ Software Design Overview ************************ The software is responsible for - Periodically measuring the battery pack - If the pack is unsafe, the shutdown sequence will run - Balancing battery cells to keep the pack safe - Periodically sending data to Telemetry Software Flow ============= .. figure:: ../_static/software-flow.jpg :align: center Software Stack ============== .. figure:: ../_static/software-stack.jpg :align: center Board Support Package (BSP) =========================== The BSP interfaces with peripherals and implements interrupt handlers. Drivers ======= Drivers interface with external hardware. The software for the BPS has drivers for: - :term:`CAN ` - :term:`EEPROM ` - LTC6811 (Voltage and Temperature) - LTC2315 (Amperes) Real Time Operating System (RTOS) ================================= The :term:`RTOS ` uses a scheduler to run multiple threads. Running these threads creates "pseudo-concurrency". The RTOS ensures that safety critical tasks will not be blocked by non-safety critical tasks. We use custom RTOS wrappers to allow easy porting. Currently, we are wrapping for `Micrium uC/OS-III RTOS `__. Applications (Apps) =================== The BPS Apps consist of threads/tasks and functions that interpret measurements. The following tasks make up the BPS' engine and are shown from highest to lowest priority: - :ref:`Initialization ` - :ref:`Fault State ` - :ref:`Check Contactor ` - :ref:`Pet Watchdog ` - :ref:`Voltage/Temperature monitor ` - :ref:`Amperes monitor ` - :ref:`Battery Balancing ` - :ref:`Log Information ` - :ref:`CAN Message Consumer ` - :ref:`Command Line Interface (CLI) ` - :ref:`Idle ` Descriptions of what each task does can be found in the Tasks section.