aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2017-11-05 07:34:34 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2017-11-05 07:34:34 +0000
commit5547e99922a8c44ac5d8ffd1e1a82793413630d3 (patch)
tree506a006c82332dc8aa92f178305ac58c4f692019
parent47b464519d4227459677a1b86838d67f7090b83c (diff)
downloadChibiOS-5547e99922a8c44ac5d8ffd1e1a82793413630d3.tar.gz
ChibiOS-5547e99922a8c44ac5d8ffd1e1a82793413630d3.tar.bz2
ChibiOS-5547e99922a8c44ac5d8ffd1e1a82793413630d3.zip
Aligned to latest PAL template.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10949 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r--os/hal/ports/LPC/LPC214x/hal_pal_lld.h72
1 files changed, 69 insertions, 3 deletions
diff --git a/os/hal/ports/LPC/LPC214x/hal_pal_lld.h b/os/hal/ports/LPC/LPC214x/hal_pal_lld.h
index 7c12d045e..f771c787f 100644
--- a/os/hal/ports/LPC/LPC214x/hal_pal_lld.h
+++ b/os/hal/ports/LPC/LPC214x/hal_pal_lld.h
@@ -25,7 +25,7 @@
#ifndef HAL_PAL_LLD_H
#define HAL_PAL_LLD_H
-#if HAL_USE_PAL || defined(__DOXYGEN__)
+#if (HAL_USE_PAL == TRUE) || defined(__DOXYGEN__)
/*===========================================================================*/
/* Unsupported modes and specific modes */
@@ -70,6 +70,10 @@ typedef struct {
} PALConfig;
/**
+ * @name Port related definitions
+ * @{
+ */
+/**
* @brief Width, in bits, of an I/O port.
*/
#define PAL_IOPORTS_WIDTH 32
@@ -78,7 +82,38 @@ typedef struct {
* @brief Whole port mask.
* @details This macro specifies all the valid bits into a port.
*/
-#define PAL_WHOLE_PORT ((ioportmask_t)0xFFFFFFFF)
+#define PAL_WHOLE_PORT ((ioportmask_t)0xFFFFFFFFU)
+/** @} */
+
+/**
+ * @name Line handling macros
+ * @{
+ */
+/**
+ * @brief Forms a line identifier.
+ * @details A port/pad pair are encoded into an @p ioline_t type. The encoding
+ * of this type is platform-dependent.
+ */
+#define PAL_LINE(port, pad) \
+ ((ioline_t)((uint32_t)(port)) | ((uint32_t)(pad)))
+
+/**
+ * @brief Decodes a port identifier from a line identifier.
+ */
+#define PAL_PORT(line) \
+ ((FIO *)(((uint32_t)(line)) & 0xFFFFFFF0U))
+
+/**
+ * @brief Decodes a pad identifier from a line identifier.
+ */
+#define PAL_PAD(line) \
+ ((uint32_t)((uint32_t)(line) & 0x0000000FU))
+
+/**
+ * @brief Value identifying an invalid line.
+ */
+#define PAL_NOLINE 0U
+/** @} */
/**
* @brief Digital I/O port sized unsigned type.
@@ -91,10 +126,20 @@ typedef uint32_t ioportmask_t;
typedef uint32_t iomode_t;
/**
+ * @brief Type of an I/O line.
+ */
+typedef uint32_t ioline_t;
+
+/**
* @brief Port Identifier.
*/
typedef FIO * ioportid_t;
+/**
+ * @brief Type of an pad identifier.
+ */
+typedef uint32_t iopadid_t;
+
/*===========================================================================*/
/* I/O Ports Identifiers. */
/*===========================================================================*/
@@ -234,6 +279,25 @@ typedef FIO * ioportid_t;
#define pal_lld_writepad(port, pad, bit) pal_lld_writegroup(port, 1, pad, bit)
/**
+ * @brief Returns a PAL event structure associated to a pad.
+ *
+ * @param[in] port port identifier
+ * @param[in] pad pad number within the port
+ *
+ * @notapi
+ */
+#define pal_lld_get_pad_event(port, pad) NULL; (void)port; (void)pad
+
+/**
+ * @brief Returns a PAL event structure associated to a line.
+ *
+ * @param[in] line line identifier
+ *
+ * @notapi
+ */
+#define pal_lld_get_line_event(line) NULL; (void)line
+
+/**
* @brief FIO port setup.
* @details This function programs the pins direction within a port.
*
@@ -241,7 +305,9 @@ typedef FIO * ioportid_t;
*/
#define pal_lld_lpc214x_set_direction(port, dir) ((port)->FIO_DIR = (dir))
+#if !defined(__DOXYGEN__)
extern const PALConfig pal_default_config;
+#endif
#ifdef __cplusplus
extern "C" {
@@ -254,7 +320,7 @@ extern "C" {
}
#endif
-#endif /* HAL_USE_PAL */
+#endif /* HAL_USE_PAL == TRUE */
#endif /* HAL_PAL_LLD_H */