rtcdriver.c File Reference

RTCDRV timer API implementation.

License

Copyright 2018 Silicon Laboratories Inc. www.silabs.com

SPDX-License-Identifier: Zlib

The licensor of this software is Silicon Laboratories Inc.

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.

Definition in file rtcdriver.c .

#include <string.h>
#include "em_device.h"
#include " em_cmu.h "
#include " em_common.h "
#include " em_core.h "
#include " em_rtc.h "
#include " rtcdriver.h "

Functions

Ecode_t RTCDRV_AllocateTimer ( RTCDRV_TimerID_t *id)
Allocate timer.
Ecode_t RTCDRV_DeInit (void)
Deinitialize the RTCDRV driver.
Ecode_t RTCDRV_Delay (uint32_t ms)
Millisecond delay function.
Ecode_t RTCDRV_FreeTimer ( RTCDRV_TimerID_t id)
Free timer.
uint32_t RTCDRV_GetWallClock (void)
Get wallclock time.
uint32_t RTCDRV_GetWallClockTicks32 (void)
Get wallclock tick count as a 32bit value. At 4 ticks per millisecond, overflow occurs after approximately 12.5 days.
uint64_t RTCDRV_GetWallClockTicks64 (void)
Get a wallclock tick count as a 64 bit value.
Ecode_t RTCDRV_Init (void)
Initialize the RTCDRV driver.
Ecode_t RTCDRV_IsRunning ( RTCDRV_TimerID_t id, bool *isRunning)
Check if a given timer is running.
uint64_t RTCDRV_MsecsToTicks (uint32_t ms)
Convert from milliseconds to RTC/RTCC ticks.
uint64_t RTCDRV_SecsToTicks (uint32_t secs)
Convert from seconds to RTC/RTCC ticks.
Ecode_t RTCDRV_SetWallClock (uint32_t secs)
Set wallclock time.
Ecode_t RTCDRV_StartTimer ( RTCDRV_TimerID_t id, RTCDRV_TimerType_t type, uint32_t timeout, RTCDRV_Callback_t callback, void *user)
Start a timer.
Ecode_t RTCDRV_StopTimer ( RTCDRV_TimerID_t id)
Stop a given timer.
uint32_t RTCDRV_TicksToMsec (uint64_t ticks)
Convert from RTC/RTCC ticks to milliseconds.
uint64_t RTCDRV_TicksToMsec64 (uint64_t ticks)
Convert from RTC/RTCC ticks to milliseconds with 64-bit resolution.
uint32_t RTCDRV_TicksToSec (uint64_t ticks)
Convert from RTC/RTCC ticks to seconds.
Ecode_t RTCDRV_TimeRemaining ( RTCDRV_TimerID_t id, uint32_t *timeRemaining)
Get time left before a given timer expires.