I am attempting to move some of TI's driverlib functions over to my own drivers so that the code is smaller and easier to handle. However, I am having a lot of trouble with the driverlib, specifically the eUSCI declarations. This line:
/* Disable the USCI module and clears the other bits of control register */
BITBAND_PERI(EUSCI_B_CMSIS(moduleInstance)->rCTLW0.r,UCSWRST_OFS) = 1;
is in the I2C_initMaster() function in driverlib.c. However I cannot find a declaration for the ->rCTLW0.r
segment. Is there a way around using this?
driverlib/MSP432P4xx/eusci.h
has:inc/msp432p401r.h
has:That
rXXX.r
stuff is used only in the ROM driverlib. It looks as if each register was declared as a union, probably to allow all bytes to be accessed separately. The source code of the ROM driverlib cannot ever be changed, but the source code of the driverlib that you can compile yourself (driverlib/MSP432P4xx/i2c.c
, notrom/MSP432P4xx/driverlib.c
) uses the correct declarations.(And if you don't like the CMSIS-style register accesses, use
msp432p401r_classic.h
.)