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.

TM4C1294NCPDT: Looking for code style recommendations

Part Number: TM4C1294NCPDT
Other Parts Discussed in Thread: SYSBIOS

Which code syntax do you recommend for personal firmware development? I see use of multiple forms -


driverlib:

  •     PWMPulseWidthSet()                  (pwm.c:447)

SYSBIOS:

  •     BIOS_getCpuFreq()  ✔️             (BIOS.c:91)

TivaWare(pwmled_EK_TM4C1294XL_TI):

  •     pwmLEDFxn():                             (pwmled.c:61)
  •     EK_TM4C1294XL_initPWM()    (EK_TM4C1294XL.c:441)


I use the following syntax

  •     jPWM_Init();
  •     jPWM_Add(PWM0);
  •     jPWM_Start(PWM0);
  •     jPWM_Stop(PWM0);                    /* disable channel 0               */
  •     jPWM_Stop(PWM_MODULE);    /* disable the entire module */


With 'j' denoting my code for clean simplicity. I have heard multiple opinions, what is your recommendation? I would like to follow your recommendations in possible.


  • Hello Justin,

    So TivaWare and driverlib were written before I was on the team and probably even before we set general best practices across TI, and I wouldn't recommend those. Instead I would recommend the SYSBIOS format.

    BIOS_getCpuFreq

    If you look at newer developed TI software like SimpleLink SDK, you'll see that is the general trend that is followed.

  • This is a clean answer and makes sense, thank you sharing. I appreciate the context you add here also, especially the SimpleLink note I will go check that out