ISSDK  1.8
IoT Sensing Software Development Kit
Macros | Functions | Variables
control.c File Reference

Defines control sub-system. More...

#include "fsl_debug_console.h"
#include "board.h"
#include "pin_mux.h"
#include "fsl_uart.h"
#include "fsl_port.h"
#include "sensor_fusion.h"
#include "control.h"
Include dependency graph for control.c:

Go to the source code of this file.

Macros

#define F_USE_WIRELESS_UART   0x0001
 0x0001 to include, 0x0000 otherwise More...
 
#define F_USE_WIRED_UART   0x0002
 0x0002 to include, 0x0000 otherwise More...
 
#define CONTROL_BAUDRATE   115200
 Baudrate to be used for serial communications. More...
 

Functions

void myUART_WriteByte (UART_Type *base, uint8_t data)
 
int8_t writeControlPort (ControlSubsystem *pComm, uint8_t buffer[], uint16_t nbytes)
 
int8_t writeWirelessPort (uint8_t buffer[], uint16_t nbytes)
 
void WIRELESS_UART_IRQHandler (void)
 
void BlueRadios_Init (void)
 
void echo (uint8_t data)
 
void WIRED_UART_IRQHandler (void)
 
int8_t initializeControlPort (ControlSubsystem *pComm)
 Initialize the control subsystem and all related hardware. More...
 

Variables

uart_handle_t wired_uartHandle
 
uart_handle_t wireless_uartHandle
 
uint8_t sUARTOutputBuffer [256]
 main output buffer defined in control.c More...
 
SensorFusionGlobals sfg
 This is the primary sensor fusion data structure. More...
 

Detailed Description

Defines control sub-system.

This file contains a UART implementation of the control subsystem. The command interpreter and streaming functions are contained in two separate files. So you can easily swap those out with only minor changes here.

Definition in file control.c.

Macro Definition Documentation

◆ CONTROL_BAUDRATE

#define CONTROL_BAUDRATE   115200

Baudrate to be used for serial communications.

Definition at line 31 of file control.c.

Referenced by initializeControlPort().

◆ F_USE_WIRED_UART

#define F_USE_WIRED_UART   0x0002

0x0002 to include, 0x0000 otherwise

Definition at line 28 of file control.c.

◆ F_USE_WIRELESS_UART

#define F_USE_WIRELESS_UART   0x0001

0x0001 to include, 0x0000 otherwise

Definition at line 25 of file control.c.

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.

Referenced by initializeControlPort().

Here is the caller graph for this function:

◆ echo()

void echo ( uint8_t  data)

Definition at line 127 of file control.c.

References WIRED_UART.

◆ initializeControlPort()

int8_t initializeControlPort ( ControlSubsystem pComm)

Initialize the control subsystem and all related hardware.

Call this once to initialize structures, ports, etc.

Parameters
pCommpointer to the control subystem structure

Definition at line 160 of file control.c.

Referenced by main().

Here is the caller graph for this function:

◆ myUART_WriteByte()

void myUART_WriteByte ( UART_Type *  base,
uint8_t  data 
)

Definition at line 46 of file control.c.

Referenced by writeControlPort(), and writeWirelessPort().

Here is the caller graph for this function:

◆ WIRED_UART_IRQHandler()

void WIRED_UART_IRQHandler ( void  )

Definition at line 136 of file control.c.

References data, DecodeCommandBytes(), RECEIVING_WIRED, SensorFusionGlobals::setStatus, WIRED_UART, and wired_uartHandle.

Here is the call graph for this function:

◆ WIRELESS_UART_IRQHandler()

void WIRELESS_UART_IRQHandler ( void  )

Definition at line 88 of file control.c.

References data, DecodeCommandBytes(), RECEIVING_WIRELESS, SensorFusionGlobals::setStatus, WIRELESS_UART, and wireless_uartHandle.

Here is the call graph for this function:

◆ writeControlPort()

int8_t writeControlPort ( ControlSubsystem pComm,
uint8_t  buffer[],
uint16_t  nbytes 
)

Definition at line 57 of file control.c.

References myUART_WriteByte(), WIRED_UART, and WIRELESS_UART.

Referenced by initializeControlPort().

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

◆ writeWirelessPort()

int8_t writeWirelessPort ( uint8_t  buffer[],
uint16_t  nbytes 
)

Definition at line 77 of file control.c.

References myUART_WriteByte(), and WIRELESS_UART.

Referenced by BlueRadios_Init().

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

Variable Documentation

◆ sfg

This is the primary sensor fusion data structure.

Definition at line 75 of file orientaion_application_baremetal_agm01.c.

◆ 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().

◆ wired_uartHandle

uart_handle_t wired_uartHandle

Definition at line 33 of file control.c.

Referenced by WIRED_UART_IRQHandler().

◆ wireless_uartHandle

uart_handle_t wireless_uartHandle

Definition at line 34 of file control.c.

Referenced by WIRELESS_UART_IRQHandler().