Herzog Library 00.00.01  rel_libdev.herzog.00.00.01.10606
Data Structures | Functions | Variables
rtc_device.c File Reference
#include "rtc_device.h"
#include "errno.h"

Data Structures

struct  Alarm_State_t
 
struct  RTC_State_t
 A structure to represent RTC device state. More...
 

Functions

static int32_t rtc_init (void)
 
static int32_t rtc_stop (void)
 
static int32_t alarm_start (RTC_ALARM_t alarm, RTC_ALARM_MODE_t mode, uint32_t secs, void *cb)
 
static int32_t alarm_stop (RTC_ALARM_t alarm)
 
static void alarm_update (RTC_ALARM_t alarm)
 
RTC_Device_tRTC_devRequest (void)
 The instance of RTC device. More...
 
static void alarm_handler (RTC_ALARM_t alarm)
 
void ALARM0_Handler (void)
 
void ALARM1_Handler (void)
 
void RTC_OVFL_Handler (void)
 
int32_t RTC_devInit (RTC_Device_t *dev)
 Initialize RTC Timer. More...
 
int32_t RTC_devStop (RTC_Device_t *dev)
 Stop RTC Timer. More...
 
int32_t RTC_devStartAlarm (RTC_Device_t *dev, RTC_ALARM_t alarm, RTC_ALARM_MODE_t mode, uint32_t secs, void *cb)
 Start a Alarm Timer. More...
 
int32_t RTC_devStopAlarm (RTC_Device_t *dev, RTC_ALARM_t alarm)
 Stop a Alarm Timer. More...
 

Variables

RTC_State_t RTC_State
 

Detailed Description

This file is proprietary to Indie Semiconductor. All rights reserved. Reproduction or distribution, in whole or in part, is forbidden except by express written permission of Indie Semiconductor.

Function Documentation

void ALARM0_Handler ( void  )
void ALARM1_Handler ( void  )
static void alarm_handler ( RTC_ALARM_t  alarm)
static
static int32_t alarm_start ( RTC_ALARM_t  alarm,
RTC_ALARM_MODE_t  mode,
uint32_t  secs,
void *  cb 
)
static
static int32_t alarm_stop ( RTC_ALARM_t  alarm)
static
static void alarm_update ( RTC_ALARM_t  alarm)
static
int32_t RTC_devInit ( RTC_Device_t dev)

Initialize RTC Timer.

Parameters
devThe pointer to RTC device,
Returns
0 for success or error code upon a failure.
RTC_Device_t* RTC_devRequest ( void  )

The instance of RTC device.

Request A RTC Device.

int32_t RTC_devStartAlarm ( RTC_Device_t dev,
RTC_ALARM_t  alarm,
RTC_ALARM_MODE_t  mode,
uint32_t  sec,
void *  cb 
)

Start a Alarm Timer.

Parameters
devThe pointer to RTC device,
alarmThe enumeration of the alarm to be started.
modeThe enumeration of alarm mode.
secThe seconds for the alarm to fire.
cbThe pointer to the call back function when the alarm fires.
Returns
0 for success or error code upon a failure.
int32_t RTC_devStop ( RTC_Device_t dev)

Stop RTC Timer.

Parameters
devThe pointer to RTC device,
Returns
0 for success or error code upon a failure.
int32_t RTC_devStopAlarm ( RTC_Device_t dev,
RTC_ALARM_t  alarm 
)

Stop a Alarm Timer.

Parameters
devThe pointer to RTC device,
alarmThe enumeration of the alarm to be started.
Returns
0 for success or error code upon a failure.
static int32_t rtc_init ( void  )
static
void RTC_OVFL_Handler ( void  )
static int32_t rtc_stop ( void  )
static

Variable Documentation

RTC_State_t RTC_State
Initial value:
= {
.alarm[RTC_ALARM_0] = {
.set_counter = f_RTC_SetAlarm0Counter,
.get_counter = f_RTC_GetAlarm0Counter,
.IRQ = ALARM0_IRQn
},
.alarm[RTC_ALARM_1] = {
.set_counter = f_RTC_SetAlarm1Counter,
.get_counter = f_RTC_GetAlarm1Counter,
.IRQ = ALARM1_IRQn
},
.tick_overflow = 0,
}
Definition: irq_enum.h:36
static __INLINE uint32_t f_RTC_GetAlarm1Counter(void)
Read RTC alarm 1 counter.
Definition: rtc_sfrs.h:186
static __INLINE void f_RTC_SetAlarm0Counter(uint32_t val)
Set RTC alarm 0 counter.
Definition: rtc_sfrs.h:178
static __INLINE uint32_t f_RTC_GetAlarm0Counter(void)
Read RTC alarm 0 counter.
Definition: rtc_sfrs.h:170
static __INLINE void f_RTC_SetAlarm1Counter(uint32_t val)
Set RTC alarm 1 counter.
Definition: rtc_sfrs.h:194
Definition: rtc_device.h:20
Definition: rtc_device.h:19
Definition: irq_enum.h:37