EICU. Cosmetical cleanup

This commit is contained in:
barthess 2015-03-03 22:43:25 +03:00
parent 35c48df910
commit e75668f53b
2 changed files with 40 additions and 9 deletions

View File

@ -128,11 +128,12 @@ EICUDriver EICUD12;
/* Driver local functions. */ /* Driver local functions. */
/*===========================================================================*/ /*===========================================================================*/
/** /**
* @brief Returns the time between latest 2 capture events. * @brief Returns both pulse width and period.
* @details The time is defined as number of ticks. * @details The time is defined as number of ticks.
* *
* @param[in] eicup Pointer to the EICUDriver object. * @param[in] eicup Pointer to the EICUDriver object.
* @param[in] channel The timer channel that fired the interrupt. * @param[in] channel The timer channel that fired the interrupt.
* @param[in] compare Content of the CCR register.
* @return The number of ticks. * @return The number of ticks.
* *
* @notapi * @notapi
@ -172,7 +173,15 @@ static eicuresult_t get_time_both(EICUDriver *eicup,
} }
/** /**
* @brief Returns pulse width.
* @details The time is defined as number of ticks.
* *
* @param[in] eicup Pointer to the EICUDriver object.
* @param[in] channel The timer channel that fired the interrupt.
* @param[in] compare Content of the CCR register.
* @return The number of ticks.
*
* @notapi
*/ */
static eicucnt_t get_time_width(EICUDriver *eicup, static eicucnt_t get_time_width(EICUDriver *eicup,
eicuchannel_t channel, eicuchannel_t channel,
@ -202,7 +211,15 @@ static eicucnt_t get_time_width(EICUDriver *eicup,
} }
/** /**
* @brief Returns both pulse period.
* @details The time is defined as number of ticks.
* *
* @param[in] eicup Pointer to the EICUDriver object.
* @param[in] channel The timer channel that fired the interrupt.
* @param[in] compare Content of the CCR register.
* @return The number of ticks.
*
* @notapi
*/ */
static eicucnt_t get_time_period(EICUDriver *eicup, static eicucnt_t get_time_period(EICUDriver *eicup,
eicuchannel_t channel, eicuchannel_t channel,
@ -285,7 +302,7 @@ static void isr_invoke_edge_cb(EICUDriver *eicup, eicuchannel_t channel) {
} }
/** /**
* @brief Common ISR call. * @brief Common EICU detect call.
* *
* @param[in] eicup Pointer to the @p EICUDriver object * @param[in] eicup Pointer to the @p EICUDriver object
* @param[in] channel The timer channel that fired the interrupt. * @param[in] channel The timer channel that fired the interrupt.
@ -327,9 +344,11 @@ static void eicu_lld_serve_interrupt(EICUDriver *eicup) {
} }
/** /**
* @brief Starts every channel.
* *
* @param[in] eicup Pointer to the @p EICUDriver object
*/ */
static void eicu_channels_start(EICUDriver *eicup) { static void start_channels(EICUDriver *eicup) {
/* Set each input channel that is used as: a normal input capture channel, /* Set each input channel that is used as: a normal input capture channel,
link the corresponding CCR register and set polarity. */ link the corresponding CCR register and set polarity. */
@ -827,7 +846,7 @@ void eicu_lld_start(EICUDriver *eicup) {
} }
#endif #endif
eicu_channels_start(eicup); start_channels(eicup);
} }
/** /**

View File

@ -256,17 +256,29 @@
* @brief Active level selector. * @brief Active level selector.
*/ */
typedef enum { typedef enum {
EICU_INPUT_ACTIVE_HIGH = 0, /**< Trigger on rising edge. */ EICU_INPUT_ACTIVE_HIGH, /**< Trigger on rising edge. */
EICU_INPUT_ACTIVE_LOW = 1, /**< Trigger on falling edge. */ EICU_INPUT_ACTIVE_LOW, /**< Trigger on falling edge. */
} eicuactivelevel_t; } eicuactivelevel_t;
/** /**
* @brief Input type selector. * @brief Input type selector.
*/ */
typedef enum { typedef enum {
EICU_INPUT_EDGE = 0, /**< Measures time between consequent edges.*/ /**
EICU_INPUT_PULSE = 1, /**< Measures pulse width.*/ * @brief Measures time between consequent edges.
EICU_INPUT_BOTH = 2 /**< Measures both period and width. */ * @details Callback fires on every _active_ edge.
*/
EICU_INPUT_EDGE,
/**
* @brief Measures pulse width.
* @details Callback fires on _idle_ edge of pulse.
*/
EICU_INPUT_PULSE,
/**
* @brief Measures both period and width..
* @details Callback fires on _active_ edge of pulse.
*/
EICU_INPUT_BOTH
} eicucapturemode_t; } eicucapturemode_t;
/** /**