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

APDS9930 Driver extensions. More...

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

Data Structures

union  uAPDS9930_REG_MAP
 Union of APDS9930 registry map. More...
 

Enumerations

enum  APDS9930_chan { APDS9930__CHAN_FULL = 0U , APDS9930__CHAN_IR , APDS9930__CHAN_PROXIMITY , APDS9930__CHAN_VISIBLE }
 Light types of APDS9930. More...
 

Functions

FctERR APDS9930_Write_En (APDS9930_t *const pCpnt, const uint8_t en)
 Write APDS9930 Enable register.
 
FctERR APDS9930_Write_Cfg (APDS9930_t *const pCpnt, const uint8_t cfg)
 Write APDS9930 Config.
 
FctERR APDS9930_Write_Ctrl (APDS9930_t *const pCpnt, const uint8_t ctrl)
 Write APDS9930 Control.
 
FctERR APDS9930_Set_PON (APDS9930_t *const pCpnt, const bool en)
 Oscillator Enable / Disable.
 
FctERR APDS9930_Set_AEN (APDS9930_t *const pCpnt, const bool en)
 ALS module Enable / Disable.
 
FctERR APDS9930_Set_PEN (APDS9930_t *const pCpnt, const bool en)
 Proximity module Enable / Disable.
 
FctERR APDS9930_Set_AIEN (APDS9930_t *const pCpnt, const bool en)
 ALS interrupt module Enable / Disable.
 
FctERR APDS9930_Set_PIEN (APDS9930_t *const pCpnt, const bool en)
 Proximity interrupt module Enable / Disable.
 
FctERR APDS9930_Set_WEN (APDS9930_t *const pCpnt, const bool en)
 WAIT module Enable / Disable.
 
FctERR APDS9930_Set_SAI (APDS9930_t *const pCpnt, const bool en)
 Sleep After Interrupt Enable / Disable.
 
FctERR APDS9930_Set_ALS_Gain (APDS9930_t *const pCpnt, const APDS9930_als_gain_ex gain)
 ALS Gain configuration.
 
FctERR APDS9930_Set_Prox_Gain (APDS9930_t *const pCpnt, const APDS9930_prox_gain gain)
 Proximity Gain configuration.
 
FctERR APDS9930_Set_Prox_Drive_Strength (APDS9930_t *const pCpnt, const APDS9930_drive_strength_ex pdrive)
 Proximity Drive configuration.
 
FctERR APDS9930_Set_ALS_Pesistence (APDS9930_t *const pCpnt, const APDS9930_als_it_persist persist)
 ALS Persistence configuration.
 
FctERR APDS9930_Set_Prox_Pesistence (APDS9930_t *const pCpnt, const APDS9930_prox_it_persist persist)
 Proximity Persistence configuration.
 
FctERR APDS9930_Set_ALS_Integration_Time (APDS9930_t *const pCpnt, const uint16_t integ)
 ALS Integration time configuration.
 
FctERR APDS9930_Set_Prox_Integration_Time (APDS9930_t *const pCpnt, const uint16_t integ)
 Proximity Integration time configuration.
 
FctERR APDS9930_Set_Wait_Time (APDS9930_t *const pCpnt, const uint16_t wait)
 Wait time configuration.
 
FctERR APDS9930_Set_AILT (APDS9930_t *const pCpnt, const uint16_t thr)
 ALS interrupt low threshold configuration.
 
FctERR APDS9930_Set_AIHT (APDS9930_t *const pCpnt, const uint16_t thr)
 ALS interrupt high threshold configuration.
 
FctERR APDS9930_Set_AIT (APDS9930_t *const pCpnt, const uint16_t lthr, const uint16_t hthr)
 ALS interrupt thresholds configuration.
 
FctERR APDS9930_Set_PILT (APDS9930_t *const pCpnt, const uint16_t thr)
 Proximity interrupt Persist Low threshold filter configuration.
 
FctERR APDS9930_Set_PIHT (APDS9930_t *const pCpnt, const uint16_t thr)
 Proximity interrupt Persist High threshold filter configuration.
 
FctERR APDS9930_Set_PIT (APDS9930_t *const pCpnt, const uint16_t lthr, const uint16_t hthr)
 Proximity interrupt Persist threshold filters configuration.
 
FctERR APDS9930_SF_Clear_ALS_IT (APDS9930_t *const pCpnt)
 Clear pending ALS interruption.
 
FctERR APDS9930_SF_Clear_PROX_IT (APDS9930_t *const pCpnt)
 Clear pending Proximity interruption.
 
FctERR APDS9930_SF_Clear_ALS_PROX_IT (APDS9930_t *const pCpnt)
 Clear pending ALS & Proximity interruptions.
 
FctERR APDS9930_Get_ChipID (APDS9930_t *const pCpnt, uint8_t *const id)
 Get APDS9930 chip ID.
 
FctERR APDS9930_Get_Full (APDS9930_t *const pCpnt, uint16_t *const full)
 Get Full conversion (Channel 0)
 
FctERR APDS9930_Get_IR (APDS9930_t *const pCpnt, uint16_t *const ir)
 Get IR conversion (Channel 1)
 
FctERR APDS9930_Get_Prox (APDS9930_t *const pCpnt, uint16_t *const prox)
 Get Proximity conversion.
 
void APDS9930_INT_GPIO_Init (APDS9930_t *const pCpnt, GPIO_TypeDef *const GPIOx, const uint16_t GPIO_Pin, const GPIO_PinState GPIO_Active)
 Interrupt GPIO pin init for APDS9930.
 
bool APDS9930_INT_GPIO_Get (const APDS9930_t *const pCpnt)
 Interrupt GPIO pin getter for APDS9930.
 

Detailed Description

APDS9930 Driver extensions.

Author
SMFSW

APDS9930: Digital Proximity and Ambient Light Sensor

Enumeration Type Documentation

◆ APDS9930_chan

Light types of APDS9930.

Enumerator
APDS9930__CHAN_FULL 

Full light spectrum channel (channel 0)

APDS9930__CHAN_IR 

Infra Red light channel (channel 1)

APDS9930__CHAN_PROXIMITY 

Proximity channel.

APDS9930__CHAN_VISIBLE 

Visible light (channel 0 - channel 1)

Function Documentation

◆ APDS9930_Get_ChipID()

FctERR APDS9930_Get_ChipID ( APDS9930_t *const pCpnt,
uint8_t *const id )
inline

Get APDS9930 chip ID.

Parameters
[in]pCpnt- Pointer to APDS9930 component
[in,out]id- pointer to chip ID result
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ APDS9930_Get_Full()

FctERR APDS9930_Get_Full ( APDS9930_t *const pCpnt,
uint16_t *const full )
inline

Get Full conversion (Channel 0)

Parameters
[in]pCpnt- Pointer to APDS9930 component
[in,out]full- pointer to Full conversion result
Returns
FctERR - error code
Here is the call graph for this function:

◆ APDS9930_Get_IR()

FctERR APDS9930_Get_IR ( APDS9930_t *const pCpnt,
uint16_t *const ir )
inline

Get IR conversion (Channel 1)

Parameters
[in]pCpnt- Pointer to APDS9930 component
[in,out]ir- pointer to IR conversion result
Returns
FctERR - error code
Here is the call graph for this function:

◆ APDS9930_Get_Prox()

FctERR APDS9930_Get_Prox ( APDS9930_t *const pCpnt,
uint16_t *const prox )
inline

Get Proximity conversion.

Parameters
[in]pCpnt- Pointer to APDS9930 component
[in,out]prox- pointer to Proximity conversion result
Returns
FctERR - error code
Here is the call graph for this function:

◆ APDS9930_INT_GPIO_Get()

bool APDS9930_INT_GPIO_Get ( const APDS9930_t *const pCpnt)

Interrupt GPIO pin getter for APDS9930.

Weak Functions
APDS9930 Interrupt GPIO pin getter may be user implemented if needed
Parameters
[in]pCpnt- Pointer to APDS9930 component
Returns
INT pin state value (0: inactive, 1: active)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ APDS9930_INT_GPIO_Init()

void APDS9930_INT_GPIO_Init ( APDS9930_t *const pCpnt,
GPIO_TypeDef *const GPIOx,
const uint16_t GPIO_Pin,
const GPIO_PinState GPIO_Active )

Interrupt GPIO pin init for APDS9930.

Weak Functions
APDS9930 Interrupt GPIO pin init may be user implemented if needed
Parameters
[in]pCpnt- Pointer to APDS9930 component
[in]GPIOx- INT port
[in]GPIO_Pin- INT pin
[in]GPIO_ActiveINT pin active state
Here is the call graph for this function:

◆ APDS9930_Set_AEN()

FctERR APDS9930_Set_AEN ( APDS9930_t *const pCpnt,
const bool en )

ALS module Enable / Disable.

Parameters
[in]pCpnt- Pointer to APDS9930 component
[in]en- 0 Disable, 1 Enable
Returns
FctERR - error code
Here is the call graph for this function:

◆ APDS9930_Set_AIEN()

FctERR APDS9930_Set_AIEN ( APDS9930_t *const pCpnt,
const bool en )

ALS interrupt module Enable / Disable.

Parameters
[in]pCpnt- Pointer to APDS9930 component
[in]en- 0 Disable, 1 Enable
Returns
FctERR - error code
Here is the call graph for this function:

◆ APDS9930_Set_AIHT()

FctERR APDS9930_Set_AIHT ( APDS9930_t *const pCpnt,
const uint16_t thr )
inline

ALS interrupt high threshold configuration.

Parameters
[in]pCpnt- Pointer to APDS9930 component
[in]thr- High threshold value
Returns
FctERR - error code
Here is the call graph for this function:

◆ APDS9930_Set_AILT()

FctERR APDS9930_Set_AILT ( APDS9930_t *const pCpnt,
const uint16_t thr )
inline

ALS interrupt low threshold configuration.

Parameters
[in]pCpnt- Pointer to APDS9930 component
[in]thr- Low threshold value
Returns
FctERR - error code
Here is the call graph for this function:

◆ APDS9930_Set_AIT()

FctERR APDS9930_Set_AIT ( APDS9930_t *const pCpnt,
const uint16_t lthr,
const uint16_t hthr )
inline

ALS interrupt thresholds configuration.

Parameters
[in]pCpnt- Pointer to APDS9930 component
[in]lthr- Low threshold value
[in]hthr- High threshold value
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ APDS9930_Set_ALS_Gain()

FctERR APDS9930_Set_ALS_Gain ( APDS9930_t *const pCpnt,
const APDS9930_als_gain_ex gain )

ALS Gain configuration.

Parameters
[in]pCpnt- Pointer to APDS9930 component
[in]gain- Gain value
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ APDS9930_Set_ALS_Integration_Time()

FctERR APDS9930_Set_ALS_Integration_Time ( APDS9930_t *const pCpnt,
const uint16_t integ )

ALS Integration time configuration.

Parameters
[in]pCpnt- Pointer to APDS9930 component
[in]integ- Integration time value (from 3ms to 699ms)
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ APDS9930_Set_ALS_Pesistence()

FctERR APDS9930_Set_ALS_Pesistence ( APDS9930_t *const pCpnt,
const APDS9930_als_it_persist persist )

ALS Persistence configuration.

Parameters
[in]pCpnt- Pointer to APDS9930 component
[in]persist- Persistence value
Returns
FctERR - error code
Here is the call graph for this function:

◆ APDS9930_Set_PEN()

FctERR APDS9930_Set_PEN ( APDS9930_t *const pCpnt,
const bool en )

Proximity module Enable / Disable.

Parameters
[in]pCpnt- Pointer to APDS9930 component
[in]en- 0 Disable, 1 Enable
Returns
FctERR - error code
Here is the call graph for this function:

◆ APDS9930_Set_PIEN()

FctERR APDS9930_Set_PIEN ( APDS9930_t *const pCpnt,
const bool en )

Proximity interrupt module Enable / Disable.

Parameters
[in]pCpnt- Pointer to APDS9930 component
[in]en- 0 Disable, 1 Enable
Returns
FctERR - error code
Here is the call graph for this function:

◆ APDS9930_Set_PIHT()

FctERR APDS9930_Set_PIHT ( APDS9930_t *const pCpnt,
const uint16_t thr )
inline

Proximity interrupt Persist High threshold filter configuration.

Parameters
[in]pCpnt- Pointer to APDS9930 component
[in]thr- Persist High threshold filter value
Returns
FctERR - error code
Here is the call graph for this function:

◆ APDS9930_Set_PILT()

FctERR APDS9930_Set_PILT ( APDS9930_t *const pCpnt,
const uint16_t thr )
inline

Proximity interrupt Persist Low threshold filter configuration.

Parameters
[in]pCpnt- Pointer to APDS9930 component
[in]thr- Persist Low threshold filter value
Returns
FctERR - error code
Here is the call graph for this function:

◆ APDS9930_Set_PIT()

FctERR APDS9930_Set_PIT ( APDS9930_t *const pCpnt,
const uint16_t lthr,
const uint16_t hthr )
inline

Proximity interrupt Persist threshold filters configuration.

Parameters
[in]pCpnt- Pointer to APDS9930 component
[in]lthr- Low threshold filter value
[in]hthr- High threshold filter value
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ APDS9930_Set_PON()

FctERR APDS9930_Set_PON ( APDS9930_t *const pCpnt,
const bool en )

Oscillator Enable / Disable.

Parameters
[in]pCpnt- Pointer to APDS9930 component
[in]en- 0 Disable, 1 Enable
Returns
FctERR - error code
Here is the call graph for this function:

◆ APDS9930_Set_Prox_Drive_Strength()

FctERR APDS9930_Set_Prox_Drive_Strength ( APDS9930_t *const pCpnt,
const APDS9930_drive_strength_ex pdrive )

Proximity Drive configuration.

Parameters
[in]pCpnt- Pointer to APDS9930 component
[in]pdrive- Proximity Drive Strength value
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ APDS9930_Set_Prox_Gain()

FctERR APDS9930_Set_Prox_Gain ( APDS9930_t *const pCpnt,
const APDS9930_prox_gain gain )

Proximity Gain configuration.

Parameters
[in]pCpnt- Pointer to APDS9930 component
[in]gain- Gain value
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ APDS9930_Set_Prox_Integration_Time()

FctERR APDS9930_Set_Prox_Integration_Time ( APDS9930_t *const pCpnt,
const uint16_t integ )

Proximity Integration time configuration.

Note
It is recommended that this register be programmed to a value of 0xff (1 cycle, 1023 bits). -> integ = 3
Parameters
[in]pCpnt- Pointer to APDS9930 component
[in]integ- Integration time value (from 3ms to 699ms)
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ APDS9930_Set_Prox_Pesistence()

FctERR APDS9930_Set_Prox_Pesistence ( APDS9930_t *const pCpnt,
const APDS9930_prox_it_persist persist )

Proximity Persistence configuration.

Parameters
[in]pCpnt- Pointer to APDS9930 component
[in]persist- Persistence value
Returns
FctERR - error code
Here is the call graph for this function:

◆ APDS9930_Set_SAI()

FctERR APDS9930_Set_SAI ( APDS9930_t *const pCpnt,
const bool en )

Sleep After Interrupt Enable / Disable.

Parameters
[in]pCpnt- Pointer to APDS9930 component
[in]en- 0 Disable, 1 Enable
Returns
FctERR - error code
Here is the call graph for this function:

◆ APDS9930_Set_Wait_Time()

FctERR APDS9930_Set_Wait_Time ( APDS9930_t *const pCpnt,
const uint16_t wait )

Wait time configuration.

Parameters
[in]pCpnt- Pointer to APDS9930 component
[in]wait- Wait time value (from 3ms to 8400ms)
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ APDS9930_Set_WEN()

FctERR APDS9930_Set_WEN ( APDS9930_t *const pCpnt,
const bool en )

WAIT module Enable / Disable.

Parameters
[in]pCpnt- Pointer to APDS9930 component
[in]en- 0 Disable, 1 Enable
Returns
FctERR - error code
Here is the call graph for this function:

◆ APDS9930_SF_Clear_ALS_IT()

FctERR APDS9930_SF_Clear_ALS_IT ( APDS9930_t *const pCpnt)
inline

Clear pending ALS interruption.

Warning
if event pin enabled, shall be called after read to reset pin
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_SF_Clear_ALS_PROX_IT()

FctERR APDS9930_SF_Clear_ALS_PROX_IT ( APDS9930_t *const pCpnt)
inline

Clear pending ALS & Proximity interruptions.

Warning
if event pin enabled, shall be called after read to reset pin
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_SF_Clear_PROX_IT()

FctERR APDS9930_SF_Clear_PROX_IT ( APDS9930_t *const pCpnt)
inline

Clear pending Proximity interruption.

Warning
if event pin enabled, shall be called after read to reset pin
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_Write_Cfg()

FctERR APDS9930_Write_Cfg ( APDS9930_t *const pCpnt,
const uint8_t cfg )
inline

Write APDS9930 Config.

Parameters
[in]pCpnt- Pointer to APDS9930 component
[in]cfg- Configuration register value
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ APDS9930_Write_Ctrl()

FctERR APDS9930_Write_Ctrl ( APDS9930_t *const pCpnt,
const uint8_t ctrl )
inline

Write APDS9930 Control.

Parameters
[in]pCpnt- Pointer to APDS9930 component
[in]ctrl- Control register value
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ APDS9930_Write_En()

FctERR APDS9930_Write_En ( APDS9930_t *const pCpnt,
const uint8_t en )
inline

Write APDS9930 Enable register.

Parameters
[in]pCpnt- Pointer to APDS9930 component
[in]en- Enable register value
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function: