The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
Dependents: hello SerialTestv11 SerialTestv12 Sierpinski ... more
mbed 2
This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.
Diff: TARGET_EFM32HG_STK3400/TARGET_Silicon_Labs/TARGET_EFM32/emlib/inc/em_idac.h
- Revision:
- 128:9bcdf88f62b0
- Parent:
- 113:f141b2784e32
- Child:
- 139:856d2700e60b
--- a/TARGET_EFM32HG_STK3400/TARGET_Silicon_Labs/TARGET_EFM32/emlib/inc/em_idac.h Fri Sep 30 16:49:46 2016 +0100 +++ b/TARGET_EFM32HG_STK3400/TARGET_Silicon_Labs/TARGET_EFM32/emlib/inc/em_idac.h Thu Oct 27 16:45:56 2016 +0100 @@ -1,10 +1,10 @@ /***************************************************************************//** * @file em_idac.h * @brief Current Digital to Analog Converter (IDAC) peripheral API - * @version 4.2.1 + * @version 5.0.0 ******************************************************************************* * @section License - * <b>(C) Copyright 2015 Silicon Labs, http://www.silabs.com</b> + * <b>Copyright 2016 Silicon Laboratories, Inc. http://www.silabs.com</b> ******************************************************************************* * * Permission is granted to anyone to use this software for any purpose, @@ -30,8 +30,8 @@ * ******************************************************************************/ -#ifndef __SILICON_LABS_EM_IDAC_H__ -#define __SILICON_LABS_EM_IDAC_H__ +#ifndef EM_IDAC_H +#define EM_IDAC_H #include "em_device.h" @@ -43,12 +43,38 @@ #endif /***************************************************************************//** - * @addtogroup EM_Library + * @addtogroup emlib * @{ ******************************************************************************/ /***************************************************************************//** * @addtogroup IDAC + * @brief + * Current Digital-to-Analog Converter (IDAC) Peripheral API + * + * @details + * The current digital-to-analog converter (IDAC) can source or sink a configurable + * constant current, which can be output on, or sinked from pin or ADC. The current + * is configurable with several ranges of various step sizes. The IDAC can be used + * with PRS and it can operate down to EM3. + * + * The following steps are necessary for basic operation: + * + * Clock enable: + * @include em_idac_clock_enable.c + * + * Initialize the peripheral with default settings and modify selected fields such as + * output select: + * @if DOXYDOC_P1_DEVICE + * @include em_idac_init_adc.c + * @endif + * @if DOXYDOC_P2_DEVICE + * @include em_idac_init_aport.c + * @endif + * + * Set output: + * @include em_idac_basic_usage.c + * * @{ ******************************************************************************/ @@ -195,104 +221,13 @@ ***************************** PROTOTYPES ********************************** ******************************************************************************/ -/***************************************************************************//** - * @brief - * Initialize IDAC. - * - * @details - * Initializes IDAC according to the initialization structure parameter, and - * sets the default calibration value stored in the DEVINFO structure. - * - * @note - * This function will disable the IDAC prior to configuration. - * - * @param[in] idac - * Pointer to IDAC peripheral register block. - * - * @param[in] init - * Pointer to IDAC initialization structure. - ******************************************************************************/ + void IDAC_Init(IDAC_TypeDef *idac, const IDAC_Init_TypeDef *init); - - -/***************************************************************************//** - * @brief - * Enable/disable IDAC. - * - * @param[in] idac - * Pointer to IDAC peripheral register block. - * - * @param[in] enable - * true to enable IDAC, false to disable. - ******************************************************************************/ void IDAC_Enable(IDAC_TypeDef *idac, bool enable); - - -/***************************************************************************//** - * @brief - * Reset IDAC to same state as after a HW reset. - * - * @param[in] idac - * Pointer to IDAC peripheral register block. - ******************************************************************************/ void IDAC_Reset(IDAC_TypeDef *idac); - - -/***************************************************************************//** - * @brief - * Enable/disable Minimal Output Transition mode. - * - * @param[in] idac - * Pointer to IDAC peripheral register block. - * - * @param[in] enable - * true to enable Minimal Output Transition mode, false to disable. - ******************************************************************************/ void IDAC_MinimalOutputTransitionMode(IDAC_TypeDef *idac, bool enable); - - -/***************************************************************************//** - * @brief - * Set the current range of the IDAC output. - * - * @details - * This function sets the current range of the IDAC output. The function - * also updates the IDAC calibration register (IDAC_CAL) with the default - * calibration value (from DEVINFO, factory setting) corresponding to the - * specified range. - * - * @param[in] idac - * Pointer to IDAC peripheral register block. - * - * @param[in] range - * Current range value. - ******************************************************************************/ void IDAC_RangeSet(IDAC_TypeDef *idac, const IDAC_Range_TypeDef range); - - -/***************************************************************************//** - * @brief - * Set the current step of the IDAC output. - * - * @param[in] idac - * Pointer to IDAC peripheral register block. - * - * @param[in] step - * Step value for IDAC output. Valid range is 0-31. - ******************************************************************************/ void IDAC_StepSet(IDAC_TypeDef *idac, const uint32_t step); - - -/***************************************************************************//** - * @brief - * Enable/disable the IDAC OUT pin. - * - * @param[in] idac - * Pointer to IDAC peripheral register block. - * - * @param[in] enable - * true to enable the IDAC OUT pin, false to disable. - ******************************************************************************/ void IDAC_OutEnable(IDAC_TypeDef *idac, bool enable); @@ -301,7 +236,7 @@ * @brief * Clear one or more pending IDAC interrupts. * - * @param[in] IDAC + * @param[in] idac * Pointer to IDAC peripheral register block. * * @param[in] flags @@ -318,7 +253,7 @@ * @brief * Disable one or more IDAC interrupts. * - * @param[in] IDAC + * @param[in] idac * Pointer to IDAC peripheral register block. * * @param[in] flags @@ -340,7 +275,7 @@ * enabling the interrupt. Consider using IDAC_IntClear() prior to enabling * if such a pending interrupt should be ignored. * - * @param[in] IDAC + * @param[in] idac * Pointer to IDAC peripheral register block. * * @param[in] flags @@ -360,7 +295,7 @@ * @note * The event bits are not cleared by the use of this function. * - * @param[in] IDAC + * @param[in] idac * Pointer to IDAC peripheral register block. * * @return @@ -378,7 +313,7 @@ * Get enabled and pending IDAC interrupt flags. * Useful for handling more interrupt sources in the same interrupt handler. * - * @param[in] IDAC + * @param[in] idac * Pointer to IDAC peripheral register block. * * @note @@ -409,7 +344,7 @@ * @brief * Set one or more pending IDAC interrupts from SW. * - * @param[in] IDAC + * @param[in] idac * Pointer to IDAC peripheral register block. * * @param[in] flags @@ -424,7 +359,7 @@ /** @} (end addtogroup IDAC) */ -/** @} (end addtogroup EM_Library) */ +/** @} (end addtogroup emlib) */ #ifdef __cplusplus } @@ -432,4 +367,4 @@ #endif /* defined(IDAC_COUNT) && (IDAC_COUNT > 0) */ -#endif /* __SILICON_LABS_EM_IDAC_H__ */ +#endif /* EM_IDAC_H */