Quad Decoder Question

I was looking through the quadrature decoder example for the nRF52 and I was having trouble getting an insight into how the three libraries (driver, driver legacy, and HAL) can be used. 

For instance, I haven't a clue what "_STATIC_INLINE uint32_t nrf_qdec_reportper_to_value ( uint32_t reportper )" does after reading the documentation. Can I get some more explanation on what this function actually does, as it doesn't seem clear to me. 

thank you

Parents Reply Children
  • The ACC register is continuously updated. The ACCREAD on the other hand contains a snapshot of the register, triggered by READCLRACC or RDCLRACC task (see QDEC chapter in product specification for more detail). (In practice, this means that you can for instance get a snapshot of this register via PPI without CPU intervention, and read it at a later time when appropriate. So even if there are delays in SW due to for instance higher priority interrupts, you will still get the ACC snapshot at the time you should if you capture it via PPI).

Related