227 #include "fsl_os_abstraction.h"
236 #define App1_TASK_NAME "App1_task"
238 #define App1_TASK_STACK_SIZE 1200
240 #define App1_TASK_PRIORITY 11
246 .version_info = 0x0100,
274 #define startof(type,member) ((int32)&((type *)0)->member)
277 #define NUM_SENSORS (sizeof(App1AppInstance.info)/sizeof(SensorInfo_t))
280 #define SET_FIELD(name,val) (((val)<<name##_SHIFT)&(name##_MASK))
281 #define GET_FIELD(name,val) ((val&name##_MASK)>>name##_SHIFT)
284 #define CTRL_STATE_MASK 0x0F
285 #define CTRL_STATE_SHIFT 0
286 #define CTRL_QREN_MASK 0x10
287 #define CTRL_QREN_SHIFT 4
288 #define CTRL_RESET_MASK 0x20
289 #define CTRL_RESET_SHIFT 5
290 #define CTRL_POWER_MASK 0xC0
291 #define CTRL_POWER_SHIFT 6
405 (task_param_t)(NULL),
749 uint32 signalledEvents = 0;
1080 switch(pHostPacket->
cmd)
1085 if (pHostPacket->
byte_cnt >
sizeof(App1AppInstance.
data)) {
1110 if (pHostPacket->
byte_cnt >
sizeof(*pConfig))
1112 if (pHostPacket->
offset + pHostPacket->
byte_cnt >
sizeof(*pConfig))
1117 NewConfig = App1AppInstance.
settings;
1148 NewConfig = App1AppInstance.
settings;
1272 if ( SmSettingsCompare(&NewConfig, &App1AppInstance.
settings)) {
1321 isf_app_subscription_info.numSensors = num_sensors;
1323 for (index=0; index< num_sensors; index++)
1325 isf_app_subscription_info.configArray[index].sensorId = sensorInfo[index].
sensorId;
1326 isf_app_subscription_info.configArray[index].sensorDataType = sensorSettings->subArray[index].resultType;
1327 isf_app_subscription_info.configArray[index].sensorResultType = sensorSettings->subArray[index].resultFormat;
1328 isf_app_subscription_info.configArray[index].sampleRateOffset =
startof(
pseudoSettings_t,subArray[index].nSamplePeriod);
1347 if(0 != App1_FlashSensor(pHostPacket->
byte_cnt, pData))
1576 uint8 sensorSubscription = pFlashData[0];
DATA_TYPE_SUB7 rawAccelerometerData_Sub7[DATA_FIFO_LEN_SUB7]
#define DATA_FIFO_LEN_SUB8
struct App1AppInstance_t::@1 info
uint16 processedDataBufferOffset
SensorInfo_t PressureInfo_Sub12
isf_fifo_t GyrometerDataFifo_Sub11
ISF board support header files.
#define App1_Pedometer16_DATA_READY_EVENT
#define App1_ALL_SENSOR_DATA_READY
The isf_sensor_configuration_extern.h contains external declarations referenced by the Sensor Manager...
isf_SensorHandle_t smAdapterHandle
DATA_TYPE_SUB1 rawAccelerometerData_Sub1[DATA_FIFO_LEN_SUB1]
SensorInfo_t GyrometerInfo_Sub10
int32 stop_sensor(isf_SensorHandle_t *pSensorAdapterHandle)
#define App1_Accelerometer2_DATA_READY_EVENT
isf_SubscriptionSettings_t AccelerometerSettings_Sub7
#define CI_MAX_FLASH_BYTES
ISF Application Type for Embedded Application.
isf_SubscriptionSettings_t PressureSettings_Sub12
The isf_magnetometer_types.h file contains the ISF data type definitions for use with the ISF generic...
semaphore_t outputBufferLock
SensorInfo_t AccelerometerInfo_Sub4
DATA_TYPE_SUB6 rawAccelerometerData_Sub6[DATA_FIFO_LEN_SUB6]
This is user's event module. Put your event handler code here.
ISF Command Interpreter (CI) stream protocol header file.
void isf_system_sync(void)
This function synchronizes the user tasks and the system initialization.
App1AppInstance_t App1AppInstance
isf_fifo_status_t isf_fifo_lock(isf_fifo_t *pFifo)
Lock a sample buffer for exclusive access.
SensorInfo_t MagnetometerInfo_Sub9
isf_fifo_status_t isf_fifo_unlock(isf_fifo_t *pFifo)
Release the exclusive access lock on a sample buffer.
DATA_TYPE_SUB18 rawCustomData_Sub18[DATA_FIFO_LEN_SUB18]
ci_response_t App1_ci_app_callback(ci_host_cmd_packet_t *pHostPacket, ci_app_resp_packet_t *pAppPacket)
#define DATA_FIFO_LEN_SUB14
const isf_dsa_Adapter_t * pAdapter
#define App1_Accelerometer5_DATA_READY_EVENT
DATA_TYPE_SUB19 rawAnalogData_Sub19[DATA_FIFO_LEN_SUB19]
#define App1_Gyrometer11_DATA_READY_EVENT
#define App1_Gyrometer10_DATA_READY_EVENT
#define SET_FIELD(name, val)
Macro that extracts one of the fields below.
#define DATA_FIFO_LEN_SUB5
SensorInfo_t AccelerometerInfo_Sub3
SensorInfo_t AltitudeInfo_Sub15
#define DATA_FIFO_LEN_SUB18
DATA_TYPE_SUB8 rawMagnetometerData_Sub8[DATA_FIFO_LEN_SUB8]
DATA_TYPE_SUB4 rawAccelerometerData_Sub4[DATA_FIFO_LEN_SUB4]
SensorInfo_t AccelerometerInfo_Sub7
SensorInfo_t AccelerometerInfo_Sub2
#define App1_Accelerometer0_DATA_READY_EVENT
This defines the DSA sensor device handle structure used to invoke the adapter access functions...
isf_fifo_t AccelerometerDataFifo_Sub1
isf_fifo_status_t isf_fifo_el_clear(isf_fifo_t *pFifo)
Routine to clear the fifo.
isf_fifo_t AltitudeDataFifo_Sub15
#define App1_Custom18_DATA_READY_EVENT
isf_dsa_result_types_t resultFormat
The format of the data to be returned- 0=RAW, 1=FIXED, 2=FLOAT.
isf_dsa_ControlInterface_t control
isf_SubscriptionSettings_t AnalogSettings_Sub19
DATA_TYPE_SUB16 rawPedometerData_Sub16[DATA_FIFO_LEN_SUB16]
isf_SubscriptionSettings_t OrientationSettings_Sub14
#define App1_Accelerometer3_DATA_READY_EVENT
#define DATA_FIFO_LEN_SUB10
DATA_TYPE_SUB11 rawGyrometerData_Sub11[DATA_FIFO_LEN_SUB11]
The isf_sensor_configuration.h contains the enumerated list of Digital Sensor Abstraction (DSA) senso...
isf_dsa_status_t(* Flash)(isf_SensorHandle_t *pSensorHandle, void *pFlashData, uint8 numBytes)
This is user's event module. Put your event handler code here.
#define startof(type, member)
isf_fifo_t AccelerometerDataFifo_Sub5
isf_fifo_t AccelerometerDataFifo_Sub7
int32 App1_GotoState(uint8 desiredState)
void App1_ProcessData(void *pProcessedDataBuffer, int32_t signalledEvents)
int32 init_sensor(uint8 nSensorID, isf_SensorHandle_t *pSensorAdapterHandle, event_t *pEventGroup, uint32 nEventFieldIndex)
This function initializes the sensor adapters in the absence of the Sensor Manager.
#define App1_Pedometer17_DATA_READY_EVENT
uint8 appType
ISF Embedded Application type.
DATA_TYPE_SUB10 rawGyrometerData_Sub10[DATA_FIFO_LEN_SUB10]
SensorInfo_t AccelerometerInfo_Sub6
isf_fifo_t AccelerometerDataFifo_Sub2
#define NUM_SENSORS
Macro thats holds number of active sensors.
uint8 nFifoDepth
1 = no FIFO, or another value < SM_MAX_FIFO_DEPTH
#define App1_TASK_STACK_SIZE
isf_fifo_t AccelerometerDataFifo_Sub4
DATA_TYPE_SUB12 rawPressureData_Sub12[DATA_FIFO_LEN_SUB12]
isf_SubscriptionSettings_t AccelerometerSettings_Sub1
isf_pm.h describes the API definitions, types, and macros for the Intelligent Sensing Framework (ISF)...
The isf_types.h file contains the ISF data type definitions and some of the globally used macros...
DATA_TYPE_SUB0 rawAccelerometerData_Sub0[DATA_FIFO_LEN_SUB0]
isf_SubscriptionSettings_t AccelerometerSettings_Sub5
The isf_pressure_types.h file contains the ISF data type definitions for use with the ISF generic pre...
void App1_ReturnSensorsToInit()
SensorInfo_t GyrometerInfo_Sub11
uint8 gNumSupportedSensors
This is the external declaration of the current number of available sensors.
#define DATA_FIFO_LEN_SUB12
isf_SubscriptionSettings_t AccelerometerSettings_Sub2
isf_fifo_t PressureDataFifo_Sub12
isf_SubscriptionSettings_t MagnetometerSettings_Sub9
isf_fifo_t GyrometerDataFifo_Sub10
SensorInfo_t OrientationInfo_Sub14
The isf_gyrometer_types.h file contains the ISF data type definitions for use with the ISF generic gy...
App1AppSettings_t settings
isf_SubscriptionSettings_t PedometerSettings_Sub16
task_param_t os_task_param_t
This structure holds the ISF application subscriptions information in the "GET_APP_SUBSCRIPTION" CI c...
isf_fifo_t MagnetometerDataFifo_Sub8
#define DATA_FIFO_LEN_SUB17
void App1_Initialization()
DATA_TYPE_SUB5 rawAccelerometerData_Sub5[DATA_FIFO_LEN_SUB5]
isf_SubscriptionSettings_t AccelerometerSettings_Sub4
The isf_util.h file contains the utility method declarations and macros.
enum isf_dsa_result_enums isf_dsa_result_types_t
int32 configure_sensor(isf_SensorHandle_t *pSensorAdapterHandle, isf_SubscriptionSettings_t *pRequiredSettings, isf_fifo_t *pfifo)
SensorInfo_t TemperatureInfo_Sub13
#define DATA_FIFO_LEN_SUB7
#define DATA_FIFO_LEN_SUB6
isf_status_t isf_lib_init(void *pNull)
API to get ISF information.
SensorInfo_t AnalogInfo_Sub19
int32 start_sensor(isf_SensorHandle_t *pSensorAdapterHandle)
isf_fifo_t TemperatureDataFifo_Sub13
#define DATA_FIFO_LEN_SUB15
#define DATA_FIFO_LEN_SUB16
isf_fifo_status_t isf_fifo_init(isf_fifo_t *pFifo, void *pData, uint16 sampleSize, uint16 bufferCapacity)
Initializes a new fifo structure with a provided buffer.
struct App1AppInstance_t::@0 instance
isf_SensorDataTypes_t sensorDataType
#define App1_Orientation14_DATA_READY_EVENT
uint32 isf_ci_app_read(uint8 aAppId, uint32 anumBytes, uint8 *apDst)
This API reads data from the host via the mailboxes.
uint32 isf_ci_app_write(uint8 aAppId, uint32 anumBytes, uint8 *apSrc)
This API writes data to the host via the mailboxes.
This structure holds the sensor subscriptions configuration info.
isf_fifo_t PedometerDataFifo_Sub17
SensorInfo_t AccelerometerInfo_Sub0
#define App1_Accelerometer6_DATA_READY_EVENT
#define DATA_FIFO_LEN_SUB0
isf_SubscriptionSettings_t AccelerometerSettings_Sub0
#define App1_Altitude15_DATA_READY_EVENT
This is user's event module. Put your event handler code here.
The isf_altitude_types.h file contains the ISF data type definitions for use with the ISF generic alt...
The isf_temperature_fixed_t.h file contains the ISF data type definitions for use with the ISF generi...
DATA_TYPE_SUB14 rawOrientationData_Sub14[DATA_FIFO_LEN_SUB14]
#define App1_Temperature13_DATA_READY_EVENT
#define DATA_FIFO_LEN_SUB19
const isf_SensorConfig_t * pSensorStaticConfig
DATA_TYPE_SUB2 rawAccelerometerData_Sub2[DATA_FIFO_LEN_SUB2]
isf_SensorDataTypes_t resultType
The desired data type of the subscription.
#define DATA_FIFO_LEN_SUB11
SensorInfo_t AccelerometerInfo_Sub5
Main ISF header file. Contains code common to all ISF components.
isf_SubscriptionSettings_t AccelerometerSettings_Sub3
#define App1_Magnetometer9_DATA_READY_EVENT
isf_dsa_AdapterStatus_t adapterStatus
unsigned short int uint16
#define DATA_FIFO_LEN_SUB13
struct App1AppInstance_t::@2 fifos
#define App1_Accelerometer7_DATA_READY_EVENT
isf_fifo_t CustomDataFifo_Sub18
isf_fifo_t AccelerometerDataFifo_Sub0
uint8 nSettingsToUse
1 = current; 2=given; 3=best possible
API definitions, types, and macros for the Intelligent Sensing Framework (ISF) Command Interpreter (C...
uint32 nSamplePeriod
Sample period in microseconds.
ci_status_t isf_ci_qr_update(uint8 aAppId, int8 anumBytes, uint8 *apSrc)
This API updates the Quick-Read mailboxes.
The isf_init.h file contains the task initialization attributes required for initialization of the fo...
#define App1_Accelerometer1_DATA_READY_EVENT
isf_fifo_t MagnetometerDataFifo_Sub9
#define CTRL_STATE_MASK
Control register mask/shift definitions for the application.
#define GET_FIELD(name, val)
isf_SubscriptionSettings_t AccelerometerSettings_Sub6
isf_SubscriptionSettings_t MagnetometerSettings_Sub8
This structure enables an application to read from or write to the host.
int32 isf_status_t
ISF return status type.
void App1_task(os_task_param_t task_init_data)
#define App1_Analog19_DATA_READY_EVENT
isf_SubscriptionSettings_t GyrometerSettings_Sub10
#define App1_Pressure12_DATA_READY_EVENT
isf_fifo_t AccelerometerDataFifo_Sub6
isf_SubscriptionSettings_t PedometerSettings_Sub17
#define DATA_FIFO_LEN_SUB1
isf_SubscriptionSettings_t AltitudeSettings_Sub15
uint32 isf_swap4byte(uint32 n)
4 byte swapping method
SensorInfo_t AccelerometerInfo_Sub1
isf_fifo_t AccelerometerDataFifo_Sub3
#define DATA_FIFO_LEN_SUB3
isf_SubscriptionSettings_t GyrometerSettings_Sub11
SensorInfo_t MagnetometerInfo_Sub8
#define App1_Accelerometer4_DATA_READY_EVENT
This structure contains host command information.
DATA_TYPE_SUB9 rawMagnetometerData_Sub9[DATA_FIFO_LEN_SUB9]
#define DATA_FIFO_LEN_SUB9
This is user's event module. Put your event handler code here.
isf_SubscriptionSettings_t CustomSettings_Sub18
DATA_TYPE_SUB17 rawPedometerData_Sub17[DATA_FIFO_LEN_SUB17]
int32 shutdown_sensor(isf_SensorHandle_t *pSensorAdapterHandle)
DATA_TYPE_SUB13 rawTemperatureData_Sub13[DATA_FIFO_LEN_SUB13]
isf_fifo_t OrientationDataFifo_Sub14
isf_fifo_t PedometerDataFifo_Sub16
#define DATA_FIFO_LEN_SUB4
isf_fifo_t AnalogDataFifo_Sub19
#define App1_TASK_PRIORITY
SensorInfo_t CustomInfo_Sub18
The isf_sm_types.h contains the collection of type definitions used in the Sensor Manager Interface a...
isf_SensorHandle_t * gSensorHandleList[]
This is the external declaration of the DSA sensor handle list array containing the sensor adapters a...
ci_response_enum
These are the CI errors provided to the host.
The isf_accelerometer_types.h file contains the ISF data type definitions for use with the ISF generi...
SensorInfo_t PedometerInfo_Sub17
isf_status_t isf_ci_stream_update_data(uint8 aDataSetID, uint16 aLength, uint16 aOffset, uint8 *apSrc)
This API updates the data of a dataset.
#define DATA_FIFO_LEN_SUB2
DATA_TYPE_SUB15 rawAltitudeData_Sub15[DATA_FIFO_LEN_SUB15]
DATA_TYPE_SUB3 rawAccelerometerData_Sub3[DATA_FIFO_LEN_SUB3]
isf_SubscriptionSettings_t TemperatureSettings_Sub13
OSA_TASK_DEFINE(App1, App1_TASK_STACK_SIZE)
isf_fifo_status_t isf_fifo_el_traverse(isf_fifo_t *pFifo, void **pSamplePtr)
Routine to traverse a fifo To initiate the traversal set pSamplePtr to NULL. The function will set th...
SensorInfo_t PedometerInfo_Sub16
isf_dsa_result_types_t sensorResultType
#define App1_Magnetometer8_DATA_READY_EVENT