InES Hardware Abstraction Layer
Data Structures | Enumerations | Functions
hal_dac.h File Reference

Interface of module hal_dac. More...

#include "reg_stm32f4xx.h"
#include "hal_common.h"

Go to the source code of this file.

Data Structures

struct  hal_dac_init_t
 Initialization structure for digital analog converter. More...
 

Enumerations

enum  hal_dac_channel_t { HAL_DAC_CH1 = 0u, HAL_DAC_CH2 = 16u }
 Defines the channel of a DAC. More...
 
enum  hal_dac_trg_t {
  HAL_DAC_TRG_TIM6 = 0u, HAL_DAC_TRG_TIM8 = 1u, HAL_DAC_TRG_TIM7 = 2u, HAL_DAC_TRG_TIM5 = 3u,
  HAL_DAC_TRG_TIM2 = 4u, HAL_DAC_TRG_TIM4 = 5u, HAL_DAC_TRG_EXTI9 = 6u, HAL_DAC_TRG_SW = 7u
}
 Defines the available trigger inputs. More...
 

Functions

void hal_dac_reset (reg_dac_t *dac) __attribute__((deprecated("Please use DACx_RESET().")))
 Resets DAC to default values. More...
 
void hal_dac_init (reg_dac_t *dac, hal_dac_channel_t channel, hal_dac_init_t init)
 Initializes the specified digital analog converter. More...
 
void hal_dac_set_dma (reg_dac_t *dac, hal_dac_channel_t channel, hal_bool_t status)
 Enables DMA on specified DAC. More...
 

Detailed Description

Interface of module hal_dac.

The hardware abstraction layer for the digital analog converter.

$Id$

Enumeration Type Documentation

◆ hal_dac_channel_t

Defines the channel of a DAC.

Enumerator
HAL_DAC_CH1 

Channel 1.

HAL_DAC_CH2 

Channel 2.

◆ hal_dac_trg_t

Defines the available trigger inputs.

Enumerator
HAL_DAC_TRG_TIM6 

Timer 6 TRGO.

HAL_DAC_TRG_TIM8 

Timer 8 TRGO.

HAL_DAC_TRG_TIM7 

Timer 7 TRGO.

HAL_DAC_TRG_TIM5 

Timer 5 TRGO.

HAL_DAC_TRG_TIM2 

Timer 2 TRGO.

HAL_DAC_TRG_TIM4 

Timer 4 TRGO.

HAL_DAC_TRG_EXTI9 

EXTI line 9.

HAL_DAC_TRG_SW 

Software trigger.

Function Documentation

◆ hal_dac_init()

void hal_dac_init ( reg_dac_t dac,
hal_dac_channel_t  channel,
hal_dac_init_t  init 
)

Initializes the specified digital analog converter.

Parameters
dac: Defines DAC to interact with.
channel: Defines DAC channel to initialize.
init: Structure with DAC configuration.

◆ hal_dac_reset()

void hal_dac_reset ( reg_dac_t dac)

Resets DAC to default values.

Parameters
dac: Defines DAC to reset.

◆ hal_dac_set_dma()

void hal_dac_set_dma ( reg_dac_t dac,
hal_dac_channel_t  channel,
hal_bool_t  status 
)

Enables DMA on specified DAC.

Parameters
dac: Defines DAC to interact with.
channel: Defines DAC channel to interact with.
status: ENABLE/DISABLE DMA on specified DAC.