[MAX326xx] Fixed analogout bugs.

pull/2432/head
Jeremy Brodt 2016-08-16 09:18:50 -05:00
parent 301d7f271f
commit 2fb904f25c
6 changed files with 8 additions and 8 deletions

View File

@ -103,7 +103,7 @@ typedef struct {
__IO uint8_t output_8; /* 0x0000 Write to push values to DAC output FIFO */
__IO uint16_t output_16; /* 0x0000 Write to push values to DAC output FIFO */
};
} mxc_dac_fifo_t;
} mxc_dac_fifo_regs_t;
/*
Register offsets for module DAC12.

View File

@ -103,7 +103,7 @@ typedef struct {
__IO uint8_t output_8; /* 0x0000 Write to push values to DAC output FIFO */
__IO uint16_t output_16; /* 0x0000 Write to push values to DAC output FIFO */
};
} mxc_dac_fifo_t;
} mxc_dac_fifo_regs_t;
/*
Register offsets for module DAC12.

View File

@ -47,7 +47,7 @@ void analogout_init(dac_t *obj, PinName pin)
// Set the object pointer
obj->dac = ((mxc_dac_regs_t*)MXC_DAC_GET_DAC((pin & 0x3)));
obj->dac_fifo = ((mxc_dac_fifo_t*)MXC_DAC_GET_FIFO((pin & 0x3)));
obj->dac_fifo = ((mxc_dac_fifo_regs_t*)MXC_DAC_GET_FIFO((pin & 0x3)));
obj->index = (pin & 0x3);
// Set the ADC clock to the system clock frequency
@ -142,7 +142,7 @@ void analogout_init(dac_t *obj, PinName pin)
(MXC_E_AFE_REF_VOLT_SEL_1500 << MXC_F_AFE_CTRL1_REF_ADC_VOLT_SEL_POS)));
// Disable interpolation
obj->dac->ctrl0 &= MXC_F_DAC_CTRL0_INTERP_MODE;
obj->dac->ctrl0 &= ~MXC_F_DAC_CTRL0_INTERP_MODE;
}
//******************************************************************************

View File

@ -101,7 +101,7 @@ struct dac_s {
int index;
uint16_t out;
mxc_dac_regs_t *dac;
mxc_dac_fifo_t * dac_fifo;
mxc_dac_fifo_regs_t * dac_fifo;
};
typedef struct {

View File

@ -47,7 +47,7 @@ void analogout_init(dac_t *obj, PinName pin)
// Set the object pointer
obj->dac = ((mxc_dac_regs_t*)MXC_DAC_GET_DAC((pin & 0x3)));
obj->dac_fifo = ((mxc_dac_fifo_t*)MXC_DAC_GET_FIFO((pin & 0x3)));
obj->dac_fifo = ((mxc_dac_fifo_regs_t*)MXC_DAC_GET_FIFO((pin & 0x3)));
obj->index = (pin & 0x3);
// Set the ADC clock to the system clock frequency
@ -142,7 +142,7 @@ void analogout_init(dac_t *obj, PinName pin)
(MXC_E_AFE_REF_VOLT_SEL_1500 << MXC_F_AFE_CTRL1_REF_ADC_VOLT_SEL_POS)));
// Disable interpolation
obj->dac->ctrl0 &= MXC_F_DAC_CTRL0_INTERP_MODE;
obj->dac->ctrl0 &= ~MXC_F_DAC_CTRL0_INTERP_MODE;
}
//******************************************************************************

View File

@ -101,7 +101,7 @@ struct dac_s {
int index;
uint16_t out;
mxc_dac_regs_t *dac;
mxc_dac_fifo_t * dac_fifo;
mxc_dac_fifo_regs_t * dac_fifo;
};
typedef struct {