#define icuGetPeriod(icup) icu_lld_get_period(icup) Topic is solved

Discussions and support about ChibiOS/HAL, the MCU Hardware Abstraction Layer.
Post Reply
dotaviper
Posts: 10
Joined: Mon Sep 28, 2015 4:44 am
Has thanked: 3 times

#define icuGetPeriod(icup) icu_lld_get_period(icup)

Post by dotaviper »

there is the following description in icu.h
/**
* @brief Returns the width of the latest cycle.
* @details The cycle width is defined as number of ticks between a start
* edge and the next start edge.
* @note This function is meant to be invoked from the width capture
* callback only.
*
* @param[in] icup pointer to the @p ICUDriver object
* @return The number of ticks.
*
* @special
*/
#define icuGetPeriod(icup) icu_lld_get_period(icup)

what is the meaning of the strart edge and the next start edge?
does it means the rising edge and the next rising edge? or the falling edge and the next falling edge?
expected your reply,thanks.
User avatar
RoccoMarco
Posts: 655
Joined: Wed Apr 24, 2013 4:11 pm
Has thanked: 83 times
Been thanked: 67 times

Re: #define icuGetPeriod(icup) icu_lld_get_period(icup)

Post by RoccoMarco »

Hi,
it depends on ICU configuration. If you have set ICU channel as ICU_INPUT_ACTIVE_HIGH it measure from a rising edge to next rising edge. Otherwise (ICU_INPUT_ACTIVE_LOW) from falling edge to next falling edge. Note that this configuration impacts also on icuGetWidth().

Hence, it is much more clear talk about start edge and stop edge.
RM
Post Reply