RV32 SoC DS UG
High-Perf RV32 SoC DS UG
RV64 SoC DS UG API and Examples
Embedded IDE UG
Loading...
Searching...
No Matches

Overview

Function definitions for RTC driver.

Warning
Below function are helper function only. Refer to rtc_api_t for the list of API functions.

Functions

rtc_status_t rtc_applyConfig (rtc_instance_t *rtc)
 Wrapper: Apply I2C + RTC configuration.
rtc_status_t rtc_enableErrorInterrupt (rtc_instance_t *rtc)
 Wrapper: Enable RTC error interrupt.
u8 convert_hour_register (u8 old_reg_val, u8 to_12h)
 Convert hour register between 12-hour and 24-hour format.

RTC (Public API - String Based Functions)

Helper function.

const char * Day_ordinal []
 Get ordinal suffix for a given day.
const char *const DayStrings []
 Get string representations for Sunday,Monday ,etc..
const char *const MonthStrings []
 Get string representations for months.
const char *const meridiem []
 Get string representations for meridiem (AM/PM).
const char * get_ordinal (u8 day)
 Get ordinal suffix for a given day.

Function Documentation

◆ convert_hour_register()

u8 convert_hour_register ( u8 old_reg_val,
u8 to_12h )

#include <rtc.h>

Convert hour register between 12-hour and 24-hour format.

Parameters
old_reg_valOriginal hour register value.
to_12hFlag indicating conversion direction (1 for 12-hour, 0 for 24-hour).
Returns
Converted hour register value.

Definition at line 96 of file rtc.c.

◆ get_ordinal()

const char * get_ordinal ( u8 day)
extern

#include <rtc.h>

Get ordinal suffix for a given day.

Parameters
dayDay of the month (1-31).
Returns
Ordinal suffix string ("st", "nd", "rd", "th").

Definition at line 69 of file rtc.c.

◆ rtc_applyConfig()

rtc_status_t rtc_applyConfig ( rtc_instance_t * rtc)

#include <rtc.h>

Wrapper: Apply I2C + RTC configuration.

Parameters
rtcPointer to RTC instance.
Returns
Status code of the operation.
Note
This is a wrapper function for API function pointer. User also can call rtc_api_t::applyConfig directly to apply the configuration. Refer to rtc_api_t for more details.

Definition at line 80 of file rtc.c.

◆ rtc_enableErrorInterrupt()

rtc_status_t rtc_enableErrorInterrupt ( rtc_instance_t * rtc)

#include <rtc.h>

Wrapper: Enable RTC error interrupt.

Parameters
rtcPointer to RTC instance.
Returns
Status code of the operation.

Definition at line 89 of file rtc.c.

Variable Documentation

◆ Day_ordinal

const char* Day_ordinal[]
extern

#include <rtc.h>

Get ordinal suffix for a given day.

Note
Array index 0 is "st", index 1 is "nd", etc..

Definition at line 24 of file rtc.c.

◆ DayStrings

const char* const DayStrings[]
extern

#include <rtc.h>

Get string representations for Sunday,Monday ,etc..

Note
Array index 0 is "Unknown", index 1 is "Sunday", etc..

Definition at line 32 of file rtc.c.

◆ meridiem

const char* const meridiem[]
extern

#include <rtc.h>

Get string representations for meridiem (AM/PM).

Note
Array index 0 is "am", index 1 is "pm".

Definition at line 62 of file rtc.c.

◆ MonthStrings

const char* const MonthStrings[]
extern

#include <rtc.h>

Get string representations for months.

Note
Array index 0 is "Unknown", index 1 is "January", etc..

Definition at line 44 of file rtc.c.