User Tools

Translations of this page:

Site Tools


en:libschsat

This is an old revision of the document!


Description of the standard construction set functions library
libschsat.h (1.01)

For devices whose number is not marked on the body the default number is 1.

#define LSS_OK 0 
#define LSS_ERROR 1 
#define LSS_BREAK 2

Standard codes returned by library functions:

float battery_get_charge(void);

The function returns the current charge of the virtual PSS (mA*h)

float battery_get_discharging_current(void); 

The function returns the current discharge current of the PSS (mA)

int camera_get_state(void); 

The function returns the current camera status (on/off)

int camera_turn_off(void);

Turns off the camera to reduce power consumption

int camera_turn_on(void);

Turns on the camera

int hyro_get_state(uint16_t num);

The function returns the current status of the AVS (on/off)

int hyro_request_raw(uint16_t num,int16_t *pRAW_dataX,int16_t *pRAW_dataY,int16_t *pRAW_dataZ); 

The function returns LSS_OK and writes the current readings of the AVS number num to the variables pRAW_dataX - pRAW_dataZ
In case of errors on the bus, the function returns LSS_ERROR
In case of a power failure, the AVS function returns LSS_BREAK ​
The angular velocity determined by the sensor is 0.00875 degrees/second per unit RAW

int hyro_request_reset(uint16_t num);

Reboots the AVS number num

int hyro_turn_off(uint16_t num);

Turns off the AVS number num to reduce power consumption

int hyro_turn_on(uint16_t num);

Turn on the AVS number num

int laser_get_state(uint16_t num); 

The function returns the current state of the HF transmitter (on/off)

int magnetometer_get_state(uint16_t num);

The function returns the current state of the magnetometer (on/off)

int magnetometer_request_raw(uint16_t num,int16_t *pRAW_dataX,int16_t *pRAW_dataY,int16_t *pRAW_dataZ); 

The function returns LSS_OK and writes the current readings of the magnetometer number num to the variables pRAW_dataX - pRAW_dataZ
In case of errors on the bus, the function returns LSS_ERROR
In case of a power failure, the magnetometer function returns LSS_BREAK ​
The return value contains: - 1100 RAW units per Gauss along the X and Y axes, 980 RAW units per Gauss along Z-axis

int magnetometer_request_reset(uint16_t num); 

Reboots the magnetometer number num

int magnetometer_turn_off(uint16_t num);

Turns off the magnetometer number num to reduce power consumption

int magnetometer_turn_on(uint16_t num);

Turns on the magnetometer number num

int motor_get_state(uint16_t num);

The function returns current state of the flywheel number num (on/off)

int motor_request_reset(uint16_t num);

Reboots the flywheel number num

int motor_request_speed(uint16_t num,int16_t *pRPM); 

The function returns LSS_OK and writes the current speed of the flywheel number num to the variable pRPM
In case of errors on the bus, the function returns LSS_ERROR
In case of power failure, the flywheel function returns LSS_BREAK ​

int motor_set_speed(uint16_t num,int16_t RPM,int16_t *confirm);

The function returns LSS_OK and writes the target speed for the flywheel number num in the variable confirm and sets this speed to the flywheel
In case of errors on the bus, the function returns LSS_ERROR
In case of a power failure, the flywheel function returns LSS_BREAK

int motor_turn_off(uint16_t num); 

Turns off the flywheel number num to reduce power consumption (short-term turning off and on is not recommended)

int motor_turn_on(uint16_t num); 

Turns on the flywheel number num

int receiver_request_reset(uint16_t num); 

Reboots the telemetry transmitter number num

int receiver_request_state(uint16_t num,float *quality); 

The function returns the current state of the telemetry transmitter number num (on/off)

int bus_setup(void);

Prepares all devices on the bus to receive information. By default, devices after turning on or rebooting start the exchange only after at least one sending is complete on the bus (for any device), this function simply sends an empty message addressed to all.

int sun_sensor_get_state(uint16_t num); 

The function returns current state of the solar sensor number num (on/off)

int sun_sensor_request_maxraw(uint16_t num, uint16_t *pMAXRAW_data1, uint16_t *pMAXRAW_data2); 

The function returns LSS_OK and writes the current maximums of the solar sensor number num in the variables pMAXRAW_data1 and pMAXRAW_data2. Maximum is the maximum reading that the sensor has ever detected since the reset.
In case of errors on bus the function returns LSS_ERROR
In case of no power on the solar sensor the function returns LSS_BREAK

int sun_sensor_request_raw(uint16_t num, uint16_t *pRAW_data1, uint16_t *pRAW_data2); 

The function returns LSS_OK and writes the current readings of the solar sensor number num in the variables pRAW_data1 and pRAW_data2.
In case of errors on bus the function returns LSS_ERROR
In case of no power on the solar sensor the function returns LSS_BREAK

int sun_sensor_request_reset(uint16_t num); 

Reboot the solar sensor number num

int sun_sensor_set_calibrate(uint16_t num,uint8_t mode); 

Not used

int sun_sensor_set_minvalue(uint16_t num,uint16_t value); 

Not used

int sun_sensor_turn_off(uint16_t num);

Turn off the solar sensor number num to reduce power consumtion

int sun_sensor_turn_on(uint16_t num); 

Turn on the solar sensor number num

int camera_take_photo(uint16_t num); 

This function sends a signal to the camera to take a photo and records the photo in the cell number num

int transceiver_get_state(uint16_t num); 

The function returns the current status of the telemetry transmitter numer num (on/off)

int transceiver_request_buff(uint16_t num,uint8_t *data);

Not used

int transceiver_request_reset(uint16_t num); 

Reboot the telemetry transmitter number num

int transceiver_send(uint16_t tx_num,uint16_t rx_num,const uint8_t *data,uint16_t len); 

Sends a data packet with data length len from the telemetry transmitter number tx_num to the telemetry receiver number rx_num (to the Earth)

int transceiver_turn_off(uint16_t num);

Turn off the telemetry transmitter number num to reduce power consumption

int transceiver_turn_on(uint16_t num); 

Turn on the telemetry transmitter number num

int transmitter_transmit_photo(uint16_t num, uint16_t nPhoto); 

Sends a photo from the camera cell number nPhoto using the HF transmitter number num to the HF receiver (to the Earth)

int transmitter_request_reset(uint16_t num);

Reboot the HF transmitter number num

int transmitter_turn_off(uint16_t num); 

Turn off the HF transmitter number num to reduce power consumption

int transmitter_turn_on(uint16_t num);

Turn on the HF transmitter number num

void dump_buffer(uint8_t *buf,size_t len);

Not used

void mSleep(int msec); 

Pause in the program for msec milliseconds

void Sleep(int sec);

Pause in the program for sec seconds

en/libschsat.1516882281.txt.gz · Last modified: 2018/01/25 15:11 by ashley