| LPCOpen Platform v1.03 LPCOpen Platform for NXP LPC Microcontrollers

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
IP: DAC register block and driver
IP drivers: Common drivers used on multiple NXP devices

## Detailed Description

## Data Structures
struct | IP_DAC_001_T
| DAC register block structure. More...

## Macros
#define | DAC_VALUE(n) ((uint32_t) ((n & 0x3FF) << 6))
#define | DAC_BIAS_EN ((uint32_t) (1 << 16))
#define | DAC_CCNT_VALUE(n) ((uint32_t) (n & 0xffff))
#define | DAC_DBLBUF_ENA ((uint32_t) (1 << 1))
#define | DAC_CNT_ENA ((uint32_t) (1 << 2))
#define | DAC_DMA_ENA ((uint32_t) (1 << 3))
#define | DAC_DACCTRL_MASK ((uint32_t) (0x0F))

## Enumerations
enum | IP_DAC_CURRENT_OPT_T { DAC_MAX_UPDATE_RATE_1MHz = 0, DAC_MAX_UPDATE_RATE_400kHz }
| Current option in DAC configuration option. More...

## Functions
void | IP_DAC_Init (IP_DAC_001_T *pDAC)
| Initial DAC configuration.
void | IP_DAC_UpdateValue (IP_DAC_001_T *pDAC, uint32_t dac_value)
| Update value to DAC buffer.
void | IP_DAC_SetBias (IP_DAC_001_T *pDAC, uint32_t bias)
| Set maximum update rate for DAC.
STATIC INLINE void | IP_DAC_ConfigDAConverterControl (IP_DAC_001_T *pDAC, uint32_t dacFlags)
| Enables the DMA operation and controls DMA timer.
void | IP_DAC_SetDMATimeOut (IP_DAC_001_T *pDAC, uint32_t time_out)
| Set reload value for interrupt/DMA counter.
IntStatus | IP_DAC_GetIntStatus (IP_DAC_001_T *pDAC)
| Get status for interrupt/DMA time out.

## Macro Definition Documentation

#define DAC_BIAS_EN ((uint32_t) (1 << 16))

If this bit = 0: The settling time of the DAC is 1 microsecond max, and the maximum current is 700 microAmpere If this bit = 1: The settling time of the DAC is 2.5 microsecond and the maximum current is 350 microAmpere

Definition at line 65 of file dac_001.h.

#define DAC_CCNT_VALUE | ( |  | n | ) | ((uint32_t) (n & 0xffff))

Value to reload interrupt DMA counter

Definition at line 67 of file dac_001.h.

#define DAC_CNT_ENA ((uint32_t) (1 << 2))

DCAR Time out count enable

Definition at line 72 of file dac_001.h.

#define DAC_DACCTRL_MASK ((uint32_t) (0x0F))

DCAR DACCTRL mask bit

Definition at line 76 of file dac_001.h.

#define DAC_DBLBUF_ENA ((uint32_t) (1 << 1))

DCAR double buffering

Definition at line 70 of file dac_001.h.

#define DAC_DMA_ENA ((uint32_t) (1 << 3))

DCAR DMA access

Definition at line 74 of file dac_001.h.

#define DAC_VALUE | ( |  | n | ) | ((uint32_t) ((n & 0x3FF) << 6))

After the selected settling time after this field is written with a new VALUE, the voltage on the AOUT pin (with respect to VSSA) is VALUE/1024 � VREF

Definition at line 59 of file dac_001.h.

## Enumeration Type Documentation

enum IP_DAC_CURRENT_OPT_T

Current option in DAC configuration option.

Enumerator:

  DAC_MAX_UPDATE_RATE_1MHz | Shorter settling times and higher power consumption; allows for a maximum update rate of 1 MHz
  DAC_MAX_UPDATE_RATE_400kHz | Longer settling times and lower power consumption; allows for a maximum update rate of 400 kHz

Definition at line 81 of file dac_001.h.

## Function Documentation

STATIC INLINE void IP_DAC_ConfigDAConverterControl | ( | IP_DAC_001_T * | pDAC,
|  | uint32_t | dacFlags
| ) |  |

Enables the DMA operation and controls DMA timer.

Parameters

  pDAC | : pointer to the DAC peripheral block
  dacFlags | : An Or'ed value of the following DAC values: DAC_DBLBUF_ENA :enable/disable DACR double buffering feature DAC_CNT_ENA :enable/disable timer out counter DAC_DMA_ENA :enable/disable DMA access

Returns
  Nothing

Note
  Pass an Or'ed value of the DAC flags to enable those options.

Definition at line 125 of file dac_001.h.

IntStatus IP_DAC_GetIntStatus | ( | IP_DAC_001_T * | pDAC | ) |

Get status for interrupt/DMA time out.

Parameters

  pDAC | : pointer to the DAC peripheral block

Returns
  interrupt/DMA time out status, should be SET or RESET

Definition at line 85 of file dac_001.c.

void IP_DAC_Init | ( | IP_DAC_001_T * | pDAC | ) |

Initial DAC configuration.

             - Maximum update rate is 1MHz
             - Value to AOUT is 0

Parameters

  pDAC | : pointer to the DAC peripheral block

Returns
  Nothing

Definition at line 51 of file dac_001.c.

void IP_DAC_SetBias | ( | IP_DAC_001_T * | pDAC,
|  | uint32_t | bias
| ) |  |

Set maximum update rate for DAC.

Parameters

  pDAC | : pointer to the DAC peripheral block
  bias | : Using Bias value, should be: 0 is 1MHz 1 is 400kHz

Returns
  Nothing

Definition at line 69 of file dac_001.c.

void IP_DAC_SetDMATimeOut | ( | IP_DAC_001_T * | pDAC,
|  | uint32_t | time_out
| ) |  |

Set reload value for interrupt/DMA counter.

Parameters

  pDAC | : pointer to the DAC peripheral block
  time_out | : time out to reload for interrupt/DMA counter

Returns
  Nothing

Definition at line 79 of file dac_001.c.

void IP_DAC_UpdateValue | ( | IP_DAC_001_T * | pDAC,
|  | uint32_t | dac_value
| ) |  |

Update value to DAC buffer.

Parameters

  pDAC | : pointer to the DAC peripheral block
  dac_value | : value 10 bit to be converted to output

Returns
  Nothing

Definition at line 58 of file dac_001.c.