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

Data Structures

struct  SysTick_State_t
 A structure to represent the state of a Systick device. More...
 

Functions

SysTick_Device_tSysTick_devRequest (void)
 Request a SysTick Device. More...
 
void SysTick_Handler (void)
 
int32_t SysTick_devDelayTicks (SysTick_Device_t *dev, uint32_t ticks)
 SysTick time delay in tick. More...
 
int32_t SysTick_devDelayMs (SysTick_Device_t *dev, uint32_t ms)
 SysTick time delay in ms. More...
 
int32_t SysTick_devGetInterruptCounts (SysTick_Device_t *dev)
 Get Systick interrupt counts. More...
 
int64_t SysTick_devGetElapsedMs (SysTick_Device_t *dev)
 Get elapsed time in ms since last systick initialization. More...
 
int32_t SysTick_devInit (SysTick_Device_t *dev, uint8_t mode, uint32_t ticks, void *cb)
 Initialize SysTick Timer. More...
 

Variables

static const SysTick_Device_t SysTick_Device
 The instance of SysTick device. More...
 
SysTick_State_t SysTick_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

int32_t SysTick_devDelayMs ( SysTick_Device_t dev,
uint32_t  ms 
)

SysTick time delay in ms.

Parameters
devThe pointer to SysTick device,
msThe time delay in ms.
Returns
0 for success or error code upon a failure.
int32_t SysTick_devDelayTicks ( SysTick_Device_t dev,
uint32_t  ticks 
)

SysTick time delay in tick.

Parameters
devThe pointer to SysTick device,
ticksThe time delay in ticks.
Returns
0 for success or error code upon a failure.
int64_t SysTick_devGetElapsedMs ( SysTick_Device_t dev)

Get elapsed time in ms since last systick initialization.

Parameters
devThe pointer to SysTick device,
Returns
The elapsed time in ms for success or error code upon a failure.
int32_t SysTick_devGetInterruptCounts ( SysTick_Device_t dev)

Get Systick interrupt counts.

Parameters
devThe pointer to SysTick device,
Returns
The interrupt counts for success or error code upon a failure.
int32_t SysTick_devInit ( SysTick_Device_t dev,
uint8_t  mode,
uint32_t  ticks,
void *  cb 
)

Initialize SysTick Timer.

Parameters
devThe pointer to SysTick device,
modeThe enumeration of SysTick timer mode.
ticksThe reload counter settings.
cbThe pointer to the call back function if it is set to interrupt mode.
Returns
0 for success or error code upon a failure.
SysTick_Device_t* SysTick_devRequest ( void  )

Request a SysTick Device.

Returns
The pointer to the timer device instance.
void SysTick_Handler ( void  )

Variable Documentation

const SysTick_Device_t SysTick_Device
static
Initial value:
=
{
.Enable = f_SYSTICK_Enable,
.Disable = f_SYSTICK_Disable,
.IsEnabled = f_SYSTICK_IsEnabled,
.IntEnable = f_SYSTICK_IntEnable,
.IntDisable = f_SYSTICK_IntDisable,
.SetLoad = f_SYSTICK_SetLoad,
.GetLoad = f_SYSTICK_GetLoad,
.SetCount = f_SYSTICK_SetCount,
.GetCount = f_SYSTICK_GetCount,
.IRQ = SysTick_IRQn,
}
static __INLINE uint32_t f_SYSTICK_GetLoad(void)
Get load value of SysTick timer.
Definition: systick_sfrs.h:92
static __INLINE void f_SYSTICK_Enable(void)
Enable SysTick timer.
Definition: systick_sfrs.h:18
static __INLINE void f_SYSTICK_SetLoad(uint32_t ticks)
Set Reload value of SysTick timer.
Definition: systick_sfrs.h:62
Definition: irq_enum.h:24
static __INLINE uint32_t f_SYSTICK_GetCount(void)
Get counter value of SysTick timer.
Definition: systick_sfrs.h:82
static __INLINE void f_SYSTICK_Disable(void)
Disable SysTick timer.
Definition: systick_sfrs.h:26
static __INLINE uint8_t f_SYSTICK_IsEnabled(void)
Check if SysTick timer enable.
Definition: systick_sfrs.h:36
static __INLINE void f_SYSTICK_IntEnable(void)
Enable SysTick timer interrupt.
Definition: systick_sfrs.h:44
static __INLINE void f_SYSTICK_SetCount(uint32_t ticks)
Set counter value of SysTick timer.
Definition: systick_sfrs.h:72
static __INLINE void f_SYSTICK_IntDisable(void)
Disable SysTick timer interrupt.
Definition: systick_sfrs.h:52

The instance of SysTick device.

SysTick_State_t SysTick_State
Initial value:
=
{
.cb_func = NULL, .counts = 0,
}