Herzog Library 00.00.01  rel_libdev.herzog.00.00.01.10606
Functions | Variables
timer_device.c File Reference
#include <stdint.h>
#include <stddef.h>
#include <string.h>
#include "timer_device.h"
#include "errno.h"

Functions

int32_t Timer_devStart (Timer_Device_t *dev)
 Start a timer. More...
 
int32_t Timer_devStop (Timer_Device_t *dev)
 Stop a timer. More...
 
int32_t Timer_devSetMs (Timer_Device_t *dev, uint32_t ms)
 Set timing interval of a timer. More...
 
int32_t Timer_devRegisterIRQ (Timer_Device_t *dev, void *cb)
 Register interrupt handling function to a timer device. More...
 
int32_t Timer_devUnregisterIRQ (Timer_Device_t *dev, void *cb)
 Unregister interrupt handling function to a timer device. More...
 
int32_t Timer_devEnableIRQ (Timer_Device_t *dev)
 Enable the interrupt of a timer device. More...
 
int32_t Timer_devDisableIRQ (Timer_Device_t *dev)
 Disable the interrupt of a timer device. More...
 
int32_t Timer_devClearTick (Timer_Device_t *dev)
 Clear the tick counter of a timer interrupt. More...
 
int32_t Timer_devGetTick (Timer_Device_t *dev)
 Get the tick counter of a timer device. More...
 
void Timer0_Handler (void)
 
void Timer1_Handler (void)
 
void Timer2_Handler (void)
 
Timer_Device_tTimer_devRequest (const char *name)
 Request a Timer Device. More...
 

Variables

static const Timer_Device_tTimer_DeviceTable []
 The table of Timer device instances supported by the platform. More...
 

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 Timer0_Handler ( void  )
void Timer1_Handler ( void  )
void Timer2_Handler ( void  )
int32_t Timer_devClearTick ( Timer_Device_t dev)

Clear the tick counter of a timer interrupt.

Parameters
devThe pointer to the timer device.
Returns
0 for success or error code upon a failure.
int32_t Timer_devDisableIRQ ( Timer_Device_t dev)

Disable the interrupt of a timer device.

Parameters
devThe pointer to the timer device.
Returns
0 for success or error code upon a failure.
int32_t Timer_devEnableIRQ ( Timer_Device_t dev)

Enable the interrupt of a timer device.

Parameters
devThe pointer to the timer device.
Returns
0 for success or error code upon a failure.
int32_t Timer_devGetTick ( Timer_Device_t dev)

Get the tick counter of a timer device.

Parameters
devThe pointer to the timer device.
Returns
the counter of timer interrupt or error code upon a failure.
int32_t Timer_devRegisterIRQ ( Timer_Device_t dev,
void *  cb 
)

Register interrupt handling function to a timer device.

Parameters
devThe pointer to the timer device.
cbPointer to the call back function to handle the timer interrupt.
Returns
0 for success or error code upon a failure.
Timer_Device_t* Timer_devRequest ( const char *  name)

Request a Timer Device.

Parameters
nameThe name string of timer device.
Returns
The pointer to the timer device instance.
int32_t Timer_devSetMs ( Timer_Device_t dev,
uint32_t  ms 
)

Set timing interval of a timer.

Parameters
devThe pointer to the timer device.
msThe interval to reload the timer.
Returns
0 for success or error code upon a failure.
int32_t Timer_devStart ( Timer_Device_t dev)

Start a timer.

Parameters
devThe pointer to the timer device.
Returns
0 for success or error code upon a failure.
int32_t Timer_devStop ( Timer_Device_t dev)

Stop a timer.

Parameters
devThe pointer to the timer device.
Returns
0 for success or error code upon a failure.
int32_t Timer_devUnregisterIRQ ( Timer_Device_t dev,
void *  cb 
)

Unregister interrupt handling function to a timer device.

Parameters
devThe pointer to the timer device.
cbPointer to the call back function to handle the timer interrupt.
Returns
0 for success or error code upon a failure.

Variable Documentation

const Timer_Device_t* Timer_DeviceTable[]
static
Initial value:
= {
}

The table of Timer device instances supported by the platform.