Struct problems

First off, I am fairly new to chip level programming!

I am using a SILabs C8051F330 and I am having trouble in the compilation
of some libraries that I need to use that were given by Texas Instruments to
implement a SPI interface to one of their wireless chips. Anyway, the library
uses many structures to handle the comm back and forth with their product.

An example of one is the following:

typedef struct {
    uint32_t rfChMask                : 20; ///< New dynamic RF channel mask to be used by WASPM
    uint32_t reserved0               : 12; ///< Reserved
} EHIF_CMD_NWM_SET_RF_CH_MASK_PARAM_T;

I get many errors all of this type:

ERROR C155 IN LINE 480 OF FILE_DEFS.H: 'rfChMask': char/int required for fields

Any suggestions are greatly appreciated!
Thanks

Parents
  • If the Keil C51 compiler can't handle (unsigned) long as data type for bit fields, then you haven't much options but to rewrite the code so you manually shift in the two field values into a single uint32_t variable and use that one instead.

    But the interesting thing: If C51 doesn't support uint32_t bit fields - what compile was that library written for?

Reply
  • If the Keil C51 compiler can't handle (unsigned) long as data type for bit fields, then you haven't much options but to rewrite the code so you manually shift in the two field values into a single uint32_t variable and use that one instead.

    But the interesting thing: If C51 doesn't support uint32_t bit fields - what compile was that library written for?

Children
More questions in this forum