Kubos ADCS API¶
Enums
-
enum
KADCSStatus
¶ ADCS function return values.
Values:
-
ADCS_OK
¶
-
ADCS_ERROR
¶ Generic error.
-
ADCS_ERROR_CONFIG
¶ Configuration error.
-
ADCS_ERROR_NO_RESPONSE
¶ No response received from subsystem.
-
ADCS_ERROR_INTERNAL
¶ An error was thrown by the subsystem.
-
ADCS_ERROR_MUTEX
¶ Mutex-related error.
-
ADCS_ERROR_NOT_IMPLEMENTED
¶ Requested function has not been implemented for the subsystem.
-
Functions
-
KADCSStatus
k_adcs_init
(void)¶ Initialize the ADCS interface.
- Return
- KADCSStatus ADCS_OK if OK, error otherwise
-
void
k_adcs_terminate
(void)¶ Terminate the ADCS interface.
-
KADCSStatus
k_adcs_noop
(void)¶ Execute ADCS no-op command.
- Note
- This function might not be implemented for all ADCSs.
- Return
- KADCSStatus ADCS_OK if OK, error otherwise
-
KADCSStatus
k_adcs_configure
(const JsonNode *config)¶ Configure the ADCS.
- Return
- KADCSStatus ADCS_OK if OK, error otherwise
- Parameters
config
: ADCS configuration structure
-
KADCSStatus
k_adcs_reset
(KADCSReset type)¶ Reset the ADCS.
- Note
- This function might not be implemented for all ADCSs
- Return
- KADCSStatus ADCS_OK if OK, error otherwise
- Parameters
type
: Type of reset to perform (hard, soft, etc)
-
KADCSStatus
k_adcs_set_mode
(ADCSMode mode, const adcs_mode_param *params)¶ Set the ADCS’s operating mode.
- Note
- See specific ADCS API documentation for available modes
- Return
- KADCSStatus ADCS_OK if OK, error otherwise
- Parameters
mode
: Operating mode to change toparams
: Pointer to optional parameters which may be needed to configure the new operational mode
-
KADCSStatus
k_adcs_run_test
(ADCSTestType test, adcs_test_results buffer)¶ Run an ADCS self-test.
- Note
- This function might not be implemented for all ADCSs. See specific ADCS API documentation for available self-tests.
- Return
- KADCSStatus ADCS_OK if OK, error otherwise
- Parameters
test
: Type of self-test to runbuffer
: (Pointer to) structure which the test-results should be copied to
-
KADCSStatus
k_adcs_get_power_status
(adcs_power_status *data)¶ Get the ADCS’s power status.
- Return
- KADCSStatus ADCS_OK if OK, error otherwise
- Parameters
data
: Pointer to storage for returned system uptime. If the value is zero, then the ADCS is offline.
-
KADCSStatus
k_adcs_get_mode
(ADCSMode *mode)¶ Get the ADCS’s current operating mode.
- Return
- KADCSStatus ADCS_OK if OK, error otherwise
- Parameters
mode
: Pointer to storage which the mode value should be copied to
-
KADCSStatus
k_adcs_get_orientation
(adcs_orient *data)¶ Get the ADCS’s current orientation.
- Note
- This function might not be implemented for all ADCSs.
- Return
- KADCSStatus ADCS_OK if OK, error otherwise
- Parameters
data
: Pointer to storage for returned data.
-
KADCSStatus
k_adcs_get_spin
(adcs_spin *data)¶ Get the ADCS’s current spin.
- Note
- This function might not be implemented for all ADCSs.
- Return
- KADCSStatus ADCS_OK if OK, error otherwise
- Parameters
data
: Pointer to storage for returned data.
-
KADCSStatus
k_adcs_get_telemetry
(ADCSTelemType type, JsonNode *buffer)¶ Read ADCS telemetry values.
- Note
- See specific ADCS API documentation for available telemetry types
- Return
- KADCSStatus ADCS_OK if OK, error otherwise
- Parameters
type
: Telemetry packet to readbuffer
: (Pointer to) structure which data should be copied to
-
KADCSStatus
k_adcs_passthrough
(const uint8_t *tx, int tx_len, uint8_t *rx, int rx_len, const struct timespec *delay)¶ Pass a command packet directly through to the ADCS.
Useful for executing commands which have not been implemented in either the generic or specific ADCS APIs.
- Return
- KADCSStatus ADCS_OK if OK, error otherwise
- Parameters
tx
: Pointer to command packet to sendtx_len
: Size of command packetrx
: Pointer to storage for command responserx_len
: Expected length of command responsedelay
: Time to wait inbetween sending the command packet and requesting a response