User Tools

Site Tools


en:libschsat

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en:libschsat [2018/01/25 15:26]
ashley
en:libschsat [2020/03/25 16:28]
Line 1: Line 1:
-**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 ​ [[power_subsys|PSS]] (mA*h) 
- 
-  float battery_get_discharging_current(void); ​ 
-The function returns the current discharge current of the  [[power_subsys|PSS]] (mA) 
- 
-  int camera_get_state(void); ​ 
-The function returns the current [[camera_subsys|camera]] status (on/off) 
- 
-  int camera_turn_off(void);​ 
-Turns off [[camera_subsys|the camera ]] to reduce power consumption 
- 
-  int camera_turn_on(void);​ 
-Turns on [[camera_subsys|the camera]] ​ 
- 
-  int hyro_get_state(uint16_t num); 
-The function returns the current status of [[w_subsys|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 [[w_subsys|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, [[w_subsys|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 [[w_subsys|the AVS]] number **num** 
- 
-  int hyro_turn_off(uint16_t num); 
-Turns off [[w_subsys|the AVS]] number **num** to reduce power consumption 
- 
-  int hyro_turn_on(uint16_t num); 
-Turn on [[w_subsys|the AVS]] number **num** 
- 
-  int laser_get_state(uint16_t num);  
-The function returns the current state of [[hf_tx_subsys|the HF transmitter]] (on/off) 
-  ​ 
-  int magnetometer_get_state(uint16_t num); 
-The function returns the current state of [[mag_subsys|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 [[mag_subsys|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, [[mag_subsys|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 [[mag_subsys|the magnetometer]] number **num** 
- 
-  int magnetometer_turn_off(uint16_t num); 
-Turns off [[mag_subsys|the magnetometer]] number **num** to reduce power consumption 
- 
-  int magnetometer_turn_on(uint16_t num); 
-Turns on [[mag_subsys|the magnetometer]] number **num** 
- 
-  int motor_get_state(uint16_t num); 
-The function returns current state of [[wheel_subsys|the flywheel]] number **num** (on/off) 
- 
-  int motor_request_reset(uint16_t num); 
-Reboots [[wheel_subsys|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 [[wheel_subsys|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, [[wheel_subsys|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  [[wheel_subsys|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, [[wheel_subsys|the flywheel]] function returns LSS_BREAK ​ 
- 
-  int motor_turn_off(uint16_t num);  
-Turns off [[wheel_subsys|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 [[wheel_subsys|the flywheel]] number **num** ​ 
- 
-  int receiver_request_reset(uint16_t num);  
-Reboots [[uhf_tx_subsys|the telemetry transmitter]] number **num** 
- 
-  int receiver_request_state(uint16_t num,float *quality); ​ 
-The function returns the current state of [[uhf_tx_subsys|the telemetry transmitter]] number **num** (on/off) 
- 
-  int bus_setup(void);​ 
-Prepares all devices on the bus to receive information. By default, after turning on or rebooting, the devices start the exchange only after at least one message has been completed 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 the current state of [[sun_subsys|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  [[sun_subsys| 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 the bus, the function returns LSS_ERROR\\ 
-In case of power failure, [[sun_subsys|the solar sensor]] 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  [[sun_subsys| the solar sensor]] number **num** in the variables pRAW_data1 and pRAW_data2. \\ 
-In case of errors on the bus, the function returns LSS_ERROR\\ 
-In case of power failure, [[sun_subsys|the solar sensor]] function returns LSS_BREAK ​ 
- 
-  int sun_sensor_request_reset(uint16_t num);  
-Reboots [[sun_subsys|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); 
-Turns off [[sun_subsys|the solar sensor]] number **num** to reduce power consumption 
- 
-  int sun_sensor_turn_on(uint16_t num);  
-Turns on [[sun_subsys|the solar sensor]] number **num** 
- 
-  int camera_take_photo(uint16_t num);  
-This function sends a signal to [[camera_subsys|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 [[uhf_tx_subsys|the telemetry transmitter]] number **num** (on/off) 
- 
-  int transceiver_request_buff(uint16_t num,uint8_t *data); 
-Not used 
- 
-  int transceiver_request_reset(uint16_t num);  
-Reboots [[uhf_tx_subsys|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 [[uhf_tx_subsys|the telemetry transmitter]] number **tx_num** to [[uhf_rx_subsys|the telemetry receiver]] number **rx_num** (to the Earth) ​ 
- 
-  int transceiver_turn_off(uint16_t num); 
-Turns off [[uhf_tx_subsys|the telemetry transmitter]] number **num** to reduce power consumption 
- 
-  int transceiver_turn_on(uint16_t num);  
-Turns on [[uhf_tx_subsys|the telemetry transmitter]] number **num** 
- 
-  int transmitter_transmit_photo(uint16_t num, uint16_t nPhoto); ​ 
-Sends a photo from [[camera_subsys|the camera]] cell number **nPhoto** using [[hf_tx_subsys|the HF transmitter]] number **num** to [[hf_rx_subsys|the HF receiver]] (to the Earth) 
- 
-  int transmitter_request_reset(uint16_t num); 
-Reboots [[hf_tx_subsys|the HF transmitter]] number **num** 
- 
-  int transmitter_turn_off(uint16_t num);  
-Turns off [[hf_tx_subsys|the HF transmitter]] number **num** to reduce power consumption 
- 
-  int transmitter_turn_on(uint16_t num); 
-Turns on [[hf_tx_subsys|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.txt · Last modified: 2020/03/25 16:28 (external edit)