Artemis Teensy Flight Software
The software on the Teensy in the Artemis cubesat.
|
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. | |
The Raspberry Pi channel.
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.
void Artemis::Channels::RPI::loop | ( | ) |
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.
void Artemis::Channels::RPI::rpi_channel | ( | ) |
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.