I have recently started learning c++ to control a raspberry pi pico and i am at a roadblock, hear me out:
i need to pass a pointer to gpio_irq_callback_t (AKA "void (*gpio_irq_callback_t)(uint gpio, uint32_t event_mask)" in the Pico SDK) as a parameter
example
forgive this pseudo code :
class B(...)
(static) void B::SetButtonCallBack(unknown parameters)
{
gpio_irq_callback_t test = unknown process;
}
class A (...)
void A::ButtonCallBack(uint gpio, uint32_t events);
A::A()
{
//here if it was as i had before separating classes it would be simply
B::SetButtonCallBack(&ButtonCallback);
//I understand i need to pass a reference to the instance as well so i am assuming i need at least:
B::SetButtonCallBack(this, &ButtonCallback);
}
I have been "fighting" with copilot AI for a while but it circles back to the same answers and it looks way to complex and doesnt even compile. does this have a simple answer?