/* Cancels ongoing read/write operation. 
Cancels the ongoing read/write operation modifying parameters in the USART software struct. */
void usart_abort_job(struct usart_module *const module, enum usart_transceiver_type transceiver_type)
/* Cancels ongoing read/write operation. 
Cancels the ongoing read/write operation modifying parameters in the USART software struct. */
void usart_abort_job(struct usart_module *const module, enum usart_transceiver_type transceiver_type)
{
	Assert(module);
	Assert(module->hw);
	SercomUsart *const usart_hw = &(module->hw->USART);
	switch(transceiver_type) {
		case USART_TRANSCEIVER_RX:
			usart_hw->INTFLAG.reg = SERCOM_USART_INTFLAG_RXC;
			module->remaining_rx_buffer_length = 0;
			break;
		case USART_TRANSCEIVER_TX:
			usart_hw->INTFLAG.reg = SERCOM_USART_INTFLAG_TXC;
			module->remaining_tx_buffer_length = 0;
			break;
	}
}