HALFRED  0.4.0
Data Structures | Macros | Typedefs | Enumerations | Functions
hal_tim.h File Reference

Timer API. More...

Detailed Description

Timer API.

hal_tim library

Purpose
HALFRED Hardware Abstraction Layer
Version
Revision
1563
License
$License$
#include <stdint.h>
#include <stdbool.h>
#include "hal_compiler_support.h"

Go to the source code of this file.

Data Structures

union  TIM_EventID
 
struct  TIM_Time
 
struct  TIM_Capabilities
 

Macros

#define HAL_TIM_USE_INTERRUPT_EVENTS   1
 Enables (1) or disables (0) interrupt level events.
 
#define HAL_TIM_USE_TASK_EVENTS   1
 Enables (1) or disables (0) task level events.
 
#define TIM_NO_EVENT   0xffffffff
 An identifier representing uninitialized (empty) event.
 
#define TIM_Deinit(TIM)   (TIM)->Deinit(TIM)
 
#define TIM_GetTime(TIM)   (TIM)->GetTime(TIM)
 
#define TIM_ResetCounter(TIM)   (TIM)->ResetCounter(TIM)
 
#define TIM_GetCapabilities(TIM, Caps)   (TIM)->GetCapabilities(TIM, Caps)
 
#define TIM_GetError(TIM, TickTimeBase)   (TIM)->GetError(TIM, TickTimeBase)
 

Typedefs

typedef struct TIMDeviceDescTIMDevice
 

Enumerations

enum  TIM_EventType { TIM_EVENT_TYPE_NO_TYPE = -1, TIM_EVENT_TYPE_INTERRUPT = 0, TIM_EVENT_TYPE_TASK = 1 }
 

Functions

void TIM_Init (TIMDevice tim, uint32_t TickTimeBase)
 
int64_t TIM_GetTimeInNS (TIMDevice tim)
 
int64_t TIM_GetTimeElapsed (TIMDevice tim, TIM_Time since)
 
TIM_Time TIM_NSToTimTime (TIMDevice tim, int64_t ns)
 
int64_t TIM_TimTimeToNS (TIMDevice tim, TIM_Time t)
 
TIM_EventID TIM_InitEvent (TIMDevice tim, void(*handler)(TIMDevice tim, TIM_EventID event_id, TIM_Time expire_time, void *context), TIM_EventType type, void *context)
 
void TIM_DeinitEvent (TIMDevice tim, TIM_EventID event_id)
 
HALRESULT TIM_ScheduleEvent (TIMDevice tim, TIM_EventID event_id, TIM_Time delta_time)
 
HALRESULT TIM_ScheduleEventAt (TIMDevice tim, TIM_EventID event_id, TIM_Time abs_time)
 
HALRESULT TIM_UnscheduleEvent (TIMDevice tim, TIM_EventID event_id)
 
bool TIM_IsEventScheduled (TIMDevice tim, TIM_EventID event_id)
 
TIM_EventID TIM_SetEventType (TIMDevice tim, TIM_EventID event_id, TIM_EventType type)
 
TIM_EventType TIM_GetEventType (TIM_EventID event_id)
 
TIM_Time TIM_GetTimeToEvent (TIMDevice tim, TIM_EventID event_id)
 
TIM_EventID TIM_GetNextEvent (TIMDevice tim)
 
TIM_Time TIM_GetEventTime (TIMDevice tim, TIM_EventID event_id)
 
void TIM_TaskEventProc (TIMDevice tim)
 
void TIM_InterruptProc (TIMDevice tim)
 
TIM_Time TIM_AddTime (TIMDevice tim, TIM_Time t1, TIM_Time t2)
 
TIM_Time TIM_SubtractTime (TIMDevice tim, TIM_Time t1, TIM_Time t2)
 
int TIM_CompareTime (TIM_Time t1, TIM_Time t2)