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

PCA9956 Driver extensions. More...

#include "PCA9956.h"
#include <stdlib.h>
#include <math.h>
Include dependency graph for PCA9956_ex.c:

Functions

FctERR PCA9956_Set_Auto_Increment (PCA9956_t *const pCpnt, const PCA962x_reg_inc inc)
 Set auto increment option for PCA9956 registers.
 
FctERR PCA9956_Set_Latch (PCA9956_t *const pCpnt, const PCA96xx_latch latch)
 Set latch type for PCA9956 peripheral.
 
FctERR PCA9956_Set_Mode_LED (PCA9956_t *const pCpnt, const PCA9xxx_chan chan, const PCA995x_ledout mode)
 Set PCA9956 peripheral LED mode.
 
FctERR PCA9956_Set_Mode_LEDs (PCA9956_t *const pCpnt, const uint32_t chans, const PCA995x_ledout mode)
 Set PCA9956 peripheral multiple LEDs mode.
 
FctERR PCA9956_Set_IREF (PCA9956_t *const pCpnt, const PCA9xxx_chan chan, const uint8_t iref)
 Set PCA9956 output gain control value.
 
FctERR PCA9956_Set_IREFs (PCA9956_t *const pCpnt, const uint32_t chans, const uint8_t iref)
 Set PCA9956 output gain control value.
 
FctERR PCA9956_Set_Offset (PCA9956_t *const pCpnt, const PCA9956_offset offset)
 Set PCA9956 peripheral delay between channels.
 
FctERR PCA9956_ReadVals (PCA9956_t *const pCpnt, uint8_t pDuty[], const bool indexed, const PCA9xxx_chan start, const PCA9xxx_chan end)
 Read PWM duty cycle array of values of a PCA9956.
 
FctERR PCA9956_ReadVal (PCA9956_t *const pCpnt, const PCA9xxx_chan chan, uint8_t *const pDuty)
 Read PWM duty cycle value of a PCA9956 channel.
 
FctERR PCA9956_PutVals (PCA9956_t *const pCpnt, const uint8_t pDuty[], const bool indexed, const PCA9xxx_chan start, const PCA9xxx_chan end)
 Send PWM duty cycle array of values to apply on a PCA9956.
 
FctERR PCA9956_PutVal (PCA9956_t *const pCpnt, const PCA9xxx_chan chan, const uint8_t duty)
 Send PWM duty cycle value to apply on a PCA9956 channel.
 
FctERR PCA9956_SetVal (PCA9956_t *const pCpnt, const PCA9xxx_chan chan)
 Send PWM Full ON value to apply on a PCA9956 channel.
 
FctERR PCA9956_ClrVal (PCA9956_t *const pCpnt, const PCA9xxx_chan chan)
 Send PWM Full OFF value to apply on a PCA9956 channel.
 
FctERR PCA9956_ReadEFLAGs (PCA9956_t *const pCpnt, uPCA9956_REG__EFLAG *const eflags)
 Read LEDs error flags.
 
FctERR PCA9956_ReadRegister (PCA9956_t *const pCpnt, const PCA9956_reg reg, uint8_t *val)
 Read register from PCA9956.
 
void PCA9956_RST_GPIO_Init (PCA9956_t *const pCpnt, GPIO_TypeDef *const GPIOx, const uint16_t GPIO_Pin, const GPIO_PinState GPIO_Active)
 Reset GPIO pin init for PCA9956.
 
void PCA9956_RST_GPIO_Set (PCA9956_t *const pCpnt, const bool state)
 Reset GPIO pin setter for PCA9956.
 
void PCA9956_OE_GPIO_Init (PCA9956_t *const pCpnt, GPIO_TypeDef *const GPIOx, const uint16_t GPIO_Pin, const GPIO_PinState GPIO_Active)
 Output Enable GPIO pin init for PCA9956.
 
void PCA9956_OE_GPIO_Set (PCA9956_t *const pCpnt, const bool state)
 Output Enable GPIO pin setter for PCA9956.
 

Detailed Description

PCA9956 Driver extensions.

Author
SMFSW

PCA9956: 24-channel Fm+ I2C-bus 57 mA/20 V constant current LED driver

Function Documentation

◆ PCA9956_ClrVal()

FctERR PCA9956_ClrVal ( PCA9956_t *const pCpnt,
const PCA9xxx_chan chan )

Send PWM Full OFF value to apply on a PCA9956 channel.

Parameters
[in]pCpnt- Pointer to PCA9956 component
[in]chan- channel number
Returns
FctERR - ErrorCode
Here is the call graph for this function:

◆ PCA9956_OE_GPIO_Init()

void PCA9956_OE_GPIO_Init ( PCA9956_t *const pCpnt,
GPIO_TypeDef *const GPIOx,
const uint16_t GPIO_Pin,
const GPIO_PinState GPIO_Active )

Output Enable GPIO pin init for PCA9956.

Weak Functions
PCA9956 Output Enable GPIO pin init may be user implemented if needed
Parameters
[in]pCpnt- Pointer to PCA9956 component
[in]GPIOx- OE port
[in]GPIO_Pin- OE pin
[in]GPIO_ActiveOE pin active state
Here is the call graph for this function:

◆ PCA9956_OE_GPIO_Set()

void PCA9956_OE_GPIO_Set ( PCA9956_t *const pCpnt,
const bool state )

Output Enable GPIO pin setter for PCA9956.

Weak Functions
PCA9956 Output Enable GPIO pin setter may be user implemented if needed
Parameters
[in]pCpnt- Pointer to PCA9956 component
[in]state- state to write on OE pin (0: inactive, 1: active)
Here is the call graph for this function:

◆ PCA9956_PutVal()

FctERR PCA9956_PutVal ( PCA9956_t *const pCpnt,
const PCA9xxx_chan chan,
const uint8_t duty )

Send PWM duty cycle value to apply on a PCA9956 channel.

Parameters
[in]pCpnt- Pointer to PCA9956 component
[in]chan- channel number
[in]duty- Duty cycle coded on a uint8_t
Returns
FctERR - ErrorCode
Here is the call graph for this function:

◆ PCA9956_PutVals()

FctERR PCA9956_PutVals ( PCA9956_t *const pCpnt,
const uint8_t pDuty[],
const bool indexed,
const PCA9xxx_chan start,
const PCA9xxx_chan end )

Send PWM duty cycle array of values to apply on a PCA9956.

Parameters
[in]pCpnt- Pointer to PCA9956 component
[in]pDuty- Pointer to duty cycle values
[in]indexed- if set to true, pDuty start address will be indexed by the value of start parameter (thus pDuty always needs first channels cells even if not sent)
[in]start- starting channel number
[in]end- ending channel number
Returns
FctERR - ErrorCode
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PCA9956_ReadEFLAGs()

FctERR PCA9956_ReadEFLAGs ( PCA9956_t *const pCpnt,
uPCA9956_REG__EFLAG *const eflags )

Read LEDs error flags.

Parameters
[in]pCpnt- Pointer to PCA9956 component
[in,out]eflags- Pointer to the error flags data for receive
Returns
FctERR - ErrorCode
Here is the call graph for this function:

◆ PCA9956_ReadRegister()

FctERR PCA9956_ReadRegister ( PCA9956_t *const pCpnt,
const PCA9956_reg reg,
uint8_t * val )

Read register from PCA9956.

Parameters
[in]pCpnt- Pointer to PCA9956 component
[in]reg- Register address to read from
[in,out]val- Pointer to the data for receive
Returns
FctERR - ErrorCode
Here is the call graph for this function:

◆ PCA9956_ReadVal()

FctERR PCA9956_ReadVal ( PCA9956_t *const pCpnt,
const PCA9xxx_chan chan,
uint8_t *const pDuty )

Read PWM duty cycle value of a PCA9956 channel.

Parameters
[in]pCpnt- Pointer to PCA9956 component
[in]chan- channel number
[in,out]pDuty- Pointer to duty cycle data
Returns
FctERR - ErrorCode
Here is the call graph for this function:

◆ PCA9956_ReadVals()

FctERR PCA9956_ReadVals ( PCA9956_t *const pCpnt,
uint8_t pDuty[],
const bool indexed,
const PCA9xxx_chan start,
const PCA9xxx_chan end )

Read PWM duty cycle array of values of a PCA9956.

Parameters
[in]pCpnt- Pointer to PCA9956 component
[in,out]pDuty- Pointer to duty cycle values
[in]indexed- if set to true, pDuty start address will be indexed by the value of start parameter (thus pDuty always needs first channels cells even if not sent)
[in]start- starting channel number
[in]end- ending channel number
Returns
FctERR - ErrorCode
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PCA9956_RST_GPIO_Init()

void PCA9956_RST_GPIO_Init ( PCA9956_t *const pCpnt,
GPIO_TypeDef *const GPIOx,
const uint16_t GPIO_Pin,
const GPIO_PinState GPIO_Active )

Reset GPIO pin init for PCA9956.

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

◆ PCA9956_RST_GPIO_Set()

void PCA9956_RST_GPIO_Set ( PCA9956_t *const pCpnt,
const bool state )

Reset GPIO pin setter for PCA9956.

Weak Functions
PCA9956 Reset GPIO pin setter may be user implemented if needed
Parameters
[in]pCpnt- Pointer to PCA9956 component
[in]state- state to write on RST pin (0: inactive, 1: active)
Here is the call graph for this function:

◆ PCA9956_Set_Auto_Increment()

FctERR PCA9956_Set_Auto_Increment ( PCA9956_t *const pCpnt,
const PCA962x_reg_inc inc )

Set auto increment option for PCA9956 registers.

Parameters
[in,out]pCpnt- Pointer to PCA9956 component
[in]inc- auto increment option
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PCA9956_Set_IREF()

FctERR PCA9956_Set_IREF ( PCA9956_t *const pCpnt,
const PCA9xxx_chan chan,
const uint8_t iref )

Set PCA9956 output gain control value.

Parameters
[in,out]pCpnt- Pointer to PCA9956 component
[in]chan- PCA9956 channel
[in]iref- output gain control value
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PCA9956_Set_IREFs()

FctERR PCA9956_Set_IREFs ( PCA9956_t *const pCpnt,
const uint32_t chans,
const uint8_t iref )

Set PCA9956 output gain control value.

Parameters
[in,out]pCpnt- Pointer to PCA9956 component
[in]chans- PCA9956 channels mask (masked channels will be affected to new mode, other ones remaining unchanged)
[in]iref- output gain control value
Returns
FctERR - error code
Here is the call graph for this function:

◆ PCA9956_Set_Latch()

FctERR PCA9956_Set_Latch ( PCA9956_t *const pCpnt,
const PCA96xx_latch latch )

Set latch type for PCA9956 peripheral.

Parameters
[in,out]pCpnt- Pointer to PCA9956 component
[in]latch- Latch type
Returns
FctERR - error code
Here is the call graph for this function:

◆ PCA9956_Set_Mode_LED()

FctERR PCA9956_Set_Mode_LED ( PCA9956_t *const pCpnt,
const PCA9xxx_chan chan,
const PCA995x_ledout mode )

Set PCA9956 peripheral LED mode.

Parameters
[in,out]pCpnt- Pointer to PCA9956 component
[in]chan- PCA9956 channel
[in]mode- channel mode (on/off/dimming/blinking)
Returns
FctERR - error code
Here is the call graph for this function:

◆ PCA9956_Set_Mode_LEDs()

FctERR PCA9956_Set_Mode_LEDs ( PCA9956_t *const pCpnt,
const uint32_t chans,
const PCA995x_ledout mode )

Set PCA9956 peripheral multiple LEDs mode.

Parameters
[in,out]pCpnt- Pointer to PCA9956 component
[in]chans- PCA9956 channels mask (masked channels will be affected to new mode, other ones remaining unchanged)
[in]mode- channel mode (on/off/dimming/blinking)
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PCA9956_Set_Offset()

FctERR PCA9956_Set_Offset ( PCA9956_t *const pCpnt,
const PCA9956_offset offset )

Set PCA9956 peripheral delay between channels.

Parameters
[in,out]pCpnt- Pointer to PCA9956 component
[in]offset- delay between channels
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PCA9956_SetVal()

FctERR PCA9956_SetVal ( PCA9956_t *const pCpnt,
const PCA9xxx_chan chan )

Send PWM Full ON value to apply on a PCA9956 channel.

Parameters
[in]pCpnt- Pointer to PCA9956 component
[in]chan- channel number
Returns
FctERR - ErrorCode
Here is the call graph for this function: