2013-11-27 16:28:31 +01:00
|
|
|
/*
|
2013-06-18 17:21:38 +02:00
|
|
|
* Copyright (C) 2013 Freie Universität Berlin
|
2010-09-22 15:10:42 +02:00
|
|
|
*
|
2013-11-22 20:47:05 +01:00
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser General
|
2013-06-18 17:21:38 +02:00
|
|
|
* Public License. See the file LICENSE in the top level directory for more
|
|
|
|
* details.
|
2013-11-27 16:28:31 +01:00
|
|
|
*/
|
2014-02-11 18:15:43 +01:00
|
|
|
|
2013-11-27 16:28:31 +01:00
|
|
|
/**
|
|
|
|
* @addtogroup core_hwtimer
|
2010-09-22 15:10:42 +02:00
|
|
|
* @{
|
2013-11-27 16:28:31 +01:00
|
|
|
*
|
|
|
|
* @file hwtimer_arch.h
|
|
|
|
* @brief Architecture specific hwtimer API
|
|
|
|
*
|
|
|
|
* @author Freie Universität Berlin, Computer Systems & Telematics
|
|
|
|
* @author Thomas Hillebrandt <hillebra@inf.fu-berlin.de>
|
|
|
|
* @author Heiko Will <hwill@inf.fu-berlin.de>
|
2014-01-28 11:50:12 +01:00
|
|
|
* @author Kaspar Schleiser <kaspar@schleiser.de>
|
2014-04-08 18:33:16 +02:00
|
|
|
* @}
|
2010-09-22 15:10:42 +02:00
|
|
|
*/
|
2014-02-11 18:15:43 +01:00
|
|
|
|
2010-09-22 15:10:42 +02:00
|
|
|
#ifndef HWTIMER_ARCH_H_
|
|
|
|
#define HWTIMER_ARCH_H_
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
/**
|
2014-04-08 18:33:16 +02:00
|
|
|
* @brief Initialize architecture dependent kernel timer support.
|
|
|
|
*
|
|
|
|
* @param[in] handler callback function for the interrupt handler
|
|
|
|
* @param[in] fcpu cpu frequency
|
2010-09-22 15:10:42 +02:00
|
|
|
*/
|
|
|
|
void hwtimer_arch_init(void (*handler)(int), uint32_t fcpu);
|
|
|
|
|
|
|
|
/**
|
2014-04-08 18:33:16 +02:00
|
|
|
* @brief Enable interrupts of hardware timers.
|
2010-09-22 15:10:42 +02:00
|
|
|
*/
|
|
|
|
void hwtimer_arch_enable_interrupt(void);
|
|
|
|
|
|
|
|
/**
|
2014-04-08 18:33:16 +02:00
|
|
|
* @brief Disable interrupts of hardware timers.
|
2010-09-22 15:10:42 +02:00
|
|
|
*/
|
|
|
|
void hwtimer_arch_disable_interrupt(void);
|
|
|
|
|
|
|
|
/**
|
2014-04-08 18:33:16 +02:00
|
|
|
* @brief Set a kernel timer to raise an interrupt after `offset` kernel timer
|
|
|
|
* ticks from now.
|
|
|
|
*
|
|
|
|
* @param[in] offset number of ticks
|
|
|
|
* @param[in] timer hardware timer identifier
|
2010-09-22 15:10:42 +02:00
|
|
|
*/
|
|
|
|
void hwtimer_arch_set(unsigned long offset, short timer);
|
|
|
|
|
|
|
|
/**
|
2014-04-08 18:33:16 +02:00
|
|
|
* @brief Set a kernel timer to raise an interrupt at specified system time.
|
|
|
|
*
|
|
|
|
* @param[in] value system time
|
|
|
|
* @param[in] timer hardware timer identifier
|
2010-09-22 15:10:42 +02:00
|
|
|
*/
|
|
|
|
void hwtimer_arch_set_absolute(unsigned long value, short timer);
|
|
|
|
|
|
|
|
/**
|
2014-04-08 18:33:16 +02:00
|
|
|
* @brief Unset the kernel timer with the given timer ID.
|
|
|
|
*
|
|
|
|
* @param[in] timer hardware timer identifier
|
2010-09-22 15:10:42 +02:00
|
|
|
*/
|
|
|
|
void hwtimer_arch_unset(short timer);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the current tick count of the default hardware timer.
|
2014-04-08 18:33:16 +02:00
|
|
|
*
|
|
|
|
* @return The current tick count of the hardware timer
|
2010-09-22 15:10:42 +02:00
|
|
|
*/
|
|
|
|
unsigned long hwtimer_arch_now(void);
|
|
|
|
|
|
|
|
#endif /* HWTIMER_ARCH_H_ */
|