42 #include "fsl_debug_console.h" 45 #include "fsl_usart.h" 61 uint32_t flag = kUSART_TxFifoNotFullFlag & USART_GetStatusFlags(base);
64 flag = kUSART_TxFifoNotFullFlag & USART_GetStatusFlags(base);
66 USART_WriteByte(base, data);
73 for (i = 0; i < nbytes; i++)
84 static char iCommandBuffer_B[5] =
"~~~~";
87 if ((kUSART_RxFifoNotEmptyFlag | kUSART_RxError) & USART_GetStatusFlags(
WIRED_USART))
99 usart_config_t config;
116 RESET_PeripheralReset(kFC0_RST_SHIFT_RSTn);
126 USART_GetDefaultConfig(&config);
128 config.enableTx =
true;
129 config.enableRx =
true;
134 USART_EnableInterrupts(
WIRED_USART, kUSART_RxLevelInterruptEnable | kUSART_RxErrorInterruptEnable);
volatile quaternion_type QuaternionPacketType
quaternion type transmitted over UART
uint8_t data[FXLS8962_DATA_SIZE]
writePort_t * write
low level function to write a char buffer to the serial stream
volatile uint8_t AltPacketOn
flag to enable altitude packet
he ControlSubsystem encapsulates command and data streaming functions.
volatile uint8_t AngularVelocityPacketOn
flag to enable angular velocity packet
#define BOARD_DEBUG_UART_CLK_ATTACH
The top level fusion structure.
quaternion_type DefaultQuaternionPacketType
default quaternion transmitted at power on
int8_t initializeControlPort(ControlSubsystem *pComm)
Initialize the control subsystem and all related hardware.
void myUART_WriteByte(USART_Type *base, uint8_t data)
int8_t writeControlPort(ControlSubsystem *pComm, uint8_t buffer[], uint16_t nbytes)
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
#define WIRED_USART_CLK_FREQ
uint8_t sUARTOutputBuffer[256]
main output buffer defined in control.c
streamData_t * stream
function to create packets for serial stream
void DecodeCommandBytes(SensorFusionGlobals *sfg, char iCommandBuffer[], uint8 sUART_InputBuffer[], uint16 nbytes)
#define BOARD_DEBUG_UART_BAUDRATE
Quaternion derived from 3-axis accel (tilt)
Defines control sub-system.
SensorFusionGlobals sfg
This is the primary sensor fusion data structure.
volatile int8_t AccelCalPacketOn
variable used to coordinate accelerometer calibration
void WIRED_USART_IRQHandler(void)
volatile uint8_t DebugPacketOn
flag to enable debug packet