XDK API  3.6.0
Documentation
Macros | Functions | Variables
LightSensor.c File Reference

This module is common to various light sensor. Used to initialize,configure and gets the data from the sensor. More...

#include "BCDS_SensorsInfo.h"
#include "BCDS_LightSensor.h"
#include "BCDS_Max44009Utils.h"
#include "BCDS_Max44009.h"
#include "FreeRTOS.h"
#include "timers.h"
+ Include dependency graph for LightSensor.c:

Macros

#define BCDS_MODULE_ID   BCDS_SENSORS_ID_LIGHTSENSOR
 
#define GET_MAPPING_ERROR   INT8_C(-2)
 
#define INIT_DONE   UINT8_C(1)
 
#define INIT_NOT_DONE   UINT8_C(0)
 
#define MAX_INTERRUPT_CHANNEL_1   UINT8_C(1)
 
#define PACKAGE_ID_DEFAULT   UINT32_C(0)
 

Functions

Retcode_T LightSensor_configureThresholdInterrupt (LightSensor_HandlePtr_T handle, uint32_t upperThreshold, uint32_t lowerThreshold, uint32_t thresholdTimer)
 function responsible to set interrupt conditions, that means, threshold boundaries and threshold timer for lightsensor interrupt. Interrupt will be fired if the light intensity is crossed threshold boundaries for a window period defined in threshold timer.User must register the callback before calling configuring interrupt More...
 
Retcode_T LightSensor_deInit (LightSensor_HandlePtr_T handle)
 DeInitializes the light sensor referenced by the passed handle. More...
 
Retcode_T LightSensor_disableInterrupt (LightSensor_HandlePtr_T handle)
 Disable Interrupt type on the handle. More...
 
Retcode_T LightSensor_getInterruptStatus (LightSensor_HandlePtr_T handle, LightSensor_ConfigInterruptPtr_T interruptStatus)
 function to read light sensor interrupt status register More...
 
Retcode_T LightSensor_init (LightSensor_HandlePtr_T handle)
 Initializes the LightSensor referenced by the passed handle. More...
 
Retcode_T LightSensor_readLuxData (LightSensor_HandlePtr_T handle, uint32_t *luxData)
 function to read sensor data in milli lux. More...
 
Retcode_T LightSensor_readRawData (LightSensor_HandlePtr_T handle, uint16_t *luxData)
 Reads raw sensor data from light sensor referenced by the passed handle. More...
 
Retcode_T LightSensor_registerDeferredCallback (LightSensor_HandlePtr_T handle, deferredInterruptCallback deferredCallback)
 function responsible to register deferred interrupt handler for light sensor. When user registers deferred callback their callback will be executed in timer daemon context, where there is no restriction of using delay functions and/or APIs related to bus access. More...
 
Retcode_T LightSensor_registerRealTimeCallback (LightSensor_HandlePtr_T handle, interruptCallback realTimeCallback)
 function responsible to register real time interrupt handler for light sensor. When user registers real time callback their callback will be executed in ISR context. User must not use any delay functions or bus access in ISR context. More...
 
Retcode_T LightSensor_setBrightness (LightSensor_HandlePtr_T handle, LightSensor_ConfigBrightness_T brightness)
 function to set brightness to low or high for light sensor More...
 
Retcode_T LightSensor_setContinuousMode (LightSensor_HandlePtr_T handle, LightSensor_ConfigMode_T manualMode)
 Function to enable/disable the Continuous mode for the light sensor referenced by the passed handle. More...
 
Retcode_T LightSensor_setIntegrationTime (LightSensor_HandlePtr_T handle, LightSensor_IntegrationTime_T integrationTime)
 function to configure integration time of light sensor. More...
 
Retcode_T LightSensor_setManualMode (LightSensor_HandlePtr_T handle, LightSensor_ConfigMode_T manualMode)
 Function to enable/disable the Manual mode for the light sensor referenced by the passed handle. More...
 
static int8_t mappingEnumForGetFunctions (uint8_t start, uint8_t end, uint8_t getValueToBeTransalated, const uint8_t *lookUpTablePtr)
 
static void maxIsrCallback (uint32_t channel, uint32_t edge)
 MAX44009 driver callback function that will be called during ISR. More...
 

Variables

static const
MAX44009_ConfigBrightness_T 
brightnessLookupTable [LIGHTSENSOR_BRIGHTNESS_OUT_OF_RANGE]
 
static const MAX44009_ConfigMode_T continousModeLookUpTable [LIGHTSENSOR_MODE_OUT_OF_RANGE]
 
static const
MAX44009_IntegrationTime_T 
integrationtimeLookupTable [LIGHTSENSOR_TIME_OUT_OF_RANGE]
 
static const MAX44009_ConfigMode_T interruptStatusLookupTable [LIGHTSENSOR_CONFIG_INTERRUPT_OUT_OF_RANGE]
 
static const MAX44009_ConfigMode_T manualModeLookUpTable [LIGHTSENSOR_MODE_OUT_OF_RANGE]
 
LightSensor_HandlePtr_T Max44009Handle = NULL
 

Macro Definition Documentation

#define BCDS_MODULE_ID   BCDS_SENSORS_ID_LIGHTSENSOR
#define GET_MAPPING_ERROR   INT8_C(-2)
#define INIT_DONE   UINT8_C(1)
#define INIT_NOT_DONE   UINT8_C(0)
#define MAX_INTERRUPT_CHANNEL_1   UINT8_C(1)
#define PACKAGE_ID_DEFAULT   UINT32_C(0)

default package ID

Function Documentation

static int8_t mappingEnumForGetFunctions ( uint8_t  start,
uint8_t  end,
uint8_t  getValueToBeTransalated,
const uint8_t *  lookUpTablePtr 
)
static

+ Here is the caller graph for this function:

static void maxIsrCallback ( uint32_t  channel,
uint32_t  edge 
)
static
Parameters
[in]channelchannel at which interrupt has occurred
[in]edgeedge at which interrupt has occurred falling(0) or raising edge(1)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

Initial value:
=
{
}
Definition: BCDS_Max44009.h:64
Definition: BCDS_Max44009.h:65
const MAX44009_ConfigMode_T continousModeLookUpTable[LIGHTSENSOR_MODE_OUT_OF_RANGE]
static
Initial value:
const MAX44009_IntegrationTime_T integrationtimeLookupTable[LIGHTSENSOR_TIME_OUT_OF_RANGE]
static
Initial value:
=
{
}
Definition: BCDS_Max44009.h:91
Definition: BCDS_Max44009.h:93
Definition: BCDS_Max44009.h:94
Definition: BCDS_Max44009.h:96
Definition: BCDS_Max44009.h:92
Definition: BCDS_Max44009.h:89
Definition: BCDS_Max44009.h:95
Definition: BCDS_Max44009.h:90
const MAX44009_ConfigMode_T interruptStatusLookupTable[LIGHTSENSOR_CONFIG_INTERRUPT_OUT_OF_RANGE]
static
Initial value:
=
{
}
Definition: BCDS_Max44009.h:116
Definition: BCDS_Max44009.h:117
const MAX44009_ConfigMode_T manualModeLookUpTable[LIGHTSENSOR_MODE_OUT_OF_RANGE]
static
Initial value:
=
{
}
Definition: BCDS_Max44009.h:113
Definition: BCDS_Max44009.h:112
LightSensor_HandlePtr_T Max44009Handle = NULL

All rights reserved. The use is subject to the XDK SDK EULA by Bosch Connected Devices and Solutions GmbH.
This documentation file has been automatically generated on Thu Mar 14 2019 19:12:49 by doxygen 1.8.8