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.

Accessing a bit in a register with the "." symbol versus the "_" symbol

Other Parts Discussed in Thread: SIMPLICITI, CC2510

Is there a difference between accessing a particular bit in a register using the "." symbol versus the "_" symbol?

  • LJT

    I'm not sure I understand your question. Can you post an example of what you are referring to?

  • Martin,

    I am working with a CC2510-CC2511DK using the SimpliciTI protocol.  In the data sheet for this part, I see mention of a CLKCON register and a OSC field name.  In order to set this particular bit in the register the data sheet says CLKCON.OSC=1 or 0.  However, in the TI sample code under the following path: cc1110_cc2510_Basic_Software_Examples\ide\iar\examples\spi\spi_cc2510.eww there is example software where they refer to this field in this particular register as CLKCON_OSC.  Is there a difference?  Which one is preferred?

    Thank you,

    Jim

  • Jim

    The only difference between the two is the naming format. The data sheet uses dot to separate the register name and the bit field name while the code example uses underscore. This will always be dependent of what kind of naming format which is used in the current project.

    In the SW example you are referring to. CLKCON_OSC is a bit mask define (located in ioCCxx10_bitdef.h) ,  while in  SimpliciTI the same bit mask is named just OSC (defined in mrfi_radio.c). So you have to use the same naming format as the sw project you are working on.

    I hope this was not to confusing.