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

Overview

Function definitions for RTC driver.

Functions

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 80 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 68 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 23 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 31 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 61 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 43 of file rtc.c.