This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Can't find #define entry

Hello!


I started porting the embedded software on a product (which uses Stellaris) to a new Tiva MCU.

I am having some trouble finding some PCTL #defines (like GPIO_PCTL_PA0_U0RX ) for TM4C1294n. 

I could find them for TM4C123 Family, but not for TM4C1294. In fact, I could not find any GPIO_PCTL_P* #define for TM4C1294n.

Did this #define names changed? I have tried searching for the values, but I could not find equivalent names.

Thank you for reading,

  • Hello Leonardo,

    Yes, these defines have changed for TM4C devices. The correct file to look for these defines is now in the driverlib/pin_map.h

    You would have to define the correct part number for TM4C129 to get the correct PCTL value for the Pin Mux.

    Regards

    Amit

  • Hello Amit,


    Thank you for answering.

    But most defines have different logics, for example:

    The old logic was:

    GPIO_PCTL_PA0_U0RX      0x00000001

    GPIO_PCTL_PA1_U0TX      0x00000010

    GPIO_PCTL_PA2_SSI0CLK   0x00000100

    ...

    GPIO_PCTL_PB02_CCP0   0x00000001

     

    And the new one is:

    GPIO_PA0_U0RX           0x00000001

    GPIO_PA1_U0TX           0x00000401

    GPIO_PA2_U4RX           0x00000801

    ...

    PIO_PB0_U1RX           0x00010001

     

    The previous logic was "RegX = (A | B | C)", but I can't understand the new logic.

     

    I mean, does the logic really changed, or am I missing something?

    If it has really changed, is there somewhere can I find the reason why?

     

    Sorry for all the questions,

    Thank you,

  • Hello Leonrado,

    Yes, the method to apply PCTL has been changed in TivaWare, but not the logic in hardware. The new format allows for the Port, Pin and PCTL information to be made as a single define instead of just keeping the PCTL value. Secondly in the new format is much easier to bind the define to the actual part.

    Regards

    Amit

  • Hello Amit,

     

    Thank you very much!

    I could find the functions that use of the new defines on spmu298a.pdf.

     

    I just have a final question: If I have to use a function like GPIOPinConfigure() to set every pin, don't the final binary get bigger/slower?

    Thank you!

  • Hello Leonardo,

    Yes, it will get bigger in terms of the constant data. The API will still remain the same size.

    Regards

    Amit

  • Thank you Amit!