Skip to content

Group onboard

Modules > onboard

Functions and data structures used by the onboard firmware.

Classes

Type Name
class dataStruct
Class for the telemetry and flight data.
class ledStruct
Class for all LEDs.

Public Functions

Type Name
void buzzerSound (uint8_t pinBuzzer)
Function to play a sound when the setup is completed.
void buzzerSoundError (uint8_t pinBuzzer)
Function to play a sound according to a error during setup.
void commandExecute (uint8_t command, RC17xxHP_RC232 * radioModule, dataStruct * dataVariables, ledStruct * pinLed, uint8_t * flightMode, Subsystem ** subsystemsList, uint8_t subsystemsCount, Subsystem * subsystemSens, Subsystem * subsystemControl, Packet * flightDataPacket, Packet * telemetryDataPacket, uint8_t pinArm, uint8_t pinSleep)
Changes the values of the loop variables and therefore the state of flight computer.
void commandReceive (RC17xxHP_RC232 * radioModule, Packet * commandPacket)
Returns the latest single-byte command from the uplink module (rc1701hp, on Serial3), or 0 if command is bad/unknown.
void flashWrite (dataStruct * dataVariables)
Function to write to the onbaord flash. f.
void ledUpdate (uint8_t state, ledStruct * pinLed)
Function to update LEDs to display different states of the system.
void loopVariablesUpdate (uint32_t * loopCount, uint32_t * loopStartTime, uint8_t loopFrequency, uint8_t pinLedLoop)
Function that update the loop variables.
void packetSend (RC17xxHP_RC232 * radioModule, uint8_t packetType, Packet * flightDataPacket, Packet * telemetryDataPacket)
Function to build up the package depending on an identifyer.
uint8_t packetSendCheck (uint8_t * flightmode, uint8_t loopFrequency, uint8_t timeBetweenStandbyPackets, uint32_t loopCount)
Function that handle the decision of sending a package depending on the timeBetweenStandbyPackets. In addition handles the decision of sending either the telemetry or flight package.
void radioModulesSetup (RC17xxHP_RC232 * rc1780hp, RC17xxHP_RC232 * rc1701hp, ledStruct * pinLed, uint8_t pinBuzzer)
Configures both radio modules; lights each module's status LED on success and sounds buzzzer.

Public Functions Documentation

function buzzerSound

Function to play a sound when the setup is completed.

void buzzerSound (
    uint8_t pinBuzzer
) 

Parameters:

  • pinBuzzer

function buzzerSoundError

Function to play a sound according to a error during setup.

void buzzerSoundError (
    uint8_t pinBuzzer
) 

Parameters:

  • pinBuzzer

function commandExecute

Changes the values of the loop variables and therefore the state of flight computer.

void commandExecute (
    uint8_t command,
    RC17xxHP_RC232 * radioModule,
    dataStruct * dataVariables,
    ledStruct * pinLed,
    uint8_t * flightMode,
    Subsystem ** subsystemsList,
    uint8_t subsystemsCount,
    Subsystem * subsystemSens,
    Subsystem * subsystemControl,
    Packet * flightDataPacket,
    Packet * telemetryDataPacket,
    uint8_t pinArm,
    uint8_t pinSleep
) 

Parameters:

  • command
  • radioModule
  • dataVariables
  • pinLed
  • flightMode
  • subsystemsList
  • subsystemsCount
  • subsystemSens
  • subsystemControl
  • pinArm
  • pinSleep

function commandReceive

Returns the latest single-byte command from the uplink module (rc1701hp, on Serial3), or 0 if command is bad/unknown.

void commandReceive (
    RC17xxHP_RC232 * radioModule,
    Packet * commandPacket
) 

Parameters:

  • radioModule

Returns:

uint8_t


function flashWrite

Function to write to the onbaord flash. f.

void flashWrite (
    dataStruct * dataVariables
) 

Parameters:

  • dataVariables

function ledUpdate

Function to update LEDs to display different states of the system.

void ledUpdate (
    uint8_t state,
    ledStruct * pinLed
) 

Parameters:

  • state
  • pinLed

function loopVariablesUpdate

Function that update the loop variables.

void loopVariablesUpdate (
    uint32_t * loopCount,
    uint32_t * loopStartTime,
    uint8_t loopFrequency,
    uint8_t pinLedLoop
) 

Parameters:

  • loopCount
  • loopStartTime
  • loopFrequency
  • pinLedLoop

function packetSend

Function to build up the package depending on an identifyer.

void packetSend (
    RC17xxHP_RC232 * radioModule,
    uint8_t packetType,
    Packet * flightDataPacket,
    Packet * telemetryDataPacket
) 

Parameters:

  • radioModule
  • dataVariables
  • pinLed
  • packetIdentifier

function packetSendCheck

Function that handle the decision of sending a package depending on the timeBetweenStandbyPackets. In addition handles the decision of sending either the telemetry or flight package.

uint8_t packetSendCheck (
    uint8_t * flightmode,
    uint8_t loopFrequency,
    uint8_t timeBetweenStandbyPackets,
    uint32_t loopCount
) 

Parameters:

  • flightmode
  • loopFrequency
  • timeBetweenStandbyPackets
  • loopCount

Returns:

uint8_t


function radioModulesSetup

Configures both radio modules; lights each module's status LED on success and sounds buzzzer.

void radioModulesSetup (
    RC17xxHP_RC232 * rc1780hp,
    RC17xxHP_RC232 * rc1701hp,
    ledStruct * pinLed,
    uint8_t pinBuzzer
) 

Parameters:

  • rc1780hp
  • rc1701hp
  • pinLed
  • pinBuzzer