Artemis Teensy Flight Software
The software on the Teensy in the Artemis cubesat.
|
The Artemis definitions. More...
Go to the source code of this file.
Classes | |
struct | thread_struct |
The structure of a thread. More... | |
Macros | |
#define | ARTEMIS_CURRENT_BEACON_1_COUNT 2 |
#define | ARTEMIS_CURRENT_SENSOR_COUNT 5 |
The number of current sensors in the satellite. | |
#define | ARTEMIS_TEMP_SENSOR_COUNT 7 |
The number of temperature sensors in the satellite. | |
#define | MAXQUEUESIZE 8 |
The maximum number of packets that a queue can hold. | |
Enumerations | |
enum class | NODES : uint8_t { GROUND_NODE_ID = 1 , TEENSY_NODE_ID = 2 , RPI_NODE_ID = 3 } |
Enumeration of Node ID. | |
enum | TEENSY_PINS { UART4_RXD , UART4_TXD , T_GPIO2 , T_GPIO3 , T_GPIO4 , T_GPIO5 , T_GPIO6 , UART6_RX , UART6_TX , T_CS1 , T_CS , SPI0_MOSI , SPI0_MISO , SPI0_SCLK , AIN0 , AIN1 , SCL1_I2C , SDA1_I2C , I2C2_SDA , I2C2_SCL , AIN3 , AIN4 , AIN5 , AIN6 , I2C1_SCL , I2C1_SDA , SPI1_D1 , SPI1_SCLK , UART5_TXD , UART5_RXD , RX_ON , TX_ON , RADIO_RESET , GPS_RSTN , UART2_RXD , UART2_TXD , RPI_ENABLE , SDN , SPI1_CS1 , SPI1_D0 , NIRQ , AIN2 } |
Enumeration of Teensy 4.1 pins, based on Artemis OBC v4.23. | |
Functions | |
bool | kill_thread (uint8_t channel_id) |
Kill a running thread. More... | |
void | PushQueue (PacketComm &packet, std::deque< PacketComm > &queue, Threads::Mutex &mtx) |
Push a packet into a queue. More... | |
bool | PullQueue (PacketComm &packet, std::deque< PacketComm > &queue, Threads::Mutex &mtx) |
Pull a packet from a queue. More... | |
void | route_packet_to_main (PacketComm packet) |
Wrapper function to send a packet to the main channel. | |
void | route_packet_to_rfm23 (PacketComm packet) |
Wrapper function to send a packet to the RFM23. | |
void | route_packet_to_pdu (PacketComm packet) |
Wrapper function to send a packet to the PDU. | |
void | route_packet_to_rpi (PacketComm packet) |
Wrapper function to send a packet to the Raspberry Pi. | |
Variables | |
const float | MV_PER_DEGREE_F = 1.0 |
The conversion factor between temperature and voltage. More... | |
const float | OFFSET_F = 58.0 |
The offset of the temperature sensors. More... | |
const float | MV_PER_ADC_UNIT = 3300.0 / 1024.0 |
The conversion factor between ADC units and voltage. More... | |
const float | heater_threshold = -10.0 |
The activation temperature, in Celsius, of the heater. | |
vector< struct thread_struct > | thread_list |
The list of active threads. More... | |
std::map< string, NODES > | NodeType |
Mapping between string names and NodeType. | |
std::deque< PacketComm > | main_queue |
The packet queue for the main channel. | |
std::deque< PacketComm > | rfm23_queue |
The packet queue for the RFM23 channel. | |
std::deque< PacketComm > | pdu_queue |
The packet queue for the PDU channel. | |
std::deque< PacketComm > | rpi_queue |
The packet queue for the Raspberry Pi channel. | |
Threads::Mutex | main_queue_mtx |
The mutex for the main channel's packet queue. | |
Threads::Mutex | rfm23_queue_mtx |
The mutex for the RFM23 channel's packet queue. | |
Threads::Mutex | pdu_queue_mtx |
The mutex for the PDU channel's packet queue. | |
Threads::Mutex | rpi_queue_mtx |
The mutex for the Raspberry Pi channel's packet queue. | |
Threads::Mutex | spi1_mtx |
The mutex for the SPI1 interface. | |
Threads::Mutex | i2c1_mtx |
The mutex for the I2C1 interface. | |
bool | deploymentmode |
Whether the satellite is in deployment mode. | |
The Artemis definitions.
This file declares constants and functions used throughout the satellite.
#define ARTEMIS_CURRENT_BEACON_1_COUNT 2 |
The number of current sensor readings in the first current beacon.
bool kill_thread | ( | uint8_t | target_channel_id | ) |
Kill a running thread.
target_channel_id | The Channel_ID of the channel to kill. |
bool PullQueue | ( | PacketComm & | packet, |
std::deque< PacketComm > & | queue, | ||
Threads::Mutex & | mtx | ||
) |
Pull a packet from a queue.
This is a helper function to check a queue of packets for a packet.
packet | The packet object that will carry the pulled packet, if there is one. |
queue | The queue of packets to be pulled from. |
mtx | The mutex used to lock the queue. |
void PushQueue | ( | PacketComm & | packet, |
std::deque< PacketComm > & | queue, | ||
Threads::Mutex & | mtx | ||
) |
Push a packet into a queue.
This is a helper function to push a packet into a queue of packets. It will push out the first packet in the queue if the queue is too large.
packet | The packet object that will be pushed into the queue. |
queue | The queue of packets to be pulled from. |
mtx | The mutex used to lock the queue. |
const float MV_PER_ADC_UNIT = 3300.0 / 1024.0 |
The conversion factor between ADC units and voltage.
This value represents the ratio between the 10-bit value returned by the Analog-To-Digital (ADC) converter to millivolts DC. It is based off of the maximum value of 1024 representing 3.3VDC, and 0 representing 0.0VDC.
const float MV_PER_DEGREE_F = 1.0 |
The conversion factor between temperature and voltage.
This value represents the relationship between millivolts and degrees Fahrenheit. It is currently 1 mV/°F.
const float OFFSET_F = 58.0 |
The offset of the temperature sensors.
This value represents the offset in the output voltage. It is given as either degrees Fahrenheit or millivolts. It is currently 58 mV (58°F).
|
extern |
The list of active threads.
This is a list of thread_structs that correspond to each active thread, running a channel. There can be a maximum of 16 active threads.