RTEMS 6.1-rc5
Loading...
Searching...
No Matches
Files | Data Structures | Enumerator | Variables
Dac12

Files

file  fsl_dac12.h
 

Data Structures

struct  _dac12_hardware_info
 DAC12 hardware information. More...
 
struct  dac12_config_t
 DAC12 module configuration. More...
 

Variables

dac12_fifo_size_info_t _dac12_hardware_info::fifoSizeInfo
 
uint32_t dac12_config_t::fifoWatermarkLevel
 
dac12_fifo_work_mode_t dac12_config_t::fifoWorkMode
 
dac12_reference_voltage_source_t dac12_config_t::referenceVoltageSource
 
dac12_fifo_trigger_mode_t dac12_config_t::fifoTriggerMode
 
dac12_reference_current_source_t dac12_config_t::referenceCurrentSource
 
dac12_speed_mode_t dac12_config_t::speedMode
 
bool dac12_config_t::enableAnalogBuffer
 
uint32_t dac12_config_t::currentReferenceInternalTrimValue
 

Driver version

enum  _dac12_status_flags {
  kDAC12_OverflowFlag = DAC_CR_OVFF_MASK , kDAC12_UnderflowFlag = DAC_CR_UDFF_MASK , kDAC12_WatermarkFlag = DAC_CR_WMF_MASK , kDAC12_NearlyEmptyFlag = DAC_CR_NEMPTF_MASK ,
  kDAC12_FullFlag = DAC_CR_FULLF_MASK
}
 DAC12 flags. More...
 
enum  _dac12_interrupt_enable { kDAC12_UnderOrOverflowInterruptEnable = DAC_CR_UVIE_MASK , kDAC12_WatermarkInterruptEnable = DAC_CR_WTMIE_MASK , kDAC12_NearlyEmptyInterruptEnable = DAC_CR_EMPTIE_MASK , kDAC12_FullInterruptEnable = DAC_CR_FULLIE_MASK }
 DAC12 interrupts. More...
 
enum  _dac12_fifo_size_info {
  kDAC12_FIFOSize2 = 0U , kDAC12_FIFOSize4 = 1U , kDAC12_FIFOSize8 = 2U , kDAC12_FIFOSize16 = 3U ,
  kDAC12_FIFOSize32 = 4U , kDAC12_FIFOSize64 = 5U , kDAC12_FIFOSize128 = 6U , kDAC12_FIFOSize256 = 7U
}
 DAC12 FIFO size information provided by hardware. More...
 
enum  _dac12_fifo_work_mode { kDAC12_FIFODisabled = 0U , kDAC12_FIFOWorkAsNormalMode = 1U , kDAC12_FIFOWorkAsSwingMode = 2U }
 DAC12 FIFO work mode. More...
 
enum  _dac12_reference_voltage_source { kDAC12_ReferenceVoltageSourceAlt1 = 0U , kDAC12_ReferenceVoltageSourceAlt2 = 1U }
 DAC12 reference voltage source. More...
 
enum  _dac12_fifo_trigger_mode { kDAC12_FIFOTriggerByHardwareMode = 0U , kDAC12_FIFOTriggerBySoftwareMode = 1U }
 DAC12 FIFO trigger mode. More...
 
enum  _dac12_reference_current_source { kDAC12_ReferenceCurrentSourceDisabled = 0U , kDAC12_ReferenceCurrentSourceAlt0 = 1U , kDAC12_ReferenceCurrentSourceAlt1 = 2U , kDAC12_ReferenceCurrentSourceAlt2 = 3U }
 DAC internal reference current source. More...
 
enum  _dac12_speed_mode { kDAC12_SpeedLowMode = 0U , kDAC12_SpeedMiddleMode = 1U , kDAC12_SpeedHighMode = 2U }
 DAC analog buffer speed mode for conversion. More...
 
typedef enum _dac12_fifo_size_info dac12_fifo_size_info_t
 DAC12 FIFO size information provided by hardware.
 
typedef enum _dac12_fifo_work_mode dac12_fifo_work_mode_t
 DAC12 FIFO work mode.
 
typedef enum _dac12_reference_voltage_source dac12_reference_voltage_source_t
 DAC12 reference voltage source.
 
typedef enum _dac12_fifo_trigger_mode dac12_fifo_trigger_mode_t
 DAC12 FIFO trigger mode.
 
typedef enum _dac12_reference_current_source dac12_reference_current_source_t
 DAC internal reference current source.
 
typedef enum _dac12_speed_mode dac12_speed_mode_t
 DAC analog buffer speed mode for conversion.
 
typedef struct _dac12_hardware_info dac12_hardware_info_t
 DAC12 hardware information.
 
#define FSL_DAC12_DRIVER_VERSION   (MAKE_VERSION(2, 1, 0))
 DAC12 driver version 2.1.0.
 
#define DAC12_CR_W1C_FLAGS_MASK   (DAC_CR_OVFF_MASK | DAC_CR_UDFF_MASK)
 Define "write 1 to clear" flags.
 
#define DAC12_CR_ALL_FLAGS_MASK   (DAC12_CR_W1C_FLAGS_MASK | DAC_CR_WMF_MASK | DAC_CR_NEMPTF_MASK | DAC_CR_FULLF_MASK)
 Define all the flag bits in DACx_CR register.
 

Initialization and de-initialization

void DAC12_GetHardwareInfo (DAC_Type *base, dac12_hardware_info_t *info)
 Get hardware information about this module.
 
void DAC12_Init (DAC_Type *base, const dac12_config_t *config)
 Initialize the DAC12 module.
 
void DAC12_GetDefaultConfig (dac12_config_t *config)
 Initializes the DAC12 user configuration structure.
 
void DAC12_Deinit (DAC_Type *base)
 De-initialize the DAC12 module.
 

Detailed Description

Typedef Documentation

◆ dac12_reference_current_source_t

DAC internal reference current source.

Analog module needs reference current to keep working . Such reference current can generated by IP itself, or by on-chip PMC's "reference part". If no current reference be selected, analog module can’t working normally ,even when other register can still be assigned, DAC would waste current but no function. To make the DAC work, either kDAC12_ReferenceCurrentSourceAltx should be selected.

Enumeration Type Documentation

◆ _dac12_fifo_size_info

DAC12 FIFO size information provided by hardware.

Enumerator
kDAC12_FIFOSize2 

FIFO depth is 2.

kDAC12_FIFOSize4 

FIFO depth is 4.

kDAC12_FIFOSize8 

FIFO depth is 8.

kDAC12_FIFOSize16 

FIFO depth is 16.

kDAC12_FIFOSize32 

FIFO depth is 32.

kDAC12_FIFOSize64 

FIFO depth is 64.

kDAC12_FIFOSize128 

FIFO depth is 128.

kDAC12_FIFOSize256 

FIFO depth is 256.

◆ _dac12_fifo_trigger_mode

DAC12 FIFO trigger mode.

Enumerator
kDAC12_FIFOTriggerByHardwareMode 

Buffer would be triggered by hardware.

kDAC12_FIFOTriggerBySoftwareMode 

Buffer would be triggered by software.

◆ _dac12_fifo_work_mode

DAC12 FIFO work mode.

Enumerator
kDAC12_FIFODisabled 

FIFO disabled and only one level buffer is enabled. Any data written from this buffer goes to conversion.

kDAC12_FIFOWorkAsNormalMode 

Data will first read from FIFO to buffer then go to conversion.

kDAC12_FIFOWorkAsSwingMode 

In Swing mode, the FIFO must be set up to be full. In Swing back mode, a trigger changes the read pointer to make it swing between the FIFO Full and Nearly Empty state. That is, the trigger increases the read pointer till FIFO is nearly empty and decreases the read pointer till the FIFO is full.

◆ _dac12_interrupt_enable

DAC12 interrupts.

Enumerator
kDAC12_UnderOrOverflowInterruptEnable 

Underflow and overflow interrupt enable.

kDAC12_WatermarkInterruptEnable 

Watermark interrupt enable.

kDAC12_NearlyEmptyInterruptEnable 

Nearly empty interrupt enable.

kDAC12_FullInterruptEnable 

Full interrupt enable.

◆ _dac12_reference_current_source

DAC internal reference current source.

Analog module needs reference current to keep working . Such reference current can generated by IP itself, or by on-chip PMC's "reference part". If no current reference be selected, analog module can’t working normally ,even when other register can still be assigned, DAC would waste current but no function. To make the DAC work, either kDAC12_ReferenceCurrentSourceAltx should be selected.

Enumerator
kDAC12_ReferenceCurrentSourceDisabled 

None of reference current source is enabled.

kDAC12_ReferenceCurrentSourceAlt0 

Use the internal reference current generated by the module itself.

kDAC12_ReferenceCurrentSourceAlt1 

Use the ZTC(Zero Temperature Coefficient) reference current generated by on-chip power management module.

kDAC12_ReferenceCurrentSourceAlt2 

Use the PTAT(Proportional To Absolution Temperature) reference current generated by power management module.

◆ _dac12_reference_voltage_source

DAC12 reference voltage source.

Enumerator
kDAC12_ReferenceVoltageSourceAlt1 

The DAC selects DACREF_1 as the reference voltage.

kDAC12_ReferenceVoltageSourceAlt2 

The DAC selects DACREF_2 as the reference voltage.

◆ _dac12_speed_mode

DAC analog buffer speed mode for conversion.

Enumerator
kDAC12_SpeedLowMode 

Low speed mode.

kDAC12_SpeedMiddleMode 

Middle speed mode.

kDAC12_SpeedHighMode 

High speed mode.

◆ _dac12_status_flags

DAC12 flags.

Enumerator
kDAC12_OverflowFlag 

FIFO overflow status flag, which indicates that more data has been written into FIFO than it can hold.

kDAC12_UnderflowFlag 

FIFO underflow status flag, which means that there is a new trigger after the FIFO is nearly empty.

kDAC12_WatermarkFlag 

FIFO wartermark status flag, which indicates the remaining FIFO data is less than the watermark setting.

kDAC12_NearlyEmptyFlag 

FIFO nearly empty flag, which means there is only one data remaining in FIFO.

kDAC12_FullFlag 

FIFO full status flag, which means that the FIFO read pointer equals the write pointer, as the write pointer increase.

Function Documentation

◆ DAC12_Deinit()

void DAC12_Deinit ( DAC_Type base)

De-initialize the DAC12 module.

Parameters
baseDAC12 peripheral base address.

brief De-initialize the DAC12 module.

param base DAC12 peripheral base address.

◆ DAC12_GetDefaultConfig()

void DAC12_GetDefaultConfig ( dac12_config_t config)

Initializes the DAC12 user configuration structure.

This function initializes the user configuration structure to a default value. The default values are:

config->fifoWatermarkLevel = 0U;
config->fifoWorkMode = kDAC12_FIFODisabled;
config->referenceVoltageSource = kDAC12_ReferenceVoltageSourceAlt1;
config->referenceCurrentSource = kDAC12_ReferenceCurrentSourceAlt0;
config->speedMode = false;
config->currentReferenceInternalTrimValue = 0x4;
@ kDAC12_ReferenceVoltageSourceAlt1
Definition: fsl_dac12.h:98
@ kDAC12_FIFODisabled
Definition: fsl_dac12.h:84
@ kDAC12_ReferenceCurrentSourceAlt0
Definition: fsl_dac12.h:122
@ kDAC12_SpeedLowMode
Definition: fsl_dac12.h:134
@ kDAC12_FIFOTriggerByHardwareMode
Definition: fsl_dac12.h:107
Definition: deflate.c:114
Parameters
configPointer to the configuration structure. See "dac12_config_t".

brief Initializes the DAC12 user configuration structure.

This function initializes the user configuration structure to a default value. The default values are: code config->fifoWatermarkLevel = 0U; config->fifoWorkMode = kDAC12_FIFODisabled; config->referenceVoltageSource = kDAC12_ReferenceVoltageSourceAlt1; config->fifoTriggerMode = kDAC12_FIFOTriggerByHardwareMode; config->referenceCurrentSource = kDAC12_ReferenceCurrentSourceAlt0; config->speedMode = kDAC12_SpeedLowMode; config->speedMode = false; config->currentReferenceInternalTrimValue = 0x4; endcode param config Pointer to the configuration structure. See "dac12_config_t".

◆ DAC12_GetHardwareInfo()

void DAC12_GetHardwareInfo ( DAC_Type base,
dac12_hardware_info_t info 
)

Get hardware information about this module.

Parameters
baseDAC12 peripheral base address.
infoPointer to info structure, see to dac12_hardware_info_t.

brief Get hardware information about this module.

param base DAC12 peripheral base address. param info Pointer to info structure, see to dac12_hardware_info_t.

◆ DAC12_Init()

void DAC12_Init ( DAC_Type base,
const dac12_config_t config 
)

Initialize the DAC12 module.

Parameters
baseDAC12 peripheral base address.
configPointer to configuration structure, see to dac12_config_t.

brief Initialize the DAC12 module.

param base DAC12 peripheral base address. param config Pointer to configuration structure, see to dac12_config_t.

Variable Documentation

◆ currentReferenceInternalTrimValue

uint32_t dac12_config_t::currentReferenceInternalTrimValue

Internal reference current trim value. 3-bit value is available.

◆ enableAnalogBuffer

bool dac12_config_t::enableAnalogBuffer

Enable analog buffer for high drive.

◆ fifoSizeInfo

dac12_fifo_size_info_t _dac12_hardware_info::fifoSizeInfo

The number of words in this device's DAC buffer.

◆ fifoWatermarkLevel

uint32_t dac12_config_t::fifoWatermarkLevel

FIFO's watermark, the max value can be the hardware FIFO size.

◆ fifoWorkMode

dac12_fifo_work_mode_t dac12_config_t::fifoWorkMode

FIFI's work mode about pointers.

◆ referenceCurrentSource

dac12_reference_current_source_t dac12_config_t::referenceCurrentSource

Select the trigger mode for FIFO. Select the reference current source.

◆ referenceVoltageSource

dac12_reference_voltage_source_t dac12_config_t::referenceVoltageSource

Select the reference voltage source.

◆ speedMode

dac12_speed_mode_t dac12_config_t::speedMode

Select the speed mode for conversion.