Ejemplo n.º 1
0
static void mcux_lpsci_poll_out(struct device *dev, unsigned char c)
{
	const struct mcux_lpsci_config *config = dev->config->config_info;

	while (!(LPSCI_GetStatusFlags(config->base)
		& kLPSCI_TxDataRegEmptyFlag))
		;

	LPSCI_WriteByte(config->base, c);
}
Ejemplo n.º 2
0
static int mcux_lpsci_fifo_fill(struct device *dev, const u8_t *tx_data,
				int len)
{
	const struct mcux_lpsci_config *config = dev->config->config_info;
	u8_t num_tx = 0;

	while ((len - num_tx > 0) &&
	       (LPSCI_GetStatusFlags(config->base)
		& kLPSCI_TxDataRegEmptyFlag)) {

		LPSCI_WriteByte(config->base, tx_data[num_tx++]);
	}

	return num_tx;
}