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

TSL2591 Driver extensions. More...

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

Data Structures

union  uTSL2591_REG_MAP
 Union of TSL2591 registry map. More...
 

Enumerations

enum  TSL2591_light { TSL2591__LIGHT_FULL = 0U , TSL2591__LIGHT_IR , TSL2591__LIGHT_VISIBLE }
 Light types of TSL2591. More...
 

Functions

FctERR TSL2591_Write_En (TSL2591_t *const pCpnt, const uint8_t en)
 Write TSL2591 Enable register.
 
FctERR TSL2591_Write_Cfg (TSL2591_t *const pCpnt, const uint8_t cfg)
 Write TSL2591 Config.
 
FctERR TSL2591_Set_PON (TSL2591_t *const pCpnt, const bool en)
 Oscillator Enable / Disable.
 
FctERR TSL2591_Set_AEN (TSL2591_t *const pCpnt, const bool en)
 ALS module Enable / Disable.
 
FctERR TSL2591_Set_AIEN (TSL2591_t *const pCpnt, const bool en)
 ALS interrupt module Enable / Disable.
 
FctERR TSL2591_Set_Gain (TSL2591_t *const pCpnt, const TSL2591_gain gain)
 Gain configuration.
 
FctERR TSL2591_Set_Integration_Time (TSL2591_t *const pCpnt, const TSL2591_integ integ)
 Integration time configuration.
 
FctERR TSL2591_Set_ALS_Pesistence (TSL2591_t *const pCpnt, const TSL2591_it_persist persist)
 ALS Persistence configuration.
 
FctERR TSL2591_Set_AILT (TSL2591_t *const pCpnt, const uint16_t thr)
 ALS interrupt low threshold configuration.
 
FctERR TSL2591_Set_AIHT (TSL2591_t *const pCpnt, const uint16_t thr)
 ALS interrupt high threshold configuration.
 
FctERR TSL2591_Set_AIT (TSL2591_t *const pCpnt, const uint16_t lthr, const uint16_t hthr)
 ALS interrupt thresholds configuration.
 
FctERR TSL2591_Set_NPAILT (TSL2591_t *const pCpnt, const uint16_t thr)
 ALS interrupt Persist Low threshold filter configuration.
 
FctERR TSL2591_Set_NPAIHT (TSL2591_t *const pCpnt, const uint16_t thr)
 ALS interrupt Persist High threshold filter configuration.
 
FctERR TSL2591_Set_NPAIT (TSL2591_t *const pCpnt, const uint16_t lthr, const uint16_t hthr)
 ALS interrupt Persist threshold filters configuration.
 
FctERR TSL2591_SF_Force_IT (TSL2591_t *const pCpnt)
 Force ALS interruption.
 
FctERR TSL2591_SF_Clear_IT (TSL2591_t *const pCpnt)
 Clear pending ALS interruption.
 
FctERR TSL2591_SF_Clear_IT_PERS (TSL2591_t *const pCpnt)
 Clear pending ALS & Persistence interruptions.
 
FctERR TSL2591_SF_Clear_PERS (TSL2591_t *const pCpnt)
 Clear pending Persistence interruption.
 
FctERR TSL2591_Get_ChipID (TSL2591_t *const pCpnt, uint8_t *const id)
 Get TSL2591 chip ID.
 
FctERR TSL2591_Reset (TSL2591_t *const pCpnt)
 Reset TSL2591 chip.
 
FctERR TSL2591_Get_Full (TSL2591_t *const pCpnt, uint16_t *const full)
 Get Full conversion (Channel 0)
 
FctERR TSL2591_Get_IR (TSL2591_t *const pCpnt, uint16_t *const ir)
 Get IR conversion (Channel 1)
 
void TSL2591_INT_GPIO_Init (TSL2591_t *const pCpnt, GPIO_TypeDef *const GPIOx, const uint16_t GPIO_Pin, const GPIO_PinState GPIO_Active)
 Interrupt GPIO pin init for TSL2591.
 
bool TSL2591_INT_GPIO_Get (const TSL2591_t *const pCpnt)
 Interrupt GPIO pin getter for TSL2591.
 

Detailed Description

TSL2591 Driver extensions.

Author
SMFSW

TSL2591: Very-high sensitivity light-to-digital converter

Enumeration Type Documentation

◆ TSL2591_light

Light types of TSL2591.

Enumerator
TSL2591__LIGHT_FULL 

Full light spectrum (channel 0)

TSL2591__LIGHT_IR 

Infra Red light (channel 1)

TSL2591__LIGHT_VISIBLE 

Visible light (channel 0 - channel 1)

Function Documentation

◆ TSL2591_Get_ChipID()

FctERR TSL2591_Get_ChipID ( TSL2591_t *const pCpnt,
uint8_t *const id )
inline

Get TSL2591 chip ID.

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

◆ TSL2591_Get_Full()

FctERR TSL2591_Get_Full ( TSL2591_t *const pCpnt,
uint16_t *const full )
inline

Get Full conversion (Channel 0)

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

◆ TSL2591_Get_IR()

FctERR TSL2591_Get_IR ( TSL2591_t *const pCpnt,
uint16_t *const ir )
inline

Get IR conversion (Channel 1)

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

◆ TSL2591_INT_GPIO_Get()

bool TSL2591_INT_GPIO_Get ( const TSL2591_t *const pCpnt)

Interrupt GPIO pin getter for TSL2591.

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

◆ TSL2591_INT_GPIO_Init()

void TSL2591_INT_GPIO_Init ( TSL2591_t *const pCpnt,
GPIO_TypeDef *const GPIOx,
const uint16_t GPIO_Pin,
const GPIO_PinState GPIO_Active )

Interrupt GPIO pin init for TSL2591.

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

◆ TSL2591_Reset()

FctERR TSL2591_Reset ( TSL2591_t *const pCpnt)
inline

Reset TSL2591 chip.

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

◆ TSL2591_Set_AEN()

FctERR TSL2591_Set_AEN ( TSL2591_t *const pCpnt,
const bool en )

ALS module Enable / Disable.

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

◆ TSL2591_Set_AIEN()

FctERR TSL2591_Set_AIEN ( TSL2591_t *const pCpnt,
const bool en )

ALS interrupt module Enable / Disable.

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

◆ TSL2591_Set_AIHT()

FctERR TSL2591_Set_AIHT ( TSL2591_t *const pCpnt,
const uint16_t thr )
inline

ALS interrupt high threshold configuration.

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

◆ TSL2591_Set_AILT()

FctERR TSL2591_Set_AILT ( TSL2591_t *const pCpnt,
const uint16_t thr )
inline

ALS interrupt low threshold configuration.

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

◆ TSL2591_Set_AIT()

FctERR TSL2591_Set_AIT ( TSL2591_t *const pCpnt,
const uint16_t lthr,
const uint16_t hthr )
inline

ALS interrupt thresholds configuration.

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

◆ TSL2591_Set_ALS_Pesistence()

FctERR TSL2591_Set_ALS_Pesistence ( TSL2591_t *const pCpnt,
const TSL2591_it_persist persist )
inline

ALS Persistence configuration.

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

◆ TSL2591_Set_Gain()

FctERR TSL2591_Set_Gain ( TSL2591_t *const pCpnt,
const TSL2591_gain gain )

Gain configuration.

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

◆ TSL2591_Set_Integration_Time()

FctERR TSL2591_Set_Integration_Time ( TSL2591_t *const pCpnt,
const TSL2591_integ integ )

Integration time configuration.

Parameters
[in]pCpnt- Pointer to TSL2591 component
[in]integ- Integration time value
Returns
FctERR - error code
Here is the call graph for this function:

◆ TSL2591_Set_NPAIHT()

FctERR TSL2591_Set_NPAIHT ( TSL2591_t *const pCpnt,
const uint16_t thr )
inline

ALS interrupt Persist High threshold filter configuration.

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

◆ TSL2591_Set_NPAILT()

FctERR TSL2591_Set_NPAILT ( TSL2591_t *const pCpnt,
const uint16_t thr )
inline

ALS interrupt Persist Low threshold filter configuration.

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

◆ TSL2591_Set_NPAIT()

FctERR TSL2591_Set_NPAIT ( TSL2591_t *const pCpnt,
const uint16_t lthr,
const uint16_t hthr )
inline

ALS interrupt Persist threshold filters configuration.

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

◆ TSL2591_Set_PON()

FctERR TSL2591_Set_PON ( TSL2591_t *const pCpnt,
const bool en )

Oscillator Enable / Disable.

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

◆ TSL2591_SF_Clear_IT()

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

◆ TSL2591_SF_Clear_IT_PERS()

FctERR TSL2591_SF_Clear_IT_PERS ( TSL2591_t *const pCpnt)
inline

Clear pending ALS & Persistence interruptions.

Warning
if event pin enabled, shall be called after read to reset pin
Parameters
[in]pCpnt- Pointer to TSL2591 component
Returns
FctERR - error code
Here is the call graph for this function:

◆ TSL2591_SF_Clear_PERS()

FctERR TSL2591_SF_Clear_PERS ( TSL2591_t *const pCpnt)
inline

Clear pending Persistence interruption.

Warning
if event pin enabled, shall be called after read to reset pin
Parameters
[in]pCpnt- Pointer to TSL2591 component
Returns
FctERR - error code
Here is the call graph for this function:

◆ TSL2591_SF_Force_IT()

FctERR TSL2591_SF_Force_IT ( TSL2591_t *const pCpnt)
inline

Force ALS interruption.

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

◆ TSL2591_Write_Cfg()

FctERR TSL2591_Write_Cfg ( TSL2591_t *const pCpnt,
const uint8_t cfg )
inline

Write TSL2591 Config.

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

◆ TSL2591_Write_En()

FctERR TSL2591_Write_En ( TSL2591_t *const pCpnt,
const uint8_t en )
inline

Write TSL2591 Enable register.

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