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