23 #include "fsl_debug_console.h" 27 #include "fsl_lpsci.h" 32 #define CONTROL_BAUDRATE 115200 49 flag = base->S1 & 0x80;
51 LPSCI_WriteByte(base, data);
58 for (i = 0; i < nbytes; i++)
78 ilen = strlen((
char *)sUARTOutputBuffer);
86 static char iCommandBuffer_A[5] =
"~~~~";
90 if ((kLPSCI_RxDataRegFullFlag)&LPSCI_GetStatusFlags(
CONTROL_UART))
103 lpsci_config_t config;
117 CLOCK_SetLpsci0Clock(0x1U);
121 LPSCI_GetDefaultConfig(&config);
124 config.enableTx =
true;
125 config.enableRx =
true;
130 LPSCI_EnableInterrupts(
CONTROL_UART, kLPSCI_RxDataRegFullInterruptEnable);
#define CONTROL_UART_RX_PIN
The port number associated with RX.
quaternion_type DefaultQuaternionPacketType
default quaternion transmitted at power on
void CreateAndSendPackets(SensorFusionGlobals *sfg, uint8_t *sUARTOutputBuffer)
volatile uint8_t RPCPacketOn
flag to enable roll, pitch, compass packet
volatile uint8_t AngularVelocityPacketOn
flag to enable angular velocity packet
void BlueRadios_Init(void)
writePort_t * write
low level function to write a char buffer to the serial stream
#define CONTROL_UART
KSDK instance name for the debug UART.
Defines control sub-system.
The top level fusion structure.
SensorFusionGlobals sfg
This is the primary sensor fusion data structure.
volatile uint8_t DebugPacketOn
flag to enable debug packet
int8_t writeControlPort(ControlSubsystem *pComm, uint8_t buffer[], uint16_t nbytes)
Quaternion derived from 3-axis accel (tilt)
#define CONTROL_UART_TX_PIN
The port number associated with TX.
volatile quaternion_type QuaternionPacketType
quaternion type transmitted over UART
he ControlSubsystem encapsulates command and data streaming functions.
#define CONTROL_UART_IRQn
KSDK interrupt vector number.
The sensor_fusion.h file implements the top level programming interface.
void myUART_WriteByte(UART0_Type *base, uint8_t data)
uint8_t data[FXLS8962_DATA_SIZE]
void CONTROL_UART_IRQHandler(void)
#define CONTROL_UART_MUX
KDSK pin mux selector.
setStatus_t * setStatus
change status indicator immediately
volatile uint8_t AltPacketOn
flag to enable altitude packet
#define CONTROL_UART_PORT_CLKEN
KDSK handle for the pin port clock enable.
uint8_t sUARTOutputBuffer[256]
main output buffer defined in control.c
#define CONTROL_UART_PORT
KDSK handle for the pin port associated with this UART.
Receiving commands over wired interface (momentary)
void DecodeCommandBytes(SensorFusionGlobals *sfg, char iCommandBuffer[], uint8 sUART_InputBuffer[], uint16 nbytes)
#define CONTROL_UART_CLKSRC
KSDK instance name for the clock feeding this module.
int8_t initializeControlPort(ControlSubsystem *pComm)
Initialize the control subsystem and all related hardware.
streamData_t * stream
function to create packets for serial stream
volatile int8_t AccelCalPacketOn
variable used to coordinate accelerometer calibration
#define CONTROL_BAUDRATE
Baudrate to be used for serial communications.