Dear All,
I came across initial function as the below,
void UartStdOutInit(void){ CMSDK_UART2->BAUDDIV = 16; CMSDK_UART2->CTRL = 0x41; // High speed test mode, TX only CMSDK_GPIO1->ALTFUNCSET = (1<<5); return;
}
At the first time this function is called for initializing uart port.
But I can't understand what CMSDK_GPIO1->ALTFUNCSET = (1<<5); instruction do ?
CMSDK_GPIO1 is a structure CMSDK uses to access memory mapped registers for a generic GPIO device.
infocenter.arm.com/.../BABFJBFD.html
CMSDK_GPIO1->ALTFUNCSET accesses the ALTFUNCSET register and your example is setting bit 5.
Could you please let me know why does ALTFUNCSET set to bit 5?
In the example system we multiplexed the GPIO1 pin 5 with UART2 TX data. And that UART is used for stdout (i.e. printf). So we need to set this bit to allow the testbench to capture the printf output.