Ke Ao Teensy Flight Software
The software on the Teensy in the Ke Ao cubesat.
|
The channel controlling the Astrodev (Li-3) radio. More...
Macros | |
#define | ASTRODEV_BAUD 9600 |
The baud rate of the serial connection to the radio. | |
#define | ASTRODEV_FREQ 435000 |
The operating frequency of the Astrodev radio in kHz. | |
Functions | |
int32_t | astrodev_init (HardwareSerial *new_serial, uint32_t baud_rate) |
Helper function to initialize Astrodev radio. | |
int32_t | astrodev_recv () |
Helper function to receive Astrodev frames from the Astrodev radio. | |
int32_t | astrodev_send () |
Helper function to send PacketComm packets through the Astrodev radio. | |
The channel controlling the Astrodev (Li-3) radio.
This is the channel that controls the Astrodev (Li-3) radio, in parallel to all other channels. When it gets a slice of computing time on the Teensy's processor, it performs actions related to the Astrodev radio. This channel must be written such that it can be interrupted at any time to switch to the next channel.
Test astrodev channel without astrodev threads
See if we need individual threads for sending/receiving
int32_t astrodev_init | ( | HardwareSerial * | new_serial, |
uint32_t | baud_rate | ||
) |
Helper function to initialize Astrodev radio.
new_serial | Pointer to a HardwareSerial object representing a serial port on the Teensy. |
baud_rate | The baud rate at which to communicate with the Astrodev radio. |
The Astrodev radio is initialized with the passed-in serial port and baud rate.
The Teensy connects to the Astrodev radio over the initialized serial connection. This connection generates no-op and reset Astrodev frames. If these frames are unacknowledged or replied to with a no-ack, the initialization of the Astrodev radio has failed.
The internal Astrodev radio object is configured using pre-defined values.
The configuration settings of the internal Astrodev radio object are applied to the actual Astrodev radio. If the configuration is not sucessfully applied, return with an error code.
The transceiver configuration settings of the actual Astrodev radio are verified by polling the radio. If the Astrodev radio transceiver configuration request cannot be sent, return with an error code. If the request was sent but the settings do not match the internal Astrodev radio object, return -1.
int32_t astrodev_recv | ( | ) |
Helper function to receive Astrodev frames from the Astrodev radio.
The radio is commanded to receive an Astrodev frame. If a frame is received, check its header for its command type. Handle the frame based on this type. See the code for a detailed explaination.
int32_t astrodev_send | ( | ) |
Helper function to send PacketComm packets through the Astrodev radio.
The radio is commanded to transmit the internally-defined outgoing packet if the buffer is not full. If the buffer is full, the Teensy waits for a short while before pinging the radio to clear the buffer_full flag and trying again. If the buffer remains full after three tries, return with an error code.