Forum Rule: Always post complete source code & details to reproduce any issue!
Page 4 of 4 FirstFirst ... 2 3 4
Results 76 to 78 of 78

Thread: T4 FlexIO - Looking back at my T4 beta testing library FlexIO_t4

  1. #76
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    9,574
    Sorry, sometimes this stuff can be a pain in the ...

    That is why most of my flexIO system code includes debug stuff, like:
    Code:
    		// Lets print out some of the settings and the like to get idea of state
    		#ifdef DEBUG_FlexSerial
    		Serial.printf("CCM_CDCDR: %x\n", CCM_CDCDR);
    		Serial.printf("VERID:%x PARAM:%x CTRL:%x PIN: %x\n", p->VERID, p->PARAM, p->CTRL, p->PIN);
    		Serial.printf("SHIFTSTAT:%x SHIFTERR=%x TIMSTAT=%x\n", p->SHIFTSTAT, p->SHIFTERR, p->TIMSTAT);
    		Serial.printf("SHIFTSIEN:%x SHIFTEIEN=%x TIMIEN=%x\n", p->SHIFTSIEN, p->SHIFTEIEN, p->TIMIEN);
    		Serial.printf("SHIFTSDEN:%x SHIFTSTATE=%x\n", p->SHIFTSDEN, p->SHIFTSTATE);
    		Serial.printf("SHIFTCTL:%x %x %x %x\n", p->SHIFTCTL[0], p->SHIFTCTL[1], p->SHIFTCTL[2], p->SHIFTCTL[3]);
    		Serial.printf("SHIFTCFG:%x %x %x %x\n", p->SHIFTCFG[0], p->SHIFTCFG[1], p->SHIFTCFG[2], p->SHIFTCFG[3]);
    		Serial.printf("TIMCTL:%x %x %x %x\n", p->TIMCTL[0], p->TIMCTL[1], p->TIMCTL[2], p->TIMCTL[3]);
    		Serial.printf("TIMCFG:%x %x %x %x\n", p->TIMCFG[0], p->TIMCFG[1], p->TIMCFG[2], p->TIMCFG[3]);
    		Serial.printf("TIMCMP:%x %x %x %x\n", p->TIMCMP[0], p->TIMCMP[1], p->TIMCMP[2], p->TIMCMP[3]);
    So that I can go through and look at the actual state of each of the registers.

    It looked like you setup the interrupt vector and enabled it... So something should be called

    But also part of the flexio_t4 code is a function addIOHandlerCallback.... which sets up the ISR with it's own IRQ handler where you could setup callbacks for different timers...

    Beyond that I am not sure.

  2. #77
    Senior Member
    Join Date
    Oct 2019
    Posts
    238
    Quote Originally Posted by KurtE View Post
    But also part of the flexio_t4 code is a function addIOHandlerCallback.... which sets up the ISR with it's own IRQ handler where you could setup callbacks for different timers...
    I was hoping to try this, but couldn't find a code example of it.
    My interpretation was I setup my own callback function, and pass it in addIOHandlerCallback() - it gets called based on whichever interrupts I enabled on the relevant instance (timer interrupt, shifter interrupt or error interrup).
    But talking another look, Im not sure that's the way to do it.

  3. #78
    Senior Member
    Join Date
    Oct 2019
    Posts
    238
    @KurtE been trying to register a callback with addIOHandlerCallback but to no avail.
    I created a callback handler:
    Code:
    FlexIOHandlerCallback *cb;
    I pass cb to addIOHandlerCallback
    Code:
    addIOHandlerCallback(cb);
    I have my own callback function,
    Code:
    bool myCB(){
    return true;
    }
    But how to I assign myCB to the callback handler cb?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •