Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
card10
firmware
Commits
828147c2
Commit
828147c2
authored
5 years ago
by
swym
Browse files
Options
Downloads
Patches
Plain Diff
gpio: document mode.ADC, move comment out of clang-tidy's reach
parent
127ea870
No related branches found
No related tags found
1 merge request
!229
feat(epicardium): gpios are configurable as ADC
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Documentation/pycardium/gpio.rst
+7
-1
7 additions, 1 deletion
Documentation/pycardium/gpio.rst
epicardium/modules/gpio.c
+5
-2
5 additions, 2 deletions
epicardium/modules/gpio.c
with
12 additions
and
3 deletions
Documentation/pycardium/gpio.rst
+
7
−
1
View file @
828147c2
...
...
@@ -25,7 +25,10 @@ output in your scripts.
:param int pin: ID of the pin to be configured.
:param int mode: An integer with the bits for the wanted mode set. Create your
integer by ORing :py:data:`gpio.mode.OUTPUT`, :py:data:`gpio.mode.INPUT`,
:py:data:`gpio.mode.PULL_UP`, :py:data:`gpio.mode.PULL_DOWN`.
:py:data:`gpio.mode.ADC`, :py:data:`gpio.mode.PULL_UP`,
:py:data:`gpio.mode.PULL_DOWN`.
.. note:: On WRISTBAND_3, there is no ADC functionality available
.. py:function:: get_mode(pin)
...
...
@@ -47,6 +50,9 @@ output in your scripts.
:param int pin: ID of the pin of to get the mode of.
:returns: Current value of the GPIO pin.
If the pin is configured as ADC, the value returned
will be between 0 and 1000, representing voltages from
0V to 3.3V
.. py:data:: WRISTBAND_1
...
...
This diff is collapsed.
Click to expand it.
epicardium/modules/gpio.c
+
5
−
2
View file @
828147c2
...
...
@@ -33,8 +33,11 @@ static gpio_cfg_t gpio_configs[] = {
static
int
s_adc_channels
[]
=
{
[
EPIC_GPIO_WRISTBAND_1
]
=
ADC_CH_5
,
[
EPIC_GPIO_WRISTBAND_2
]
=
ADC_CH_6
,
[
EPIC_GPIO_WRISTBAND_3
]
=
-
1
,
//AFAICT on P0.29, there is no ADC available
/* on P0.29, there is no ADC available
* see GPIO matrix in MAX32665-MAX32668.pdf,
* pages 32,33
*/
[
EPIC_GPIO_WRISTBAND_3
]
=
-
1
,
[
EPIC_GPIO_WRISTBAND_4
]
=
ADC_CH_4
,
};
...
...
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