Functions | Variables
sdk.c File Reference
#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"
Include dependency graph for sdk.c:

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
PacketInfopacketBaudrate
PacketInfopacketCmdHL
PacketInfopacketCmdLL
PacketInfopacketConfig
PacketInfopacketControlEnable
PacketInfopacketExtPosition
PacketInfopacketMotors
PacketInfopacketSSDKParams
PacketInfopacketSubscription
PacketInfopacketTimeSync
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

Function Documentation

int checkTxPeriod ( uint16_t  period) [inline]

checks if a packet has to be sent

Definition at line 675 of file sdk.c.

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.

Definition at line 218 of file sdk.c.

void sdkInit ( void  )

initializes the sdk

Definition at line 131 of file sdk.c.

void sendGpsData ( void  ) [inline]

assembles GPS packet and sends it

Definition at line 535 of file sdk.c.

void sendImuData ( void  ) [inline]

assembles IMU packet and sends it

Definition at line 513 of file sdk.c.

void sendMagData ( void  ) [inline]

assembles magnetic compass data packet and sends it

Definition at line 596 of file sdk.c.

void sendRcData ( void  ) [inline]

assembles rc packet and sends it

Definition at line 585 of file sdk.c.

void sendStatus ( void  ) [inline]

assembles status packet and sends it

Definition at line 557 of file sdk.c.

void synchronizeTime ( void  ) [inline]

adjusts HLP time to host PC time

Definition at line 606 of file sdk.c.

void watchdog ( void  ) [inline]

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

Definition at line 659 of file sdk.c.

void writeCommand ( short  pitch,
short  roll,
short  yaw,
short  thrust,
short  ctrl,
short  enable 
) [inline]

Writes command to the LLP.

Definition at line 502 of file sdk.c.


Variable Documentation

Definition at line 118 of file sdk.c.

Definition at line 93 of file sdk.c.

unsigned char cmdLLNew = 0

Definition at line 64 of file sdk.c.

short cmdLLValid = 0

Definition at line 63 of file sdk.c.

Definition at line 113 of file sdk.c.

unsigned int cpuLoad = 0

Definition at line 68 of file sdk.c.

Definition at line 88 of file sdk.c.

Definition at line 100 of file sdk.c.

Definition at line 78 of file sdk.c.

Definition at line 104 of file sdk.c.

short extPositionValid = 0

Definition at line 66 of file sdk.c.

Definition at line 73 of file sdk.c.

Definition at line 126 of file sdk.c.

Definition at line 71 of file sdk.c.

Definition at line 75 of file sdk.c.

short motor_state = -1

Definition at line 81 of file sdk.c.

short motor_state_count = 0

Definition at line 82 of file sdk.c.

Definition at line 97 of file sdk.c.

Definition at line 119 of file sdk.c.

Definition at line 105 of file sdk.c.

Definition at line 94 of file sdk.c.

Definition at line 127 of file sdk.c.

Definition at line 114 of file sdk.c.

Definition at line 101 of file sdk.c.

Definition at line 98 of file sdk.c.

Definition at line 110 of file sdk.c.

Definition at line 123 of file sdk.c.

Definition at line 108 of file sdk.c.

Definition at line 72 of file sdk.c.

Definition at line 48 of file sdk.c.

Definition at line 47 of file sdk.c.

unsigned int sdkCycleStartTime = 0

Definition at line 69 of file sdk.c.

unsigned int sdkLoops = 0

counts ssdk loops

Definition at line 83 of file sdk.c.

unsigned int ssdk_reset_state = 0

Definition at line 85 of file sdk.c.

Definition at line 74 of file sdk.c.

Definition at line 79 of file sdk.c.

Definition at line 122 of file sdk.c.

int64_t time_correction = 0

Definition at line 61 of file sdk.c.

unsigned short time_step = 2000

Definition at line 60 of file sdk.c.

int64_t timeOffset = 0

Definition at line 59 of file sdk.c.

volatile int64_t timestamp = 0

current time. Gets incremented by timer0 and gets corrected by synchronizeTime().

Definition at line 58 of file sdk.c.

Definition at line 107 of file sdk.c.

Definition at line 46 of file sdk.c.

Definition at line 50 of file sdk.c.

Definition at line 49 of file sdk.c.

Definition at line 45 of file sdk.c.



asctec_hl_firmware
Author(s): Markus Achtelik, Michael Achtelik, Stephan Weiss, Laurent Kneip
autogenerated on Tue Jan 7 2014 11:05:19