34 #include "App1_Functions.h"
41 #include "mqx_tasks.h"
61 #define startof(type,member) ((int32)&((type *)0)->member)
64 #define App1_Orientation0_DATA_READY_EVENT ((uint32)(1 << 0))
66 #define App1_Pressure1_DATA_READY_EVENT ((uint32)(1 << 1))
68 #define App1_ALL_SENSOR_DATA_READY (3)
80 #define SET_FIELD(name,val) (((val)<<name##_SHIFT)&(name##_MASK))
81 #define GET_FIELD(name,val) ((val&name##_MASK)>>name##_SHIFT)
84 #define CTRL_STATE_MASK 0x0F
85 #define CTRL_STATE_SHIFT 0
86 #define CTRL_QREN_MASK 0x10
87 #define CTRL_QREN_SHIFT 4
88 #define CTRL_RESET_MASK 0x20
89 #define CTRL_RESET_SHIFT 5
90 #define CTRL_POWER_MASK 0xC0
91 #define CTRL_POWER_SHIFT 6
129 #define CONFIG_SETTINGS_REPORTRATE_BYTE_START (4)
130 #define CONFIG_SETTINGS_REPORTRATE_BYTE_ENDS (7)
196 App1_Initialization();
250 uint32 signalledEvents = _lwevent_get_signalled();
256 App1_ProcessData(&App1AppInstance.
data, _lwevent_get_signalled());
272 App1_ProcessData(&App1AppInstance.
data, _lwevent_get_signalled());
321 switch(pHostPacket->
cmd) {
327 if (pHostPacket->
byte_cnt >
sizeof(App1AppInstance.
data)) {
354 if (pHostPacket->
byte_cnt >
sizeof(*pConfig))
356 if (pHostPacket->
offset + pHostPacket->
byte_cnt >
sizeof(*pConfig))
362 NewConfig = App1AppInstance.
settings;
379 NewConfig = App1AppInstance.
settings;
413 if ( SmSettingsCompare(&NewConfig, &App1AppInstance.
settings)) {
struct App1AppInstance_t::@1 info
ISF board support header files.
void isf_system_sync(void)
This function synchronizes the user tasks and the system initialization.
unsigned char uint8
This defines uint8 as unsigned char.
isf_SensorHandle_t smAdapterHandle
int32 stop_sensor(isf_SensorHandle_t *pSensorAdapterHandle)
ISF Command Interpreter (CI) stream protocol header file.
isf_fifo_status_t isf_fifo_lock(isf_fifo_t *pFifo)
Lock a sample buffer for exclusive access.
isf_fifo_status_t isf_fifo_unlock(isf_fifo_t *pFifo)
Release the exclusive access lock on a sample buffer.
ci_response_t App1_ci_app_callback(ci_host_cmd_packet_t *pHostPacket, ci_app_resp_packet_t *pAppPacket)
SensorInfo_t PressInfo_Sub1
#define SET_FIELD(name, val)
Macro that extracts one of the fields below.
This defines the DSA sensor device handle structure used to invoke the adapter access functions...
isf_fifo_status_t isf_fifo_el_clear(isf_fifo_t *pFifo)
Routine to clear the fifo.
isf_dsa_result_types_t resultFormat
The format of the data to be returned- 0=RAW, 1=FIXED, 2=FLOAT.
The isf_sensor_configuration.h contains the enumerated list of Digital Sensor Abstraction (DSA) senso...
unsigned long uint32
This defines uint32 as unsigned long.
#define startof(type, member)
int32 App1_GotoState(uint8 desiredState)
void TaskApp1_task(uint32_t task_init_data)
power_level_t isf_power_set(power_level_t aLevel)
This API sets the requested power level for power management.
isf_fifo_t orientDataFifo_Sub0
uint8 nFifoDepth
1 = no FIFO, or another value < SM_MAX_FIFO_DEPTH
DATA_TYPE_SUB0 rawOrientData_Sub0[DATA_FIFO_LEN_SUB0]
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...
The isf_pressure_types.h file contains the ISF data type definitions for use with the ISF generic pre...
void App1_ReturnSensorsToInit()
#define App1_Pressure1_DATA_READY_EVENT
DATA_TYPE_SUB1 rawPressData_Sub1[DATA_FIFO_LEN_SUB1]
App1AppSettings_t settings
isf_SubscriptionSettings_t OrientSettings_Sub0
int32 init_sensor(uint8 nSensorID, isf_SensorHandle_t *pSensorAdapterHandle, LWEVENT_STRUCT *pEventGroup, uint32 nEventFieldIndex)
This function initializes the sensor adapters in the absence of the Sensor Manager.
int32 configure_sensor(isf_SensorHandle_t *pSensorAdapterHandle, isf_SubscriptionSettings_t *pRequiredSettings, isf_fifo_t *pfifo)
isf_status_t isf_lib_init(void *pNull)
API ISF library get information.
int32 start_sensor(isf_SensorHandle_t *pSensorAdapterHandle)
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
#define App1_Orientation0_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.
#define DATA_FIFO_LEN_SUB0
long int32
This defines int32 as long.
isf_SensorDataTypes_t resultType
The desired data type of the subscription.
SensorInfo_t OrientInfo_Sub0
Main ISF header file. Contains code common to all ISF components.
isf_dsa_AdapterStatus_t adapterStatus
isf_fifo_t pressDataFifo_Sub1
struct App1AppInstance_t::@2 fifos
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.
LWSEM_STRUCT outputBufferLock
The isf_init.h file contains the task initialization attributes required for initialization of the fo...
#define CTRL_STATE_MASK
Control register mask/shift definitions for the application.
#define GET_FIELD(name, val)
This structure enables an application to read from or write to the host.
int32 isf_status_t
ISF return status type.
#define DATA_FIFO_LEN_SUB1
isf_SubscriptionSettings_t PressSettings_Sub1
This structure contains host command information.
int32 shutdown_sensor(isf_SensorHandle_t *pSensorAdapterHandle)
The isf_sm_types.h contains the collection of type definitions used in the Sensor Manager Interface a...
ci_response_enum
These are the CI errors provided to the host.
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 App1_ALL_SENSOR_DATA_READY