Artemis Teensy Flight Software
The software on the Teensy in the Artemis cubesat.
main.cpp File Reference

The main operating loop for the Teensy. More...

#include "artemis_devices.h"
#include "artemisbeacons.h"
#include "channels/artemis_channels.h"
#include "helpers.h"
#include <Arduino.h>
#include <USBHost_t36.h>
#include <pdu.h>
#include <support/configCosmosKernel.h>
#include <vector>

Functions

void setup_connections ()
 Helper function to set up connections on the Teensy.
 
void setup_devices ()
 Helper function to set up devices on the Teensy.
 
void setup_threads ()
 Helper function to set up threads on the Teensy.
 
void beacon_artemis_devices ()
 Helper function to poll Artemis devices for their readings.
 
void beacon_if_deployed ()
 Helper function to beacon Artemis devices if in deployment mode.
 
void route_packets ()
 Helper function to route packets.
 
void route_packet_to_ground ()
 Helper function to route packets to ground.
 
void ensure_rpi_is_powered ()
 Helper function to ensure the Raspberry Pi is powered. More...
 
void send_pong_reply ()
 Helper function to send a pong reply.
 
void enable_rpi ()
 Helper function to enable the Raspberry Pi.
 
void report_rpi_enabled ()
 Helper function to report if the Raspberry Pi is enabled.
 
void update_pdu_switches ()
 Helper function to request PDU switch state update.
 
void setup ()
 Main setup function. More...
 
void loop ()
 Main loop function. More...
 

Detailed Description

The main operating loop for the Teensy.

This file contains the main oprerating loop that runs on the Teensy. Like an Arduino sketch, it consists of a setup and loop function.

Function Documentation

◆ ensure_rpi_is_powered()

void ensure_rpi_is_powered ( )

Helper function to ensure the Raspberry Pi is powered.

Todo:
This should still function if the current sensors are not enabled via build flags.

◆ loop()

void loop ( )

Main loop function.

This function runs in an infinite loop after setup() completes. It routes packets among the various channels and periodically creates beacon packets when in deployment mode. It also runs tests if they are enabled.

◆ setup()

void setup ( )

Main setup function.

This function is run once, when the Teensy is started. It initializes the various sensors and connections on the Teensy.

The frequency of the Teensy's processor is also set here. Allowed frequencies in MHz are: 24, 150, 396, 450, 528, 600.