GPIOV2_WRITE_MASK
const uint32_t write_mask = GPIOV2_WRITE_MASK(pin);
WR4(sc, GPIOV2_SWPORT_DDR_REG(pin), GPIOV2_WRITE_MASK(pin) | ddr);