Help > Software > The <platform.h> Library for C.impl > I/O Ports
I/O Ports

Ports are accessed as regular read/write operations in the memory map. The library contains predefined constants for the base address of each port register, as well as constants referring to offset from the base for registers related to the port.

Thus for example, writing 0xFF into the PIC32’s LATB register will be expressed as *(BASEB + LATA) = 0xFF;

As another example, clearing the specific bit RA0 would be *(BASEA + LATCLR) = BIT(0);

Referring to invalid port numbers in C.impl may cause unexpected system behaviour.