예제 #1
0
파일: dac_lld.c 프로젝트: ISMER/ChibiOS-RT
/**
 * @brief   DAC DMA interrupt function.
 *
 * @param[in] dacp      pointer to the @p DACDriver object
 * @param[in] flags     dma error flags
 */
static void dac_serve_dma_interrupt(DACDriver *dacp, uint32_t flags) {

  if ((flags & (1 << LPC17xx_DAC_DMA_CHANNEL)) != 0) {
    _dac_isr_error_code(dacp, flags);  /* DMA errors handling.*/
  }
  else {
    if (dacp->half_buffer == false) {
      _dac_isr_half_code(dacp);
      dacp->half_buffer = true;
    }
    else {
      _dac_isr_full_code(dacp);
      dacp->half_buffer = false;
    }
  }
}
예제 #2
0
/**
 * @brief   Shared end/half-of-tx service routine.
 *
 * @param[in] dacp      pointer to the @p DACDriver object
 * @param[in] flags     pre-shifted content of the ISR register
 */
static void dac_lld_serve_tx_interrupt(DACDriver *dacp, uint32_t flags) {

  if ((flags & (STM32_DMA_ISR_TEIF | STM32_DMA_ISR_DMEIF)) != 0) {
    /* DMA errors handling.*/
    _dac_isr_error_code(dacp, DAC_ERR_DMAFAILURE);
  }
  else {
    if ((flags & STM32_DMA_ISR_HTIF) != 0) {
      /* Half transfer processing.*/
      _dac_isr_half_code(dacp);
    }
    if ((flags & STM32_DMA_ISR_TCIF) != 0) {
      /* Transfer complete processing.*/
      _dac_isr_full_code(dacp);
    }
  }
}