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

APDS9960 Driver extensions. More...

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

Data Structures

union  uAPDS9960_REG_MAP
 Union of APDS9960 registry map. More...
 

Enumerations

enum  APDS9960_chan {
  APDS9960__CHAN_CLEAR = 0U , APDS9960__CHAN_RED , APDS9960__CHAN_GREEN , APDS9960__CHAN_BLUE ,
  APDS9960__CHAN_PROXIMITY
}
 Type channels of APDS9960. More...
 

Functions

FctERR APDS9960_Write_En (APDS9960_t *const pCpnt, const uint8_t en)
 Write APDS9960 Enable register.
 
FctERR APDS9960_Write_Cfg1 (APDS9960_t *const pCpnt, const uint8_t cfg1)
 Write APDS9960 Config1.
 
FctERR APDS9960_Write_Cfg2 (APDS9960_t *const pCpnt, const uint8_t cfg2)
 Write APDS9960 Config2.
 
FctERR APDS9960_Write_Ctrl (APDS9960_t *const pCpnt, const uint8_t ctrl)
 Write APDS9960 Control.
 
FctERR APDS9960_Set_PON (APDS9960_t *const pCpnt, const bool en)
 Oscillator Enable / Disable.
 
FctERR APDS9960_Set_AEN (APDS9960_t *const pCpnt, const bool en)
 ALS module Enable / Disable.
 
FctERR APDS9960_Set_PEN (APDS9960_t *const pCpnt, const bool en)
 Proximity module Enable / Disable.
 
FctERR APDS9960_Set_AIEN (APDS9960_t *const pCpnt, const bool en)
 ALS interrupt module Enable / Disable.
 
FctERR APDS9960_Set_PIEN (APDS9960_t *const pCpnt, const bool en)
 Proximity interrupt module Enable / Disable.
 
FctERR APDS9960_Set_WEN (APDS9960_t *const pCpnt, const bool en)
 WAIT module Enable / Disable.
 
FctERR APDS9960_Set_GEN (APDS9960_t *const pCpnt, const bool en)
 Gesture module Enable / Disable.
 
FctERR APDS9960_Set_AILT (APDS9960_t *const pCpnt, const uint16_t thr)
 ALS interrupt low threshold configuration.
 
FctERR APDS9960_Set_AIHT (APDS9960_t *const pCpnt, const uint16_t thr)
 ALS interrupt high threshold configuration.
 
FctERR APDS9960_Set_AIT (APDS9960_t *const pCpnt, const uint16_t lthr, const uint16_t hthr)
 ALS interrupt thresholds configuration.
 
FctERR APDS9960_Set_PILT (APDS9960_t *const pCpnt, const uint8_t thr)
 Proximity interrupt low threshold configuration.
 
FctERR APDS9960_Set_PIHT (APDS9960_t *const pCpnt, const uint8_t thr)
 Proximity interrupt high threshold configuration.
 
FctERR APDS9960_Set_PIT (APDS9960_t *const pCpnt, const uint8_t lthr, const uint8_t hthr)
 Proximity interrupt thresholds configuration.
 
FctERR APDS9960_Set_ALS_Pesistence (APDS9960_t *const pCpnt, const APDS9960_als_it_persist persist)
 ALS Persistence configuration.
 
FctERR APDS9960_Set_Prox_Pesistence (APDS9960_t *const pCpnt, const APDS9960_prox_it_persist persist)
 Proximity Persistence configuration.
 
FctERR APDS9960_Set_Prox_Pulse_Length (APDS9960_t *const pCpnt, const APDS9960_pulse_length length)
 Proximity Pulse Length configuration.
 
FctERR APDS9960_Set_Prox_Pulse_Count (APDS9960_t *const pCpnt, const uint8_t cnt)
 Proximity Pulse Count configuration.
 
FctERR APDS9960_Set_ALS_Gain (APDS9960_t *const pCpnt, const APDS9960_als_gain gain)
 ALS Gain configuration.
 
FctERR APDS9960_Set_Prox_Gain (APDS9960_t *const pCpnt, const APDS9960_prox_gain gain)
 Proximity Gain configuration.
 
FctERR APDS9960_Set_Prox_Drive_Strength (APDS9960_t *const pCpnt, const APDS9960_drive_strength ldrive)
 Proximity Drive configuration.
 
FctERR APDS9960_Set_ADC_Integration_Time (APDS9960_t *const pCpnt, const uint16_t integ)
 ADC Integration time configuration.
 
FctERR APDS9960_Set_Wait_Time (APDS9960_t *const pCpnt, const uint16_t wait)
 Wait time configuration.
 
FctERR APDS9960_SF_Force_IT (APDS9960_t *const pCpnt)
 Force interruption.
 
FctERR APDS9960_SF_Clear_PROX_IT (APDS9960_t *const pCpnt)
 Clear pending Proximity interruption.
 
FctERR APDS9960_SF_Clear_ALS_IT (APDS9960_t *const pCpnt)
 Clear pending ALS interruption.
 
FctERR APDS9960_SF_Clear_ALS_PROX_IT (APDS9960_t *const pCpnt)
 Clear pending ALS & Proximity interruptions.
 
FctERR APDS9960_Get_ChipID (APDS9960_t *const pCpnt, uint8_t *const id)
 Get APDS9960 chip ID.
 
FctERR APDS9960_Get_Clear (APDS9960_t *const pCpnt, uint16_t *const clear)
 Get Clear conversion.
 
FctERR APDS9960_Get_Red (APDS9960_t *const pCpnt, uint16_t *const red)
 Get Red conversion.
 
FctERR APDS9960_Get_Green (APDS9960_t *const pCpnt, uint16_t *const green)
 Get Green conversion.
 
FctERR APDS9960_Get_Blue (APDS9960_t *const pCpnt, uint16_t *const blue)
 Get Blue conversion.
 
FctERR APDS9960_Get_Prox (APDS9960_t *const pCpnt, uint8_t *const prox)
 Get Proximity conversion.
 
void APDS9960_INT_GPIO_Init (APDS9960_t *const pCpnt, GPIO_TypeDef *const GPIOx, const uint16_t GPIO_Pin, const GPIO_PinState GPIO_Active)
 Interrupt GPIO pin init for APDS9960.
 
bool APDS9960_INT_GPIO_Get (const APDS9960_t *const pCpnt)
 Interrupt GPIO pin getter for APDS9960.
 

Detailed Description

APDS9960 Driver extensions.

Author
SMFSW

APDS9960: Digital Proximity, Ambient Light, RGB and Gesture Sensor

Enumeration Type Documentation

◆ APDS9960_chan

Type channels of APDS9960.

Enumerator
APDS9960__CHAN_CLEAR 

Clear light channel.

APDS9960__CHAN_RED 

Red light channel.

APDS9960__CHAN_GREEN 

Green light channel.

APDS9960__CHAN_BLUE 

Blue light channel.

APDS9960__CHAN_PROXIMITY 

Proximity channel.

Function Documentation

◆ APDS9960_Get_Blue()

FctERR APDS9960_Get_Blue ( APDS9960_t *const pCpnt,
uint16_t *const blue )
inline

Get Blue conversion.

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

◆ APDS9960_Get_ChipID()

FctERR APDS9960_Get_ChipID ( APDS9960_t *const pCpnt,
uint8_t *const id )
inline

Get APDS9960 chip ID.

Parameters
[in]pCpnt- Pointer to APDS9960 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:

◆ APDS9960_Get_Clear()

FctERR APDS9960_Get_Clear ( APDS9960_t *const pCpnt,
uint16_t *const clear )
inline

Get Clear conversion.

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

◆ APDS9960_Get_Green()

FctERR APDS9960_Get_Green ( APDS9960_t *const pCpnt,
uint16_t *const green )
inline

Get Green conversion.

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

◆ APDS9960_Get_Prox()

FctERR APDS9960_Get_Prox ( APDS9960_t *const pCpnt,
uint8_t *const prox )
inline

Get Proximity conversion.

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

◆ APDS9960_Get_Red()

FctERR APDS9960_Get_Red ( APDS9960_t *const pCpnt,
uint16_t *const red )
inline

Get Red conversion.

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

◆ APDS9960_INT_GPIO_Get()

bool APDS9960_INT_GPIO_Get ( const APDS9960_t *const pCpnt)

Interrupt GPIO pin getter for APDS9960.

Weak Functions
APDS9960 Interrupt GPIO pin getter may be user implemented if needed
Parameters
[in]pCpnt- Pointer to APDS9960 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:

◆ APDS9960_INT_GPIO_Init()

void APDS9960_INT_GPIO_Init ( APDS9960_t *const pCpnt,
GPIO_TypeDef *const GPIOx,
const uint16_t GPIO_Pin,
const GPIO_PinState GPIO_Active )

Interrupt GPIO pin init for APDS9960.

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

◆ APDS9960_Set_ADC_Integration_Time()

FctERR APDS9960_Set_ADC_Integration_Time ( APDS9960_t *const pCpnt,
const uint16_t integ )

ADC Integration time configuration.

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

◆ APDS9960_Set_AEN()

FctERR APDS9960_Set_AEN ( APDS9960_t *const pCpnt,
const bool en )

ALS module Enable / Disable.

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

◆ APDS9960_Set_AIEN()

FctERR APDS9960_Set_AIEN ( APDS9960_t *const pCpnt,
const bool en )

ALS interrupt module Enable / Disable.

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

◆ APDS9960_Set_AIHT()

FctERR APDS9960_Set_AIHT ( APDS9960_t *const pCpnt,
const uint16_t thr )
inline

ALS interrupt high threshold configuration.

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

◆ APDS9960_Set_AILT()

FctERR APDS9960_Set_AILT ( APDS9960_t *const pCpnt,
const uint16_t thr )
inline

ALS interrupt low threshold configuration.

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

◆ APDS9960_Set_AIT()

FctERR APDS9960_Set_AIT ( APDS9960_t *const pCpnt,
const uint16_t lthr,
const uint16_t hthr )
inline

ALS interrupt thresholds configuration.

Parameters
[in]pCpnt- Pointer to APDS9960 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:

◆ APDS9960_Set_ALS_Gain()

FctERR APDS9960_Set_ALS_Gain ( APDS9960_t *const pCpnt,
const APDS9960_als_gain gain )

ALS Gain configuration.

Parameters
[in]pCpnt- Pointer to APDS9960 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:

◆ APDS9960_Set_ALS_Pesistence()

FctERR APDS9960_Set_ALS_Pesistence ( APDS9960_t *const pCpnt,
const APDS9960_als_it_persist persist )

ALS Persistence configuration.

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

◆ APDS9960_Set_GEN()

FctERR APDS9960_Set_GEN ( APDS9960_t *const pCpnt,
const bool en )

Gesture module Enable / Disable.

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

◆ APDS9960_Set_PEN()

FctERR APDS9960_Set_PEN ( APDS9960_t *const pCpnt,
const bool en )

Proximity module Enable / Disable.

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

◆ APDS9960_Set_PIEN()

FctERR APDS9960_Set_PIEN ( APDS9960_t *const pCpnt,
const bool en )

Proximity interrupt module Enable / Disable.

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

◆ APDS9960_Set_PIHT()

FctERR APDS9960_Set_PIHT ( APDS9960_t *const pCpnt,
const uint8_t thr )
inline

Proximity interrupt high threshold configuration.

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

◆ APDS9960_Set_PILT()

FctERR APDS9960_Set_PILT ( APDS9960_t *const pCpnt,
const uint8_t thr )
inline

Proximity interrupt low threshold configuration.

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

◆ APDS9960_Set_PIT()

FctERR APDS9960_Set_PIT ( APDS9960_t *const pCpnt,
const uint8_t lthr,
const uint8_t hthr )
inline

Proximity interrupt thresholds configuration.

Parameters
[in]pCpnt- Pointer to APDS9960 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:

◆ APDS9960_Set_PON()

FctERR APDS9960_Set_PON ( APDS9960_t *const pCpnt,
const bool en )

Oscillator Enable / Disable.

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

◆ APDS9960_Set_Prox_Drive_Strength()

FctERR APDS9960_Set_Prox_Drive_Strength ( APDS9960_t *const pCpnt,
const APDS9960_drive_strength ldrive )

Proximity Drive configuration.

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

◆ APDS9960_Set_Prox_Gain()

FctERR APDS9960_Set_Prox_Gain ( APDS9960_t *const pCpnt,
const APDS9960_prox_gain gain )

Proximity Gain configuration.

Parameters
[in]pCpnt- Pointer to APDS9960 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:

◆ APDS9960_Set_Prox_Pesistence()

FctERR APDS9960_Set_Prox_Pesistence ( APDS9960_t *const pCpnt,
const APDS9960_prox_it_persist persist )

Proximity Persistence configuration.

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

◆ APDS9960_Set_Prox_Pulse_Count()

FctERR APDS9960_Set_Prox_Pulse_Count ( APDS9960_t *const pCpnt,
const uint8_t cnt )

Proximity Pulse Count configuration.

Parameters
[in]pCpnt- Pointer to APDS9960 component
[in]cnt- Proximity pulse count
Returns
FctERR - error code
Here is the call graph for this function:

◆ APDS9960_Set_Prox_Pulse_Length()

FctERR APDS9960_Set_Prox_Pulse_Length ( APDS9960_t *const pCpnt,
const APDS9960_pulse_length length )

Proximity Pulse Length configuration.

Parameters
[in]pCpnt- Pointer to APDS9960 component
[in]length- Proximity pulse length
Returns
FctERR - error code
Here is the call graph for this function:

◆ APDS9960_Set_Wait_Time()

FctERR APDS9960_Set_Wait_Time ( APDS9960_t *const pCpnt,
const uint16_t wait )

Wait time configuration.

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

◆ APDS9960_Set_WEN()

FctERR APDS9960_Set_WEN ( APDS9960_t *const pCpnt,
const bool en )

WAIT module Enable / Disable.

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

◆ APDS9960_SF_Clear_ALS_IT()

FctERR APDS9960_SF_Clear_ALS_IT ( APDS9960_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 APDS9960 component
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ APDS9960_SF_Clear_ALS_PROX_IT()

FctERR APDS9960_SF_Clear_ALS_PROX_IT ( APDS9960_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 APDS9960 component
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ APDS9960_SF_Clear_PROX_IT()

FctERR APDS9960_SF_Clear_PROX_IT ( APDS9960_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 APDS9960 component
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ APDS9960_SF_Force_IT()

FctERR APDS9960_SF_Force_IT ( APDS9960_t *const pCpnt)
inline

Force interruption.

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

◆ APDS9960_Write_Cfg1()

FctERR APDS9960_Write_Cfg1 ( APDS9960_t *const pCpnt,
const uint8_t cfg1 )
inline

Write APDS9960 Config1.

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

◆ APDS9960_Write_Cfg2()

FctERR APDS9960_Write_Cfg2 ( APDS9960_t *const pCpnt,
const uint8_t cfg2 )
inline

Write APDS9960 Config2.

Parameters
[in]pCpnt- Pointer to APDS9960 component
[in]cfg2- Configuration2 register value
Returns
FctERR - error code
Here is the call graph for this function:

◆ APDS9960_Write_Ctrl()

FctERR APDS9960_Write_Ctrl ( APDS9960_t *const pCpnt,
const uint8_t ctrl )
inline

Write APDS9960 Control.

Parameters
[in]pCpnt- Pointer to APDS9960 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:

◆ APDS9960_Write_En()

FctERR APDS9960_Write_En ( APDS9960_t *const pCpnt,
const uint8_t en )
inline

Write APDS9960 Enable register.

Parameters
[in]pCpnt- Pointer to APDS9960 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: