43 #include "fsl_debug_console.h" 46 #include "clock_config.h" 51 #include "fsl_i2c_cmsis.h" 87 I2Cdrv->PowerControl(ARM_POWER_FULL);
88 I2Cdrv->Control(ARM_I2C_BUS_SPEED, ARM_I2C_BUS_SPEED_FAST);
94 #if F_USING_ACCEL || F_USING_MAG void initSensorFusionGlobals(SensorFusionGlobals *sfg, StatusSubsystem *pStatusSubsystem, ControlSubsystem *pControlSubsystem)
utility function to insert default values in the top level structure
The register_io_i2c.h file declares low-level interface functions for reading and writing sensor regi...
int8_t FXAS21002_Read(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
#define BOARD_BootClockRUN
void initializeStatusSubsystem(StatusSubsystem *pStatus)
installSensor_t * installSensor
function for installing a new sensor into t
int8_t MPL3115_Read(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
struct StatusSubsystem statusSubsystem
provides visual (usually LED) status indicator
void BOARD_InitDebugConsole(void)
void(* registeridlefunction_t)(void *userParam)
This is the register idle function type.
The fxos8700.h file contains the register definitions for FXOS8700 sensor driver. ...
updateStatus_t * updateStatus
status=next status
he ControlSubsystem encapsulates command and data streaming functions.
The fxas21002.h contains the fxas21002 sensor register definitions and its bit mask.
int8_t FXOS8700_Read(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
void pit_init(uint32_t microseconds)
StatusSubsystem() provides an object-like interface for communicating status to the user...
The top level fusion structure.
applyPerturbation_t * applyPerturbation
apply step function for testing purposes
int main(void)
This is a bare-metal implementation of the NXP sensor fusion demo build.
int8_t FXAS21002_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
initializeFusionEngine_t * initializeFusionEngine
set sensor fusion structures to initial values
int8_t MPL3115_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t FXOS8700_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)
setStatus_t * setStatus
change status indicator immediately
The sensor_fusion.h file implements the top level programming interface.
Provides function prototypes for driver level interfaces.
The mpl3115.h contains the MPL3115 Pressure sensor register definitions, access macros, and device access functions.
uint8_t sUARTOutputBuffer[256]
main output buffer defined in control.c
#define I2C_S_DEVICE_INDEX
registerDeviceInfo_t i2cBusInfo
#define FXAS21002_I2C_ADDR
runFusion_t * runFusion
run the fusion routines
int8_t initializeControlPort(ControlSubsystem *pComm)
Initialize the control subsystem and all related hardware.
streamData_t * stream
function to create packets for serial stream
Provides a simple abstraction for a periodic interval timer.
Application-specific status subsystem.
SensorFusionGlobals sfg
This is the primary sensor fusion data structure.
readSensors_t * readSensors
read all physical sensors
#define FUSION_HZ
(int) actual rate of fusion algorithm execution and sensor FIFO reads
conditionSensorReadings_t * conditionSensorReadings
preprocessing step for sensor fusion
Defines control sub-system.
struct ControlSubsystem * pControlSubsystem
struct ControlSubsystem controlSubsystem
used for serial communications
struct PhysicalSensor sensors[3]
This implementation uses up to 3 sensors.
status_t SMC_SetPowerModeWait(void *arg)
Configures the system to WAIT power mode. API name used from Kinetis family to maintain compatibility...
This structure defines the device specific info required by register I/O.
void BOARD_InitPins(void)
Configures pin routing and optionally pin electrical features.
setStatus_t * queueStatus
queue status change for next regular interval
An instance of PhysicalSensor structure type should be allocated for each physical sensors (combo dev...
#define FXOS8700_I2C_ADDR
int32_t loopcounter
counter incrementing each iteration of sensor fusion (typically 25Hz)
#define I2C_S_SIGNAL_EVENT