Sapphire SoC DS Sapphire SoC UG Sapphire HP SoC DS Sapphire HP SoC UG RISC-V Embedded IDE UG Board Support Package
Loading...
Searching...
No Matches
rtc_config.h File Reference
#include "userDef.h"
#include "rtc/device/PCF8523.h"

Go to the source code of this file.

Overview

RTC Configuration and Driver Selection.

Author
Efinix Inc

This file automatically selects the correct I2C address and driver structure based on the user-defined ACTIVE_RTC_TYPE.

Definition in file rtc_config.h.

Macros

Automatic Driver Selection

Resolves the low-level driver implementation based on ACTIVE_RTC_TYPE. This allows the user to switch RTC devices by changing a single configuration value in userDef.h.

Note
  • User can switch between supported RTC devices by changing the ACTIVE_RTC_TYPE macro.
    • Add #define ACTIVE_RTC_TYPE RTC_TYPE_PCF8523 in userDef.h to use PCF8523 RTC.
    • Add #define ACTIVE_RTC_TYPE RTC_TYPE_DS3231 in userDef.h to use DS3231 RTC.
  • For custom RTC devices, include the custom driver header and define RTC_CTRL and RTC_DRIVER macros accordingly.
    • Refer to userDef.h in rtcDemo of including a custom RTC driver.
#define RTC_CTRL   RTC_PCF8523_ADDR
 I2C Address for the currently selected RTC (PCF8523).
#define RTC_DRIVER   PCF8523_DRIVER
 Driver Interface Table for the currently selected RTC (PCF8523).