[SOLVED] Need some help deciphering how to use this esp32 declaration

I am trying to learn more about the esp32 and going through the arduino core functions
In the file esp32-hal-cpu.h there is this typedef

typedef void (* apb_change_cb_t) (void * arg, apb_change_ev_t ev_type, uint32_t old_apb, uint32_t new_apb);

I got my C book out but could not figure it out. I am getting errors when I try different things in my code

Can anyone shed some light on how it is supposed to be used (called) from my program.

/*
typedef enum { APB_BEFORE_CHANGE, APB_AFTER_CHANGE } apb_change_ev_t;
typedef void (* apb_change_cb_t)  (void * arg, apb_change_ev_t ev_type, uint32_t old_apb, uint32_t new_apb);
bool addApbChangeCallback(void * arg, apb_change_cb_t cb);
*/

#include "/home/jrm/.arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/esp32-hal-cpu.h"

apb_change_cb_t*    apbvar;
apb_change_cb_t  apbvar_val;
uint32_t old_apb, new_apb;

 
//Callback function
apb_change_cb_t myCallbackFunc(int,void){
    Serial.println("In the callback function");
}

void setup() {
  
  Serial.begin(115200);
  while(!Serial);
  
  addApbChangeCallback( NULL, myCallbackFunc);
 
  old_apb=getApbFrequency();
  if(old_apb == 80000000)
      new_apb=old_apb*2;
  else
     new_apb=old_apb;
     
 apbvar=(NULL, APB_AFTER_CHANGE, old_apb, new_apb);
 apbvar_val=*apbvar;
  
  //Serial.print("apbvar_val = "); Serial.println(apbvar);
  
  
}

void loop() {
 
}

The typedef defines type ‘apb_change_cb_t’ as a function pointer. The function pointed to returns no value and takes 4 arguments:
– a pointer to void
– a ‘apb_change_ev_t’ which itself a typedef enum
– a uint32_t
– a uint32_t
To create a variable of this type, you could do something like:

void myCallbackFunc(void * arg, apb_change_ev_t ev_type, uint32_t old_apb, uint32_t new_apb) {
 Serial.println("In the callback function");
}

apb_change_cb_t ptr = myCallbackFunc;

Thank you very much gfvalvo, karma++