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

TCS3400 Driver extensions. More...

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

Enumerations

enum  TCS3400_chan { TCS3400__CHAN_CLEAR = 0U , TCS3400__CHAN_RED , TCS3400__CHAN_GREEN , TCS3400__CHAN_BLUE }
 Light type channels of TCS3400. More...
 

Functions

FctERR TCS3400_Write_En (TCS3400_t *const pCpnt, const uint8_t en)
 Write TCS3400 Enable register.
 
FctERR TCS3400_Write_Cfg (TCS3400_t *const pCpnt, const uint8_t cfg)
 Write TCS3400 Config register.
 
FctERR TCS3400_Write_Ctl (TCS3400_t *const pCpnt, const uint8_t ctl)
 Write TCS3400 Control register.
 
FctERR TCS3400_Set_PON (TCS3400_t *const pCpnt, const bool en)
 Oscillator Enable / Disable.
 
FctERR TCS3400_Set_AEN (TCS3400_t *const pCpnt, const bool en)
 Clear module Enable / Disable.
 
FctERR TCS3400_Set_AIEN (TCS3400_t *const pCpnt, const bool en)
 Clear interrupt module Enable / Disable.
 
FctERR TCS3400_Set_WEN (TCS3400_t *const pCpnt, const bool en)
 WAIT module Enable / Disable.
 
FctERR TCS3400_Set_SAI (TCS3400_t *const pCpnt, const bool en)
 Sleep After Interrupt Enable / Disable.
 
FctERR TCS3400_Set_Gain (TCS3400_t *const pCpnt, const TCS3400_gain gain)
 Gain configuration.
 
FctERR TCS3400_Set_Pesistence (TCS3400_t *const pCpnt, const TCS3400_it_persist persist)
 ALS Persistence configuration.
 
FctERR TCS3400_Set_Integration_Time (TCS3400_t *const pCpnt, const uint16_t integ)
 Integration time configuration.
 
FctERR TCS3400_Set_Wait_Time (TCS3400_t *const pCpnt, const uint16_t wait)
 Wait time configuration.
 
FctERR TCS3400_Set_AILT (TCS3400_t *const pCpnt, const uint16_t thr)
 ALS interrupt low threshold configuration.
 
FctERR TCS3400_Set_AIHT (TCS3400_t *const pCpnt, const uint16_t thr)
 ALS interrupt high threshold configuration.
 
FctERR TCS3400_Set_AIT (TCS3400_t *const pCpnt, const uint16_t lthr, const uint16_t hthr)
 ALS interrupt thresholds configuration.
 
FctERR TCS3400_Force_IT (TCS3400_t *const pCpnt)
 Force interruption.
 
FctERR TCS3400_Clear_IR_IT (TCS3400_t *const pCpnt)
 Clear pending IR interruption.
 
FctERR TCS3400_Clear_All_IT (TCS3400_t *const pCpnt)
 Clear All pending interruptions.
 
FctERR TCS3400_Get_RevID (TCS3400_t *const pCpnt, uint8_t *const id)
 Get TCS3400 Revision ID.
 
FctERR TCS3400_Get_DeviceID (TCS3400_t *const pCpnt, uint8_t *const id)
 Get TCS3400 Device ID.
 
FctERR TCS3400_Get_Channels (TCS3400_t *const pCpnt, uint16_t buf[])
 Get All channels conversions.
 
FctERR TCS3400_Get_Channel (TCS3400_t *const pCpnt, uint16_t *const val, const TCS3400_chan chan)
 Get Specific channel conversion.
 
FctERR TCS3400_Get_Clear (TCS3400_t *const pCpnt, uint16_t *const clr)
 Get Clear channel conversion.
 
FctERR TCS3400_Get_Red (TCS3400_t *const pCpnt, uint16_t *const r)
 Get Red channel conversion.
 
FctERR TCS3400_Get_Green (TCS3400_t *const pCpnt, uint16_t *const g)
 Get Green channel conversion.
 
FctERR TCS3400_Get_Blue (TCS3400_t *const pCpnt, uint16_t *const b)
 Get Blue channel conversion.
 
void TCS3400_INT_GPIO_Init (TCS3400_t *const pCpnt, GPIO_TypeDef *const GPIOx, const uint16_t GPIO_Pin, const GPIO_PinState GPIO_Active)
 Interrupt GPIO pin init for TCS3400.
 
bool TCS3400_INT_GPIO_Get (const TCS3400_t *const pCpnt)
 Interrupt GPIO pin getter for TCS3400.
 

Detailed Description

TCS3400 Driver extensions.

Author
SMFSW

TCS3400: Color Light-to-Digital Converter

Enumeration Type Documentation

◆ TCS3400_chan

Light type channels of TCS3400.

Enumerator
TCS3400__CHAN_CLEAR 

Clear light channel.

TCS3400__CHAN_RED 

Red light channel.

TCS3400__CHAN_GREEN 

Green light channel.

TCS3400__CHAN_BLUE 

Blue light channel.

Function Documentation

◆ TCS3400_Clear_All_IT()

FctERR TCS3400_Clear_All_IT ( TCS3400_t *const pCpnt)
inline

Clear All pending interruptions.

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

◆ TCS3400_Clear_IR_IT()

FctERR TCS3400_Clear_IR_IT ( TCS3400_t *const pCpnt)
inline

Clear pending IR interruption.

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

◆ TCS3400_Force_IT()

FctERR TCS3400_Force_IT ( TCS3400_t *const pCpnt)
inline

Force interruption.

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

◆ TCS3400_Get_Blue()

FctERR TCS3400_Get_Blue ( TCS3400_t *const pCpnt,
uint16_t *const b )
inline

Get Blue channel conversion.

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

◆ TCS3400_Get_Channel()

FctERR TCS3400_Get_Channel ( TCS3400_t *const pCpnt,
uint16_t *const val,
const TCS3400_chan chan )

Get Specific channel conversion.

Parameters
[in]pCpnt- Pointer to TCS3400 component
[in,out]val- pointer to conversions result
[in]chan- Channel to get
Returns
FctERR - error code
Here is the call graph for this function:

◆ TCS3400_Get_Channels()

FctERR TCS3400_Get_Channels ( TCS3400_t *const pCpnt,
uint16_t buf[] )

Get All channels conversions.

Parameters
[in]pCpnt- Pointer to TCS3400 component
[in,out]buf- pointer to conversions tab result
Returns
FctERR - error code
Here is the call graph for this function:

◆ TCS3400_Get_Clear()

FctERR TCS3400_Get_Clear ( TCS3400_t *const pCpnt,
uint16_t *const clr )
inline

Get Clear channel conversion.

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

◆ TCS3400_Get_DeviceID()

FctERR TCS3400_Get_DeviceID ( TCS3400_t *const pCpnt,
uint8_t *const id )
inline

Get TCS3400 Device ID.

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

◆ TCS3400_Get_Green()

FctERR TCS3400_Get_Green ( TCS3400_t *const pCpnt,
uint16_t *const g )
inline

Get Green channel conversion.

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

◆ TCS3400_Get_Red()

FctERR TCS3400_Get_Red ( TCS3400_t *const pCpnt,
uint16_t *const r )
inline

Get Red channel conversion.

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

◆ TCS3400_Get_RevID()

FctERR TCS3400_Get_RevID ( TCS3400_t *const pCpnt,
uint8_t *const id )
inline

Get TCS3400 Revision ID.

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

◆ TCS3400_INT_GPIO_Get()

bool TCS3400_INT_GPIO_Get ( const TCS3400_t *const pCpnt)

Interrupt GPIO pin getter for TCS3400.

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

◆ TCS3400_INT_GPIO_Init()

void TCS3400_INT_GPIO_Init ( TCS3400_t *const pCpnt,
GPIO_TypeDef *const GPIOx,
const uint16_t GPIO_Pin,
const GPIO_PinState GPIO_Active )

Interrupt GPIO pin init for TCS3400.

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

◆ TCS3400_Set_AEN()

FctERR TCS3400_Set_AEN ( TCS3400_t *const pCpnt,
const bool en )

Clear module Enable / Disable.

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

◆ TCS3400_Set_AIEN()

FctERR TCS3400_Set_AIEN ( TCS3400_t *const pCpnt,
const bool en )

Clear interrupt module Enable / Disable.

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

◆ TCS3400_Set_AIHT()

FctERR TCS3400_Set_AIHT ( TCS3400_t *const pCpnt,
const uint16_t thr )
inline

ALS interrupt high threshold configuration.

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

◆ TCS3400_Set_AILT()

FctERR TCS3400_Set_AILT ( TCS3400_t *const pCpnt,
const uint16_t thr )
inline

ALS interrupt low threshold configuration.

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

◆ TCS3400_Set_AIT()

FctERR TCS3400_Set_AIT ( TCS3400_t *const pCpnt,
const uint16_t lthr,
const uint16_t hthr )
inline

ALS interrupt thresholds configuration.

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

◆ TCS3400_Set_Gain()

FctERR TCS3400_Set_Gain ( TCS3400_t *const pCpnt,
const TCS3400_gain gain )

Gain configuration.

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

◆ TCS3400_Set_Integration_Time()

FctERR TCS3400_Set_Integration_Time ( TCS3400_t *const pCpnt,
const uint16_t integ )

Integration time configuration.

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

◆ TCS3400_Set_Pesistence()

FctERR TCS3400_Set_Pesistence ( TCS3400_t *const pCpnt,
const TCS3400_it_persist persist )
inline

ALS Persistence configuration.

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

◆ TCS3400_Set_PON()

FctERR TCS3400_Set_PON ( TCS3400_t *const pCpnt,
const bool en )

Oscillator Enable / Disable.

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

◆ TCS3400_Set_SAI()

FctERR TCS3400_Set_SAI ( TCS3400_t *const pCpnt,
const bool en )

Sleep After Interrupt Enable / Disable.

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

◆ TCS3400_Set_Wait_Time()

FctERR TCS3400_Set_Wait_Time ( TCS3400_t *const pCpnt,
const uint16_t wait )

Wait time configuration.

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

◆ TCS3400_Set_WEN()

FctERR TCS3400_Set_WEN ( TCS3400_t *const pCpnt,
const bool en )

WAIT module Enable / Disable.

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

◆ TCS3400_Write_Cfg()

FctERR TCS3400_Write_Cfg ( TCS3400_t *const pCpnt,
const uint8_t cfg )
inline

Write TCS3400 Config register.

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

◆ TCS3400_Write_Ctl()

FctERR TCS3400_Write_Ctl ( TCS3400_t *const pCpnt,
const uint8_t ctl )
inline

Write TCS3400 Control register.

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

◆ TCS3400_Write_En()

FctERR TCS3400_Write_En ( TCS3400_t *const pCpnt,
const uint8_t en )
inline

Write TCS3400 Enable register.

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