GPT - get current value ?

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
omcdr
Posts: 89
Joined: Wed Aug 17, 2016 3:25 pm
Has thanked: 7 times
Been thanked: 7 times

GPT - get current value ?

Post by omcdr »

In one external interrupt I'm starting GPT timer by gptStartOneShotI() function, in another one I stop GPT by gptStopTimer().
How to read current ticks(with prescaler) or ticks after stop from GPT timer ? Is there a function for it?
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: GPT - get current value ?

Post by Giovanni »

Hi,

There is not such a function, the GPT driver does not even define if the internal timer counts up or down. if you need a counter then you could use:

- Virtual timers and system time counter.
- Realtime counter if you need high resolution.

Giovanni
Post Reply