Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Ainigma
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Werner Sembach
Ainigma
Commits
a90a8388
Commit
a90a8388
authored
7 years ago
by
Werner Sembach
Browse files
Options
Downloads
Patches
Plain Diff
Add explanatory comments
parent
52a3ef22
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/ADC.cpp
+17
-1
17 additions, 1 deletion
src/ADC.cpp
src/DCMotor.cpp
+1
-1
1 addition, 1 deletion
src/DCMotor.cpp
with
18 additions
and
2 deletions
src/ADC.cpp
+
17
−
1
View file @
a90a8388
...
@@ -8,7 +8,23 @@ extern "C" void adc_init() {
...
@@ -8,7 +8,23 @@ extern "C" void adc_init() {
rcc_clock_setup_hse_3v3
(
&
rcc_hse_8mhz_3v3
[
RCC_CLOCK_3V3_168MHZ
]);
rcc_clock_setup_hse_3v3
(
&
rcc_hse_8mhz_3v3
[
RCC_CLOCK_3V3_168MHZ
]);
rcc_periph_clock_enable
(
RCC_ADC1
);
rcc_periph_clock_enable
(
RCC_ADC1
);
gpio_mode_setup
(
GPIOC
,
GPIO_MODE_ANALOG
,
GPIO_PUPD_NONE
,
GPIO1
);
// Uncomment pins that are used as ADC
//gpio_mode_setup(GPIOA, GPIO_MODE_ANALOG, GPIO_PUPD_NONE, GPIO0); //ADC Channel 0 <> GPIO PA0
//gpio_mode_setup(GPIOA, GPIO_MODE_ANALOG, GPIO_PUPD_NONE, GPIO1); //ADC Channel 1 <> GPIO PA1
//gpio_mode_setup(GPIOA, GPIO_MODE_ANALOG, GPIO_PUPD_NONE, GPIO2); //ADC Channel 2 <> GPIO PA2
//gpio_mode_setup(GPIOA, GPIO_MODE_ANALOG, GPIO_PUPD_NONE, GPIO3); //ADC Channel 3 <> GPIO PA3
//gpio_mode_setup(GPIOA, GPIO_MODE_ANALOG, GPIO_PUPD_NONE, GPIO4); //ADC Channel 4 <> GPIO PA4
//gpio_mode_setup(GPIOA, GPIO_MODE_ANALOG, GPIO_PUPD_NONE, GPIO5); //ADC Channel 5 <> GPIO PA5
//gpio_mode_setup(GPIOA, GPIO_MODE_ANALOG, GPIO_PUPD_NONE, GPIO6); //ADC Channel 6 <> GPIO PA6
//gpio_mode_setup(GPIOA, GPIO_MODE_ANALOG, GPIO_PUPD_NONE, GPIO7); //ADC Channel 7 <> GPIO PA7
//gpio_mode_setup(GPIOB, GPIO_MODE_ANALOG, GPIO_PUPD_NONE, GPIO0); //ADC Channel 8 <> GPIO PB0
//gpio_mode_setup(GPIOB, GPIO_MODE_ANALOG, GPIO_PUPD_NONE, GPIO1); //ADC Channel 9 <> GPIO PB1
//gpio_mode_setup(GPIOC, GPIO_MODE_ANALOG, GPIO_PUPD_NONE, GPIO0); //ADC Channel 10 <> GPIO PC0
gpio_mode_setup
(
GPIOC
,
GPIO_MODE_ANALOG
,
GPIO_PUPD_NONE
,
GPIO1
);
//ADC Channel 11 <> GPIO PC1
//gpio_mode_setup(GPIOC, GPIO_MODE_ANALOG, GPIO_PUPD_NONE, GPIO2); //ADC Channel 12 <> GPIO PC2
//gpio_mode_setup(GPIOC, GPIO_MODE_ANALOG, GPIO_PUPD_NONE, GPIO3); //ADC Channel 13 <> GPIO PC3
//gpio_mode_setup(GPIOC, GPIO_MODE_ANALOG, GPIO_PUPD_NONE, GPIO4); //ADC Channel 14 <> GPIO PC4
//gpio_mode_setup(GPIOC, GPIO_MODE_ANALOG, GPIO_PUPD_NONE, GPIO5); //ADC Channel 15 <> GPIO PC5
adc_power_off
(
ADC1
);
adc_power_off
(
ADC1
);
adc_disable_scan_mode
(
ADC1
);
adc_disable_scan_mode
(
ADC1
);
...
...
This diff is collapsed.
Click to expand it.
src/DCMotor.cpp
+
1
−
1
View file @
a90a8388
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment