40 #include "rtos_main_task.h"
58 #define Analog_1_CONVERT_FLOAT_FACTOR (1.0F/32767.0F)
59 #define Analog_1_CONVERT_FIXED_FACTOR (32767)
60 #define NUM_MESSAGES 64
124 uint32_t gselect_pin;
231 switch (convertToType)
258 if (pConverter == NULL)
263 retStat = pConverter(
265 (Analog_1_DataBuffer_t *)pNativeSample, pConvertedSample);
286 if (NULL == pSensorHandle)
300 if (NULL == pDeviceDescriptor)
315 ADC16_DRV_WaitConvDone(
FSL_ADC1, kAdc16Chn29);
316 pCurrentSampleBuffer->
data[index] = ADC16_DRV_GetConvValueRAW(
FSL_ADC1, kAdc16Chn29);
320 if (kStatus_OSA_Success !=OSA_SemaWait(&pDeviceDescriptor->
deviceSemaphore, OSA_WAIT_FOREVER))
322 goto unlockdescriptor;
328 goto unlockdescriptor;
341 *pFifoEntry = *pCurrentSampleBuffer;
349 pCurrentSampleBuffer, pFifoEntry, &numBytes);
382 if(NULL == pSensorHandle)
417 if(NULL == pSensorHandle)
429 if (NULL == pDeviceDescriptor)
440 goto unlockdescriptor;
473 if(NULL == pSensorHandle)
485 if (NULL == pDeviceDescriptor)
496 goto unlockdescriptor;
532 int32_t sensorConfStat;
534 if((NULL == pSensorHandle) || (NULL == pSensorSettings))
543 if (NULL == pDeviceDescriptor)
549 sensorConfStat = apply_sensor_specific_configurations();
562 goto unlockdescriptor;
569 goto unlockdescriptor;
601 if ((NULL == pSensorHandle) || (NULL == pSensorSettings))
625 if ( NULL == pSensorHandle)
645 if (NULL == pDeviceDescriptor)
655 for(channelId = 0; channelId < configuredADCh; channelId++)
657 pCurrentSampleBuffer->
data[channelId] = 0;
664 if (kStatus_OSA_Success != OSA_SemaCreate(&pDeviceDescriptor->
deviceSemaphore, 1)){
669 AnalogVoltagetoOutputConvTable.
offset = 0.0;
670 AnalogVoltagetoOutputConvTable.
convFactor = 1.0;
isf_timestamp_t timestamp
#define Analog_1_CONVERT_FLOAT_FACTOR
void Analog_1_fsl_Sensor_Generic_Analog_Configure(void *pSensorHandle, void *pSensorSettings, int8_t *retValue)
void Analog_1_fsl_Sensor_Generic_Analog_EndData(void *pSensorHandle, int8_t *retValue)
isf_dsa_status_t fsl_Sensor_Analog_1_ValidateSettings(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
const Analog_1_device_t Analog_1_DeviceInfo
This allows access to the sensor communications specific configuration.
uint32 isf_time_util_get_usec(void)
This API returns the time in microseconds.
This is user's event module. Put your event handler code here.
isf_dsa_ControlData_t controlData
isf_fifo_status_t isf_fifo_lock(isf_fifo_t *pFifo)
Lock a sample buffer for exclusive access.
isf_dsa_status_t fsl_Sensor_Analog_1_Initialize(isf_SensorHandle_t *pSensorHandle)
isf_fifo_status_t isf_fifo_unlock(isf_fifo_t *pFifo)
Release the exclusive access lock on a sample buffer.
isf_fifo_status_t isf_fifo_el_increment(isf_fifo_t *pFifo)
Routine increments the insert pointer after direct access.
isf_Analog_1_float_data_t sensorData[MAX_ADC_CHANNELS]
This defines the DSA sensor device handle structure used to invoke the adapter access functions...
isf_dsa_status_t Analog_1_fixed_converter(Analog_1_Sensor_Specific_Settings_t *pSensorSpecificConfig, Analog_1_DataBuffer_t *nativeSample, void *vpConvertedSample)
isf_dsa_status_t fsl_Sensor_Analog_1_StartData(isf_SensorHandle_t *pSensorHandle)
Define the sensor device descriptor.
void Analog_1_fsl_Sensor_Generic_AnalogCallback(void *pSensorHandle)
isf_dsa_status_t Analog_1_float_converter(Analog_1_Sensor_Specific_Settings_t *pSensorSpecificConfig, Analog_1_DataBuffer_t *nativeSample, void *vpConvertedSample)
This is user's event module. Put your event handler code here.
isf_timestamp_t timestamp
isf_dsa_status_t fsl_Sensor_Analog_1_Configure(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
int32 isf_dsa_status_t
This is the Sensor Manager API return type definition.
uint16 data[MAX_ADC_CHANNELS]
Analog_1_Sensor_Specific_Settings_t Analog_1_Sensor_Specific_Config
This allows access to the sensor specific configuration for the target sensor.
Standard fixed type for three axis accelerometers.
void Analog_1_fsl_Sensor_Generic_Analog_Shutdown(void *pSensorHandle, int8_t *retValue)
enum isf_dsa_result_enums isf_dsa_result_types_t
This structure stores sample Information necessary to communicate with non I2C slave device...
bm_callback_token_t bm_register_periodic_callback(isf_duration_t aPeriod, bm_callback_t *pCallback, void *pCbData)
This API schedules a callback at the specified period.
const adc16_chn_config_t ADC1_ChnConfig0
Channel configuration declaration.
isf_dsa_result_types_t resultFormat
This is user's event module. Put your event handler code here.
void Analog_1_fsl_Sensor_Generic_Analog_Initialize(void *pSensorHandle, int8_t *retValue)
isf_dsa_status_t fsl_Sensor_Analog_1_EndData(isf_SensorHandle_t *pSensorHandle)
isf_SensorDataTypes_t resultType
isf_dsa_status_t fsl_Sensor_Analog_1_Shutdown(isf_SensorHandle_t *pSensorHandle)
isf_dsa_AdapterStatus_t adapterStatus
isf_SensorDataTypes_t Analog_1_SupportedDataTypes[]
const adc16_converter_config_t ADC1_InitConfig0
ADC configuration declaration.
void Analog_1_fsl_Sensor_Generic_Analog_StartData(void *pSensorHandle, int8_t *retValue)
isf_SensorTypes_t Analog_1_SupportedSensorTypes[]
Supported sensor and data types for the Sensor.
void Analog_1_fsl_Sensor_Generic_Analog_Convert(void *pSensorHandle, uint32_t convertToType, uint8_t resultType, void *pNativeSample, void *pConvertedSample, int32_t *numBytes, int8_t *retValue)
isf_fifo_t * pSampleBufferInfo
#define BM_ERROR
This value specifies a general Bus Manager error. If an error occurs in registering a callback...
int32 isf_status_t
ISF return status type.
#define FSL_ADC1
Device instance number.
This defines the DSA sensor configuration parameter structure configuring the sensor settings by a su...
This is user's event module. Put your event handler code here.
void Analog_1_fsl_Sensor_Generic_Analog_ValidateSettings(void *pSensorHandle, void *pSensorSettings, int8_t *retValue)
isf_dsa_SensorSettings_t sensorSettings
#define Analog_1_CONVERT_FIXED_FACTOR
void * isf_fifo_el_get_insert_pointer(isf_fifo_t *pFifo)
Routine returns the insert pointer for direct access.
This is user's event module. Put your event handler code here.
isf_Analog_1_fixed_data_t sensorData[MAX_ADC_CHANNELS]
semaphore_t deviceSemaphore
This structure defines the dummy DSA data buffer format.
isf_dsa_status_t fsl_Sensor_Analog_1_Convert(isf_SensorHandle_t *pSensorHandle, isf_SensorDataTypes_t convertToType, isf_dsa_result_types_t resultType, void *pNativeSample, void *pConvertedSample, int32_t *numBytes)
bm_callback_token_t token