meh

Fork of mbed by mbed official

Committer:
Kojto
Date:
Tue Mar 17 14:27:45 2015 +0000
Revision:
96:487b796308b0
Parent:
92:4fc01daae5a5
Release 96 of the mbed library

Changes:
- IAR support for ble boards, lpc, ethernet stack
- RTC - attach function to redirect time functions
- Nucleo F103RB - cube driver
- k20xx - fixes for teensy and k20 platforms in sleep/deepsleep and usb
- STM32L0, Nucleo/Disco L053 - refactoring

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bogdanm 84:0b3ab51c8877 1 /**
bogdanm 84:0b3ab51c8877 2 ******************************************************************************
bogdanm 84:0b3ab51c8877 3 * @file stm32l0xx_hal_dac_ex.h
bogdanm 84:0b3ab51c8877 4 * @author MCD Application Team
Kojto 96:487b796308b0 5 * @version V1.2.0
Kojto 96:487b796308b0 6 * @date 06-February-2015
Kojto 96:487b796308b0 7 * @brief Header file of DAC HAL Extension module.
bogdanm 84:0b3ab51c8877 8 ******************************************************************************
bogdanm 84:0b3ab51c8877 9 * @attention
bogdanm 84:0b3ab51c8877 10 *
Kojto 96:487b796308b0 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
bogdanm 84:0b3ab51c8877 12 *
bogdanm 84:0b3ab51c8877 13 * Redistribution and use in source and binary forms, with or without modification,
bogdanm 84:0b3ab51c8877 14 * are permitted provided that the following conditions are met:
bogdanm 84:0b3ab51c8877 15 * 1. Redistributions of source code must retain the above copyright notice,
bogdanm 84:0b3ab51c8877 16 * this list of conditions and the following disclaimer.
bogdanm 84:0b3ab51c8877 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
bogdanm 84:0b3ab51c8877 18 * this list of conditions and the following disclaimer in the documentation
bogdanm 84:0b3ab51c8877 19 * and/or other materials provided with the distribution.
bogdanm 84:0b3ab51c8877 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
bogdanm 84:0b3ab51c8877 21 * may be used to endorse or promote products derived from this software
bogdanm 84:0b3ab51c8877 22 * without specific prior written permission.
bogdanm 84:0b3ab51c8877 23 *
bogdanm 84:0b3ab51c8877 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
bogdanm 84:0b3ab51c8877 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
bogdanm 84:0b3ab51c8877 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
bogdanm 84:0b3ab51c8877 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
bogdanm 84:0b3ab51c8877 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
bogdanm 84:0b3ab51c8877 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
bogdanm 84:0b3ab51c8877 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
bogdanm 84:0b3ab51c8877 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
bogdanm 84:0b3ab51c8877 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
bogdanm 84:0b3ab51c8877 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
bogdanm 84:0b3ab51c8877 34 *
bogdanm 84:0b3ab51c8877 35 ******************************************************************************
bogdanm 84:0b3ab51c8877 36 */
bogdanm 84:0b3ab51c8877 37
bogdanm 84:0b3ab51c8877 38 /* Define to prevent recursive inclusion -------------------------------------*/
bogdanm 84:0b3ab51c8877 39 #ifndef __STM32L0xx_HAL_DAC_EX_H
bogdanm 84:0b3ab51c8877 40 #define __STM32L0xx_HAL_DAC_EX_H
bogdanm 84:0b3ab51c8877 41
bogdanm 84:0b3ab51c8877 42 #ifdef __cplusplus
bogdanm 84:0b3ab51c8877 43 extern "C" {
bogdanm 84:0b3ab51c8877 44 #endif
bogdanm 84:0b3ab51c8877 45
Kojto 96:487b796308b0 46 #if !defined (STM32L031xx) && !defined (STM32L041xx) && !defined (STM32L051xx) && !defined (STM32L061xx) && !defined (STM32L071xx) && !defined (STM32L081xx)
bogdanm 84:0b3ab51c8877 47
bogdanm 84:0b3ab51c8877 48 /* Includes ------------------------------------------------------------------*/
bogdanm 84:0b3ab51c8877 49 #include "stm32l0xx_hal_def.h"
bogdanm 84:0b3ab51c8877 50
bogdanm 84:0b3ab51c8877 51 /** @addtogroup STM32L0xx_HAL_Driver
bogdanm 84:0b3ab51c8877 52 * @{
bogdanm 84:0b3ab51c8877 53 */
bogdanm 84:0b3ab51c8877 54
bogdanm 84:0b3ab51c8877 55 /** @addtogroup DACEx
bogdanm 84:0b3ab51c8877 56 * @{
bogdanm 84:0b3ab51c8877 57 */
bogdanm 84:0b3ab51c8877 58
bogdanm 84:0b3ab51c8877 59 /* Exported types ------------------------------------------------------------*/
bogdanm 84:0b3ab51c8877 60
bogdanm 84:0b3ab51c8877 61 /* Exported constants --------------------------------------------------------*/
bogdanm 84:0b3ab51c8877 62
Kojto 96:487b796308b0 63 /** @defgroup DACEx_Exported_Constants DACEx Exported Constants
bogdanm 84:0b3ab51c8877 64 * @{
Kojto 96:487b796308b0 65 */
Kojto 96:487b796308b0 66
Kojto 96:487b796308b0 67 /** @defgroup DACEx_lfsrunmask_triangleamplitude DACEx lfsrunmask triangleamplitude
bogdanm 84:0b3ab51c8877 68 * @{
bogdanm 84:0b3ab51c8877 69 */
bogdanm 84:0b3ab51c8877 70 #define DAC_LFSRUNMASK_BIT0 ((uint32_t)0x00000000) /*!< Unmask DAC channel LFSR bit0 for noise wave generation */
bogdanm 84:0b3ab51c8877 71 #define DAC_LFSRUNMASK_BITS1_0 ((uint32_t)DAC_CR_MAMP1_0) /*!< Unmask DAC channel LFSR bit[1:0] for noise wave generation */
bogdanm 84:0b3ab51c8877 72 #define DAC_LFSRUNMASK_BITS2_0 ((uint32_t)DAC_CR_MAMP1_1) /*!< Unmask DAC channel LFSR bit[2:0] for noise wave generation */
bogdanm 84:0b3ab51c8877 73 #define DAC_LFSRUNMASK_BITS3_0 ((uint32_t)DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0)/*!< Unmask DAC channel LFSR bit[3:0] for noise wave generation */
bogdanm 84:0b3ab51c8877 74 #define DAC_LFSRUNMASK_BITS4_0 ((uint32_t)DAC_CR_MAMP1_2) /*!< Unmask DAC channel LFSR bit[4:0] for noise wave generation */
bogdanm 84:0b3ab51c8877 75 #define DAC_LFSRUNMASK_BITS5_0 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_0) /*!< Unmask DAC channel LFSR bit[5:0] for noise wave generation */
bogdanm 84:0b3ab51c8877 76 #define DAC_LFSRUNMASK_BITS6_0 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_1) /*!< Unmask DAC channel LFSR bit[6:0] for noise wave generation */
bogdanm 84:0b3ab51c8877 77 #define DAC_LFSRUNMASK_BITS7_0 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Unmask DAC channel LFSR bit[7:0] for noise wave generation */
bogdanm 84:0b3ab51c8877 78 #define DAC_LFSRUNMASK_BITS8_0 ((uint32_t)DAC_CR_MAMP1_3) /*!< Unmask DAC channel LFSR bit[8:0] for noise wave generation */
bogdanm 84:0b3ab51c8877 79 #define DAC_LFSRUNMASK_BITS9_0 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_0) /*!< Unmask DAC channel LFSR bit[9:0] for noise wave generation */
bogdanm 84:0b3ab51c8877 80 #define DAC_LFSRUNMASK_BITS10_0 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_1) /*!< Unmask DAC channel LFSR bit[10:0] for noise wave generation */
bogdanm 84:0b3ab51c8877 81 #define DAC_LFSRUNMASK_BITS11_0 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Unmask DAC channel LFSR bit[11:0] for noise wave generation */
bogdanm 84:0b3ab51c8877 82 #define DAC_TRIANGLEAMPLITUDE_1 ((uint32_t)0x00000000) /*!< Select max triangle amplitude of 1 */
bogdanm 84:0b3ab51c8877 83 #define DAC_TRIANGLEAMPLITUDE_3 ((uint32_t)DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 3 */
bogdanm 84:0b3ab51c8877 84 #define DAC_TRIANGLEAMPLITUDE_7 ((uint32_t)DAC_CR_MAMP1_1) /*!< Select max triangle amplitude of 7 */
bogdanm 84:0b3ab51c8877 85 #define DAC_TRIANGLEAMPLITUDE_15 ((uint32_t)DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 15 */
bogdanm 84:0b3ab51c8877 86 #define DAC_TRIANGLEAMPLITUDE_31 ((uint32_t)DAC_CR_MAMP1_2) /*!< Select max triangle amplitude of 31 */
bogdanm 84:0b3ab51c8877 87 #define DAC_TRIANGLEAMPLITUDE_63 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 63 */
bogdanm 84:0b3ab51c8877 88 #define DAC_TRIANGLEAMPLITUDE_127 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_1) /*!< Select max triangle amplitude of 127 */
bogdanm 84:0b3ab51c8877 89 #define DAC_TRIANGLEAMPLITUDE_255 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 255 */
bogdanm 84:0b3ab51c8877 90 #define DAC_TRIANGLEAMPLITUDE_511 ((uint32_t)DAC_CR_MAMP1_3) /*!< Select max triangle amplitude of 511 */
bogdanm 84:0b3ab51c8877 91 #define DAC_TRIANGLEAMPLITUDE_1023 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 1023 */
bogdanm 84:0b3ab51c8877 92 #define DAC_TRIANGLEAMPLITUDE_2047 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_1) /*!< Select max triangle amplitude of 2047 */
bogdanm 84:0b3ab51c8877 93 #define DAC_TRIANGLEAMPLITUDE_4095 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 4095 */
bogdanm 84:0b3ab51c8877 94
bogdanm 84:0b3ab51c8877 95 #define IS_DAC_LFSR_UNMASK_TRIANGLE_AMPLITUDE(VALUE) (((VALUE) == DAC_LFSRUNMASK_BIT0) || \
bogdanm 84:0b3ab51c8877 96 ((VALUE) == DAC_LFSRUNMASK_BITS1_0) || \
bogdanm 84:0b3ab51c8877 97 ((VALUE) == DAC_LFSRUNMASK_BITS2_0) || \
bogdanm 84:0b3ab51c8877 98 ((VALUE) == DAC_LFSRUNMASK_BITS3_0) || \
bogdanm 84:0b3ab51c8877 99 ((VALUE) == DAC_LFSRUNMASK_BITS4_0) || \
bogdanm 84:0b3ab51c8877 100 ((VALUE) == DAC_LFSRUNMASK_BITS5_0) || \
bogdanm 84:0b3ab51c8877 101 ((VALUE) == DAC_LFSRUNMASK_BITS6_0) || \
bogdanm 84:0b3ab51c8877 102 ((VALUE) == DAC_LFSRUNMASK_BITS7_0) || \
bogdanm 84:0b3ab51c8877 103 ((VALUE) == DAC_LFSRUNMASK_BITS8_0) || \
bogdanm 84:0b3ab51c8877 104 ((VALUE) == DAC_LFSRUNMASK_BITS9_0) || \
bogdanm 84:0b3ab51c8877 105 ((VALUE) == DAC_LFSRUNMASK_BITS10_0) || \
bogdanm 84:0b3ab51c8877 106 ((VALUE) == DAC_LFSRUNMASK_BITS11_0) || \
bogdanm 84:0b3ab51c8877 107 ((VALUE) == DAC_TRIANGLEAMPLITUDE_1) || \
bogdanm 84:0b3ab51c8877 108 ((VALUE) == DAC_TRIANGLEAMPLITUDE_3) || \
bogdanm 84:0b3ab51c8877 109 ((VALUE) == DAC_TRIANGLEAMPLITUDE_7) || \
bogdanm 84:0b3ab51c8877 110 ((VALUE) == DAC_TRIANGLEAMPLITUDE_15) || \
bogdanm 84:0b3ab51c8877 111 ((VALUE) == DAC_TRIANGLEAMPLITUDE_31) || \
bogdanm 84:0b3ab51c8877 112 ((VALUE) == DAC_TRIANGLEAMPLITUDE_63) || \
bogdanm 84:0b3ab51c8877 113 ((VALUE) == DAC_TRIANGLEAMPLITUDE_127) || \
bogdanm 84:0b3ab51c8877 114 ((VALUE) == DAC_TRIANGLEAMPLITUDE_255) || \
bogdanm 84:0b3ab51c8877 115 ((VALUE) == DAC_TRIANGLEAMPLITUDE_511) || \
bogdanm 84:0b3ab51c8877 116 ((VALUE) == DAC_TRIANGLEAMPLITUDE_1023) || \
bogdanm 84:0b3ab51c8877 117 ((VALUE) == DAC_TRIANGLEAMPLITUDE_2047) || \
bogdanm 84:0b3ab51c8877 118 ((VALUE) == DAC_TRIANGLEAMPLITUDE_4095))
bogdanm 84:0b3ab51c8877 119 /**
bogdanm 84:0b3ab51c8877 120 * @}
bogdanm 84:0b3ab51c8877 121 */
bogdanm 84:0b3ab51c8877 122
Kojto 96:487b796308b0 123
Kojto 96:487b796308b0 124 /**
Kojto 96:487b796308b0 125 * @}
Kojto 96:487b796308b0 126 */
Kojto 96:487b796308b0 127
bogdanm 84:0b3ab51c8877 128 /* Exported macro ------------------------------------------------------------*/
Kojto 96:487b796308b0 129
bogdanm 84:0b3ab51c8877 130 /* Exported functions --------------------------------------------------------*/
bogdanm 84:0b3ab51c8877 131
Kojto 96:487b796308b0 132 /** @addtogroup DACEx_Exported_Functions
Kojto 96:487b796308b0 133 * @{
Kojto 96:487b796308b0 134 */
bogdanm 84:0b3ab51c8877 135
Kojto 96:487b796308b0 136 /** @addtogroup DACEx_Exported_Functions_Group1
Kojto 96:487b796308b0 137 * @{
Kojto 96:487b796308b0 138 */
Kojto 96:487b796308b0 139 /* Extension features functions ***********************************************/
Kojto 96:487b796308b0 140 HAL_StatusTypeDef HAL_DACEx_TriangleWaveGenerate(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t Amplitude);
Kojto 96:487b796308b0 141 HAL_StatusTypeDef HAL_DACEx_NoiseWaveGenerate(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t Amplitude);
Kojto 96:487b796308b0 142
Kojto 96:487b796308b0 143 #if defined (STM32L072xx) || defined (STM32L073xx) || defined (STM32L082xx) || defined (STM32L083xx)
Kojto 96:487b796308b0 144 uint32_t HAL_DACEx_DualGetValue(DAC_HandleTypeDef* hdac);
Kojto 96:487b796308b0 145 HAL_StatusTypeDef HAL_DACEx_DualSetValue(DAC_HandleTypeDef* hdac, uint32_t Alignment, uint32_t Data1, uint32_t Data2);
Kojto 96:487b796308b0 146 void HAL_DACEx_ConvCpltCallbackCh2(DAC_HandleTypeDef* hdac);
Kojto 96:487b796308b0 147 void HAL_DACEx_ConvHalfCpltCallbackCh2(DAC_HandleTypeDef* hdac);
Kojto 96:487b796308b0 148 void HAL_DACEx_ErrorCallbackCh2(DAC_HandleTypeDef* hdac);
Kojto 96:487b796308b0 149 void HAL_DACEx_DMAUnderrunCallbackCh2(DAC_HandleTypeDef* hdac);
Kojto 96:487b796308b0 150 #endif
Kojto 96:487b796308b0 151
bogdanm 84:0b3ab51c8877 152 /**
bogdanm 84:0b3ab51c8877 153 * @}
bogdanm 84:0b3ab51c8877 154 */
bogdanm 84:0b3ab51c8877 155
bogdanm 84:0b3ab51c8877 156 /**
bogdanm 84:0b3ab51c8877 157 * @}
bogdanm 84:0b3ab51c8877 158 */
Kojto 96:487b796308b0 159
Kojto 96:487b796308b0 160 /**
Kojto 96:487b796308b0 161 * @}
Kojto 96:487b796308b0 162 */
Kojto 96:487b796308b0 163
Kojto 96:487b796308b0 164 /**
Kojto 96:487b796308b0 165 * @}
Kojto 96:487b796308b0 166 */
Kojto 96:487b796308b0 167 #endif /* STM32L031xx && STM32L041xx && !STM32L051xx && !STM32L061xx && !STM32L071xx && !STM32L081xx*/
bogdanm 84:0b3ab51c8877 168
bogdanm 84:0b3ab51c8877 169 #ifdef __cplusplus
bogdanm 84:0b3ab51c8877 170 }
bogdanm 84:0b3ab51c8877 171 #endif
bogdanm 84:0b3ab51c8877 172
Kojto 96:487b796308b0 173 #endif /*__STM32L0xx_HAL_DAC_EX_H */
bogdanm 84:0b3ab51c8877 174
bogdanm 84:0b3ab51c8877 175 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Kojto 96:487b796308b0 176