void initUART() { // 初始化UART ENABLE_UART0(); // 设置UART参数 S3C2440_UART * const uart = S3C2440_GetBase_UART(S3C2440_UART0); // FIFO enable, Tx/Rx FIFO clear uart->UFCON = 0x0; uart->UMCON = 0x0; // Normal, No parity, 1 stop, 8 bit uart->ULCON = 0x3; // tx=level, rx=edge, disable timeout int., enable rx error int. uart->UCON = 0x5; //uart->UBRDIV = get_PCLK() / (16 * 115200) - 1; uart->UBRDIV = 50000000 / (16 * 115200) - 1; int i = 0; for ( i = 0; i < 100; i++ ) ; }
void oled_setup() { INIT_UART0( UART_BAUDRATE_9K6, (UART_OPT_NO_PARITY|UART_OPT_8_BITS_PER_CHAR|UART_OPT_ONE_STOP_BIT)); ENABLE_UART0(); }