/* This routine waits for the TX holding register or TX FIFO to be ready and then it writes a character to the data register.  */
static void apbuart_poll_out(const struct device *dev, unsigned char x)
/* This routine waits for the TX holding register or TX FIFO to be ready and then it writes a character to the data register.  */
static void apbuart_poll_out(const struct device *dev, unsigned char x)
{
	const struct apbuart_dev_cfg *config = dev->config;
	struct apbuart_dev_data *data = dev->data;
	volatile struct apbuart_regs *regs = (void *) config->regs;
	if (data->usefifo) {
		while (regs->status & APBUART_STATUS_TF) {
			;
		}
	} else {
		while (!(regs->status & APBUART_STATUS_HOLD_REGISTER_EMPTY)) {
			;
		}
	}
	regs->data = x & 0xff;
}