GPT callback context information Topic is solved

Discussions and support about ChibiOS/HAL, the MCU Hardware Abstraction Layer.
Post Reply
BingBang2222
Posts: 2
Joined: Fri May 27, 2016 9:48 pm
Has thanked: 1 time

GPT callback context information

Post by BingBang2222 »

Hello, I'm Vincenzo.
I'm quite experienced with C programming but I'm a newbie to ChibiOs and STM world, so I would like to say sorry in advance if I ask a n00b question. I was not able to find the answer to my question on the web nor on the docs.

I'm using the GPT driver to get a callback called at fixed intervals. I'd like to pass to this callback context information, you know, that void* pointer that you pass when register the callback function and is available between the parameters of the callback function every time it's called.

That's it, I was not able to find this mechanism in GPTDriver. Is this feature present but I cannot find it? Or is it absent? if so, is there a reason for the absence of that feature?

Thank you very much for your help,
regards,
Vincenzo
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 callback context information

Post by Giovanni »

Hi,

You can extend the GPTDriver structure using GPT_DRIVER_EXT_FIELDS, add there your parameters.

Giovanni
BingBang2222
Posts: 2
Joined: Fri May 27, 2016 9:48 pm
Has thanked: 1 time

Re: GPT callback context information

Post by BingBang2222 »

Thank you, this solved my problem!
Vincenzo
Post Reply