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

PCA9532 Driver. More...

#include "sarmfsw.h"
#include "I2C_component.h"
#include "I2C_peripheral.h"
#include "PCA9xxx.h"
#include "PCA9532_proc.h"
#include "PCA9532_ex.h"
Include dependency graph for PCA9532.h:
This graph shows which files directly or indirectly include this file:

Data Structures

union  uPCA9532_REG__INPUT0
 Union for INPUT0 register of PCA9532. More...
 
union  uPCA9532_REG__INPUT1
 Union for INPUT1 register of PCA9532. More...
 
union  uPCA9532_REG__INPUT
 Union for INPUT registers of PCA9532. More...
 
union  uPCA9532_REG__LS0
 Union for LS0 register of PCA9532. More...
 
union  uPCA9532_REG__LS1
 Union for LS1 register of PCA9532. More...
 
union  uPCA9532_REG__LS2
 Union for LS2 register of PCA9532. More...
 
union  uPCA9532_REG__LS3
 Union for LS3 register of PCA9532. More...
 
union  uPCA9532_REG__LS
 Union for LS registers of PCA9532. More...
 

Macros

#define I2C_PCA9532_NB   1U
 Number of PCA9532 peripherals.
 
#define PCA9532_BASE_ADDR   0x60U
 PCA9532 Base Address.
 

Enumerations

enum  PCA9532_reg {
  PCA9532__INPUT0 = 0U , PCA9532__INPUT1 , PCA9532__PSC0 , PCA9532__PWM0 ,
  PCA9532__PSC1 , PCA9532__PWM1 , PCA9532__LS0 , PCA9532__LS1 ,
  PCA9532__LS2 , PCA9532__LS3
}
 Register map enum of PCA9532. More...
 

Functions

FctERR PCA9532_Init (const uint8_t idx, I2C_HandleTypeDef *const hi2c, const uint16_t devAddress)
 Initialization for PCA9532 peripheral.
 
FctERR PCA9532_Init_Single (void)
 Initialization for PCA9532 peripheral.
 
FctERR PCA9532_Write (I2C_slave_t *const pSlave, const uint8_t *data, const uint16_t addr, const uint16_t nb)
 I2C Write function for PCA9532.
 
FctERR PCA9532_Read (I2C_slave_t *const pSlave, uint8_t *data, const uint16_t addr, const uint16_t nb)
 I2C Read function for PCA9532.
 

Detailed Description

PCA9532 Driver.

Author
SMFSW

PCA9532: 16-bit I2C-bus LED dimmer

Macro Definition Documentation

◆ I2C_PCA9532_NB

#define I2C_PCA9532_NB   1U

Number of PCA9532 peripherals.

Note
Define I2C_PCA9532_NB to enable multiple peripherals of this type

◆ PCA9532_BASE_ADDR

#define PCA9532_BASE_ADDR   0x60U

PCA9532 Base Address.

Note
Define PCA9532_BASE_ADDR to change default device base address

Enumeration Type Documentation

◆ PCA9532_reg

Register map enum of PCA9532.

Enumerator
PCA9532__INPUT0 

register INPUT0

PCA9532__INPUT1 

register INPUT1

PCA9532__PSC0 

register Frequency Prescaler 0

PCA9532__PWM0 

register PWM0

PCA9532__PSC1 

register Frequency Prescaler 1

PCA9532__PWM1 

register PWM1

PCA9532__LS0 

register LED0 to LED3 selector

PCA9532__LS1 

register LED4 to LED7 selector

PCA9532__LS2 

register LED8 to LED11 selector

PCA9532__LS3 

register LED12 to LED15 selector

Function Documentation

◆ PCA9532_Init()

FctERR PCA9532_Init ( const uint8_t idx,
I2C_HandleTypeDef *const hi2c,
const uint16_t devAddress )

Initialization for PCA9532 peripheral.

Parameters
[in]idx- PCA9532 index
[in]hi2c- pointer to PCA9532 I2C instance
[in]devAddress- PCA9532 device address
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PCA9532_Init_Single()

FctERR PCA9532_Init_Single ( void )

Initialization for PCA9532 peripheral.

Warning
In case multiple devices (defined by I2C_PCA9532_NB > 1), you shall use PCA9532_Init instead
Returns
FctERR - error code
Here is the call graph for this function:

◆ PCA9532_Read()

FctERR PCA9532_Read ( I2C_slave_t *const pSlave,
uint8_t * data,
const uint16_t addr,
const uint16_t nb )

I2C Read function for PCA9532.

Warning
When Auto-Increment flag is set (AI = 1) and a read sequence is initiated, the sequence must start by reading a register different from the INPUT0 register.
Parameters
[in,out]pSlave- Pointer to I2C slave instance
[in,out]data- pointer to read to
[in]addr- Address to read from
[in]nb- Number of bytes to read
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PCA9532_Write()

FctERR PCA9532_Write ( I2C_slave_t *const pSlave,
const uint8_t * data,
const uint16_t addr,
const uint16_t nb )

I2C Write function for PCA9532.

Parameters
[in,out]pSlave- Pointer to I2C slave instance
[in]data- pointer to write from
[in]addr- Address to write to
[in]nb- Number of bytes to write
Returns
FctERR - error code
Here is the call graph for this function:
Here is the caller graph for this function: