Artemis Teensy Flight Software
The software on the Teensy in the Artemis cubesat.
Artemis::Channels::RPI Namespace Reference

The Raspberry Pi channel. More...

Functions

void rpi_channel ()
 The top-level channel definition. More...
 
void setup ()
 The Raspberry Pi setup function. More...
 
void loop ()
 The Raspberry Pi loop function. More...
 
void handle_queue ()
 Helper function to handle packet queue. More...
 
void shut_down_pi ()
 Shuts down the Raspberry Pi and kills the channel.
 
void send_to_pi ()
 Helper function to send a packet to the Raspberry Pi.
 
void receive_from_pi ()
 Helper function to receive a packet from the Raspberry Pi. More...
 

Variables

PacketComm packet
 The packet used throughout the channel.
 
bool piIsOn = false
 Whether the Raspberry Pi is on and active.
 

Detailed Description

The Raspberry Pi channel.

Function Documentation

◆ handle_queue()

void Artemis::Channels::RPI::handle_queue ( )

Helper function to handle packet queue.

This is a helper function called in loop() that checks for packets and routes them to the Raspberry Pi.

◆ loop()

void Artemis::Channels::RPI::loop ( )

The Raspberry Pi loop function.

This function runs in an infinite loop after setup() completes. It routes packets going to and coming from the Raspberry Pi.

Todo:
Handle the case where the Pi is not on.

◆ receive_from_pi()

void Artemis::Channels::RPI::receive_from_pi ( )

Helper function to receive a packet from the Raspberry Pi.

It seems that the micro-cosmos implementation of PacketComm/SLIPLib does not provide a convenient get_slip() method. This means that we need to manually parse the Serial stream for something that looks like SLIP packets. From there, we use the standard SLIPUnPacketize() method to turn it back into a regular packet for routing.

This method is temporarily extra-documented, to explain how this searching works.

Todo:
See if there's a better way of doing this.

◆ rpi_channel()

void Artemis::Channels::RPI::rpi_channel ( )

The top-level channel definition.

This is the function that defines the Raspberry Pi channel. Like an Arduino script, it has a setup() function that is run once, then loop() runs forever.

◆ setup()

void Artemis::Channels::RPI::setup ( )

The Raspberry Pi setup function.

This function is run once, when the channel is started. It connects to the Raspberry Pi over a serial connection.

Todo:
Ensure the Pi is on before completing setup.