diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-06-07 14:50:14 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-06-07 14:50:14 +0000 |
commit | 600cf9a77d21f4d3a56a7cbfa5f1132b05913f74 (patch) | |
tree | eb7d68fb91dadf0e9ada991bc210d7babb85eee8 /src/lib/pal.h | |
parent | e1ce26043955f6354af12bafa87c62ef9328440e (diff) | |
download | ChibiOS-600cf9a77d21f4d3a56a7cbfa5f1132b05913f74.tar.gz ChibiOS-600cf9a77d21f4d3a56a7cbfa5f1132b05913f74.tar.bz2 ChibiOS-600cf9a77d21f4d3a56a7cbfa5f1132b05913f74.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1021 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'src/lib/pal.h')
-rw-r--r-- | src/lib/pal.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/lib/pal.h b/src/lib/pal.h index cac306c43..72f824aab 100644 --- a/src/lib/pal.h +++ b/src/lib/pal.h @@ -61,6 +61,30 @@ #define PAL_GROUP_MASK(width) ((ioportmask_t)(1 << (width)) - 1)
/**
+ * @brief Data part of a static I/O bus initializer.
+ * @details This macro should be used when statically initializing an I/O bus
+ * that is part of a bigger structure.
+ *
+ * @param name the name of the IOBus variable
+ * @param port the I/O port descriptor
+ * @param width the bus width in bits
+ * @param offset the bus bit offset within the port
+ */
+#define _IOBUS_DATA(name, port, width, offset) \
+ {port, PAL_GROUP_MASK(width), offset}
+
+/**
+ * @brief Static I/O bus initializer.
+ *
+ * @param name the name of the IOBus variable
+ * @param port the I/O port descriptor
+ * @param width the bus width in bits
+ * @param offset the bus bit offset within the port
+ */
+#define IOBUS_DECL(name, port, width, offset) \
+ IOBus name = _IOBUS_DATA(name, port, width, offset)
+
+/**
* @brief I/O bus descriptor.
* @details This structure describes a group of contiguous digital I/O lines
* that have to be handled as bus.
|