Lines Matching refs:port
35 errval_t serial_init(unsigned port, bool initialize_hw)
37 if (port >= MAX_NUM_UARTS) {
41 if ((lpaddr_t)ports[port].base == (uart_base[port] + KERNEL_OFFSET)) {
45 apm88xxxx_pc16550_t *uart = &ports[port];
46 apm88xxxx_pc16550_initialize(uart, (mackerel_addr_t)(uart_base[port] + KERNEL_OFFSET));
51 // local apm88xxxx_pc16550 struct for the port.
59 errval_t serial_early_init(unsigned port)
61 if (port >= MAX_NUM_UARTS) {
65 if ((lpaddr_t)ports[port].base == uart_base[port]) {
69 apm88xxxx_pc16550_t *uart = &ports[port];
70 apm88xxxx_pc16550_initialize(uart, (mackerel_addr_t)uart_base[port]);
74 errval_t serial_early_init_mmu_enabled(unsigned port)
76 return serial_early_init(port);
81 * \brief Prints a single character to a serial port.
83 void serial_putchar(unsigned port, char c)
85 assert(port < MAX_NUM_UARTS);
86 assert(ports[port].base != 0);
88 while(!apm88xxxx_pc16550_LSR_thre_rdf(&ports[port]));
90 apm88xxxx_pc16550_THR_thr_wrf(&ports[port], c);
94 * \brief Reads a single character from the default serial port.
97 char serial_getchar(unsigned port)
99 assert(port < MAX_NUM_UARTS);
100 assert(ports[port].base != 0);
103 while(!apm88xxxx_pc16550_LSR_dr_rdf(&ports[port]));
105 return apm88xxxx_pc16550_RBR_rbr_rdf(&ports[port]);