2 * @brief LPC18xx/43xx D/A conversion driver
5 * Copyright(C) NXP Semiconductors, 2012
9 * Software that is described herein is for illustrative purposes only
10 * which provides customers with programming information regarding the
11 * LPC products. This software is supplied "AS IS" without any warranties of
12 * any kind, and NXP Semiconductors and its licensor disclaim any and
13 * all warranties, express or implied, including all implied warranties of
14 * merchantability, fitness for a particular purpose and non-infringement of
15 * intellectual property rights. NXP Semiconductors assumes no responsibility
16 * or liability for the use of the software, conveys no license or rights under any
17 * patent, copyright, mask work right, or any other intellectual property rights in
18 * or to any products. NXP Semiconductors reserves the right to make changes
19 * in the software without notification. NXP Semiconductors also makes no
20 * representation or warranty that such application will be suitable for the
21 * specified use without further testing or modification.
24 * Permission to use, copy, modify, and distribute this software and its
25 * documentation is hereby granted, under NXP Semiconductors' and its
26 * licensor's relevant copyrights in the software, without fee, provided that it
27 * is used in conjunction with NXP Semiconductors microcontrollers. This
28 * copyright, permission, and disclaimer notice must appear in all copies of
32 #ifndef __DAC_18XX_43XX_H_
33 #define __DAC_18XX_43XX_H_
39 /** @defgroup DAC_18XX_43XX CHIP: LPC18xx/43xx D/A conversion driver
40 * @ingroup CHIP_18XX_43XX_Drivers
44 // FIXME LPC_DAC_T *pDAC argument not needed for 18xx/43xx CHIP driver
47 * @brief Initial DAC configuration
48 * - Maximum current is 700 uA
49 * - Value to AOUT is 0
50 * @param pDAC : pointer to LPC_DAC_T
53 void Chip_DAC_Init(LPC_DAC_T *pDAC);
57 * @param pDAC : pointer to LPC_DAC_T
60 void Chip_DAC_DeInit(LPC_DAC_T *pDAC);
63 * @brief Update value to DAC buffer
64 * @param pDAC : pointer to LPC_DAC_T
65 * @param dac_value : value 10 bit to be converted to output
68 STATIC INLINE void Chip_DAC_UpdateValue(LPC_DAC_T *pDAC, uint32_t dac_value)
70 IP_DAC_UpdateValue(pDAC, dac_value);
74 * @brief Set maximum update rate for DAC
75 * @param pDAC : pointer to LPC_DAC_T
76 * @param bias : Using Bias value, should be:
81 STATIC INLINE void Chip_DAC_SetBias(LPC_DAC_T *pDAC, uint32_t bias)
83 IP_DAC_SetBias(pDAC, bias);
87 * @brief Enables the DMA operation and controls DMA timer
88 * @param pDAC : pointer to the DAC peripheral block
89 * @param dacFlags : An Or'ed value of the following DAC values:
90 * - DAC_DBLBUF_ENA :enable/disable DACR double buffering feature
91 * - DAC_CNT_ENA :enable/disable timer out counter
92 * - DAC_DMA_ENA :enable/disable DMA access
94 * @note Pass an Or'ed value of the DAC flags to enable those options.
96 STATIC INLINE void Chip_DAC_ConfigDAConverterControl(IP_DAC_001_T *pDAC, uint32_t dacFlags)
98 IP_DAC_ConfigDAConverterControl(pDAC, dacFlags);
102 * @brief Set reload value for interrupt/DMA counter
103 * @param pDAC : pointer to LPC_DAC_T
104 * @param time_out : time out to reload for interrupt/DMA counter
107 STATIC INLINE void Chip_DAC_SetDMATimeOut(LPC_DAC_T *pDAC, uint32_t time_out)
109 IP_DAC_SetDMATimeOut(pDAC, time_out);
113 * @brief Get status for interrupt/DMA time out
114 * @param pDAC : pointer to LPC_DAC_T
115 * @return interrupt/DMA time out status, should be SET or RESET
117 STATIC INLINE IntStatus Chip_DAC_GetIntStatus(LPC_DAC_T *pDAC)
119 return IP_DAC_GetIntStatus(pDAC);
130 #endif /* __DAC_18XX_43XX_H_ */