EFR32 Mighty Gecko 12 Software Documentation  efr32mg12-doc-5.1.2
em_vdac.h File Reference

Detailed Description

Digital to Analog Converter (VDAC) peripheral API.

Version
5.1.2

License

Copyright 2016 Silicon Laboratories, Inc. http://www.silabs.com

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software.
  2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.

DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Silicon Labs has no obligation to support this Software. Silicon Labs is providing the Software "AS IS", with no express or implied warranties of any kind, including, but not limited to, any implied warranties of merchantability or fitness for any particular purpose or warranties against infringement of any proprietary rights of a third party.

Silicon Labs will not be liable for any consequential, incidental, or special damages, or any other relief, or for any claim by any third party, arising from your use of this Software.

Definition in file em_vdac.h.

#include "em_device.h"
#include "em_assert.h"
#include <stdbool.h>

Go to the source code of this file.

Data Structures

struct  VDAC_Init_TypeDef
 
struct  VDAC_InitChannel_TypeDef
 

Macros

#define VDAC_INIT_DEFAULT
 
#define VDAC_INITCHANNEL_DEFAULT
 

Enumerations

enum  VDAC_PrsSel_TypeDef {
  vdacPrsSelCh0 = _VDAC_CH0CTRL_PRSSEL_PRSCH0,
  vdacPrsSelCh1 = _VDAC_CH0CTRL_PRSSEL_PRSCH1,
  vdacPrsSelCh2 = _VDAC_CH0CTRL_PRSSEL_PRSCH2,
  vdacPrsSelCh3 = _VDAC_CH0CTRL_PRSSEL_PRSCH3,
  vdacPrsSelCh4 = _VDAC_CH0CTRL_PRSSEL_PRSCH4,
  vdacPrsSelCh5 = _VDAC_CH0CTRL_PRSSEL_PRSCH5,
  vdacPrsSelCh6 = _VDAC_CH0CTRL_PRSSEL_PRSCH6,
  vdacPrsSelCh7 = _VDAC_CH0CTRL_PRSSEL_PRSCH7,
  vdacPrsSelCh8 = _VDAC_CH0CTRL_PRSSEL_PRSCH8,
  vdacPrsSelCh9 = _VDAC_CH0CTRL_PRSSEL_PRSCH9,
  vdacPrsSelCh10 = _VDAC_CH0CTRL_PRSSEL_PRSCH10,
  vdacPrsSelCh11 = _VDAC_CH0CTRL_PRSSEL_PRSCH11
}
 
enum  VDAC_Ref_TypeDef {
  vdacRef1V25Ln = _VDAC_CTRL_REFSEL_1V25LN,
  vdacRef2V5Ln = _VDAC_CTRL_REFSEL_2V5LN,
  vdacRef1V25 = _VDAC_CTRL_REFSEL_1V25,
  vdacRef2V5 = _VDAC_CTRL_REFSEL_2V5,
  vdacRefAvdd = _VDAC_CTRL_REFSEL_VDD,
  vdacRefExtPin = _VDAC_CTRL_REFSEL_EXT
}
 
enum  VDAC_Refresh_TypeDef {
  vdacRefresh8 = _VDAC_CTRL_REFRESHPERIOD_8CYCLES,
  vdacRefresh16 = _VDAC_CTRL_REFRESHPERIOD_16CYCLES,
  vdacRefresh32 = _VDAC_CTRL_REFRESHPERIOD_32CYCLES,
  vdacRefresh64 = _VDAC_CTRL_REFRESHPERIOD_64CYCLES
}
 
enum  VDAC_TrigMode_TypeDef {
  vdacTrigModeSw = _VDAC_CH0CTRL_TRIGMODE_SW,
  vdacTrigModePrs = _VDAC_CH0CTRL_TRIGMODE_PRS,
  vdacTrigModeRefresh = _VDAC_CH0CTRL_TRIGMODE_REFRESH,
  vdacTrigModeSwPrs = _VDAC_CH0CTRL_TRIGMODE_SWPRS,
  vdacTrigModeSwRefresh = _VDAC_CH0CTRL_TRIGMODE_SWREFRESH,
  vdacTrigModeLesense = _VDAC_CH0CTRL_TRIGMODE_LESENSE
}
 

Functions

__STATIC_INLINE void VDAC_Channel0OutputSet (VDAC_TypeDef *vdac, uint32_t value)
 Set the output signal of VDAC channel 0 to a given value. More...
 
__STATIC_INLINE void VDAC_Channel1OutputSet (VDAC_TypeDef *vdac, uint32_t value)
 Set the output signal of VDAC channel 1 to a given value. More...
 
void VDAC_ChannelOutputSet (VDAC_TypeDef *vdac, unsigned int channel, uint32_t value)
 Set the output signal of a VDAC channel to a given value. More...
 
void VDAC_Enable (VDAC_TypeDef *vdac, unsigned int ch, bool enable)
 Enable/disable VDAC channel. More...
 
void VDAC_Init (VDAC_TypeDef *vdac, const VDAC_Init_TypeDef *init)
 Initialize VDAC. More...
 
void VDAC_InitChannel (VDAC_TypeDef *vdac, const VDAC_InitChannel_TypeDef *init, unsigned int ch)
 Initialize a VDAC channel. More...
 
__STATIC_INLINE void VDAC_IntClear (VDAC_TypeDef *vdac, uint32_t flags)
 Clear one or more pending VDAC interrupts. More...
 
__STATIC_INLINE void VDAC_IntDisable (VDAC_TypeDef *vdac, uint32_t flags)
 Disable one or more VDAC interrupts. More...
 
__STATIC_INLINE void VDAC_IntEnable (VDAC_TypeDef *vdac, uint32_t flags)
 Enable one or more VDAC interrupts. More...
 
__STATIC_INLINE uint32_t VDAC_IntGet (VDAC_TypeDef *vdac)
 Get pending VDAC interrupt flags. More...
 
__STATIC_INLINE uint32_t VDAC_IntGetEnabled (VDAC_TypeDef *vdac)
 Get enabled and pending VDAC interrupt flags. Useful for handling more interrupt sources in the same interrupt handler. More...
 
__STATIC_INLINE void VDAC_IntSet (VDAC_TypeDef *vdac, uint32_t flags)
 Set one or more pending VDAC interrupts from SW. More...
 
uint32_t VDAC_PrescaleCalc (uint32_t vdacFreq, bool syncMode, uint32_t hfperFreq)
 Calculate prescaler value used to determine VDAC clock. More...
 
void VDAC_Reset (VDAC_TypeDef *vdac)
 Reset VDAC to same state as after a HW reset. More...