From 9226141410542325cfac87cd8eb62368c0ad82d4 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 2 Dec 2012 09:08:10 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4864 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/SAM4L/hal_lld.c | 4 ++++ os/hal/platforms/SAM4L/hal_lld.h | 43 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 46 insertions(+), 1 deletion(-) (limited to 'os/hal/platforms') diff --git a/os/hal/platforms/SAM4L/hal_lld.c b/os/hal/platforms/SAM4L/hal_lld.c index 2564ac49d..02dbfb9a3 100644 --- a/os/hal/platforms/SAM4L/hal_lld.c +++ b/os/hal/platforms/SAM4L/hal_lld.c @@ -53,6 +53,10 @@ /* Driver exported functions. */ /*===========================================================================*/ +void sam4l_clock_init(void) { + +} + /** * @brief Low level HAL driver initialization. * diff --git a/os/hal/platforms/SAM4L/hal_lld.h b/os/hal/platforms/SAM4L/hal_lld.h index 1b7106962..fb78792b9 100644 --- a/os/hal/platforms/SAM4L/hal_lld.h +++ b/os/hal/platforms/SAM4L/hal_lld.h @@ -29,14 +29,21 @@ #ifndef _HAL_LLD_H_ #define _HAL_LLD_H_ +#include "sam4l.h" + /*===========================================================================*/ /* Driver constants. */ /*===========================================================================*/ +/** + * @brief Defines the support for realtime counters in the HAL. + */ +#define HAL_IMPLEMENTS_COUNTERS TRUE + /** * @brief Platform name. */ -#define PLATFORM_NAME "" +#define PLATFORM_NAME "SAM4L Series" /*===========================================================================*/ /* Driver pre-compile time settings. */ @@ -50,10 +57,43 @@ /* Driver data structures and types. */ /*===========================================================================*/ +/** + * @brief Type representing a system clock frequency. + */ +typedef uint32_t halclock_t; + +/** + * @brief Type of the realtime free counter value. + */ +typedef uint32_t halrtcnt_t; + /*===========================================================================*/ /* Driver macros. */ /*===========================================================================*/ +/** + * @brief Returns the current value of the system free running counter. + * @note This service is implemented by returning the content of the + * DWT_CYCCNT register. + * + * @return The value of the system free running counter of + * type halrtcnt_t. + * + * @notapi + */ +#define hal_lld_get_counter_value() DWT_CYCCNT + +/** + * @brief Realtime counter frequency. + * @note The DWT_CYCCNT register is incremented directly by the system + * clock so this function returns STM32_HCLK. + * + * @return The realtime counter frequency of type halclock_t. + * + * @notapi + */ +#define hal_lld_get_counter_frequency() STM32_HCLK + /*===========================================================================*/ /* External declarations. */ /*===========================================================================*/ @@ -61,6 +101,7 @@ #ifdef __cplusplus extern "C" { #endif + void sam4l_clock_init(void); void hal_lld_init(void); #ifdef __cplusplus } -- cgit v1.2.3