summaryrefslogtreecommitdiff
path: root/include/sys_io.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sys_io.h')
-rw-r--r--include/sys_io.h70
1 files changed, 65 insertions, 5 deletions
diff --git a/include/sys_io.h b/include/sys_io.h
index c868ec5f0..ab5886913 100644
--- a/include/sys_io.h
+++ b/include/sys_io.h
@@ -231,7 +231,7 @@ typedef uint32_t mem_addr_t;
* This functions takes the designated bit starting from addr and sets it to 1.
*
* @param addr the memory address from where to look for the bit
- * @param bit the designated bit to set (from 0 to n)
+ * @param bit the designated bit to set (from 0 to 31)
*/
/**
@@ -241,7 +241,7 @@ typedef uint32_t mem_addr_t;
* This functions takes the designated bit starting from addr and sets it to 0.
*
* @param addr the memory address from where to look for the bit
- * @param bit the designated bit to clear (from 0 to n)
+ * @param bit the designated bit to clear (from 0 to 31)
*/
/**
@@ -252,7 +252,7 @@ typedef uint32_t mem_addr_t;
* current setting. It will return the current setting.
*
* @param addr the memory address from where to look for the bit
- * @param bit the designated bit to test (from 0 to n)
+ * @param bit the designated bit to test (from 0 to 31)
*
* @return 1 if it is set, 0 otherwise
*/
@@ -265,7 +265,7 @@ typedef uint32_t mem_addr_t;
* current setting and sets it. It will return the previous setting.
*
* @param addr the memory address from where to look for the bit
- * @param bit the designated bit to test and set (from 0 to n)
+ * @param bit the designated bit to test and set (from 0 to 31)
*
* @return 1 if it was set, 0 otherwise
*/
@@ -278,11 +278,71 @@ typedef uint32_t mem_addr_t;
* current setting and clears it. It will return the previous setting.
*
* @param addr the memory address from where to look for the bit
- * @param bit the designated bit to test and clear (from 0 to n)
+ * @param bit the designated bit to test and clear (from 0 to 31)
*
* @return 0 if it was clear, 1 otherwise
*/
+/**
+ * @fn static inline void sys_bitfield_set_bit(mem_addr_t addr, int bit)
+ * @brief Set the designated bit from addr to 1
+ *
+ * This functions takes the designated bit starting from addr and sets it to 1.
+ *
+ * @param addr the memory address from where to look for the bit
+ * @param bit the designated bit to set (arbitrary)
+ */
+
+/**
+ * @fn static inline void sys_bitfield_clear_bit(mem_addr_t addr, int bit)
+ * @brief Clear the designated bit from addr to 0
+ *
+ * This functions takes the designated bit starting from addr and sets it to 0.
+ *
+ * @param addr the memory address from where to look for the bit
+ * @param bit the designated bit to clear (arbitrary)
+ */
+
+/**
+ * @fn static inline int sys_bitfield_test_bit(mem_addr_t addr, int bit)
+ * @brief Test the bit if it is set or not
+ *
+ * This functions takes the designated bit starting from addr and tests its
+ * current setting. It will return the current setting.
+ *
+ * @param addr the memory address from where to look for the bit
+ * @param bit the designated bit to test (arbitrary
+ *
+ * @return 1 if it is set, 0 otherwise
+ */
+
+/**
+ * @fn static inline int sys_bitfield_test_and_set_bit(mem_addr_t addr, int bit)
+ * @brief Test the bit and set it
+ *
+ * This functions takes the designated bit starting from addr, tests its
+ * current setting and sets it. It will return the previous setting.
+ *
+ * @param addr the memory address from where to look for the bit
+ * @param bit the designated bit to test and set (arbitrary)
+ *
+ * @return 1 if it was set, 0 otherwise
+ */
+
+/**
+ * @fn static inline int sys_bitfield_test_and_clear_bit(mem_addr_t addr, int bit)
+ * @brief Test the bit and clear it
+ *
+ * This functions takes the designated bit starting from addr, test its
+ * current setting and clears it. It will return the previous setting.
+ *
+ * @param addr the memory address from where to look for the bit
+ * @param bit the designated bit to test and clear (arbitrary)
+ *
+ * @return 0 if it was clear, 1 otherwise
+ */
+
+
#ifdef __cplusplus
}
#endif