Ke Ao Teensy Flight Software
The software on the Teensy in the Ke Ao cubesat.
Loading...
Searching...
No Matches
artemis_defs.cpp File Reference

The Artemis definitions. More...

Functions

int kill_thread (uint8_t channel_id)
 Kills a running thread.
 
int32_t PushQueue (PacketComm &packet, std::deque< PacketComm > &queue, Threads::Mutex &mtx)
 Push a packet to the specified queue.
 
int32_t PullQueue (PacketComm &packet, std::deque< PacketComm > &queue, Threads::Mutex &mtx)
 Pulls a packet from the specified queue.
 

Variables

vector< struct thread_structthread_list
 The list of threads currently running on the Teensy.
 
std::map< string, NODESNodeType
 Mapping of string node types to corresponding node IDs.
 
Threads::Mutex main_queue_mtx
 The mutex for the main_queue.
 
Threads::Mutex astrodev_queue_mtx
 The mutex for the astrodev_queue.
 
Threads::Mutex rfm23_queue_mtx
 The mutex for the rfm23_queue.
 
Threads::Mutex rfm98_queue_mtx
 The mutex for the rfm98_queue.
 
Threads::Mutex pdu_queue_mtx
 The mutex for the pdu_queue.
 
Threads::Mutex rpi_queue_mtx
 The mutex for the rpi_queue.
 
std::deque< PacketComm > main_queue
 The main queue for packets in the Teensy.
 
std::deque< PacketComm > astrodev_queue
 The queue for packets going to the Astrodev (Li-3) radio.
 
std::deque< PacketComm > rfm23_queue
 The queue for packets going to the RFM23 radio.
 
std::deque< PacketComm > rfm98_queue
 The queue for packets going to the RFM98 radio.
 
std::deque< PacketComm > pdu_queue
 The queue for packets to command the PDU.
 
std::deque< PacketComm > rpi_queue
 The queue for packets going to the Raspberry Pi.
 
Threads::Mutex spi1_mtx
 The mutex for the SPI1 interface on the Teensy.
 
Threads::Mutex i2c1_mtx
 The mutex for the I2C1 interface on the Teensy.
 

Detailed Description

The Artemis definitions.

Function Documentation

◆ kill_thread()

int kill_thread ( uint8_t  channel_id)

Kills a running thread.

Parameters
channel_idThe ID of the thread to be killed.
Returns
int Returns the thread ID of the thread if it is successfully killed, or -1 if unsuccessful.

◆ PullQueue()

int32_t PullQueue ( PacketComm &  packet,
std::deque< PacketComm > &  queue,
Threads::Mutex &  mtx 
)

Pulls a packet from the specified queue.

Parameters
packetThe packet that will be pulled into.
queueThe queue that the packet will be pulled from.
mtxThe mutex used to lock the queue.
Returns
int32_t Returns 1 if queue is not empty, 0 if the queue is empty.

◆ PushQueue()

int32_t PushQueue ( PacketComm &  packet,
std::deque< PacketComm > &  queue,
Threads::Mutex &  mtx 
)

Push a packet to the specified queue.

Parameters
packetThe packet to be pushed.
queueThe queue that the packet will be pushed into.
mtxThe mutex used to lock the queue.
Returns
int32_t This function always returns 1.

Variable Documentation

◆ NodeType

std::map<string, NODES> NodeType
Initial value:
= {
{ "ground", NODES::GROUND_NODE_ID},
{"artemis_teensy", NODES::TEENSY_NODE_ID},
{ "artemis_rpi", NODES::RPI_NODE_ID},
{ "pleiades", NODES::PLEIADES_NODE_ID},
}
@ TEENSY_NODE_ID
@ RPI_NODE_ID
@ GROUND_NODE_ID
@ PLEIADES_NODE_ID

Mapping of string node types to corresponding node IDs.

This map associates string keys with NODES values, allowing for easy translation between string names and numerical IDs.

◆ thread_list

vector<struct thread_struct> thread_list

The list of threads currently running on the Teensy.

A maximum of 16 threads can be handled by the thread list.