ISF  2.2 rev 5
Intelligent Sensing Framework for Kinetis with Processor Expert
App1 module documentation

Data Structures

struct  subscriptionConfig_t
 This structure holds the sensor subscriptions configuration info. More...
 
struct  pseudoSettings_t
 
struct  appSubscriptionResponse_t
 This structure holds the ISF application subscriptions information in the "GET_APP_SUBSCRIPTION" CI command response buffer. More...
 

Macros

#define App1_TASK_NAME   "App1_task"
 
#define App1_TASK_STACK_SIZE   1200
 
#define App1_TASK_PRIORITY   11
 
#define startof(type, member)   ((int32)&((type *)0)->member)
 
#define NUM_SENSORS   (sizeof(App1AppInstance.info)/sizeof(SensorInfo_t))
 Macro thats holds number of active sensors. More...
 
#define SET_FIELD(name, val)   (((val)<<name##_SHIFT)&(name##_MASK))
 Macro that extracts one of the fields below. More...
 
#define GET_FIELD(name, val)   ((val&name##_MASK)>>name##_SHIFT)
 
#define CTRL_STATE_MASK   0x0F
 Control register mask/shift definitions for the application. More...
 
#define CTRL_STATE_SHIFT   0
 
#define CTRL_QREN_MASK   0x10
 
#define CTRL_QREN_SHIFT   4
 
#define CTRL_RESET_MASK   0x20
 
#define CTRL_RESET_SHIFT   5
 
#define CTRL_POWER_MASK   0xC0
 
#define CTRL_POWER_SHIFT   6
 

Functions

 OSA_TASK_DEFINE (App1, App1_TASK_STACK_SIZE)
 
int32 App1_GotoState (uint8 desiredState)
 
void App1_task (os_task_param_t task_init_data)
 
void App1_init (void)
 
void App1_MainTask (void)
 
ci_response_t App1_ci_app_callback (ci_host_cmd_packet_t *pHostPacket, ci_app_resp_packet_t *pAppPacket)
 
void App1_ReturnSensorsToInit ()
 

Variables

App1AppInstance_t App1AppInstance
 

Detailed Description

Macro Definition Documentation

#define App1_TASK_NAME   "App1_task"

Definition at line 236 of file App1.c.

Referenced by App1_init().

#define App1_TASK_PRIORITY   11

Definition at line 240 of file App1.c.

Referenced by App1_init().

#define App1_TASK_STACK_SIZE   1200

Definition at line 238 of file App1.c.

Referenced by App1_init().

#define CTRL_POWER_MASK   0xC0

Definition at line 290 of file App1.c.

Referenced by App1_ci_app_callback().

#define CTRL_POWER_SHIFT   6

Definition at line 291 of file App1.c.

#define CTRL_QREN_MASK   0x10

Definition at line 286 of file App1.c.

#define CTRL_QREN_SHIFT   4

Definition at line 287 of file App1.c.

#define CTRL_RESET_MASK   0x20

Definition at line 288 of file App1.c.

#define CTRL_RESET_SHIFT   5

Definition at line 289 of file App1.c.

#define CTRL_STATE_MASK   0x0F

Control register mask/shift definitions for the application.

Definition at line 284 of file App1.c.

Referenced by App1_ci_app_callback(), and App1_GotoState().

#define CTRL_STATE_SHIFT   0

Definition at line 285 of file App1.c.

#define GET_FIELD (   name,
  val 
)    ((val&name##_MASK)>>name##_SHIFT)

Definition at line 281 of file App1.c.

Referenced by App1_ci_app_callback(), App1_GotoState(), and App1_MainTask().

#define NUM_SENSORS   (sizeof(App1AppInstance.info)/sizeof(SensorInfo_t))

Macro thats holds number of active sensors.

Definition at line 277 of file App1.c.

#define SET_FIELD (   name,
  val 
)    (((val)<<name##_SHIFT)&(name##_MASK))

Macro that extracts one of the fields below.

Definition at line 280 of file App1.c.

Referenced by App1_ci_app_callback(), and App1_GotoState().

#define startof (   type,
  member 
)    ((int32)&((type *)0)->member)

Definition at line 274 of file App1.c.

Referenced by App1_ci_app_callback().

Function Documentation

ci_response_t App1_ci_app_callback ( ci_host_cmd_packet_t pHostPacket,
ci_app_resp_packet_t pAppPacket 
)

Definition at line 1067 of file App1.c.

References App1AppSettings_t::AccelerometerSettings_Sub0, App1AppSettings_t::AccelerometerSettings_Sub1, App1AppSettings_t::AccelerometerSettings_Sub2, App1AppSettings_t::AccelerometerSettings_Sub3, App1AppSettings_t::AccelerometerSettings_Sub4, App1AppSettings_t::AccelerometerSettings_Sub5, App1AppSettings_t::AccelerometerSettings_Sub6, App1AppSettings_t::AccelerometerSettings_Sub7, App1AppSettings_t::AltitudeSettings_Sub15, App1AppSettings_t::AnalogSettings_Sub19, App1_GotoState(), App1_STATE_STOPPED_UNSUBSCRIBED, ci_host_cmd_packet_t::appId, App1AppInstance_t::appId, ci_host_cmd_packet_t::byte_cnt, ci_app_resp_packet_t::bytes_xfer, CI_CMD_GET_APP_SUBSCRIPTION, CI_CMD_READ_APP_DATA, CI_CMD_READ_CONFIG, CI_CMD_READ_VERSION, CI_CMD_RESET_APP, CI_CMD_UPDATE_QUICKREAD, CI_CMD_WRITE_CONFIG, CI_CMD_WRITE_SREC_FLASH, CI_ERROR_COMMAND, CI_ERROR_NONE, CI_INVALID_COUNT, CI_MAX_FLASH_BYTES, ci_host_cmd_packet_t::cmd, App1AppSettings_t::control, CTRL_POWER_MASK, CTRL_STATE_MASK, App1AppSettings_t::CustomSettings_Sub18, App1AppInstance_t::data, GET_FIELD, App1AppSettings_t::GyrometerSettings_Sub10, App1AppSettings_t::GyrometerSettings_Sub11, App1AppInstance_t::info, App1AppInstance_t::instance, isf_ci_app_read(), isf_ci_app_write(), isf_ci_qr_update(), isf_swap4byte(), App1AppSettings_t::MagnetometerSettings_Sub8, App1AppSettings_t::MagnetometerSettings_Sub9, isf_SubscriptionSettings_t::nSamplePeriod, ci_host_cmd_packet_t::offset, App1AppSettings_t::OrientationSettings_Sub14, App1AppInstance_t::outputBufferLock, App1AppSettings_t::PedometerSettings_Sub16, App1AppSettings_t::PedometerSettings_Sub17, App1AppSettings_t::PressureSettings_Sub12, SensorInfo_t::sensorId, SET_FIELD, App1AppInstance_t::settings, startof, and App1AppSettings_t::TemperatureSettings_Sub13.

Here is the call graph for this function:

int32 App1_GotoState ( uint8  desiredState)

Definition at line 1612 of file App1.c.

References App1AppInstance_t::AccelerometerDataFifo_Sub0, App1AppInstance_t::AccelerometerDataFifo_Sub1, App1AppInstance_t::AccelerometerDataFifo_Sub2, App1AppInstance_t::AccelerometerDataFifo_Sub3, App1AppInstance_t::AccelerometerDataFifo_Sub4, App1AppInstance_t::AccelerometerDataFifo_Sub5, App1AppInstance_t::AccelerometerDataFifo_Sub6, App1AppInstance_t::AccelerometerDataFifo_Sub7, App1AppInstance_t::AccelerometerInfo_Sub0, App1AppInstance_t::AccelerometerInfo_Sub1, App1AppInstance_t::AccelerometerInfo_Sub2, App1AppInstance_t::AccelerometerInfo_Sub3, App1AppInstance_t::AccelerometerInfo_Sub4, App1AppInstance_t::AccelerometerInfo_Sub5, App1AppInstance_t::AccelerometerInfo_Sub6, App1AppInstance_t::AccelerometerInfo_Sub7, App1AppSettings_t::AccelerometerSettings_Sub0, App1AppSettings_t::AccelerometerSettings_Sub1, App1AppSettings_t::AccelerometerSettings_Sub2, App1AppSettings_t::AccelerometerSettings_Sub3, App1AppSettings_t::AccelerometerSettings_Sub4, App1AppSettings_t::AccelerometerSettings_Sub5, App1AppSettings_t::AccelerometerSettings_Sub6, App1AppSettings_t::AccelerometerSettings_Sub7, App1AppInstance_t::AltitudeDataFifo_Sub15, App1AppInstance_t::AltitudeInfo_Sub15, App1AppSettings_t::AltitudeSettings_Sub15, App1AppInstance_t::AnalogDataFifo_Sub19, App1AppInstance_t::AnalogInfo_Sub19, App1AppSettings_t::AnalogSettings_Sub19, App1_ReturnSensorsToInit(), App1_STATE_STARTED_SUBSCRIBED, App1_STATE_STOPPED_SUBSCRIBED, App1_STATE_STOPPED_UNSUBSCRIBED, configure_sensor(), App1AppSettings_t::control, CTRL_STATE_MASK, App1AppInstance_t::CustomDataFifo_Sub18, App1AppInstance_t::CustomInfo_Sub18, App1AppSettings_t::CustomSettings_Sub18, App1AppInstance_t::fifos, GET_FIELD, App1AppInstance_t::GyrometerDataFifo_Sub10, App1AppInstance_t::GyrometerDataFifo_Sub11, App1AppInstance_t::GyrometerInfo_Sub10, App1AppInstance_t::GyrometerInfo_Sub11, App1AppSettings_t::GyrometerSettings_Sub10, App1AppSettings_t::GyrometerSettings_Sub11, App1AppInstance_t::info, ISF_SUCCESS, App1AppInstance_t::MagnetometerDataFifo_Sub8, App1AppInstance_t::MagnetometerDataFifo_Sub9, App1AppInstance_t::MagnetometerInfo_Sub8, App1AppInstance_t::MagnetometerInfo_Sub9, App1AppSettings_t::MagnetometerSettings_Sub8, App1AppSettings_t::MagnetometerSettings_Sub9, App1AppInstance_t::OrientationDataFifo_Sub14, App1AppInstance_t::OrientationInfo_Sub14, App1AppSettings_t::OrientationSettings_Sub14, App1AppInstance_t::PedometerDataFifo_Sub16, App1AppInstance_t::PedometerDataFifo_Sub17, App1AppInstance_t::PedometerInfo_Sub16, App1AppInstance_t::PedometerInfo_Sub17, App1AppSettings_t::PedometerSettings_Sub16, App1AppSettings_t::PedometerSettings_Sub17, App1AppInstance_t::PressureDataFifo_Sub12, App1AppInstance_t::PressureInfo_Sub12, App1AppSettings_t::PressureSettings_Sub12, SET_FIELD, App1AppInstance_t::settings, shutdown_sensor(), SensorInfo_t::smAdapterHandle, start_sensor(), stop_sensor(), App1AppInstance_t::TemperatureDataFifo_Sub13, App1AppInstance_t::TemperatureInfo_Sub13, and App1AppSettings_t::TemperatureSettings_Sub13.

Referenced by App1_ci_app_callback(), and App1_MainTask().

Here is the call graph for this function:

Here is the caller graph for this function:

void App1_init ( void  )

Definition at line 397 of file App1.c.

References App1_task(), App1_TASK_NAME, App1_TASK_PRIORITY, and App1_TASK_STACK_SIZE.

Referenced by Components_Init().

Here is the call graph for this function:

Here is the caller graph for this function:

void App1_MainTask ( void  )

Definition at line 426 of file App1.c.

References App1AppInstance_t::AccelerometerDataFifo_Sub0, App1AppInstance_t::AccelerometerDataFifo_Sub1, App1AppInstance_t::AccelerometerDataFifo_Sub2, App1AppInstance_t::AccelerometerDataFifo_Sub3, App1AppInstance_t::AccelerometerDataFifo_Sub4, App1AppInstance_t::AccelerometerDataFifo_Sub5, App1AppInstance_t::AccelerometerDataFifo_Sub6, App1AppInstance_t::AccelerometerDataFifo_Sub7, App1AppInstance_t::AccelerometerInfo_Sub0, App1AppInstance_t::AccelerometerInfo_Sub1, App1AppInstance_t::AccelerometerInfo_Sub2, App1AppInstance_t::AccelerometerInfo_Sub3, App1AppInstance_t::AccelerometerInfo_Sub4, App1AppInstance_t::AccelerometerInfo_Sub5, App1AppInstance_t::AccelerometerInfo_Sub6, App1AppInstance_t::AccelerometerInfo_Sub7, App1AppSettings_t::AccelerometerSettings_Sub0, App1AppSettings_t::AccelerometerSettings_Sub1, App1AppSettings_t::AccelerometerSettings_Sub2, App1AppSettings_t::AccelerometerSettings_Sub3, App1AppSettings_t::AccelerometerSettings_Sub4, App1AppSettings_t::AccelerometerSettings_Sub5, App1AppSettings_t::AccelerometerSettings_Sub6, App1AppSettings_t::AccelerometerSettings_Sub7, App1AppInstance_t::AltitudeDataFifo_Sub15, App1AppInstance_t::AltitudeInfo_Sub15, App1AppSettings_t::AltitudeSettings_Sub15, App1AppInstance_t::AnalogDataFifo_Sub19, App1AppInstance_t::AnalogInfo_Sub19, App1AppSettings_t::AnalogSettings_Sub19, App1_Accelerometer0_DATA_READY_EVENT, App1_Accelerometer1_DATA_READY_EVENT, App1_Accelerometer2_DATA_READY_EVENT, App1_Accelerometer3_DATA_READY_EVENT, App1_Accelerometer4_DATA_READY_EVENT, App1_Accelerometer5_DATA_READY_EVENT, App1_Accelerometer6_DATA_READY_EVENT, App1_Accelerometer7_DATA_READY_EVENT, App1_ALL_SENSOR_DATA_READY, App1_Altitude15_DATA_READY_EVENT, App1_Analog19_DATA_READY_EVENT, App1_Custom18_DATA_READY_EVENT, App1_Exit(), App1_GotoState(), App1_Gyrometer10_DATA_READY_EVENT, App1_Gyrometer11_DATA_READY_EVENT, App1_Initialization(), App1_Magnetometer8_DATA_READY_EVENT, App1_Magnetometer9_DATA_READY_EVENT, App1_Orientation14_DATA_READY_EVENT, App1_Pedometer16_DATA_READY_EVENT, App1_Pedometer17_DATA_READY_EVENT, App1_Pressure12_DATA_READY_EVENT, App1_ProcessData(), App1_Temperature13_DATA_READY_EVENT, App1AppInstance_t::appId, App1AppSettings_t::control, App1AppInstance_t::CustomDataFifo_Sub18, App1AppInstance_t::CustomInfo_Sub18, App1AppSettings_t::CustomSettings_Sub18, App1AppInstance_t::data, DATA_FIFO_LEN_SUB0, DATA_FIFO_LEN_SUB1, DATA_FIFO_LEN_SUB10, DATA_FIFO_LEN_SUB11, DATA_FIFO_LEN_SUB12, DATA_FIFO_LEN_SUB13, DATA_FIFO_LEN_SUB14, DATA_FIFO_LEN_SUB15, DATA_FIFO_LEN_SUB16, DATA_FIFO_LEN_SUB17, DATA_FIFO_LEN_SUB18, DATA_FIFO_LEN_SUB19, DATA_FIFO_LEN_SUB2, DATA_FIFO_LEN_SUB3, DATA_FIFO_LEN_SUB4, DATA_FIFO_LEN_SUB5, DATA_FIFO_LEN_SUB6, DATA_FIFO_LEN_SUB7, DATA_FIFO_LEN_SUB8, DATA_FIFO_LEN_SUB9, DATA_TYPE_SUB0, DATA_TYPE_SUB1, DATA_TYPE_SUB10, DATA_TYPE_SUB11, DATA_TYPE_SUB12, DATA_TYPE_SUB13, DATA_TYPE_SUB14, DATA_TYPE_SUB15, DATA_TYPE_SUB16, DATA_TYPE_SUB17, DATA_TYPE_SUB18, DATA_TYPE_SUB19, DATA_TYPE_SUB2, DATA_TYPE_SUB3, DATA_TYPE_SUB4, DATA_TYPE_SUB5, DATA_TYPE_SUB6, DATA_TYPE_SUB7, DATA_TYPE_SUB8, DATA_TYPE_SUB9, DSA_Analog_1, DSA_Custom_1, DSA_FXAS21002_1, DSA_FXAS21002_2, DSA_FXLC95000_1, DSA_FXLC95000_2, DSA_FXLS8471_1, DSA_FXLS8471_2, DSA_FXLS8952_1, DSA_FXOS8700_1, DSA_FXOS8700_2, DSA_MAG3110_1, DSA_MMA8491Q_1, DSA_MMA865x_1, DSA_MMA955x_1, DSA_MMA955x_2, DSA_MPL3115_1, DSA_ORIENT_1, App1AppInstance_t::fifos, GET_FIELD, gSensorHandleList, App1AppInstance_t::GyrometerDataFifo_Sub10, App1AppInstance_t::GyrometerDataFifo_Sub11, App1AppInstance_t::GyrometerInfo_Sub10, App1AppInstance_t::GyrometerInfo_Sub11, App1AppSettings_t::GyrometerSettings_Sub10, App1AppSettings_t::GyrometerSettings_Sub11, App1AppInstance_t::info, init_sensor(), App1AppInstance_t::instance, isf_ci_qr_update(), isf_ci_stream_update_data(), isf_fifo_el_clear(), isf_fifo_el_traverse(), isf_fifo_init(), isf_fifo_lock(), isf_fifo_unlock(), ISF_SUCCESS, App1AppInstance_t::MagnetometerDataFifo_Sub8, App1AppInstance_t::MagnetometerDataFifo_Sub9, App1AppInstance_t::MagnetometerInfo_Sub8, App1AppInstance_t::MagnetometerInfo_Sub9, App1AppSettings_t::MagnetometerSettings_Sub8, App1AppSettings_t::MagnetometerSettings_Sub9, isf_SubscriptionSettings_t::nFifoDepth, isf_SubscriptionSettings_t::nSamplePeriod, isf_SubscriptionSettings_t::nSettingsToUse, App1AppInstance_t::OrientationDataFifo_Sub14, App1AppInstance_t::OrientationInfo_Sub14, App1AppSettings_t::OrientationSettings_Sub14, App1AppInstance_t::outputBufferLock, App1AppInstance_t::PedometerDataFifo_Sub16, App1AppInstance_t::PedometerDataFifo_Sub17, App1AppInstance_t::PedometerInfo_Sub16, App1AppInstance_t::PedometerInfo_Sub17, App1AppSettings_t::PedometerSettings_Sub16, App1AppSettings_t::PedometerSettings_Sub17, App1AppInstance_t::PressureDataFifo_Sub12, App1AppInstance_t::PressureInfo_Sub12, App1AppSettings_t::PressureSettings_Sub12, App1SensorData_t::rawAccelerometerData_Sub0, App1SensorData_t::rawAccelerometerData_Sub1, App1SensorData_t::rawAccelerometerData_Sub2, App1SensorData_t::rawAccelerometerData_Sub3, App1SensorData_t::rawAccelerometerData_Sub4, App1SensorData_t::rawAccelerometerData_Sub5, App1SensorData_t::rawAccelerometerData_Sub6, App1SensorData_t::rawAccelerometerData_Sub7, App1SensorData_t::rawAltitudeData_Sub15, App1SensorData_t::rawAnalogData_Sub19, App1SensorData_t::rawCustomData_Sub18, App1SensorData_t::rawGyrometerData_Sub10, App1SensorData_t::rawGyrometerData_Sub11, App1SensorData_t::rawMagnetometerData_Sub8, App1SensorData_t::rawMagnetometerData_Sub9, App1SensorData_t::rawOrientationData_Sub14, App1SensorData_t::rawPedometerData_Sub16, App1SensorData_t::rawPedometerData_Sub17, App1SensorData_t::rawPressureData_Sub12, App1SensorData_t::rawTemperatureData_Sub13, isf_SubscriptionSettings_t::resultFormat, isf_SubscriptionSettings_t::resultType, SensorInfo_t::sensorId, App1AppInstance_t::settings, SensorInfo_t::smAdapterHandle, App1AppInstance_t::smLWEvent, App1AppInstance_t::TemperatureDataFifo_Sub13, App1AppInstance_t::TemperatureInfo_Sub13, and App1AppSettings_t::TemperatureSettings_Sub13.

Referenced by App1_task().

Here is the call graph for this function:

Here is the caller graph for this function:

void App1_task ( os_task_param_t  task_init_data)

Definition at line 378 of file App1.c.

References App1_MainTask(), isf_lib_init(), and isf_system_sync().

Referenced by App1_init().

Here is the call graph for this function:

Here is the caller graph for this function:

OSA_TASK_DEFINE ( App1  ,
App1_TASK_STACK_SIZE   
)

Variable Documentation

App1AppInstance_t App1AppInstance
Initial value:
= {
.instance.appId = 2,
.settings.control = SET_FIELD(CTRL_STATE,App1_STATE_STOPPED_UNSUBSCRIBED) | SET_FIELD(CTRL_POWER,1) | SET_FIELD(CTRL_QREN,0),
.info.AccelerometerInfo_Sub0.sensorId = DSA_FXLC95000_1,
.info.AccelerometerInfo_Sub1.sensorId = DSA_FXLC95000_2,
.info.AccelerometerInfo_Sub2.sensorId = DSA_FXLS8471_1,
.info.AccelerometerInfo_Sub3.sensorId = DSA_FXLS8471_2,
.info.AccelerometerInfo_Sub4.sensorId = DSA_FXLS8952_1,
.info.AccelerometerInfo_Sub5.sensorId = DSA_FXOS8700_1,
.info.AccelerometerInfo_Sub6.sensorId = DSA_MMA8491Q_1,
.info.AccelerometerInfo_Sub7.sensorId = DSA_MMA865x_1,
.info.MagnetometerInfo_Sub8.sensorId = DSA_FXOS8700_2,
.info.MagnetometerInfo_Sub9.sensorId = DSA_MAG3110_1,
.info.GyrometerInfo_Sub10.sensorId = DSA_FXAS21002_1,
.info.GyrometerInfo_Sub11.sensorId = DSA_FXAS21002_2,
.info.PressureInfo_Sub12.sensorId = DSA_MPL3115_1,
.info.TemperatureInfo_Sub13.sensorId = DSA_MPL3115_1,
.info.OrientationInfo_Sub14.sensorId = DSA_ORIENT_1,
.info.AltitudeInfo_Sub15.sensorId = DSA_MPL3115_1,
.info.PedometerInfo_Sub16.sensorId = DSA_MMA955x_1,
.info.PedometerInfo_Sub17.sensorId = DSA_MMA955x_2,
.info.CustomInfo_Sub18.sensorId = DSA_Custom_1,
.info.AnalogInfo_Sub19.sensorId = DSA_Analog_1,
}
#define SET_FIELD(name, val)
Macro that extracts one of the fields below.
Definition: App1.c:280

Definition at line 300 of file App1.c.