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

PCF8523 Driver. More...

#include "sarmfsw.h"
#include "I2C_component.h"
#include "I2C_peripheral.h"
#include "PCF8523_ex.h"
#include "PCF8523_proc.h"
Include dependency graph for PCF8523.h:
This graph shows which files directly or indirectly include this file:

Data Structures

union  uPCF8523_REG__CTRL1
 Union for Control_1 register for PCF8523 peripheral. More...
 
union  uPCF8523_REG__CTRL2
 Union for Control_2 register for PCF8523 peripheral. More...
 
union  uPCF8523_REG__CTRL3
 Union for Control_3 register for PCF8523 peripheral. More...
 
union  uPCF8523_REG__SECONDS
 Union for Seconds register for PCF8523 peripheral. More...
 
union  uPCF8523_REG__MINUTES
 Union for Minutes and Minute Alarm when in AM/PM mode register for PCF8523 peripheral. More...
 
union  uPCF8523_REG__HOURS
 Union for Hours and Hour Alarm when in AM/PM mode register for PCF8523 peripheral peripheral. More...
 
union  uPCF8523_REG__DAYS
 Union for Days and Day Alarm register for PCF8523 peripheral peripheral. More...
 
union  uPCF8523_REG__WEEKDAYS
 Union for Weekdays and Weekday Alarm register for PCF8523 peripheral peripheral. More...
 
union  uPCF8523_REG__OFFSET
 Union for Offset for PCF8523 peripheral peripheral. More...
 
union  uPCF8523_REG__CLKOUT_CTRL
 Union for Tmr_CLKOUT_ctrl for PCF8523 peripheral peripheral. More...
 
union  uPCF8523_REG__B_FREQ_CTRL
 Union for Tmr_B_freq_ctrl for PCF8523 peripheral peripheral. More...
 

Macros

#define PCF8523_BASE_ADDR   0x68U
 PCF8523 Base address.
 

Enumerations

enum  PCF8523_reg {
  PCF8523__CONTROL_1 = 0U , PCF8523__CONTROL_2 , PCF8523__CONTROL_3 , PCF8523__SECONDS ,
  PCF8523__MINUTES , PCF8523__HOURS , PCF8523__DAYS , PCF8523__WEEKDAYS ,
  PCF8523__MONTHS , PCF8523__YEARS , PCF8523__MINUTE_ALARM , PCF8523__HOUR_ALARM ,
  PCF8523__DAY_ALARM , PCF8523__WEEKDAY_ALARM , PCF8523__OFFSET , PCF8523__TMR_CLKOUT_CTRL ,
  PCF8523__TMR_A_FREQ_CTRL , PCF8523__TMR_A_REG , PCF8523__TMR_B_FREQ_CTRL , PCF8523__TMR_B_REG
}
 Register map enum for PCF8523 peripheral peripheral. More...
 
enum  PCF8523_weekdays {
  PCF8523__SUNDAY = 0U , PCF8523__MONDAY , PCF8523__TUESDAY , PCF8523__WEDNESDAY ,
  PCF8523__THURSDAY , PCF8523__FRIDAY , PCF8523__SATURDAY
}
 Weekdays enum for PCF8523 peripheral. More...
 
enum  PCF8523_months {
  PCF8523__JANUARY = 0x01U , PCF8523__FEBRUARY , PCF8523__MARCH , PCF8523__APRIL ,
  PCF8523__MAY , PCF8523__JUNE , PCF8523__JULY , PCF8523__AUGUST ,
  PCF8523__SEPTEMBER , PCF8523__OCTOBER = 0x10U , PCF8523__NOVEMBER , PCF8523__DECEMBER
}
 Weekdays enum for PCF8523 peripheral. More...
 
enum  PCF8523_power {
  PCF8523__SO_EN_STANDARD = 0U , PCF8523__SO_EN_DIRECT_SWITCHING , PCF8523__SO_DI_POWER_VDD , PCF8523__SO_EN_STANDARD_NO_BL = 4U ,
  PCF8523__SO_EN_DIRECT_SWITCHING_NO_BL , PCF8523__SO_DI_POWER_VDD_NO_BL = 7U
}
 Power Management enum for PCF8523 peripheral. More...
 

Functions

FctERR PCF8523_Init (void)
 Initialization for PCF8523 peripheral peripheral.
 
FctERR PCF8523_Write (const uint8_t *data, const uint16_t addr, const uint16_t nb)
 I2C Write function for PCF8523 peripheral.
 
FctERR PCF8523_Read (uint8_t *data, const uint16_t addr, const uint16_t nb)
 I2C Read function for PCF8523 peripheral.
 

Detailed Description

PCF8523 Driver.

Author
SMFSW

PCF8523: Real-Time Clock (RTC) and calendar

Macro Definition Documentation

◆ PCF8523_BASE_ADDR

#define PCF8523_BASE_ADDR   0x68U

PCF8523 Base address.

Note
Define PCF8523_BASE_ADDR to change default device base address

Enumeration Type Documentation

◆ PCF8523_months

Weekdays enum for PCF8523 peripheral.

Note
BCD coded values
Enumerator
PCF8523__JANUARY 

January.

PCF8523__FEBRUARY 

February.

PCF8523__MARCH 

March.

PCF8523__APRIL 

April.

PCF8523__MAY 

May.

PCF8523__JUNE 

June.

PCF8523__JULY 

July.

PCF8523__AUGUST 

August.

PCF8523__SEPTEMBER 

September.

PCF8523__OCTOBER 

October.

PCF8523__NOVEMBER 

November.

PCF8523__DECEMBER 

December.

◆ PCF8523_power

Power Management enum for PCF8523 peripheral.

Enumerator
PCF8523__SO_EN_STANDARD 

battery switch-over function is enabled in standard mode; battery low detection function is enabled

PCF8523__SO_EN_DIRECT_SWITCHING 

battery switch-over function is enabled in direct switching mode; battery low detection function is enabled

PCF8523__SO_DI_POWER_VDD 

battery switch-over function is disabled - only one power supply (VDD); battery low detection function is enabled

PCF8523__SO_EN_STANDARD_NO_BL 

battery switch-over function is enabled in standard mode; battery low detection function is disabled

PCF8523__SO_EN_DIRECT_SWITCHING_NO_BL 

battery switch-over function is enabled in direct switching mode; battery low detection function is disabled

PCF8523__SO_DI_POWER_VDD_NO_BL 

battery switch-over function is disabled - only one power supply (VDD); battery low detection function is disabled

◆ PCF8523_reg

Register map enum for PCF8523 peripheral peripheral.

Enumerator
PCF8523__CONTROL_1 

Control and status register 1.

PCF8523__CONTROL_2 

Control and status register 2.

PCF8523__CONTROL_3 

Control and status register 3.

PCF8523__SECONDS 

Seconds and clock integrity status register.

PCF8523__MINUTES 

Minutes register.

PCF8523__HOURS 

Hours register.

PCF8523__DAYS 

Days register.

PCF8523__WEEKDAYS 

Weekdays register.

PCF8523__MONTHS 

Months register.

PCF8523__YEARS 

Years register.

PCF8523__MINUTE_ALARM 

Minute alarm register.

PCF8523__HOUR_ALARM 

Hour alarm register.

PCF8523__DAY_ALARM 

Day alarm register.

PCF8523__WEEKDAY_ALARM 

Weekday alarm register.

PCF8523__OFFSET 

Offset register.

PCF8523__TMR_CLKOUT_CTRL 

Timer and CLKOUT control register.

PCF8523__TMR_A_FREQ_CTRL 

Timer A frequency control register.

PCF8523__TMR_A_REG 

Timer A value register.

PCF8523__TMR_B_FREQ_CTRL 

Timer B frequency control register.

PCF8523__TMR_B_REG 

Timer B value register.

◆ PCF8523_weekdays

Weekdays enum for PCF8523 peripheral.

Note
For reference only, Weekdays can start from any day for week
Enumerator
PCF8523__SUNDAY 

Sunday.

PCF8523__MONDAY 

Monday.

PCF8523__TUESDAY 

Tuesday.

PCF8523__WEDNESDAY 

Wednesday.

PCF8523__THURSDAY 

Thursday.

PCF8523__FRIDAY 

Friday.

PCF8523__SATURDAY 

Saturday.

Function Documentation

◆ PCF8523_Init()

FctERR PCF8523_Init ( void )

Initialization for PCF8523 peripheral peripheral.

Weak Functions
PCF8523 Base address may be changed if user implemented
Returns
FctERR - error code
Here is the call graph for this function:

◆ PCF8523_Read()

FctERR PCF8523_Read ( uint8_t * data,
const uint16_t addr,
const uint16_t nb )

I2C Read function for PCF8523 peripheral.

Parameters
[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:

◆ PCF8523_Write()

FctERR PCF8523_Write ( const uint8_t * data,
const uint16_t addr,
const uint16_t nb )

I2C Write function for PCF8523 peripheral.

Parameters
[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: