summaryrefslogtreecommitdiff
path: root/platform/drivers/inc/sema4.h
diff options
context:
space:
mode:
authorStefan Agner <stefan@agner.ch>2016-05-02 19:13:19 -0700
committerStefan Agner <stefan@agner.ch>2016-05-09 17:17:05 -0700
commit21d6d84123de8e6e2ebdf5543b530403951b3059 (patch)
tree046a7fa39e1c7cff49792ac67f1ae899271a56b7 /platform/drivers/inc/sema4.h
parent2fb8ccd4adf6433033a402e2fa07c2f11c489518 (diff)
resync with FreeRTOS_BSP_1.0.1_iMX7D
Diffstat (limited to 'platform/drivers/inc/sema4.h')
-rw-r--r--platform/drivers/inc/sema4.h122
1 files changed, 58 insertions, 64 deletions
diff --git a/platform/drivers/inc/sema4.h b/platform/drivers/inc/sema4.h
index 55ed0e0..cd04c14 100644
--- a/platform/drivers/inc/sema4.h
+++ b/platform/drivers/inc/sema4.h
@@ -43,48 +43,43 @@
/*******************************************************************************
* Definitions
******************************************************************************/
-#define SEMA4_PROCESSOR_NONE (0xFF)
-#define SEMA4_GATE_STATUS_FLAG(gate) ((uint16_t)(1U << ((gate) ^ 7)))
+#define SEMA4_PROCESSOR_NONE (0xFF)
+#define SEMA4_GATE_STATUS_FLAG(gate) ((uint16_t)(1U << ((gate) ^ 7)))
-/*!
- * @brief Status flag
- */
-enum _sema4_status_flag {
- sema4StatusFlagGate0 = 1U << 7,
- sema4StatusFlagGate1 = 1U << 6,
- sema4StatusFlagGate2 = 1U << 5,
- sema4StatusFlagGate3 = 1U << 4,
- sema4StatusFlagGate4 = 1U << 3,
- sema4StatusFlagGate5 = 1U << 2,
- sema4StatusFlagGate6 = 1U << 1,
- sema4StatusFlagGate7 = 1U << 0,
- sema4StatusFlagGate8 = 1U << 15,
- sema4StatusFlagGate9 = 1U << 14,
- sema4StatusFlagGate10 = 1U << 13,
- sema4StatusFlagGate11 = 1U << 12,
- sema4StatusFlagGate12 = 1U << 11,
- sema4StatusFlagGate13 = 1U << 10,
- sema4StatusFlagGate14 = 1U << 9,
- sema4StatusFlagGate15 = 1U << 8
+/*! @brief Status flag. */
+enum _sema4_status_flag
+{
+ sema4StatusFlagGate0 = 1U << 7, /*!< Sema4 Gate 0 flag. */
+ sema4StatusFlagGate1 = 1U << 6, /*!< Sema4 Gate 1 flag. */
+ sema4StatusFlagGate2 = 1U << 5, /*!< Sema4 Gate 2 flag. */
+ sema4StatusFlagGate3 = 1U << 4, /*!< Sema4 Gate 3 flag. */
+ sema4StatusFlagGate4 = 1U << 3, /*!< Sema4 Gate 4 flag. */
+ sema4StatusFlagGate5 = 1U << 2, /*!< Sema4 Gate 5 flag. */
+ sema4StatusFlagGate6 = 1U << 1, /*!< Sema4 Gate 6 flag. */
+ sema4StatusFlagGate7 = 1U << 0, /*!< Sema4 Gate 7 flag. */
+ sema4StatusFlagGate8 = 1U << 15, /*!< Sema4 Gate 8 flag. */
+ sema4StatusFlagGate9 = 1U << 14, /*!< Sema4 Gate 9 flag. */
+ sema4StatusFlagGate10 = 1U << 13, /*!< Sema4 Gate 10 flag. */
+ sema4StatusFlagGate11 = 1U << 12, /*!< Sema4 Gate 11 flag. */
+ sema4StatusFlagGate12 = 1U << 11, /*!< Sema4 Gate 12 flag. */
+ sema4StatusFlagGate13 = 1U << 10, /*!< Sema4 Gate 13 flag. */
+ sema4StatusFlagGate14 = 1U << 9, /*!< Sema4 Gate 14 flag. */
+ sema4StatusFlagGate15 = 1U << 8, /*!< Sema4 Gate 15 flag. */
};
-/*!
- * @brief SEMA4 reset finite state machine.
- */
+/*! @brief SEMA4 reset finite state machine. */
enum _sema4_reset_state
{
- sema4ResetIdle = 0U, /*!< Idle, waiting for the first data pattern write. */
- sema4ResetMid = 1U, /*!< Waiting for the second data pattern write. */
- sema4ResetFinished = 2U, /*!< Reset completed. Software could not get this state. */
+ sema4ResetIdle = 0U, /*!< Idle, waiting for the first data pattern write. */
+ sema4ResetMid = 1U, /*!< Waiting for the second data pattern write. */
+ sema4ResetFinished = 2U, /*!< Reset completed. Software can't get this state. */
};
-/*!
- * @brief SEMA4 status return codes.
- */
+/*! @brief SEMA4 status return codes. */
typedef enum _sema4_status
{
- statusSema4Success = 0U, /*!< Success. */
- statusSema4Busy = 1U /*!< SEMA4 gate has been locked by other processor. */
+ statusSema4Success = 0U, /*!< Success. */
+ statusSema4Busy = 1U, /*!< SEMA4 gate has been locked by other processor. */
} sema4_status_t;
/*******************************************************************************
@@ -101,10 +96,10 @@ extern "C" {
*/
/*!
- * @brief Lock SEMA4 gate for exclusive access between multicore
+ * @brief Lock SEMA4 gate for exclusive access between multicore.
*
- * @param base SEMA4 base address
- * @param gateIndex SEMA4 gate index
+ * @param base SEMA4 base pointer.
+ * @param gateIndex SEMA4 gate index.
* @retval statusSema4Success Lock the gate successfully.
* @retval statusSema4Busy SEMA4 gate has been locked by other processor.
*/
@@ -113,24 +108,24 @@ sema4_status_t SEMA4_TryLock(SEMA4_Type *base, uint32_t gateIndex);
/*!
* @brief Lock SEMA4 gate for exclusive access between multicore, polling until success.
*
- * @param base SEMA4 base address
- * @param gateIndex SEMA4 gate index
+ * @param base SEMA4 base pointer.
+ * @param gateIndex SEMA4 gate index.
*/
void SEMA4_Lock(SEMA4_Type *base, uint32_t gateIndex);
/*!
- * @brief Unlock SEMA4 gate
+ * @brief Unlock SEMA4 gate.
*
* @param base SEMA4 base pointer.
- * @param gateIndex SEMA4 gate index
+ * @param gateIndex SEMA4 gate index.
*/
void SEMA4_Unlock(SEMA4_Type *base, uint32_t gateIndex);
/*!
- * @brief Get processor number which locks the SEMA4 gate
+ * @brief Get processor number which locks the SEMA4 gate.
*
* @param base SEMA4 base pointer.
- * @param gateIndex SEMA4 gate index
+ * @param gateIndex SEMA4 gate index.
* @return processor number which locks the SEMA4 gate, or SEMA4_PROCESSOR_NONE
* to indicate the gate is not locked.
*/
@@ -144,15 +139,15 @@ uint32_t SEMA4_GetLockProcessor(SEMA4_Type *base, uint32_t gateIndex);
*/
/*!
- * @brief Reset SEMA4 gate to unlocked status
+ * @brief Reset SEMA4 gate to unlocked status.
*
* @param base SEMA4 base pointer.
- * @param gateIndex SEMA4 gate index
+ * @param gateIndex SEMA4 gate index.
*/
void SEMA4_ResetGate(SEMA4_Type *base, uint32_t gateIndex);
/*!
- * @brief Reset all SEMA4 gates to unlocked status
+ * @brief Reset all SEMA4 gates to unlocked status.
*
* @param base SEMA4 base pointer.
*/
@@ -160,9 +155,8 @@ void SEMA4_ResetAllGates(SEMA4_Type *base);
/*!
* @brief Get bus master number which performing the gate reset function.
- *
- * This function gets the bus master number which performing the gate reset
- * function.
+ * This function gets the bus master number which performing the
+ * gate reset function.
*
* @param base SEMA4 base pointer.
* @return Bus master number.
@@ -174,11 +168,11 @@ static inline uint8_t SEMA4_GetGateResetBus(SEMA4_Type *base)
/*!
* @brief Get sema4 gate reset state.
- *
- * This function gets current state of the sema4 reset gate finite state machine.
+ * This function gets current state of the sema4 reset gate finite
+ * state machine.
*
* @param base SEMA4 base pointer.
- * @return Current state, see _sema4_reset_state.
+ * @return Current state (see @ref _sema4_reset_state).
*/
static inline uint8_t SEMA4_GetGateResetState(SEMA4_Type *base)
{
@@ -186,15 +180,15 @@ static inline uint8_t SEMA4_GetGateResetState(SEMA4_Type *base)
}
/*!
- * @brief Reset SEMA4 IRQ notification
+ * @brief Reset SEMA4 IRQ notification.
*
* @param base SEMA4 base pointer.
- * @param gateIndex SEMA4 gate index
+ * @param gateIndex SEMA4 gate index.
*/
void SEMA4_ResetNotification(SEMA4_Type *base, uint32_t gateIndex);
/*!
- * @brief Reset all IRQ notifications
+ * @brief Reset all IRQ notifications.
*
* @param base SEMA4 base pointer.
*/
@@ -202,9 +196,8 @@ void SEMA4_ResetAllNotifications(SEMA4_Type *base);
/*!
* @brief Get bus master number which performing the notification reset function.
- *
- * This function gets the bus master number which performing the notification reset
- * function.
+ * This function gets the bus master number which performing the notification
+ * reset function.
*
* @param base SEMA4 base pointer.
* @return Bus master number.
@@ -220,7 +213,7 @@ static inline uint8_t SEMA4_GetNotificationResetBus(SEMA4_Type *base)
* This function gets current state of the sema4 reset notification finite state machine.
*
* @param base SEMA4 base pointer.
- * @return Current state, see _sema4_reset_state.
+ * @return Current state (See @ref _sema4_reset_state).
*/
static inline uint8_t SEMA4_GetNotificationResetState(SEMA4_Type *base)
{
@@ -230,7 +223,7 @@ static inline uint8_t SEMA4_GetNotificationResetState(SEMA4_Type *base)
/*@}*/
/*!
- * @name SEMA4 Interupt and Status Control
+ * @name SEMA4 Interrupt and Status Control
* @{
*/
@@ -238,7 +231,7 @@ static inline uint8_t SEMA4_GetNotificationResetState(SEMA4_Type *base)
* @brief Get SEMA4 notification status.
*
* @param base SEMA4 base pointer.
- * @param flags SEMA4 gate status mask (see _sema4_status_flag)
+ * @param flags SEMA4 gate status mask (See @ref _sema4_status_flag).
* @return SEMA4 notification status bits. If bit value is set, the corresponding
* gate's notification is available.
*/
@@ -251,9 +244,10 @@ static inline uint16_t SEMA4_GetStatusFlag(SEMA4_Type * base, uint16_t flags)
* @brief Enable or disable SEMA4 IRQ notification.
*
* @param base SEMA4 base pointer.
- * @param intMask SEMA4 gate status mask (see _sema4_status_flag)
- * @param enable Interrupt enable (true: enable, false: disable), only those gates
- * whose intMask is set will be affected.
+ * @param intMask SEMA4 gate status mask (see @ref _sema4_status_flag).
+ * @param enable Enable/Disable Sema4 interrupt, only those gates whose intMask is set are affected.
+ * - true: Enable Sema4 interrupt.
+ * - false: Disable Sema4 interrupt.
*/
void SEMA4_SetIntCmd(SEMA4_Type * base, uint16_t intMask, bool enable);
@@ -261,7 +255,7 @@ void SEMA4_SetIntCmd(SEMA4_Type * base, uint16_t intMask, bool enable);
* @brief check whether SEMA4 IRQ notification enabled.
*
* @param base SEMA4 base pointer.
- * @param flags SEMA4 gate status mask (see _sema4_status_flag)
+ * @param flags SEMA4 gate status mask (see @ref _sema4_status_flag).
* @return SEMA4 notification interrupt enable status bits. If bit value is set,
* the corresponding gate's notification is enabled
*/