Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
1db55381
Commit
1db55381
authored
Dec 12, 2018
by
Damien George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stm32/adc: Support 16-bit ADC configuration on H7 MCUs.
parent
6cab8dae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
ports/stm32/adc.c
ports/stm32/adc.c
+6
-0
No files found.
ports/stm32/adc.c
View file @
1db55381
...
...
@@ -677,6 +677,9 @@ void adc_init_all(pyb_adc_all_obj_t *adc_all, uint32_t resolution, uint32_t en_m
case
8
:
resolution
=
ADC_RESOLUTION_8B
;
break
;
case
10
:
resolution
=
ADC_RESOLUTION_10B
;
break
;
case
12
:
resolution
=
ADC_RESOLUTION_12B
;
break
;
#if defined(STM32H7)
case
16
:
resolution
=
ADC_RESOLUTION_16B
;
break
;
#endif
default:
nlr_raise
(
mp_obj_new_exception_msg_varg
(
&
mp_type_ValueError
,
"resolution %d not supported"
,
resolution
));
...
...
@@ -706,6 +709,9 @@ int adc_get_resolution(ADC_HandleTypeDef *adcHandle) {
#endif
case
ADC_RESOLUTION_8B
:
return
8
;
case
ADC_RESOLUTION_10B
:
return
10
;
#if defined(STM32H7)
case
ADC_RESOLUTION_16B
:
return
16
;
#endif
}
return
12
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment