#include "main.h"#include "system.h"#include "sdk.h"#include "LL_HL_comm.h"#include "uart.h"#include "time.h"#include "irq.h"#include "LPC214x.h"#include "hardware.h"#include <ekf/autogen_ekf_propagation.h>#include <ekf/autogen_ekf_propagation_initialize.h>#include "gpsmath.h"#include <ert_main.h>#include "dekf.h"
Go to the source code of this file.
Functions | |
| int | checkTxPeriod (uint16_t period) | 
| checks if a packet has to be sent   | |
| void | SDK_mainloop (void) | 
| void | sdkInit (void) | 
| initializes the sdk   | |
| void | sendGpsData (void) | 
| assembles GPS packet and sends it   | |
| void | sendImuData (void) | 
| assembles IMU packet and sends it   | |
| void | sendMagData (void) | 
| assembles magnetic compass data packet and sends it   | |
| void | sendRcData (void) | 
| assembles rc packet and sends it   | |
| void | sendStatus (void) | 
| assembles status packet and sends it   | |
| void | synchronizeTime () | 
| adjusts HLP time to host PC time   | |
| void | watchdog (void) | 
| gets called every sdk loops. Currently, only checks for packets from the PC and starts autobaud in case there wwas no communication in the last 10 s   | |
| void | writeCommand (short pitch, short roll, short yaw, short thrust, short ctrl, short enable) | 
| Writes command to the LLP.   | |
Variables | |
| HLI_BAUDRATE | baudrate | 
| HLI_CMD_LL | cmdLL | 
| unsigned char | cmdLLNew = 0 | 
| short | cmdLLValid = 0 | 
| HLI_CMD_LL | controlEnable | 
| unsigned int | cpuLoad = 0 | 
| DekfContext | dekf | 
| HLI_EXT_POSITION | ext_position_update | 
| HLI_EXT_POSITION | extPosition | 
| HLI_CMD_HL | extPositionCmd | 
| short | extPositionValid = 0 | 
| HLI_GPS | gpsData | 
| HLI_CONFIG | hli_config | 
| HLI_IMU | imuData | 
| HLI_MAG | mag_data | 
| short | motor_state = -1 | 
| short | motor_state_count = 0 | 
| HLI_MOTORS | motors | 
| PacketInfo * | packetBaudrate | 
| PacketInfo * | packetCmdHL | 
| PacketInfo * | packetCmdLL | 
| PacketInfo * | packetConfig | 
| PacketInfo * | packetControlEnable | 
| PacketInfo * | packetExtPosition | 
| PacketInfo * | packetMotors | 
| PacketInfo * | packetSSDKParams | 
| PacketInfo * | packetSubscription | 
| PacketInfo * | packetTimeSync | 
| HLI_RCDATA | rcData | 
| struct RO_ALL_DATA | RO_ALL_Data | 
| struct RO_RC_DATA | RO_RC_Data | 
| unsigned int | sdkCycleStartTime = 0 | 
| unsigned int | sdkLoops = 0 | 
| counts ssdk loops   | |
| unsigned int | ssdk_reset_state = 0 | 
| HLI_SSDK_STATUS | ssdk_status | 
| HLI_STATUS | statusData | 
| HLI_SUBSCRIPTION | subscription | 
| int64_t | time_correction = 0 | 
| unsigned short | time_step = 2000 | 
| int64_t | timeOffset = 0 | 
| volatile int64_t | timestamp = 0 | 
| current time. Gets incremented by timer0 and gets corrected by synchronizeTime().   | |
| HLI_TIMESYNC | timeSync | 
| struct WO_CTRL_INPUT | WO_CTRL_Input | 
| struct  WO_DIRECT_INDIVIDUAL_MOTOR_CONTROL  | WO_Direct_Individual_Motor_Control | 
| struct WO_DIRECT_MOTOR_CONTROL | WO_Direct_Motor_Control | 
| struct WO_SDK_STRUCT | WO_SDK | 
| int checkTxPeriod | ( | uint16_t | period | ) |  [inline] | 
        
| void SDK_mainloop | ( | void | ) | 
SDK_mainloop(void) is triggered @ 1kHz.
WO_(Write Only) data is written to the LL processor after execution of this function.
RO_(Read Only) data is updated before entering this function and can be read to obtain information for supervision or control
WO_ and RO_ structs are defined in sdk.h
The struct LL_1khz_attitude_data (defined in LL_HL_comm.h) can be used to read all sensor data, results of the data fusion and R/C inputs transmitted from the LL-processor. This struct is automatically updated at 1 kHz.
| void sendGpsData | ( | void | ) |  [inline] | 
        
| void sendImuData | ( | void | ) |  [inline] | 
        
| void sendMagData | ( | void | ) |  [inline] | 
        
| void sendRcData | ( | void | ) |  [inline] | 
        
| void sendStatus | ( | void | ) |  [inline] | 
        
| void synchronizeTime | ( | void | ) |  [inline] | 
        
| void watchdog | ( | void | ) |  [inline] | 
        
| void writeCommand | ( | short | pitch, | 
| short | roll, | ||
| short | yaw, | ||
| short | thrust, | ||
| short | ctrl, | ||
| short | enable | ||
| ) |  [inline] | 
        
| short cmdLLValid = 0 | 
| short extPositionValid = 0 | 
| short motor_state = -1 | 
| short motor_state_count = 0 | 
| struct RO_ALL_DATA RO_ALL_Data | 
| struct RO_RC_DATA RO_RC_Data | 
| unsigned int sdkCycleStartTime = 0 | 
| unsigned int ssdk_reset_state = 0 | 
| int64_t time_correction = 0 | 
| int64_t timeOffset = 0 | 
| volatile int64_t timestamp = 0 | 
current time. Gets incremented by timer0 and gets corrected by synchronizeTime().
| struct WO_CTRL_INPUT WO_CTRL_Input | 
| struct WO_SDK_STRUCT WO_SDK |