ISSDK  1.8
IoT Sensing Software Development Kit
Data Structures | Typedefs | Functions | Variables
control.h File Reference

Defines control sub-system. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ControlSubsystem
 he ControlSubsystem encapsulates command and data streaming functions. More...
 

Typedefs

typedef struct ControlSubsystem ControlSubsystem
 he ControlSubsystem encapsulates command and data streaming functions. More...
 
Control Port Function Type Definitions

The "write" and "stream" commands provide two control functions visible at the main() level. These typedefs define the structure of those two calls.

typedef int8_t() writePort_t(struct ControlSubsystem *pComm, uint8_t buffer[], uint16_t nbytes)
 
typedef void() streamData_t(SensorFusionGlobals *sfg, uint8_t *sUARTOutputBuffer)
 

Functions

int8_t initializeControlPort (ControlSubsystem *pComm)
 Call this once to initialize structures, ports, etc. More...
 
void CreateAndSendPackets (SensorFusionGlobals *sfg, uint8_t *sUARTOutputBuffer)
 
void DecodeCommandBytes (SensorFusionGlobals *sfg, char iCommandBuffer[], uint8 sUART_InputBuffer[], uint16 nbytes)
 
void BlueRadios_Init (void)
 
void sBufAppendItem (uint8_t *pDest, uint16_t *pIndex, uint8_t *pSource, uint16_t iBytesToCopy)
 Utility function used to place data in output buffer about to be transmitted via UART. More...
 

Variables

uint8_t sUARTOutputBuffer [256]
 main output buffer defined in control.c More...
 

Detailed Description

Defines control sub-system.

Each sensor fusion application will probably have its own set of functions to control the fusion process and report results. This file defines the programming interface that should be followed in order for the fusion functions to operate correctly out of the box. The actual command interpreter is defined separately in DecodeCommandBytes.c. The output streaming function is defined in output_stream.c. Via these three files, the NXP Sensor Fusion Library provides a default set of functions which are compatible with the Sensor Fusion Toolbox. Use of the toolbox is highly recommended at least during initial development, as it provides many useful debug features. The NXP development team will typically require use of the toolbox as a pre-requisite for providing software support.

Definition in file control.h.

Typedef Documentation

◆ ControlSubsystem

he ControlSubsystem encapsulates command and data streaming functions.

The ControlSubsystem encapsulates command and data streaming functions for the library. A C++-like typedef structure which includes executable methods for the subsystem is defined here.

◆ streamData_t

typedef void() streamData_t(SensorFusionGlobals *sfg, uint8_t *sUARTOutputBuffer)

Definition at line 34 of file control.h.

◆ writePort_t

typedef int8_t() writePort_t(struct ControlSubsystem *pComm, uint8_t buffer[], uint16_t nbytes)

Definition at line 33 of file control.h.

Function Documentation

◆ BlueRadios_Init()

void BlueRadios_Init ( void  )

Used to initialize the Blue Radios Bluetooth module found on the FRDM-FXS-MULT2-B sensor shield from NXP.

Definition at line 110 of file control.c.

References sUARTOutputBuffer, writeControlPort(), and writeWirelessPort().

Referenced by initializeControlPort().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateAndSendPackets()

void CreateAndSendPackets ( SensorFusionGlobals sfg,
uint8_t *  sUARTOutputBuffer 
)

◆ DecodeCommandBytes()

void DecodeCommandBytes ( SensorFusionGlobals sfg,
char  iCommandBuffer[],
uint8  sUART_InputBuffer[],
uint16  nbytes 
)

This function is responsible for decoding commands sent by the NXP Sensor Fusion Toolbox and setting the appropriate flags in the ControlSubsystem data structure. Packet protocols are defined in the NXP Sensor Fusion for Kinetis Product Development Kit User Guide.

Definition at line 68 of file DecodeCommandBytes.c.

References ACCEL_CAL_AVERAGING_SECS, ControlSubsystem::AccelCalPacketOn, ControlSubsystem::AltPacketOn, ControlSubsystem::AngularVelocityPacketOn, CHX, CHZ, cmd_180X, cmd_180Y, cmd_180Z, cmd_ALTminus, cmd_ALTplus, cmd_DBminus, cmd_DBplus, cmd_ERAC, cmd_ERGC, cmd_ERMC, cmd_ERYC, cmd_M90X, cmd_M90Y, cmd_M90Z, cmd_P90X, cmd_P90Y, cmd_P90Z, cmd_PA00, cmd_PA01, cmd_PA02, cmd_PA03, cmd_PA04, cmd_PA05, cmd_PA06, cmd_PA07, cmd_PA08, cmd_PA09, cmd_PA10, cmd_PA11, cmd_Q3, cmd_Q3G, cmd_Q3M, cmd_Q6AG, cmd_Q6MA, cmd_Q9, cmd_RINS, cmd_RPCminus, cmd_RPCplus, cmd_RST, cmd_SVAC, cmd_SVGC, cmd_SVMC, cmd_SVYC, cmd_VGminus, cmd_VGplus, ControlSubsystem::DebugPacketOn, EraseAccelCalibrationFromNVM(), EraseGyroCalibrationFromNVM(), EraseMagCalibrationFromNVM(), fInitializeAccelCalibration(), fInitializeFusion(), fInitializeMagCalibration(), FUSION_HZ, SensorFusionGlobals::iPerturbation, SensorFusionGlobals::MagBuffer, SensorFusionGlobals::MagCal, SensorFusionGlobals::pControlSubsystem, Q3, Q3G, Q3M, Q6AG, Q6MA, Q9, ControlSubsystem::QuaternionPacketType, ControlSubsystem::RPCPacketOn, SaveAccelCalibrationToNVM(), SaveGyroCalibrationToNVM(), and SaveMagCalibrationToNVM().

Referenced by CONTROL_UART_IRQHandler(), WIRED_UART_IRQHandler(), WIRED_USART_IRQHandler(), and WIRELESS_UART_IRQHandler().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initializeControlPort()

int8_t initializeControlPort ( ControlSubsystem pComm)

◆ sBufAppendItem()

void sBufAppendItem ( uint8_t *  pDest,
uint16_t *  pIndex,
uint8_t *  pSource,
uint16_t  iBytesToCopy 
)

Utility function used to place data in output buffer about to be transmitted via UART.

Definition at line 37 of file output_stream.c.

Referenced by appendZerosOrientBuf(), CreateAndSendPackets(), and sBufAppendZeros().

Here is the caller graph for this function:

Variable Documentation

◆ sUARTOutputBuffer

uint8_t sUARTOutputBuffer[256]

main output buffer defined in control.c

Definition at line 37 of file control.c.

Referenced by BlueRadios_Init(), and main().