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.

Header files with register bit field breakdowns?

Other Parts Discussed in Thread: TMS320F2812, HALCOGEN, TMS570LS3137, RM48L952

Does TI provide a package of header files similar to the TMS320F2812 C281x C/C++ Header Files and Peripheral Examples (including F281x). I am looking for a struct bit field breakdown for all of the registers of the TMS570LS3137 and 20216. I know that HalCoGen will provide a high level version of this.

For example, HalCoGen provides the following for the CAN peripheral CTL registers:

uint32 CTL;          /**< 0x0000: Control Register                       */

I would like something like the following:

union
{
    volatile uint32 R;
    struct {
        uint32 rsvd1:6;
        uint32 WUBA:1;
        uint32 PDR:1;
        uint32 rsvd2:3;
        uint32 DE3:1;
        uint32 DE2:1;
        uint32 DE1:1;
        uint32 IE1:1;
        volatile uint32 InitDbg:1;
        uint32 SWR:1;
        uint32 rsvd3:1;
        uint32 PMD:4;
        uint32 ABO:1;
        uint32 IDS:1;
        uint32 Test:1;
        uint32 CCE:1;
        uint32 DAR:1;
        uint32 rsvd4:1;
        uint32 EIE:1;
        uint32 SIE:1;
        uint32 IE0:1;
        uint32 Init:1;
    }
    B;
}CTL; /**< 0x0000: Control Register                       */

  • Jeremy,

    HALCoGen is our primary tool to provide headers and drivers. I don't believe we have headers with bit fields, but let me check and get back to you.

    - Hercules support

  • Any update on this?

  • Hi Jeremy,

    HALCoGen headers does not support bit definitions to adhere to MISRA-C-2004. Drivers are written in a way to address the complete registers at 32bit boundary, user software / Driver will do bit manipulation where ever necessary.  

    Regards
    Prathap

  • Hi Prathap,

    Is there any way to have HALCoGen create header files with bitfields (I do not require MISRA compliant header files)?  I find it rather shocking that TI expects the user to create the bitfields of hardware registers themselves.  I have been working with microcontrollers and embedded processors/software for over 13 years and have never once had to create bit definitions for the hardware registers for any parts I have used (even 8 bit micros with only 256 bytes of banked RAM) - the manufacturer/compiler provider has always supplied these in a header file in one form or another.  I have used micros from Atmel, Microchip, Freescale/Motorola, and Xilinx.  Please tell me TI provides these bit definitions so I don't have to spend hrs creating them from staring at the user manual.

    I really don't even need them to be generated by Halcogen.  If there exists a set of header files that provide the register and bit field definitions for a RM48L952, that would work for me.

    Thank you,

    Matt