Hi guys,
I'm trying to create a UART communication by using the USB module to emulate a COM-port. I already looked in the usb_dev_serial example but i have some understanding problems.
My first question is if the example redirects the traffic from UART to the USB module and vice versa internally? Because in the example the UART pins are muxed out:
//
// Configure GPIO Pins for UART mode.
//
EALLOW;
GpioCtrlRegs.GPAMUX2.bit.GPIO28 = 1;
GpioCtrlRegs.GPAPUD.bit.GPIO28 = 0;
GpioCtrlRegs.GPAQSEL2.bit.GPIO28 = 3;
GpioCtrlRegs.GPADIR.bit.GPIO28 = 0;
GpioCtrlRegs.GPAMUX2.bit.GPIO29 = 1;
GpioCtrlRegs.GPAPUD.bit.GPIO29 = 0;
GpioCtrlRegs.GPADIR.bit.GPIO29 = 1;
EDIS;
The Problem is that these pins are already in use. Another confusion exists at the USBGPIOEnable()-function:
void USBGPIOEnable(void)
{
EALLOW;
GpioCtrlRegs.GPBLOCK.all = 0x00000000;
GpioCtrlRegs.GPBAMSEL.bit.GPIO42 = 1;
GpioCtrlRegs.GPBAMSEL.bit.GPIO43 = 1;
//VBUS
GpioCtrlRegs.GPBDIR.bit.GPIO46 = 0;
//ID
GpioCtrlRegs.GPBDIR.bit.GPIO47 = 0;
GpioCtrlRegs.GPDGMUX2.bit.GPIO120 = 3;
GpioCtrlRegs.GPDMUX2.bit.GPIO120 = 3;
GpioCtrlRegs.GPDGMUX2.bit.GPIO121 = 3;
GpioCtrlRegs.GPDMUX2.bit.GPIO121 = 3;
EDIS;
}
In the function above there's talk of GPIO120 and 121 but the F28075 only got GPIOs up to 94. I also don't know what's the meaning of "ID".
Kind regards
Tom