Quantcast
Channel: MSP low-power microcontrollers
Viewing all articles
Browse latest Browse all 62426

Forum Post: RE: MSP432P401R: alignment errors from driverlib

$
0
0
I was talking not about MSP432 but MSP430. That code is correct, and similar logic should have been used for MSP432: void GPIO_setAsOutputPin(uint8_t selectedPort, uint16_t selectedPins) { uint16_t baseAddress = GPIO_PORT_TO_BASE[selectedPort]; // Shift by 8 if port is even (upper 8-bits) if((selectedPort & 1) ^ 1) { selectedPins <<= 8; } HWREG16(baseAddress + OFS_PASEL) &= ~selectedPins; HWREG16(baseAddress + OFS_PADIR) |= selectedPins; }

Viewing all articles
Browse latest Browse all 62426

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>