diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-12-02 09:08:10 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-12-02 09:08:10 +0000 |
commit | 9226141410542325cfac87cd8eb62368c0ad82d4 (patch) | |
tree | 0ec9536b8c47903c6dd93e2d7c7b1e58bd123ab6 /os/hal/platforms/SAM4L | |
parent | af7d354bdca2ad2c96bd7eada7033aaf7b0991e1 (diff) | |
download | ChibiOS-9226141410542325cfac87cd8eb62368c0ad82d4.tar.gz ChibiOS-9226141410542325cfac87cd8eb62368c0ad82d4.tar.bz2 ChibiOS-9226141410542325cfac87cd8eb62368c0ad82d4.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4864 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/SAM4L')
-rw-r--r-- | os/hal/platforms/SAM4L/hal_lld.c | 4 | ||||
-rw-r--r-- | os/hal/platforms/SAM4L/hal_lld.h | 43 |
2 files changed, 46 insertions, 1 deletions
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
}
|