DAC driver improvement.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7975 35acf78f-673a-0410-8e92-d51de3d6d3f4
master
Giovanni Di Sirio 2015-05-13 09:25:53 +00:00
parent e294750f06
commit e4b3c5cdde
3 changed files with 7 additions and 26 deletions

View File

@ -239,10 +239,7 @@ extern "C" {
void dacObjectInit(DACDriver *dacp);
void dacStart(DACDriver *dacp, const DACConfig *config);
void dacStop(DACDriver *dacp);
void dacPutChannel(DACDriver *dacp,
dacchannel_t channel,
dacsample_t sample);
void dacPutChannelI(DACDriver *dacp,
void dacPutChannelX(DACDriver *dacp,
dacchannel_t channel,
dacsample_t sample);
void dacStartConversion(DACDriver *dacp, const DACConversionGroup *grpp,

View File

@ -437,14 +437,14 @@ void dac_lld_start_conversion(DACDriver *dacp) {
#endif
default:
chDbgAssert(false, "unexpected DAC mode");
break;
return;
}
dmaStreamSetMemory0(dacp->params->dma, dacp->samples);
dmaStreamSetTransactionSize(dacp->params->dma, n);
dmaStreamSetMode(dacp->params->dma, dmamode |
STM32_DMA_CR_DMEIE | STM32_DMA_CR_TEIE |
STM32_DMA_CR_HTIE | STM32_DMA_CR_TCIE);
dmaStreamSetMode(dacp->params->dma, dmamode |
STM32_DMA_CR_DMEIE | STM32_DMA_CR_TEIE |
STM32_DMA_CR_HTIE | STM32_DMA_CR_TCIE);
dmaStreamEnable(dacp->params->dma);
/* DAC configuration.*/

View File

@ -137,25 +137,9 @@ void dacStop(DACDriver *dacp) {
* @param[in] channel DAC channel number
* @param[in] sample value to be output
*
* @api
* @xclass
*/
void dacPutChannel(DACDriver *dacp, dacchannel_t channel, dacsample_t sample) {
osalSysLock();
dacPutChannelI(dacp, channel, sample);
osalSysUnlock();
}
/**
* @brief Outputs a value directly on a DAC channel.
*
* @param[in] dacp pointer to the @p DACDriver object
* @param[in] channel DAC channel number
* @param[in] sample value to be output
*
* @iclass
*/
void dacPutChannelI(DACDriver *dacp, dacchannel_t channel, dacsample_t sample) {
void dacPutChannelX(DACDriver *dacp, dacchannel_t channel, dacsample_t sample) {
osalDbgCheckClassI();
osalDbgCheck(channel < DAC_MAX_CHANNELS);