int main (void) { SystemCoreClockUpdate(); USART_init(&usart, PIO0_18, PIO0_19); USART_begin(&usart, 9600); USART_puts(&usart, "Hello.\n"); VCOM_Init(); // VCOM Initialization USB_Init(); // USB Initialization USB_Connect(TRUE); // USB Connect while (!USB_Configuration) ; // wait until USB is configured while (1) { // Loop forever VCOM_Serial2Usb(); // read serial port and initiate USB event VCOM_CheckSerialState(); VCOM_Usb2Serial(); } // end while SPI_init(&SPI0, PIO0_1, PIO0_1, PIO0_1, PIO0_2); while ( 1 ); }
void USARTSerial::begin(const uint32_t baud) { USART_init(port, pinrx, pintx); USART_begin(port, baud); }