![]() |
F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
|
#include <Fw/FPrimeBasicTypes.h>Go to the source code of this file.
Macros | |
| #define | WASM_IMPORT(module, name) |
| #define | WASM_MODULE_NAME ("fprime_v1") |
Enumerations | |
| enum | FprimeTlmValid { FPRIME_TLM_VALID = 0, FPRIME_TLM_INVALID = 1 } |
| enum | FprimeParamValid { FPRIME_PARAM_UNINIT = 0, FPRIME_PARAM_VALID = 1, FPRIME_PARAM_INVALID = 2, FPRIME_PARAM_DEFAULT = 3 } |
| enum | FprimeCmdResponse { FPRIME_CMD_OK = 0, FPRIME_CMD_INVALID_OPCODE = 1, FPRIME_CMD_VALIDATION_ERROR = 2, FPRIME_CMD_FORMAT_ERROR = 3, FPRIME_CMD_EXECUTION_ERROR = 4, FPRIME_CMD_BUSY = 5, FPRIME_CMD_CLEARED = 5 } |
| enum | FprimeEventSeverity : I32 { FPRIME_EVENT_FATAL = 1, FPRIME_EVENT_WARNING_HI = 2, FPRIME_EVENT_WARNING_LO = 3, FPRIME_EVENT_COMMAND = 4, FPRIME_EVENT_ACTIVITY_HI = 5, FPRIME_EVENT_ACTIVITY_LO = 6, FPRIME_EVENT_DIAGNOSTIC = 7 } |
| enum | FprimeBlockingType { FPRIME_BLOCK_BLOCKING = 0, FPRIME_BLOCK_NONBLOCKING = 1 } |
| enum | FprimeQueueStatus { FPRIME_QUEUE_OK = 0, FPRIME_QUEUE_EMPTY = 1 } |
Functions | |
| void | fprime_wasm_exit (I32 code) |
| Exit the current Wasm program with a return code. This function does not return. More... | |
| void | fprime_wasm_panic (I32 code) |
| Exit the current Wasm program with a failure. This function does not return. More... | |
| U32 | fprime_wasm_get_args (U32 destination_ptr, U32 destination_size) |
| Get the sequence arguments this sequence was invoked with This function will write the arguments provided from the invoke/run into the guest memory. More... | |
| void | fprime_wasm_get_time (U32 time_ptr, U32 time_size) |
| Read the current F´ system time into guest memory. More... | |
| FprimeTlmValid | fprime_wasm_read_telemetry (I64 id, U32 time_ptr, U32 time_size, U32 value_ptr, U32 value_size) |
| Read a telemetry channel value and write it to the specified memory addresses. More... | |
| FprimeParamValid | fprime_wasm_read_parameter (I64 id, U32 value_ptr, U32 value_size) |
| Read a parameter value and write it to the specified memory addresses. More... | |
| FprimeCmdResponse | fprime_wasm_command (U32 buf_ptr, U32 buf_size) |
| Dispatch a command, blocking call. More... | |
| void | fprime_wasm_event (FprimeEventSeverity severity, U32 msg_ptr, U32 msg_size) |
| Emit an event from the current WasmSequencer component at a given severity level. More... | |
| void | fprime_wasm_rsleep (U64 us) |
| Pause the runtime for a specified time. More... | |
| void | fprime_wasm_asleep (U64 us) |
| Pause the runtime until a specified time. More... | |
| void | fprime_wasm_serial_out (I32 index, U32 data_ptr, U32 data_size) |
| Invoke a serial port If the port is not connected, the module will panic/trap. More... | |
| FprimeQueueStatus | fprime_wasm_serial_receive (I32 index, U32 data_ptr, U32 data_size, U32 actual_size_ptr, FprimeBlockingType block_type) |
| Receive a message from a serial input queue. More... | |
| enum FprimeBlockingType |
| enum FprimeCmdResponse |
| enum FprimeEventSeverity : I32 |
| enum FprimeParamValid |
Parameter validity, mirroring Fw::ParamValid. Unlike telemetry (FprimeTlmValid, a two-state VALID/INVALID enum), a parameter read distinguishes four states, so it uses its own encoding. Note FPRIME_PARAM_VALID is 1, not 0.
| enum FprimeQueueStatus |
| enum FprimeTlmValid |
| void fprime_wasm_asleep | ( | U64 | us | ) |
Pause the runtime until a specified time.
| us | Microseconds from system epoch to pause until |
| FprimeCmdResponse fprime_wasm_command | ( | U32 | buf_ptr, |
| U32 | buf_size | ||
| ) |
Dispatch a command, blocking call.
Command must be encoded with the FwOpcodeType + arguments. A FORMAT_ERROR will be returned if the format is not valid!
| buf_ptr | Guest memory address to encoded command |
| buf_size | Size allocated for value_ptr |
| void fprime_wasm_event | ( | FprimeEventSeverity | severity, |
| U32 | msg_ptr, | ||
| U32 | msg_size | ||
| ) |
Emit an event from the current WasmSequencer component at a given severity level.
| severity | Event severity level to emit |
| msg_ptr | Guest memory address to event message string |
| msg_size | Size allocated for value_ptr |
| void fprime_wasm_exit | ( | I32 | code | ) |
Exit the current Wasm program with a return code. This function does not return.
| code | 0 indicates success, any non-zero exit code will |
| U32 fprime_wasm_get_args | ( | U32 | destination_ptr, |
| U32 | destination_size | ||
| ) |
Get the sequence arguments this sequence was invoked with This function will write the arguments provided from the invoke/run into the guest memory.
| destination_ptr | Guest memory address to argument buffer |
| destination_size | Length of the argument buffer. This size must be greater than or equal to the length of arguments passed to the sequence otherwise the interpreter will trap |
| void fprime_wasm_get_time | ( | U32 | time_ptr, |
| U32 | time_size | ||
| ) |
Read the current F´ system time into guest memory.
The host serializes an Fw::Time into the guest buffer.
| time_ptr | Guest memory address to write the serialized time |
| time_size | Size allocated for time_ptr, must equal Fw::Time::SERIALIZED_SIZE |
| void fprime_wasm_panic | ( | I32 | code | ) |
Exit the current Wasm program with a failure. This function does not return.
| code | Aribtrary code to indicate source of the panic |
| FprimeParamValid fprime_wasm_read_parameter | ( | I64 | id, |
| U32 | value_ptr, | ||
| U32 | value_size | ||
| ) |
Read a parameter value and write it to the specified memory addresses.
| id | Parameter ID to read |
| value_ptr | Guest memory address to parameters's value |
| value_size | Size allocated for value_ptr |
| FprimeTlmValid fprime_wasm_read_telemetry | ( | I64 | id, |
| U32 | time_ptr, | ||
| U32 | time_size, | ||
| U32 | value_ptr, | ||
| U32 | value_size | ||
| ) |
Read a telemetry channel value and write it to the specified memory addresses.
| id | Channel ID to read |
| time_ptr | Guest memory address to write channel update time |
| time_size | Size allocated for time_ptr, should be Fw::Time::SERIALIZED_SIZE |
| value_ptr | Guest memory address to channel's value |
| value_size | Size allocated for value_ptr |
| void fprime_wasm_rsleep | ( | U64 | us | ) |
Pause the runtime for a specified time.
| us | Microseconds to pause the runtime for |
| void fprime_wasm_serial_out | ( | I32 | index, |
| U32 | data_ptr, | ||
| U32 | data_size | ||
| ) |
Invoke a serial port If the port is not connected, the module will panic/trap.
| index | Port index to emit on the serialOut on |
| data_ptr | Pointer to the data to send on the output port |
| data_size | Length of the data to send on the output port |
| FprimeQueueStatus fprime_wasm_serial_receive | ( | I32 | index, |
| U32 | data_ptr, | ||
| U32 | data_size, | ||
| U32 | actual_size_ptr, | ||
| FprimeBlockingType | block_type | ||
| ) |
Receive a message from a serial input queue.
| index | Port number/queue index to receive message from |
| data_ptr | Pointer to the destination to write serial messages into |
| data_size | Size of the data_ptr memory. If a message is larger than this size, trap the wasm module |
| actual_size_ptr | (U32*). On message receive, number of bytes received will be written here (little endian) |
| block_type | Whether or not to block for a message when the queue on this index is empty |