aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/templates/pal_lld.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/templates/pal_lld.h')
-rw-r--r--os/hal/templates/pal_lld.h297
1 files changed, 142 insertions, 155 deletions
diff --git a/os/hal/templates/pal_lld.h b/os/hal/templates/pal_lld.h
index c19aab1de..8b8dd9202 100644
--- a/os/hal/templates/pal_lld.h
+++ b/os/hal/templates/pal_lld.h
@@ -18,8 +18,9 @@
*/
/**
- * @file templates/pal_lld.h
- * @brief PAL subsystem low level driver header template.
+ * @file templates/pal_lld.h
+ * @brief PAL subsystem low level driver header template.
+ *
* @addtogroup PAL_LLD
* @{
*/
@@ -38,42 +39,42 @@
/*===========================================================================*/
/**
- * @brief Generic I/O ports static initializer.
+ * @brief Generic I/O ports static initializer.
* @details An instance of this structure must be passed to @p palInit() at
* system startup time in order to initialized the digital I/O
* subsystem. This represents only the initial setup, specific pads
* or whole ports can be reprogrammed at later time.
- *
- * @note This structure content is architecture dependent. The nome should be
- * changed to include the architecture name following this pattern:<br>
- * - [ARCH][CELL]Config.
- * .
- * As example:<br>
- * - MSP430DIOConfig.
- * .
+ * @note This structure content is architecture dependent. The nome should
+ * be changed to include the architecture name following this
+ * pattern:<br>
+ * - [ARCH][CELL]Config.
+ * .
+ * As example:<br>
+ * - MSP430DIOConfig.
+ * .
*/
typedef struct {
} GenericConfig;
/**
- * @brief Width, in bits, of an I/O port.
+ * @brief Width, in bits, of an I/O port.
*/
#define PAL_IOPORTS_WIDTH 32
/**
- * @brief Whole port mask.
- * @brief This macro specifies all the valid bits into a port.
+ * @brief Whole port mask.
+ * @brief This macro specifies all the valid bits into a port.
*/
#define PAL_WHOLE_PORT ((ioportmask_t)0xFFFFFFFF)
/**
- * @brief Digital I/O port sized unsigned type.
+ * @brief Digital I/O port sized unsigned type.
*/
typedef uint32_t ioportmask_t;
/**
- * @brief Port Identifier.
+ * @brief Port Identifier.
* @details This type can be a scalar or some kind of pointer, do not make
* any assumption about it, use the provided macros when populating
* variables of this type.
@@ -85,7 +86,7 @@ typedef uint32_t ioportid_t;
/*===========================================================================*/
/**
- * @brief First I/O port identifier.
+ * @brief First I/O port identifier.
* @details Low level drivers can define multiple ports, it is suggested to
* use this naming convention.
*/
@@ -97,225 +98,211 @@ typedef uint32_t ioportid_t;
/*===========================================================================*/
/**
- * @brief Low level PAL subsystem initialization.
+ * @brief Low level PAL subsystem initialization.
*
- * @param[in] config the architecture-dependent ports configuration
+ * @param[in] config architecture-dependent ports configuration
*/
#define pal_lld_init(config)
/**
- * @brief Reads the physical I/O port states.
- *
- * @param[in] port the port identifier
- * @return The port bits.
+ * @brief Reads the physical I/O port states.
+ * @note This function is not meant to be invoked directly by the
+ * application code.
*
- * @note This function is not meant to be invoked directly by the application
- * code.
+ * @param[in] port port identifier
+ * @return The port bits.
*/
#define pal_lld_readport(port)
/**
- * @brief Reads the output latch.
+ * @brief Reads the output latch.
* @details The purpose of this function is to read back the latched output
* value.
+ * @note This function is not meant to be invoked directly by the
+ * application code.
*
- * @param[in] port the port identifier
- * @return The latched logical states.
- *
- * @note This function is not meant to be invoked directly by the application
- * code.
+ * @param[in] port port identifier
+ * @return The latched logical states.
*/
#define pal_lld_readlatch(port)
/**
- * @brief Writes a bits mask on a I/O port.
- *
- * @param[in] port the port identifier
- * @param[in] bits the bits to be written on the specified port
+ * @brief Writes a bits mask on a I/O port.
+ * @note This function is not meant to be invoked directly by the
+ * application code.
*
- * @note This function is not meant to be invoked directly by the application
- * code.
+ * @param[in] port port identifier
+ * @param[in] bits bits to be written on the specified port
*/
#define pal_lld_writeport(port, bits)
/**
- * @brief Sets a bits mask on a I/O port.
+ * @brief Sets a bits mask on a I/O port.
+ * @note This function is not meant to be invoked directly by the
+ * application code.
+ * @note The @ref PAL provides a default software implementation of this
+ * functionality, implement this function if can optimize it by using
+ * special hardware functionalities or special coding.
*
- * @param[in] port the port identifier
- * @param[in] bits the bits to be ORed on the specified port
- *
- * @note This function is not meant to be invoked directly by the application
- * code.
- * @note The @ref PAL provides a default software implementation of this
- * functionality, implement this function if can optimize it by using
- * special hardware functionalities or special coding.
+ * @param[in] port port identifier
+ * @param[in] bits bits to be ORed on the specified port
*/
#define pal_lld_setport(port, bits)
/**
- * @brief Clears a bits mask on a I/O port.
- *
- * @param[in] port the port identifier
- * @param[in] bits the bits to be cleared on the specified port
+ * @brief Clears a bits mask on a I/O port.
+ * @note This function is not meant to be invoked directly by the
+ * application code.
+ * @note The @ref PAL provides a default software implementation of this
+ * functionality, implement this function if can optimize it by using
+ * special hardware functionalities or special coding.
*
- * @note This function is not meant to be invoked directly by the application
- * code.
- * @note The @ref PAL provides a default software implementation of this
- * functionality, implement this function if can optimize it by using
- * special hardware functionalities or special coding.
+ * @param[in] port port identifier
+ * @param[in] bits bits to be cleared on the specified port
*/
#define pal_lld_clearport(port, bits)
/**
- * @brief Toggles a bits mask on a I/O port.
+ * @brief Toggles a bits mask on a I/O port.
+ * @note This function is not meant to be invoked directly by the
+ * application code.
+ * @note The @ref PAL provides a default software implementation of this
+ * functionality, implement this function if can optimize it by using
+ * special hardware functionalities or special coding.
*
- * @param[in] port the port identifier
- * @param[in] bits the bits to be XORed on the specified port
- *
- * @note This function is not meant to be invoked directly by the application
- * code.
- * @note The @ref PAL provides a default software implementation of this
- * functionality, implement this function if can optimize it by using
- * special hardware functionalities or special coding.
+ * @param[in] port port identifier
+ * @param[in] bits bits to be XORed on the specified port
*/
#define pal_lld_toggleport(port, bits)
/**
- * @brief Reads a group of bits.
- *
- * @param[in] port the port identifier
- * @param[in] mask the group mask
- * @param[in] offset the group bit offset within the port
- * @return The group logical states.
+ * @brief Reads a group of bits.
+ * @note This function is not meant to be invoked directly by the
+ * application code.
+ * @note The @ref PAL provides a default software implementation of this
+ * functionality, implement this function if can optimize it by using
+ * special hardware functionalities or special coding.
*
- * @note This function is not meant to be invoked directly by the application
- * code.
- * @note The @ref PAL provides a default software implementation of this
- * functionality, implement this function if can optimize it by using
- * special hardware functionalities or special coding.
+ * @param[in] port port identifier
+ * @param[in] mask group mask
+ * @param[in] offset group bit offset within the port
+ * @return The group logical states.
*/
#define pal_lld_readgroup(port, mask, offset)
/**
- * @brief Writes a group of bits.
+ * @brief Writes a group of bits.
+ * @note This function is not meant to be invoked directly by the
+ * application code.
+ * @note The @ref PAL provides a default software implementation of this
+ * functionality, implement this function if can optimize it by using
+ * special hardware functionalities or special coding.
*
- * @param[in] port the port identifier
- * @param[in] mask the group mask
- * @param[in] offset the group bit offset within the port
- * @param[in] bits the bits to be written. Values exceeding the group width
- * are masked.
- *
- * @note This function is not meant to be invoked directly by the application
- * code.
- * @note The @ref PAL provides a default software implementation of this
- * functionality, implement this function if can optimize it by using
- * special hardware functionalities or special coding.
+ * @param[in] port port identifier
+ * @param[in] mask group mask
+ * @param[in] offset group bit offset within the port
+ * @param[in] bits bits to be written. Values exceeding the group width
+ * are masked.
*/
#define pal_lld_writegroup(port, mask, offset, bits)
/**
- * @brief Pads group mode setup.
+ * @brief Pads group mode setup.
* @details This function programs a pads group belonging to the same port
* with the specified mode.
+ * @note This function is not meant to be invoked directly by the
+ * application code.
+ * @note Programming an unknown or unsupported mode is silently ignored.
*
- * @param[in] port the port identifier
- * @param[in] mask the group mask
- * @param[in] mode the mode
- *
- * @note This function is not meant to be invoked directly by the application
- * code.
- * @note Programming an unknown or unsupported mode is silently ignored.
+ * @param[in] port port identifier
+ * @param[in] mask group mask
+ * @param[in] mode group mode
*/
#define pal_lld_setgroupmode(port, mask, mode)
/**
- * @brief Reads a logical state from an I/O pad.
+ * @brief Reads a logical state from an I/O pad.
+ * @note This function is not meant to be invoked directly by the
+ * application code.
+ * @note The @ref PAL provides a default software implementation of this
+ * functionality, implement this function if can optimize it by using
+ * special hardware functionalities or special coding.
*
- * @param[in] port the port identifier
- * @param[in] pad the pad number within the port
- * @return The logical state.
- * @retval 0 low logical state.
- * @retval 1 high logical state.
- *
- * @note This function is not meant to be invoked directly by the application
- * code.
- * @note The @ref PAL provides a default software implementation of this
- * functionality, implement this function if can optimize it by using
- * special hardware functionalities or special coding.
+ * @param[in] port port identifier
+ * @param[in] pad pad number within the port
+ * @return The logical state.
+ * @retval PAL_LOW low logical state.
+ * @retval PAL_HIGH high logical state.
*/
#define pal_lld_readpad(port, pad)
/**
- * @brief Writes a logical state on an output pad.
- *
- * @param[in] port the port identifier
- * @param[in] pad the pad number within the port
- * @param[out] bit the logical value, the value must be @p 0 or @p 1
+ * @brief Writes a logical state on an output pad.
+ * @note This function is not meant to be invoked directly by the
+ * application code.
+ * @note The @ref PAL provides a default software implementation of this
+ * functionality, implement this function if can optimize it by using
+ * special hardware functionalities or special coding.
*
- * @note This function is not meant to be invoked directly by the application
- * code.
- * @note The @ref PAL provides a default software implementation of this
- * functionality, implement this function if can optimize it by using
- * special hardware functionalities or special coding.
+ * @param[in] port port identifier
+ * @param[in] pad pad number within the port
+ * @param[out] bit logical value, the value must be @p PAL_LOW or
+ * @p PAL_HIGH
*/
#define pal_lld_writepad(port, pad, bit)
/**
- * @brief Sets a pad logical state to @p 1.
+ * @brief Sets a pad logical state to @p PAL_HIGH.
+ * @note This function is not meant to be invoked directly by the
+ * application code.
+ * @note The @ref PAL provides a default software implementation of this
+ * functionality, implement this function if can optimize it by using
+ * special hardware functionalities or special coding.
*
- * @param[in] port the port identifier
- * @param[in] pad the pad number within the port
- *
- * @note This function is not meant to be invoked directly by the application
- * code.
- * @note The @ref PAL provides a default software implementation of this
- * functionality, implement this function if can optimize it by using
- * special hardware functionalities or special coding.
+ * @param[in] port port identifier
+ * @param[in] pad pad number within the port
*/
#define pal_lld_setpad(port, pad)
/**
- * @brief Clears a pad logical state to @p 0.
- *
- * @param[in] port the port identifier
- * @param[in] pad the pad number within the port
+ * @brief Clears a pad logical state to @p PAL_LOW.
+ * @note This function is not meant to be invoked directly by the
+ * application code.
+ * @note The @ref PAL provides a default software implementation of this
+ * functionality, implement this function if can optimize it by using
+ * special hardware functionalities or special coding.
*
- * @note This function is not meant to be invoked directly by the application
- * code.
- * @note The @ref PAL provides a default software implementation of this
- * functionality, implement this function if can optimize it by using
- * special hardware functionalities or special coding.
+ * @param[in] port port identifier
+ * @param[in] pad pad number within the port
*/
#define pal_lld_clearpad(port, pad)
/**
- * @brief Toggles a pad logical state.
+ * @brief Toggles a pad logical state.
+ * @note This function is not meant to be invoked directly by the
+ * application code.
+ * @note The @ref PAL provides a default software implementation of this
+ * functionality, implement this function if can optimize it by using
+ * special hardware functionalities or special coding.
*
- * @param[in] port the port identifier
- * @param[in] pad the pad number within the port
- *
- * @note This function is not meant to be invoked directly by the application
- * code.
- * @note The @ref PAL provides a default software implementation of this
- * functionality, implement this function if can optimize it by using
- * special hardware functionalities or special coding.
+ * @param[in] port port identifier
+ * @param[in] pad pad number within the port
*/
#define pal_lld_togglepad(port, pad)
/**
- * @brief Pad mode setup.
+ * @brief Pad mode setup.
* @details This function programs a pad with the specified mode.
+ * @note This function is not meant to be invoked directly by the
+ * application code.
+ * @note The @ref PAL provides a default software implementation of this
+ * functionality, implement this function if can optimize it by using
+ * special hardware functionalities or special coding.
+ * @note Programming an unknown or unsupported mode is silently ignored.
*
- * @param[in] port the port identifier
- * @param[in] pad the pad number within the port
- * @param[in] mode the mode
- *
- * @note This function is not meant to be invoked directly by the application
- * code.
- * @note The @ref PAL provides a default software implementation of this
- * functionality, implement this function if can optimize it by using
- * special hardware functionalities or special coding.
- * @note Programming an unknown or unsupported mode is silently ignored.
+ * @param[in] port port identifier
+ * @param[in] pad pad number within the port
+ * @param[in] mode pad mode
*/
#define pal_lld_setpadmode(port, pad, mode)