I2C_Drivers (ARM) 1.1
SMFSW collection of HAL I2C Drivers for ARM
Loading...
Searching...
No Matches
APDS9930_proc.h File Reference

APDS9930 Driver procedures. More...

#include "sarmfsw.h"
#include "APDS9930.h"
#include "shared_ALS.h"
Include dependency graph for APDS9930_proc.h:
This graph shows which files directly or indirectly include this file:

Data Structures

struct  APDS9930_t
 APDS9930 user interface struct. More...
 

Macros

#define APDS9930_CHIP_ID   0x39U
 APDS9930 Chip ID to check against.
 
#define APDS9930_DEVICE_FACTOR   52U
 APDS9930 Device factor.
 
#define APDS9930_DEF_PROX_PULSES   8U
 Recommended proximity pulses in a cycle.
 

Enumerations

enum  APDS9930_als_gain_ex {
  APDS9930__ALS_GAIN_1X = 0U , APDS9930__ALS_GAIN_8X , APDS9930__ALS_GAIN_16X , APDS9930__ALS_GAIN_120X ,
  APDS9930__ALS_GAIN_1ON6X , APDS9930__ALS_GAIN_8ON6X
}
 Gain values of APDS9930 ALS. More...
 
enum  APDS9930_drive_strength_ex {
  APDS9930__STRENGTH_100MA = 0U , APDS9930__STRENGTH_50MA , APDS9930__STRENGTH_25MA , APDS9930__STRENGTH_12_5MA ,
  APDS9930__STRENGTH_11_1MA , APDS9930__STRENGTH_5_6MA , APDS9930__STRENGTH_2_8MA , APDS9930__STRENGTH_1_4MA
}
 Proximity LED Drive strength values. More...
 

Functions

FctERR APDS9930_Init_Sequence (APDS9930_t *const pCpnt)
 Initialization Sequence for APDS9930 peripheral.
 
void APDS9930_Set_LPC (APDS9930_t *const pCpnt)
 Set proper LPC value (Lux per Count)
 
uint32_t APDS9930_Get_Lux (const APDS9930_t *const pCpnt)
 Get current Illuminance (in lux)
 
FctERR APDS9930_handler (APDS9930_t *const pCpnt)
 Handler for APDS9930 peripheral.
 
FctERR APDS9930_handler_it (APDS9930_t *const pCpnt)
 Handler for APDS9930 peripheral GPIO interrupt.
 
FctERR APDS9930_handler_all (void)
 Handler for all APDS9930 peripherals.
 
FctERR APDS9930_handler_it_all (void)
 Handler for all APDS9930 peripherals GPIO interrupt.
 

Variables

APDS9930_t APDS9930 [I2C_APDS9930_NB]
 APDS9930 User structure.
 

Detailed Description

APDS9930 Driver procedures.

Author
SMFSW

APDS9930: Digital Proximity and Ambient Light Sensor

Macro Definition Documentation

◆ APDS9930_CHIP_ID

#define APDS9930_CHIP_ID   0x39U

APDS9930 Chip ID to check against.

◆ APDS9930_DEF_PROX_PULSES

#define APDS9930_DEF_PROX_PULSES   8U

Recommended proximity pulses in a cycle.

◆ APDS9930_DEVICE_FACTOR

#define APDS9930_DEVICE_FACTOR   52U

APDS9930 Device factor.

Enumeration Type Documentation

◆ APDS9930_als_gain_ex

Gain values of APDS9930 ALS.

Warning
Datasheet p9 states ok, but CONFIG register description p22 states not to use 16 or 120 gain when AGL asserted
Enumerator
APDS9930__ALS_GAIN_1X 

ALS 1X Gain.

APDS9930__ALS_GAIN_8X 

ALS 8X Gain.

APDS9930__ALS_GAIN_16X 

ALS 16X Gain.

APDS9930__ALS_GAIN_120X 

ALS 120X Gain.

APDS9930__ALS_GAIN_1ON6X 

ALS 1/6X Gain.

APDS9930__ALS_GAIN_8ON6X 

ALS 8/6X Gain.

◆ APDS9930_drive_strength_ex

Proximity LED Drive strength values.

Enumerator
APDS9930__STRENGTH_100MA 

PDL=0 : 100mA.

APDS9930__STRENGTH_50MA 

PDL=0 : 50mA.

APDS9930__STRENGTH_25MA 

PDL=0 : 25mA.

APDS9930__STRENGTH_12_5MA 

PDL=0 : 12.5mA.

APDS9930__STRENGTH_11_1MA 

PDL=1 : 11.1mA.

APDS9930__STRENGTH_5_6MA 

PDL=1 : 5.6mA.

APDS9930__STRENGTH_2_8MA 

PDL=1 : 2.8mA.

APDS9930__STRENGTH_1_4MA 

PDL=1 : 1.4mA.

Function Documentation

◆ APDS9930_Get_Lux()

uint32_t APDS9930_Get_Lux ( const APDS9930_t *const pCpnt)
inline

Get current Illuminance (in lux)

Parameters
[in]pCpnt- Pointer to APDS9930 component
Returns
FctERR - error code

◆ APDS9930_handler()

FctERR APDS9930_handler ( APDS9930_t *const pCpnt)

Handler for APDS9930 peripheral.

Weak Functions
APDS9930 handler may be user implemented to suit custom needs
Note
May be called periodically to handle APDS9930 tasks
Alternately may be called when event occurs on APDS9930 pin (or by calling APDS9930_handler_it instead)
Parameters
[in]pCpnt- Pointer to APDS9930 component
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ APDS9930_handler_all()

FctERR APDS9930_handler_all ( void )

Handler for all APDS9930 peripherals.

Note
May be called periodically to handle all APDS9930 tasks
Returns
FctERR - error code
Here is the call graph for this function:

◆ APDS9930_handler_it()

FctERR APDS9930_handler_it ( APDS9930_t *const pCpnt)

Handler for APDS9930 peripheral GPIO interrupt.

Note
APDS9930_INT_GPIO_Init has to be called at init before using interrupt handler function
Weak Functions
APDS9930 GPIO interrupt handler may be user implemented to suit custom needs
Note
May be called periodically to handle APDS9930 tasks through interrupts
Parameters
[in]pCpnt- Pointer to APDS9930 component
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ APDS9930_handler_it_all()

FctERR APDS9930_handler_it_all ( void )

Handler for all APDS9930 peripherals GPIO interrupt.

Note
APDS9930_INT_GPIO_Init has to be called at init before using interrupt handler function
May be called periodically to handle all APDS9930 tasks
Returns
FctERR - error code
Here is the call graph for this function:

◆ APDS9930_Init_Sequence()

FctERR APDS9930_Init_Sequence ( APDS9930_t *const pCpnt)

Initialization Sequence for APDS9930 peripheral.

Weak Functions
APDS9930 Init sequence may be user implemented if custom initialization sequence needed
Parameters
[in]pCpnt- Pointer to APDS9930 component
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ APDS9930_Set_LPC()

void APDS9930_Set_LPC ( APDS9930_t *const pCpnt)

Set proper LPC value (Lux per Count)

Note
Should be called after Configuration change of Integration time or Gain
Parameters
[in]pCpnt- Pointer to APDS9930 component
Here is the caller graph for this function:

Variable Documentation

◆ APDS9930

APDS9930_t APDS9930[I2C_APDS9930_NB]
extern

APDS9930 User structure.