Subversion Repositories DashDisplay

Rev

Rev 56 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 56 Rev 61
Line 50... Line 50...
50
/* To select into literal LL_DAC_CHANNEL_x the relevant bits for:             */
50
/* To select into literal LL_DAC_CHANNEL_x the relevant bits for:             */
51
/* - channel bits position into registers CR, MCR, CCR, SHHR, SHRR            */
51
/* - channel bits position into registers CR, MCR, CCR, SHHR, SHRR            */
52
/* - channel bits position into register SWTRIG                               */
52
/* - channel bits position into register SWTRIG                               */
53
/* - channel register offset of data holding register DHRx                    */
53
/* - channel register offset of data holding register DHRx                    */
54
/* - channel register offset of data output register DORx                     */
54
/* - channel register offset of data output register DORx                     */
55
#define DAC_CR_CH1_BITOFFSET           0U    /* Position of channel bits into registers CR, MCR, CCR, SHHR, SHRR of channel 1 */
55
#define DAC_CR_CH1_BITOFFSET           0UL   /* Position of channel bits into registers
-
 
56
                                                CR, MCR, CCR, SHHR, SHRR of channel 1 */
56
#define DAC_CR_CH2_BITOFFSET           16U   /* Position of channel bits into registers CR, MCR, CCR, SHHR, SHRR of channel 2 */
57
#define DAC_CR_CH2_BITOFFSET           16UL  /* Position of channel bits into registers
-
 
58
                                                CR, MCR, CCR, SHHR, SHRR of channel 2 */
57
#define DAC_CR_CHX_BITOFFSET_MASK      (DAC_CR_CH1_BITOFFSET | DAC_CR_CH2_BITOFFSET)
59
#define DAC_CR_CHX_BITOFFSET_MASK      (DAC_CR_CH1_BITOFFSET | DAC_CR_CH2_BITOFFSET)
58
 
60
 
59
#define DAC_SWTR_CH1                   (DAC_SWTRIGR_SWTRIG1) /* Channel bit into register SWTRIGR of channel 1. */
61
#define DAC_SWTR_CH1                   (DAC_SWTRIGR_SWTRIG1) /* Channel bit into register SWTRIGR of channel 1. */
60
#define DAC_SWTR_CH2                   (DAC_SWTRIGR_SWTRIG2) /* Channel bit into register SWTRIGR of channel 2. */
62
#define DAC_SWTR_CH2                   (DAC_SWTRIGR_SWTRIG2) /* Channel bit into register SWTRIGR of channel 2. */
61
#define DAC_SWTR_CHX_MASK              (DAC_SWTR_CH1 | DAC_SWTR_CH2)
63
#define DAC_SWTR_CHX_MASK              (DAC_SWTR_CH1 | DAC_SWTR_CH2)
62
 
64
 
63
#define DAC_REG_DHR12R1_REGOFFSET      0x00000000U             /* Register DHR12Rx channel 1 taken as reference */
65
#define DAC_REG_DHR12R1_REGOFFSET      0x00000000UL            /* Register DHR12Rx channel 1 taken as reference */
64
#define DAC_REG_DHR12L1_REGOFFSET      0x00100000U             /* Register offset of DHR12Lx channel 1 versus DHR12Rx channel 1 (shifted left of 20 bits) */
66
#define DAC_REG_DHR12L1_REGOFFSET      0x00100000UL            /* Register offset of DHR12Lx channel 1 versus
-
 
67
                                                                  DHR12Rx channel 1 (shifted left of 20 bits)   */
65
#define DAC_REG_DHR8R1_REGOFFSET       0x02000000U             /* Register offset of DHR8Rx  channel 1 versus DHR12Rx channel 1 (shifted left of 24 bits) */
68
#define DAC_REG_DHR8R1_REGOFFSET       0x02000000UL            /* Register offset of DHR8Rx  channel 1 versus
-
 
69
                                                                  DHR12Rx channel 1 (shifted left of 24 bits)   */
-
 
70
 
66
#define DAC_REG_DHR12R2_REGOFFSET      0x00030000U             /* Register offset of DHR12Rx channel 2 versus DHR12Rx channel 1 (shifted left of 16 bits) */
71
#define DAC_REG_DHR12R2_REGOFFSET      0x00030000UL            /* Register offset of DHR12Rx channel 2 versus
-
 
72
                                                                  DHR12Rx channel 1 (shifted left of 16 bits)   */
67
#define DAC_REG_DHR12L2_REGOFFSET      0x00400000U             /* Register offset of DHR12Lx channel 2 versus DHR12Rx channel 1 (shifted left of 20 bits) */
73
#define DAC_REG_DHR12L2_REGOFFSET      0x00400000UL            /* Register offset of DHR12Lx channel 2 versus
-
 
74
                                                                  DHR12Rx channel 1 (shifted left of 20 bits)   */
68
#define DAC_REG_DHR8R2_REGOFFSET       0x05000000U             /* Register offset of DHR8Rx  channel 2 versus DHR12Rx channel 1 (shifted left of 24 bits) */
75
#define DAC_REG_DHR8R2_REGOFFSET       0x05000000UL            /* Register offset of DHR8Rx  channel 2 versus
-
 
76
                                                                  DHR12Rx channel 1 (shifted left of 24 bits)   */
-
 
77
 
69
#define DAC_REG_DHR12RX_REGOFFSET_MASK 0x000F0000U
78
#define DAC_REG_DHR12RX_REGOFFSET_MASK 0x000F0000UL
70
#define DAC_REG_DHR12LX_REGOFFSET_MASK 0x00F00000U
79
#define DAC_REG_DHR12LX_REGOFFSET_MASK 0x00F00000UL
71
#define DAC_REG_DHR8RX_REGOFFSET_MASK  0x0F000000U
80
#define DAC_REG_DHR8RX_REGOFFSET_MASK  0x0F000000UL
-
 
81
#define DAC_REG_DHRX_REGOFFSET_MASK    (DAC_REG_DHR12RX_REGOFFSET_MASK\
72
#define DAC_REG_DHRX_REGOFFSET_MASK    (DAC_REG_DHR12RX_REGOFFSET_MASK | DAC_REG_DHR12LX_REGOFFSET_MASK | DAC_REG_DHR8RX_REGOFFSET_MASK)
82
                                        | DAC_REG_DHR12LX_REGOFFSET_MASK | DAC_REG_DHR8RX_REGOFFSET_MASK)
73
 
83
 
74
#define DAC_REG_DOR1_REGOFFSET         0x00000000U             /* Register DORx channel 1 taken as reference */
84
#define DAC_REG_DOR1_REGOFFSET         0x00000000UL            /* Register DORx channel 1 taken as reference */
-
 
85
 
75
#define DAC_REG_DOR2_REGOFFSET         0x10000000U             /* Register offset of DORx channel 1 versus DORx channel 2 (shifted left of 28 bits) */
86
#define DAC_REG_DOR2_REGOFFSET         0x10000000UL            /* Register offset of DORx channel 1 versus
-
 
87
                                                                  DORx channel 2 (shifted left of 28 bits)   */
76
#define DAC_REG_DORX_REGOFFSET_MASK    (DAC_REG_DOR1_REGOFFSET | DAC_REG_DOR2_REGOFFSET)
88
#define DAC_REG_DORX_REGOFFSET_MASK    (DAC_REG_DOR1_REGOFFSET | DAC_REG_DOR2_REGOFFSET)
77
 
89
 
78
 
90
 
-
 
91
 
79
#define DAC_REG_DHR_REGOFFSET_MASK_POSBIT0         0x0000000FU  /* Mask of data hold registers offset (DHR12Rx, DHR12Lx, DHR8Rx, ...) when shifted to position 0 */
92
#define DAC_REG_DHR_REGOFFSET_MASK_POSBIT0         0x0000000FUL /* Mask of data hold registers offset (DHR12Rx,
-
 
93
                                                                   DHR12Lx, DHR8Rx, ...) when shifted to position 0 */
80
#define DAC_REG_DORX_REGOFFSET_MASK_POSBIT0        0x00000001U  /* Mask of DORx registers offset when shifted to position 0 */
94
#define DAC_REG_DORX_REGOFFSET_MASK_POSBIT0        0x00000001UL /* Mask of DORx registers offset when shifted
-
 
95
                                                                   to position 0                                    */
81
#define DAC_REG_SHSRX_REGOFFSET_MASK_POSBIT0       0x00000001U  /* Mask of SHSRx registers offset when shifted to position 0 */
96
#define DAC_REG_SHSRX_REGOFFSET_MASK_POSBIT0       0x00000001UL /* Mask of SHSRx registers offset when shifted
-
 
97
                                                                   to position 0                                    */
82
 
98
 
83
#define DAC_REG_DHR12RX_REGOFFSET_BITOFFSET_POS           16U   /* Position of bits register offset of DHR12Rx channel 1 or 2 versus DHR12Rx channel 1 (shifted left of 16 bits) */
99
#define DAC_REG_DHR12RX_REGOFFSET_BITOFFSET_POS           16UL  /* Position of bits register offset of DHR12Rx
-
 
100
                                                                   channel 1 or 2 versus DHR12Rx channel 1
-
 
101
                                                                   (shifted left of 16 bits)                   */
84
#define DAC_REG_DHR12LX_REGOFFSET_BITOFFSET_POS           20U   /* Position of bits register offset of DHR12Lx channel 1 or 2 versus DHR12Rx channel 1 (shifted left of 20 bits) */
102
#define DAC_REG_DHR12LX_REGOFFSET_BITOFFSET_POS           20UL  /* Position of bits register offset of DHR12Lx
-
 
103
                                                                   channel 1 or 2 versus DHR12Rx channel 1
-
 
104
                                                                   (shifted left of 20 bits)                   */
85
#define DAC_REG_DHR8RX_REGOFFSET_BITOFFSET_POS            24U   /* Position of bits register offset of DHR8Rx  channel 1 or 2 versus DHR12Rx channel 1 (shifted left of 24 bits) */
105
#define DAC_REG_DHR8RX_REGOFFSET_BITOFFSET_POS            24UL  /* Position of bits register offset of DHR8Rx
-
 
106
                                                                   channel 1 or 2 versus DHR12Rx channel 1
-
 
107
                                                                   (shifted left of 24 bits)                   */
86
#define DAC_REG_DORX_REGOFFSET_BITOFFSET_POS              28U   /* Position of bits register offset of DORx channel 1 or 2 versus DORx channel 1 (shifted left of 28 bits) */
108
#define DAC_REG_DORX_REGOFFSET_BITOFFSET_POS              28UL  /* Position of bits register offset of DORx
-
 
109
                                                                   channel 1 or 2 versus DORx channel 1
-
 
110
                                                                   (shifted left of 28 bits)                   */
87
 
111
 
88
/* DAC registers bits positions */
112
/* DAC registers bits positions */
89
#define DAC_DHR12RD_DACC2DHR_BITOFFSET_POS                DAC_DHR12RD_DACC2DHR_Pos
113
#define DAC_DHR12RD_DACC2DHR_BITOFFSET_POS                DAC_DHR12RD_DACC2DHR_Pos
90
#define DAC_DHR12LD_DACC2DHR_BITOFFSET_POS                DAC_DHR12LD_DACC2DHR_Pos
114
#define DAC_DHR12LD_DACC2DHR_BITOFFSET_POS                DAC_DHR12LD_DACC2DHR_Pos
91
#define DAC_DHR8RD_DACC2DHR_BITOFFSET_POS                 DAC_DHR8RD_DACC2DHR_Pos
115
#define DAC_DHR8RD_DACC2DHR_BITOFFSET_POS                 DAC_DHR8RD_DACC2DHR_Pos
92
 
116
 
93
/* Miscellaneous data */
117
/* Miscellaneous data */
94
#define DAC_DIGITAL_SCALE_12BITS                        4095U  /* Full-scale digital value with a resolution of 12 bits (voltage range determined by analog voltage references Vref+ and Vref-, refer to reference manual) */
118
#define DAC_DIGITAL_SCALE_12BITS                  4095UL   /* Full-scale digital value with a resolution of 12
-
 
119
                                                              bits (voltage range determined by analog voltage
-
 
120
                                                              references Vref+ and Vref-, refer to reference manual) */
95
 
121
 
96
/**
122
/**
97
  * @}
123
  * @}
98
  */
124
  */
99
 
125
 
Line 108... Line 134...
108
  *         a register from a register basis from which an offset
134
  *         a register from a register basis from which an offset
109
  *         is applied.
135
  *         is applied.
110
  * @param  __REG__ Register basis from which the offset is applied.
136
  * @param  __REG__ Register basis from which the offset is applied.
111
  * @param  __REG_OFFFSET__ Offset to be applied (unit: number of registers).
137
  * @param  __REG_OFFFSET__ Offset to be applied (unit: number of registers).
112
  * @retval Pointer to register address
138
  * @retval Pointer to register address
113
*/
139
  */
114
#define __DAC_PTR_REG_OFFSET(__REG__, __REG_OFFFSET__)                         \
140
#define __DAC_PTR_REG_OFFSET(__REG__, __REG_OFFFSET__)                         \
115
  ((uint32_t *)((uint32_t) ((uint32_t)(&(__REG__)) + ((__REG_OFFFSET__) << 2U))))
141
  ((uint32_t *)((uint32_t) ((uint32_t)(&(__REG__)) + ((__REG_OFFFSET__) << 2UL))))
116
 
142
 
117
/**
143
/**
118
  * @}
144
  * @}
119
  */
145
  */
120
 
146
 
Line 128... Line 154...
128
/**
154
/**
129
  * @brief  Structure definition of some features of DAC instance.
155
  * @brief  Structure definition of some features of DAC instance.
130
  */
156
  */
131
typedef struct
157
typedef struct
132
{
158
{
133
  uint32_t TriggerSource;               /*!< Set the conversion trigger source for the selected DAC channel: internal (SW start) or from external peripheral (timer event, external interrupt line).
159
  uint32_t TriggerSource;               /*!< Set the conversion trigger source for the selected DAC channel:
-
 
160
                                             internal (SW start) or from external peripheral
-
 
161
                                             (timer event, external interrupt line).
134
                                             This parameter can be a value of @ref DAC_LL_EC_TRIGGER_SOURCE
162
                                             This parameter can be a value of @ref DAC_LL_EC_TRIGGER_SOURCE
135
 
163
 
136
                                             This feature can be modified afterwards using unitary function @ref LL_DAC_SetTriggerSource(). */
164
                                             This feature can be modified afterwards using unitary
-
 
165
                                             function @ref LL_DAC_SetTriggerSource(). */
137
 
166
 
138
  uint32_t WaveAutoGeneration;          /*!< Set the waveform automatic generation mode for the selected DAC channel.
167
  uint32_t WaveAutoGeneration;          /*!< Set the waveform automatic generation mode for the selected DAC channel.
139
                                             This parameter can be a value of @ref DAC_LL_EC_WAVE_AUTO_GENERATION_MODE
168
                                             This parameter can be a value of @ref DAC_LL_EC_WAVE_AUTO_GENERATION_MODE
140
 
169
 
141
                                             This feature can be modified afterwards using unitary function @ref LL_DAC_SetWaveAutoGeneration(). */
170
                                             This feature can be modified afterwards using unitary
-
 
171
                                             function @ref LL_DAC_SetWaveAutoGeneration(). */
142
 
172
 
143
  uint32_t WaveAutoGenerationConfig;    /*!< Set the waveform automatic generation mode for the selected DAC channel.
173
  uint32_t WaveAutoGenerationConfig;    /*!< Set the waveform automatic generation mode for the selected DAC channel.
144
                                             If waveform automatic generation mode is set to noise, this parameter can be a value of @ref DAC_LL_EC_WAVE_NOISE_LFSR_UNMASK_BITS
174
                                             If waveform automatic generation mode is set to noise, this parameter
-
 
175
                                             can be a value of @ref DAC_LL_EC_WAVE_NOISE_LFSR_UNMASK_BITS
-
 
176
                                             If waveform automatic generation mode is set to triangle,
145
                                             If waveform automatic generation mode is set to triangle, this parameter can be a value of @ref DAC_LL_EC_WAVE_TRIANGLE_AMPLITUDE
177
                                             this parameter can be a value of @ref DAC_LL_EC_WAVE_TRIANGLE_AMPLITUDE
146
                                             @note If waveform automatic generation mode is disabled, this parameter is discarded.
178
                                             @note If waveform automatic generation mode is disabled,
-
 
179
                                              this parameter is discarded.
147
 
180
 
148
                                             This feature can be modified afterwards using unitary function @ref LL_DAC_SetWaveNoiseLFSR(), @ref LL_DAC_SetWaveTriangleAmplitude()
181
                                             This feature can be modified afterwards using unitary
-
 
182
                                             function @ref LL_DAC_SetWaveNoiseLFSR(),
-
 
183
                                             @ref LL_DAC_SetWaveTriangleAmplitude()
149
                                             depending on the wave automatic generation selected. */
184
                                             depending on the wave automatic generation selected. */
150
 
185
 
151
  uint32_t OutputBuffer;                /*!< Set the output buffer for the selected DAC channel.
186
  uint32_t OutputBuffer;                /*!< Set the output buffer for the selected DAC channel.
152
                                             This parameter can be a value of @ref DAC_LL_EC_OUTPUT_BUFFER
187
                                             This parameter can be a value of @ref DAC_LL_EC_OUTPUT_BUFFER
153
 
188
 
154
                                             This feature can be modified afterwards using unitary function @ref LL_DAC_SetOutputBuffer(). */
189
                                             This feature can be modified afterwards using unitary
155
 
-
 
-
 
190
                                             function @ref LL_DAC_SetOutputBuffer(). */
156
} LL_DAC_InitTypeDef;
191
} LL_DAC_InitTypeDef;
157
 
192
 
158
/**
193
/**
159
  * @}
194
  * @}
160
  */
195
  */
Line 172... Line 207...
172
/* DAC channel 1 flags */
207
/* DAC channel 1 flags */
173
#define LL_DAC_FLAG_DMAUDR1                (DAC_SR_DMAUDR1)   /*!< DAC channel 1 flag DMA underrun */
208
#define LL_DAC_FLAG_DMAUDR1                (DAC_SR_DMAUDR1)   /*!< DAC channel 1 flag DMA underrun */
174
 
209
 
175
/* DAC channel 2 flags */
210
/* DAC channel 2 flags */
176
#define LL_DAC_FLAG_DMAUDR2                (DAC_SR_DMAUDR2)   /*!< DAC channel 2 flag DMA underrun */
211
#define LL_DAC_FLAG_DMAUDR2                (DAC_SR_DMAUDR2)   /*!< DAC channel 2 flag DMA underrun */
-
 
212
 
177
/**
213
/**
178
  * @}
214
  * @}
179
  */
215
  */
180
 
216
 
181
/** @defgroup DAC_LL_EC_IT DAC interruptions
217
/** @defgroup DAC_LL_EC_IT DAC interruptions
182
  * @brief    IT defines which can be used with LL_DAC_ReadReg and  LL_DAC_WriteReg functions
218
  * @brief    IT defines which can be used with LL_DAC_ReadReg and  LL_DAC_WriteReg functions
183
  * @{
219
  * @{
184
  */
220
  */
185
#define LL_DAC_IT_DMAUDRIE1                (DAC_CR_DMAUDRIE1) /*!< DAC channel 1 interruption DMA underrun */
221
#define LL_DAC_IT_DMAUDRIE1                (DAC_CR_DMAUDRIE1) /*!< DAC channel 1 interruption DMA underrun */
-
 
222
 
186
#define LL_DAC_IT_DMAUDRIE2                (DAC_CR_DMAUDRIE2) /*!< DAC channel 2 interruption DMA underrun */
223
#define LL_DAC_IT_DMAUDRIE2                (DAC_CR_DMAUDRIE2) /*!< DAC channel 2 interruption DMA underrun */
-
 
224
 
187
/**
225
/**
188
  * @}
226
  * @}
189
  */
227
  */
190
 
228
 
191
/** @defgroup DAC_LL_EC_CHANNEL DAC channels
229
/** @defgroup DAC_LL_EC_CHANNEL DAC channels
192
  * @{
230
  * @{
193
  */
231
  */
194
#define LL_DAC_CHANNEL_1                   (DAC_REG_DOR1_REGOFFSET | DAC_REG_DHR12R1_REGOFFSET | DAC_REG_DHR12L1_REGOFFSET | DAC_REG_DHR8R1_REGOFFSET | DAC_CR_CH1_BITOFFSET | DAC_SWTR_CH1) /*!< DAC channel 1 */
232
#define LL_DAC_CHANNEL_1                   (DAC_REG_DOR1_REGOFFSET | DAC_REG_DHR12R1_REGOFFSET | DAC_REG_DHR12L1_REGOFFSET | DAC_REG_DHR8R1_REGOFFSET | DAC_CR_CH1_BITOFFSET | DAC_SWTR_CH1) /*!< DAC channel 1 */
-
 
233
 
195
#define LL_DAC_CHANNEL_2                   (DAC_REG_DOR2_REGOFFSET | DAC_REG_DHR12R2_REGOFFSET | DAC_REG_DHR12L2_REGOFFSET | DAC_REG_DHR8R2_REGOFFSET | DAC_CR_CH2_BITOFFSET | DAC_SWTR_CH2) /*!< DAC channel 2 */
234
#define LL_DAC_CHANNEL_2                   (DAC_REG_DOR2_REGOFFSET | DAC_REG_DHR12R2_REGOFFSET | DAC_REG_DHR12L2_REGOFFSET | DAC_REG_DHR8R2_REGOFFSET | DAC_CR_CH2_BITOFFSET | DAC_SWTR_CH2) /*!< DAC channel 2 */
-
 
235
 
196
/**
236
/**
197
  * @}
237
  * @}
198
  */
238
  */
199
 
239
 
200
/** @defgroup DAC_LL_EC_TRIGGER_SOURCE DAC trigger source
240
/** @defgroup DAC_LL_EC_TRIGGER_SOURCE DAC trigger source
201
  * @{
241
  * @{
202
  */
242
  */
203
#define LL_DAC_TRIG_SOFTWARE               (DAC_CR_TSEL1_2 | DAC_CR_TSEL1_1 | DAC_CR_TSEL1_0) /*!< DAC channel conversion trigger internal (SW start) */
243
#define LL_DAC_TRIG_SOFTWARE               (DAC_CR_TSEL1_2 | DAC_CR_TSEL1_1 | DAC_CR_TSEL1_0) /*!< DAC channel conversion trigger internal (SW start) */
204
#define LL_DAC_TRIG_EXT_TIM2_TRGO          (DAC_CR_TSEL1_2                                  ) /*!< DAC channel conversion trigger from external peripheral: TIM2 TRGO. */
244
#define LL_DAC_TRIG_EXT_TIM2_TRGO          (DAC_CR_TSEL1_2                                  ) /*!< DAC channel conversion trigger from external peripheral: TIM2 TRGO. */
205
#define LL_DAC_TRIG_EXT_TIM4_TRGO          (DAC_CR_TSEL1_2                  | DAC_CR_TSEL1_0) /*!< DAC channel conversion trigger from external peripheral: TIM4 TRGO. */
245
#define LL_DAC_TRIG_EXT_TIM4_TRGO          (DAC_CR_TSEL1_2                  | DAC_CR_TSEL1_0) /*!< DAC channel conversion trigger from external peripheral: TIM4 TRGO. */
206
#define LL_DAC_TRIG_EXT_TIM6_TRGO          0x00000000U                                        /*!< DAC channel conversion trigger from external peripheral: TIM6 TRGO. */
246
#define LL_DAC_TRIG_EXT_TIM6_TRGO          0x00000000UL                                       /*!< DAC channel conversion trigger from external peripheral: TIM6 TRGO. */
207
#define LL_DAC_TRIG_EXT_TIM7_TRGO          (                 DAC_CR_TSEL1_1                 ) /*!< DAC channel conversion trigger from external peripheral: TIM7 TRGO. */
247
#define LL_DAC_TRIG_EXT_TIM7_TRGO          (                 DAC_CR_TSEL1_1                 ) /*!< DAC channel conversion trigger from external peripheral: TIM7 TRGO. */
208
#define LL_DAC_TRIG_EXT_TIM9_TRGO          (                 DAC_CR_TSEL1_1 | DAC_CR_TSEL1_0) /*!< DAC channel conversion trigger from external peripheral: TIM15 TRGO. */
248
#define LL_DAC_TRIG_EXT_TIM9_TRGO          (                 DAC_CR_TSEL1_1 | DAC_CR_TSEL1_0) /*!< DAC channel conversion trigger from external peripheral: TIM15 TRGO. */
209
#define LL_DAC_TRIG_EXT_EXTI_LINE9         (DAC_CR_TSEL1_2 | DAC_CR_TSEL1_1                 ) /*!< DAC channel conversion trigger from external peripheral: external interrupt line 9. */
249
#define LL_DAC_TRIG_EXT_EXTI_LINE9         (DAC_CR_TSEL1_2 | DAC_CR_TSEL1_1                 ) /*!< DAC channel conversion trigger from external peripheral: external interrupt line 9. */
210
/**
250
/**
211
  * @}
251
  * @}
212
  */
252
  */
213
 
253
 
214
/** @defgroup DAC_LL_EC_WAVE_AUTO_GENERATION_MODE DAC waveform automatic generation mode
254
/** @defgroup DAC_LL_EC_WAVE_AUTO_GENERATION_MODE DAC waveform automatic generation mode
215
  * @{
255
  * @{
216
  */
256
  */
217
#define LL_DAC_WAVE_AUTO_GENERATION_NONE     0x00000000U                     /*!< DAC channel wave auto generation mode disabled. */
257
#define LL_DAC_WAVE_AUTO_GENERATION_NONE     0x00000000UL                    /*!< DAC channel wave auto generation mode disabled. */
218
#define LL_DAC_WAVE_AUTO_GENERATION_NOISE    (               DAC_CR_WAVE1_0) /*!< DAC channel wave auto generation mode enabled, set generated noise waveform. */
258
#define LL_DAC_WAVE_AUTO_GENERATION_NOISE    (               DAC_CR_WAVE1_0) /*!< DAC channel wave auto generation mode enabled, set generated noise waveform. */
219
#define LL_DAC_WAVE_AUTO_GENERATION_TRIANGLE (DAC_CR_WAVE1_1               ) /*!< DAC channel wave auto generation mode enabled, set generated triangle waveform. */
259
#define LL_DAC_WAVE_AUTO_GENERATION_TRIANGLE (DAC_CR_WAVE1_1               ) /*!< DAC channel wave auto generation mode enabled, set generated triangle waveform. */
220
/**
260
/**
221
  * @}
261
  * @}
222
  */
262
  */
223
 
263
 
224
/** @defgroup DAC_LL_EC_WAVE_NOISE_LFSR_UNMASK_BITS DAC wave generation - Noise LFSR unmask bits
264
/** @defgroup DAC_LL_EC_WAVE_NOISE_LFSR_UNMASK_BITS DAC wave generation - Noise LFSR unmask bits
225
  * @{
265
  * @{
226
  */
266
  */
227
#define LL_DAC_NOISE_LFSR_UNMASK_BIT0      0x00000000U                                                         /*!< Noise wave generation, unmask LFSR bit0, for the selected DAC channel */
267
#define LL_DAC_NOISE_LFSR_UNMASK_BIT0      0x00000000UL                                                        /*!< Noise wave generation, unmask LFSR bit0, for the selected DAC channel */
228
#define LL_DAC_NOISE_LFSR_UNMASK_BITS1_0   (                                                   DAC_CR_MAMP1_0) /*!< Noise wave generation, unmask LFSR bits[1:0], for the selected DAC channel */
268
#define LL_DAC_NOISE_LFSR_UNMASK_BITS1_0   (                                                   DAC_CR_MAMP1_0) /*!< Noise wave generation, unmask LFSR bits[1:0], for the selected DAC channel */
229
#define LL_DAC_NOISE_LFSR_UNMASK_BITS2_0   (                                  DAC_CR_MAMP1_1                 ) /*!< Noise wave generation, unmask LFSR bits[2:0], for the selected DAC channel */
269
#define LL_DAC_NOISE_LFSR_UNMASK_BITS2_0   (                                  DAC_CR_MAMP1_1                 ) /*!< Noise wave generation, unmask LFSR bits[2:0], for the selected DAC channel */
230
#define LL_DAC_NOISE_LFSR_UNMASK_BITS3_0   (                                  DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Noise wave generation, unmask LFSR bits[3:0], for the selected DAC channel */
270
#define LL_DAC_NOISE_LFSR_UNMASK_BITS3_0   (                                  DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Noise wave generation, unmask LFSR bits[3:0], for the selected DAC channel */
231
#define LL_DAC_NOISE_LFSR_UNMASK_BITS4_0   (                 DAC_CR_MAMP1_2                                  ) /*!< Noise wave generation, unmask LFSR bits[4:0], for the selected DAC channel */
271
#define LL_DAC_NOISE_LFSR_UNMASK_BITS4_0   (                 DAC_CR_MAMP1_2                                  ) /*!< Noise wave generation, unmask LFSR bits[4:0], for the selected DAC channel */
232
#define LL_DAC_NOISE_LFSR_UNMASK_BITS5_0   (                 DAC_CR_MAMP1_2                  | DAC_CR_MAMP1_0) /*!< Noise wave generation, unmask LFSR bits[5:0], for the selected DAC channel */
272
#define LL_DAC_NOISE_LFSR_UNMASK_BITS5_0   (                 DAC_CR_MAMP1_2                  | DAC_CR_MAMP1_0) /*!< Noise wave generation, unmask LFSR bits[5:0], for the selected DAC channel */
Line 241... Line 281...
241
  */
281
  */
242
 
282
 
243
/** @defgroup DAC_LL_EC_WAVE_TRIANGLE_AMPLITUDE DAC wave generation - Triangle amplitude
283
/** @defgroup DAC_LL_EC_WAVE_TRIANGLE_AMPLITUDE DAC wave generation - Triangle amplitude
244
  * @{
284
  * @{
245
  */
285
  */
246
#define LL_DAC_TRIANGLE_AMPLITUDE_1        0x00000000U                                                         /*!< Triangle wave generation, amplitude of 1 LSB of DAC output range, for the selected DAC channel */
286
#define LL_DAC_TRIANGLE_AMPLITUDE_1        0x00000000UL                                                        /*!< Triangle wave generation, amplitude of 1 LSB of DAC output range, for the selected DAC channel */
247
#define LL_DAC_TRIANGLE_AMPLITUDE_3        (                                                   DAC_CR_MAMP1_0) /*!< Triangle wave generation, amplitude of 3 LSB of DAC output range, for the selected DAC channel */
287
#define LL_DAC_TRIANGLE_AMPLITUDE_3        (                                                   DAC_CR_MAMP1_0) /*!< Triangle wave generation, amplitude of 3 LSB of DAC output range, for the selected DAC channel */
248
#define LL_DAC_TRIANGLE_AMPLITUDE_7        (                                  DAC_CR_MAMP1_1                 ) /*!< Triangle wave generation, amplitude of 7 LSB of DAC output range, for the selected DAC channel */
288
#define LL_DAC_TRIANGLE_AMPLITUDE_7        (                                  DAC_CR_MAMP1_1                 ) /*!< Triangle wave generation, amplitude of 7 LSB of DAC output range, for the selected DAC channel */
249
#define LL_DAC_TRIANGLE_AMPLITUDE_15       (                                  DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Triangle wave generation, amplitude of 15 LSB of DAC output range, for the selected DAC channel */
289
#define LL_DAC_TRIANGLE_AMPLITUDE_15       (                                  DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Triangle wave generation, amplitude of 15 LSB of DAC output range, for the selected DAC channel */
250
#define LL_DAC_TRIANGLE_AMPLITUDE_31       (                 DAC_CR_MAMP1_2                                  ) /*!< Triangle wave generation, amplitude of 31 LSB of DAC output range, for the selected DAC channel */
290
#define LL_DAC_TRIANGLE_AMPLITUDE_31       (                 DAC_CR_MAMP1_2                                  ) /*!< Triangle wave generation, amplitude of 31 LSB of DAC output range, for the selected DAC channel */
251
#define LL_DAC_TRIANGLE_AMPLITUDE_63       (                 DAC_CR_MAMP1_2                  | DAC_CR_MAMP1_0) /*!< Triangle wave generation, amplitude of 63 LSB of DAC output range, for the selected DAC channel */
291
#define LL_DAC_TRIANGLE_AMPLITUDE_63       (                 DAC_CR_MAMP1_2                  | DAC_CR_MAMP1_0) /*!< Triangle wave generation, amplitude of 63 LSB of DAC output range, for the selected DAC channel */
Line 260... Line 300...
260
  */
300
  */
261
 
301
 
262
/** @defgroup DAC_LL_EC_OUTPUT_BUFFER DAC channel output buffer
302
/** @defgroup DAC_LL_EC_OUTPUT_BUFFER DAC channel output buffer
263
  * @{
303
  * @{
264
  */
304
  */
265
#define LL_DAC_OUTPUT_BUFFER_ENABLE        0x00000000U             /*!< The selected DAC channel output is buffered: higher drive current capability, but also higher current consumption */
305
#define LL_DAC_OUTPUT_BUFFER_ENABLE        0x00000000UL            /*!< The selected DAC channel output is buffered: higher drive current capability, but also higher current consumption */
266
#define LL_DAC_OUTPUT_BUFFER_DISABLE       (DAC_CR_BOFF1)          /*!< The selected DAC channel output is not buffered: lower drive current capability, but also lower current consumption */
306
#define LL_DAC_OUTPUT_BUFFER_DISABLE       (DAC_CR_BOFF1)          /*!< The selected DAC channel output is not buffered: lower drive current capability, but also lower current consumption */
267
/**
307
/**
268
  * @}
308
  * @}
269
  */
309
  */
270
 
310
 
271
/** @defgroup DAC_LL_EC_RESOLUTION  DAC channel output resolution
311
/** @defgroup DAC_LL_EC_RESOLUTION  DAC channel output resolution
272
  * @{
312
  * @{
273
  */
313
  */
274
#define LL_DAC_RESOLUTION_12B              0x00000000U             /*!< DAC channel resolution 12 bits */
314
#define LL_DAC_RESOLUTION_12B              0x00000000UL            /*!< DAC channel resolution 12 bits */
275
#define LL_DAC_RESOLUTION_8B               0x00000002U             /*!< DAC channel resolution 8 bits */
315
#define LL_DAC_RESOLUTION_8B               0x00000002UL            /*!< DAC channel resolution 8 bits */
276
/**
316
/**
277
  * @}
317
  * @}
278
  */
318
  */
279
 
319
 
280
/** @defgroup DAC_LL_EC_REGISTERS  DAC registers compliant with specific purpose
320
/** @defgroup DAC_LL_EC_REGISTERS  DAC registers compliant with specific purpose
Line 308... Line 348...
308
/*        - DAC channel output buffer enabled                                 */
348
/*        - DAC channel output buffer enabled                                 */
309
/*        - load impedance of 5kOhm (min), 50pF (max)                         */
349
/*        - load impedance of 5kOhm (min), 50pF (max)                         */
310
/* Literal set to maximum value (refer to device datasheet,                   */
350
/* Literal set to maximum value (refer to device datasheet,                   */
311
/* parameter "tWAKEUP").                                                      */
351
/* parameter "tWAKEUP").                                                      */
312
/* Unit: us                                                                   */
352
/* Unit: us                                                                   */
313
#define LL_DAC_DELAY_STARTUP_VOLTAGE_SETTLING_US             15U  /*!< Delay for DAC channel voltage settling time from DAC channel startup (transition from disable to enable) */
353
#define LL_DAC_DELAY_STARTUP_VOLTAGE_SETTLING_US             15UL /*!< Delay for DAC channel voltage settling time from DAC channel startup (transition from disable to enable) */
314
 
354
 
315
/* Delay for DAC channel voltage settling time.                               */
355
/* Delay for DAC channel voltage settling time.                               */
316
/* Note: DAC channel startup time depends on board application environment:   */
356
/* Note: DAC channel startup time depends on board application environment:   */
317
/*       impedance connected to DAC channel output.                           */
357
/*       impedance connected to DAC channel output.                           */
318
/*       The delay below is specified under conditions:                       */
358
/*       The delay below is specified under conditions:                       */
Line 321... Line 361...
321
/*        - DAC channel output buffer enabled                                 */
361
/*        - DAC channel output buffer enabled                                 */
322
/*        - load impedance of 5kOhm min, 50pF max                             */
362
/*        - load impedance of 5kOhm min, 50pF max                             */
323
/* Literal set to maximum value (refer to device datasheet,                   */
363
/* Literal set to maximum value (refer to device datasheet,                   */
324
/* parameter "tSETTLING").                                                    */
364
/* parameter "tSETTLING").                                                    */
325
/* Unit: us                                                                   */
365
/* Unit: us                                                                   */
326
#define LL_DAC_DELAY_VOLTAGE_SETTLING_US                    12U  /*!< Delay for DAC channel voltage settling time */
366
#define LL_DAC_DELAY_VOLTAGE_SETTLING_US                    12UL /*!< Delay for DAC channel voltage settling time */
327
 
367
 
328
/**
368
/**
329
  * @}
369
  * @}
330
  */
370
  */
331
 
371
 
Line 394... Line 434...
394
  * @param  __DECIMAL_NB__ 1...2
434
  * @param  __DECIMAL_NB__ 1...2
395
  * @retval Returned value can be one of the following values:
435
  * @retval Returned value can be one of the following values:
396
  *         @arg @ref LL_DAC_CHANNEL_1
436
  *         @arg @ref LL_DAC_CHANNEL_1
397
  *         @arg @ref LL_DAC_CHANNEL_2
437
  *         @arg @ref LL_DAC_CHANNEL_2
398
  */
438
  */
399
#define __LL_DAC_DECIMAL_NB_TO_CHANNEL(__DECIMAL_NB__)                         \
439
#define __LL_DAC_DECIMAL_NB_TO_CHANNEL(__DECIMAL_NB__)\
400
  (((__DECIMAL_NB__) == 1U)                                                    \
440
  (((__DECIMAL_NB__) == 1UL)? (LL_DAC_CHANNEL_1  ):(((__DECIMAL_NB__) == 2UL) ? ( LL_DAC_CHANNEL_2):(0UL)))
401
    ? (                                                                        \
-
 
402
       LL_DAC_CHANNEL_1                                                        \
-
 
403
      )                                                                        \
-
 
404
      :                                                                        \
-
 
405
      (((__DECIMAL_NB__) == 2U)                                                \
-
 
406
        ? (                                                                    \
-
 
407
           LL_DAC_CHANNEL_2                                                    \
-
 
408
          )                                                                    \
-
 
409
          :                                                                    \
-
 
410
          (                                                                    \
-
 
411
           0U                                                                   \
-
 
412
          )                                                                    \
-
 
413
      )                                                                        \
-
 
414
  )
-
 
415
 
441
 
416
/**
442
/**
417
  * @brief  Helper macro to define the DAC conversion data full-scale digital
443
  * @brief  Helper macro to define the DAC conversion data full-scale digital
418
  *         value corresponding to the selected DAC resolution.
444
  *         value corresponding to the selected DAC resolution.
419
  * @note   DAC conversion data full-scale corresponds to voltage range
445
  * @note   DAC conversion data full-scale corresponds to voltage range
Line 423... Line 449...
423
  *         @arg @ref LL_DAC_RESOLUTION_12B
449
  *         @arg @ref LL_DAC_RESOLUTION_12B
424
  *         @arg @ref LL_DAC_RESOLUTION_8B
450
  *         @arg @ref LL_DAC_RESOLUTION_8B
425
  * @retval ADC conversion data equivalent voltage value (unit: mVolt)
451
  * @retval ADC conversion data equivalent voltage value (unit: mVolt)
426
  */
452
  */
427
#define __LL_DAC_DIGITAL_SCALE(__DAC_RESOLUTION__)                             \
453
#define __LL_DAC_DIGITAL_SCALE(__DAC_RESOLUTION__)                             \
428
  ((0x00000FFFU) >> ((__DAC_RESOLUTION__) << 1U))
454
  ((0x00000FFFUL) >> ((__DAC_RESOLUTION__) << 1UL))
429
 
455
 
430
/**
456
/**
431
  * @brief  Helper macro to calculate the DAC conversion data (unit: digital
457
  * @brief  Helper macro to calculate the DAC conversion data (unit: digital
432
  *         value) corresponding to a voltage (unit: mVolt).
458
  *         value) corresponding to a voltage (unit: mVolt).
433
  * @note   This helper macro is intended to provide input data in voltage
459
  * @note   This helper macro is intended to provide input data in voltage
434
  *         rather than digital value,
460
  *         rather than digital value,
435
  *         to be used with LL DAC functions such as
461
  *         to be used with LL DAC functions such as
436
  *         @ref LL_DAC_ConvertData12RightAligned().
462
  *         @ref LL_DAC_ConvertData12RightAligned().
437
  * @note   Analog reference voltage (Vref+) must be either known from
463
  * @note   Analog reference voltage (Vref+) must be either known from
438
  *         user board environment or can be calculated using ADC measurement
464
  *         user board environment or can be calculated using ADC measurement
439
  *         and ADC helper macro @ref __LL_ADC_CALC_VREFANALOG_VOLTAGE().
465
  *         and ADC helper macro __LL_ADC_CALC_VREFANALOG_VOLTAGE().
440
  * @param  __VREFANALOG_VOLTAGE__ Analog reference voltage (unit: mV)
466
  * @param  __VREFANALOG_VOLTAGE__ Analog reference voltage (unit: mV)
441
  * @param  __DAC_VOLTAGE__ Voltage to be generated by DAC channel
467
  * @param  __DAC_VOLTAGE__ Voltage to be generated by DAC channel
442
  *                         (unit: mVolt).
468
  *                         (unit: mVolt).
443
  * @param  __DAC_RESOLUTION__ This parameter can be one of the following values:
469
  * @param  __DAC_RESOLUTION__ This parameter can be one of the following values:
444
  *         @arg @ref LL_DAC_RESOLUTION_12B
470
  *         @arg @ref LL_DAC_RESOLUTION_12B
Line 446... Line 472...
446
  * @retval DAC conversion data (unit: digital value)
472
  * @retval DAC conversion data (unit: digital value)
447
  */
473
  */
448
#define __LL_DAC_CALC_VOLTAGE_TO_DATA(__VREFANALOG_VOLTAGE__,\
474
#define __LL_DAC_CALC_VOLTAGE_TO_DATA(__VREFANALOG_VOLTAGE__,\
449
                                      __DAC_VOLTAGE__,\
475
                                      __DAC_VOLTAGE__,\
450
                                      __DAC_RESOLUTION__)                      \
476
                                      __DAC_RESOLUTION__)                      \
451
  ((__DAC_VOLTAGE__) * __LL_DAC_DIGITAL_SCALE(__DAC_RESOLUTION__)              \
477
((__DAC_VOLTAGE__) * __LL_DAC_DIGITAL_SCALE(__DAC_RESOLUTION__)              \
452
   / (__VREFANALOG_VOLTAGE__)                                                  \
478
 / (__VREFANALOG_VOLTAGE__)                                                  \
453
  )
479
)
454
 
480
 
455
/**
481
/**
456
  * @}
482
  * @}
457
  */
483
  */
458
 
484
 
Line 812... Line 838...
812
  *         function "LL_DMA_ConfigAddresses()".
838
  *         function "LL_DMA_ConfigAddresses()".
813
  *         Example:
839
  *         Example:
814
  *           LL_DMA_ConfigAddresses(DMA1,
840
  *           LL_DMA_ConfigAddresses(DMA1,
815
  *                                  LL_DMA_CHANNEL_1,
841
  *                                  LL_DMA_CHANNEL_1,
816
  *                                  (uint32_t)&< array or variable >,
842
  *                                  (uint32_t)&< array or variable >,
817
  *                                  LL_DAC_DMA_GetRegAddr(DAC1, LL_DAC_CHANNEL_1, LL_DAC_DMA_REG_DATA_12BITS_RIGHT_ALIGNED),
843
  *                                  LL_DAC_DMA_GetRegAddr(DAC1, LL_DAC_CHANNEL_1,
-
 
844
  *                                  LL_DAC_DMA_REG_DATA_12BITS_RIGHT_ALIGNED),
818
  *                                  LL_DMA_DIRECTION_MEMORY_TO_PERIPH);
845
  *                                  LL_DMA_DIRECTION_MEMORY_TO_PERIPH);
819
  * @rmtoll DHR12R1  DACC1DHR       LL_DAC_DMA_GetRegAddr\n
846
  * @rmtoll DHR12R1  DACC1DHR       LL_DAC_DMA_GetRegAddr\n
820
  *         DHR12L1  DACC1DHR       LL_DAC_DMA_GetRegAddr\n
847
  *         DHR12L1  DACC1DHR       LL_DAC_DMA_GetRegAddr\n
821
  *         DHR8R1   DACC1DHR       LL_DAC_DMA_GetRegAddr\n
848
  *         DHR8R1   DACC1DHR       LL_DAC_DMA_GetRegAddr\n
822
  *         DHR12R2  DACC2DHR       LL_DAC_DMA_GetRegAddr\n
849
  *         DHR12R2  DACC2DHR       LL_DAC_DMA_GetRegAddr\n
Line 834... Line 861...
834
  */
861
  */
835
__STATIC_INLINE uint32_t LL_DAC_DMA_GetRegAddr(DAC_TypeDef *DACx, uint32_t DAC_Channel, uint32_t Register)
862
__STATIC_INLINE uint32_t LL_DAC_DMA_GetRegAddr(DAC_TypeDef *DACx, uint32_t DAC_Channel, uint32_t Register)
836
{
863
{
837
  /* Retrieve address of register DHR12Rx, DHR12Lx or DHR8Rx depending on     */
864
  /* Retrieve address of register DHR12Rx, DHR12Lx or DHR8Rx depending on     */
838
  /* DAC channel selected.                                                    */
865
  /* DAC channel selected.                                                    */
839
  return ((uint32_t)(__DAC_PTR_REG_OFFSET((DACx)->DHR12R1,
866
  return ((uint32_t)(__DAC_PTR_REG_OFFSET((DACx)->DHR12R1, ((DAC_Channel >> (Register & 0x1FUL))
840
                                          ((DAC_Channel >> (Register & 0x1FUL)) & DAC_REG_DHR_REGOFFSET_MASK_POSBIT0))));
867
                                                            & DAC_REG_DHR_REGOFFSET_MASK_POSBIT0))));
841
}
868
}
842
/**
869
/**
843
  * @}
870
  * @}
844
  */
871
  */
845
 
872
 
Line 998... Line 1025...
998
  * @param  Data Value between Min_Data=0x000 and Max_Data=0xFFF
1025
  * @param  Data Value between Min_Data=0x000 and Max_Data=0xFFF
999
  * @retval None
1026
  * @retval None
1000
  */
1027
  */
1001
__STATIC_INLINE void LL_DAC_ConvertData12RightAligned(DAC_TypeDef *DACx, uint32_t DAC_Channel, uint32_t Data)
1028
__STATIC_INLINE void LL_DAC_ConvertData12RightAligned(DAC_TypeDef *DACx, uint32_t DAC_Channel, uint32_t Data)
1002
{
1029
{
1003
  __IO uint32_t *preg = __DAC_PTR_REG_OFFSET(DACx->DHR12R1, (DAC_Channel >> DAC_REG_DHR12RX_REGOFFSET_BITOFFSET_POS) & DAC_REG_DHR_REGOFFSET_MASK_POSBIT0);
1030
  __IO uint32_t *preg = __DAC_PTR_REG_OFFSET(DACx->DHR12R1, (DAC_Channel >> DAC_REG_DHR12RX_REGOFFSET_BITOFFSET_POS)
-
 
1031
                                             & DAC_REG_DHR_REGOFFSET_MASK_POSBIT0);
1004
 
1032
 
1005
  MODIFY_REG(*preg,
-
 
1006
             DAC_DHR12R1_DACC1DHR,
1033
  MODIFY_REG(*preg, DAC_DHR12R1_DACC1DHR, Data);
1007
             Data);
-
 
1008
}
1034
}
1009
 
1035
 
1010
/**
1036
/**
1011
  * @brief  Set the data to be loaded in the data holding register
1037
  * @brief  Set the data to be loaded in the data holding register
1012
  *         in format 12 bits left alignment (MSB aligned on bit 15),
1038
  *         in format 12 bits left alignment (MSB aligned on bit 15),
Line 1020... Line 1046...
1020
  * @param  Data Value between Min_Data=0x000 and Max_Data=0xFFF
1046
  * @param  Data Value between Min_Data=0x000 and Max_Data=0xFFF
1021
  * @retval None
1047
  * @retval None
1022
  */
1048
  */
1023
__STATIC_INLINE void LL_DAC_ConvertData12LeftAligned(DAC_TypeDef *DACx, uint32_t DAC_Channel, uint32_t Data)
1049
__STATIC_INLINE void LL_DAC_ConvertData12LeftAligned(DAC_TypeDef *DACx, uint32_t DAC_Channel, uint32_t Data)
1024
{
1050
{
1025
  __IO uint32_t *preg = __DAC_PTR_REG_OFFSET(DACx->DHR12R1, (DAC_Channel >> DAC_REG_DHR12LX_REGOFFSET_BITOFFSET_POS) & DAC_REG_DHR_REGOFFSET_MASK_POSBIT0);
1051
  __IO uint32_t *preg = __DAC_PTR_REG_OFFSET(DACx->DHR12R1, (DAC_Channel >> DAC_REG_DHR12LX_REGOFFSET_BITOFFSET_POS)
-
 
1052
                                             & DAC_REG_DHR_REGOFFSET_MASK_POSBIT0);
1026
 
1053
 
1027
  MODIFY_REG(*preg,
-
 
1028
             DAC_DHR12L1_DACC1DHR,
1054
  MODIFY_REG(*preg, DAC_DHR12L1_DACC1DHR, Data);
1029
             Data);
-
 
1030
}
1055
}
1031
 
1056
 
1032
/**
1057
/**
1033
  * @brief  Set the data to be loaded in the data holding register
1058
  * @brief  Set the data to be loaded in the data holding register
1034
  *         in format 8 bits left alignment (LSB aligned on bit 0),
1059
  *         in format 8 bits left alignment (LSB aligned on bit 0),
Line 1042... Line 1067...
1042
  * @param  Data Value between Min_Data=0x00 and Max_Data=0xFF
1067
  * @param  Data Value between Min_Data=0x00 and Max_Data=0xFF
1043
  * @retval None
1068
  * @retval None
1044
  */
1069
  */
1045
__STATIC_INLINE void LL_DAC_ConvertData8RightAligned(DAC_TypeDef *DACx, uint32_t DAC_Channel, uint32_t Data)
1070
__STATIC_INLINE void LL_DAC_ConvertData8RightAligned(DAC_TypeDef *DACx, uint32_t DAC_Channel, uint32_t Data)
1046
{
1071
{
1047
  __IO uint32_t *preg = __DAC_PTR_REG_OFFSET(DACx->DHR12R1, (DAC_Channel >> DAC_REG_DHR8RX_REGOFFSET_BITOFFSET_POS) & DAC_REG_DHR_REGOFFSET_MASK_POSBIT0);
1072
  __IO uint32_t *preg = __DAC_PTR_REG_OFFSET(DACx->DHR12R1, (DAC_Channel >> DAC_REG_DHR8RX_REGOFFSET_BITOFFSET_POS)
-
 
1073
                                             & DAC_REG_DHR_REGOFFSET_MASK_POSBIT0);
1048
 
1074
 
1049
  MODIFY_REG(*preg,
-
 
1050
             DAC_DHR8R1_DACC1DHR,
1075
  MODIFY_REG(*preg, DAC_DHR8R1_DACC1DHR, Data);
1051
             Data);
-
 
1052
}
1076
}
1053
 
1077
 
1054
 
1078
 
1055
/**
1079
/**
1056
  * @brief  Set the data to be loaded in the data holding register
1080
  * @brief  Set the data to be loaded in the data holding register
Line 1127... Line 1151...
1127
  *         @arg @ref LL_DAC_CHANNEL_2
1151
  *         @arg @ref LL_DAC_CHANNEL_2
1128
  * @retval Value between Min_Data=0x000 and Max_Data=0xFFF
1152
  * @retval Value between Min_Data=0x000 and Max_Data=0xFFF
1129
  */
1153
  */
1130
__STATIC_INLINE uint32_t LL_DAC_RetrieveOutputData(DAC_TypeDef *DACx, uint32_t DAC_Channel)
1154
__STATIC_INLINE uint32_t LL_DAC_RetrieveOutputData(DAC_TypeDef *DACx, uint32_t DAC_Channel)
1131
{
1155
{
1132
  __IO uint32_t const *preg = __DAC_PTR_REG_OFFSET(DACx->DOR1, (DAC_Channel >> DAC_REG_DORX_REGOFFSET_BITOFFSET_POS) & DAC_REG_DORX_REGOFFSET_MASK_POSBIT0);
1156
  __IO uint32_t const *preg = __DAC_PTR_REG_OFFSET(DACx->DOR1, (DAC_Channel >> DAC_REG_DORX_REGOFFSET_BITOFFSET_POS)
-
 
1157
                                                   & DAC_REG_DORX_REGOFFSET_MASK_POSBIT0);
1133
 
1158
 
1134
  return (uint16_t) READ_BIT(*preg, DAC_DOR1_DACC1DOR);
1159
  return (uint16_t) READ_BIT(*preg, DAC_DOR1_DACC1DOR);
1135
}
1160
}
1136
 
1161
 
1137
/**
1162
/**
Line 1139... Line 1164...
1139
  */
1164
  */
1140
 
1165
 
1141
/** @defgroup DAC_LL_EF_FLAG_Management FLAG Management
1166
/** @defgroup DAC_LL_EF_FLAG_Management FLAG Management
1142
  * @{
1167
  * @{
1143
  */
1168
  */
-
 
1169
 
1144
/**
1170
/**
1145
  * @brief  Get DAC underrun flag for DAC channel 1
1171
  * @brief  Get DAC underrun flag for DAC channel 1
1146
  * @rmtoll SR       DMAUDR1        LL_DAC_IsActiveFlag_DMAUDR1
1172
  * @rmtoll SR       DMAUDR1        LL_DAC_IsActiveFlag_DMAUDR1
1147
  * @param  DACx DAC instance
1173
  * @param  DACx DAC instance
1148
  * @retval State of bit (1 or 0).
1174
  * @retval State of bit (1 or 0).