/* Aborts an ongoing job running on serializer. 
Aborts an ongoing job. */
void i2s_serializer_abort_job(struct i2s_module *const module_inst, const enum i2s_serializer serializer, const enum i2s_job_type job_type)
/* Aborts an ongoing job running on serializer. 
Aborts an ongoing job. */
void i2s_serializer_abort_job(struct i2s_module *const module_inst, const enum i2s_serializer serializer, const enum i2s_job_type job_type)
{
	Assert(module_inst);
	Assert(module_inst->hw);
	Assert(serializer < I2S_SERIALIZER_N);
	if (job_type == I2S_JOB_WRITE_BUFFER) {
		module_inst->hw->INTENCLR.reg = (I2S_INTENCLR_TXRDY0 << serializer);
		module_inst->serializer[serializer].job_status = STATUS_ABORTED;
	} else if (job_type == I2S_JOB_READ_BUFFER) {
		module_inst->hw->INTENCLR.reg = (I2S_INTENCLR_RXRDY0 << serializer);
		module_inst->serializer[serializer].job_status = STATUS_ABORTED;
	}
}