/* Get QUAD DECODER current counter. 
Get the current counter of quad decoder, based on the given axis */
int16_t quad_decoder_get_counter(enum quad_decoder_axis qdec)
/* Get QUAD DECODER current counter. 
Get the current counter of quad decoder, based on the given axis */
int16_t quad_decoder_get_counter(enum quad_decoder_axis qdec)
{
	switch (qdec) {
	case QDEC_AXIS_X:
		return LPMCU_MISC_REGS0->QUAD_DEC0_STATUS.bit.COUNT;
	case QDEC_AXIS_Y:
		return LPMCU_MISC_REGS0->QUAD_DEC1_STATUS.bit.COUNT;
	case QDEC_AXIS_Z:
		return LPMCU_MISC_REGS0->QUAD_DEC2_STATUS.bit.COUNT;
	}
	return 0;
}