Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Upstream WS24
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Microcontroller
Upstream WS24
Commits
f435a738
Commit
f435a738
authored
6 months ago
by
Valentini, Matteo
Browse files
Options
Downloads
Patches
Plain Diff
Update gpio.c
parent
8e86c1eb
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/A1/gpio.c
+4
-4
4 additions, 4 deletions
src/A1/gpio.c
with
4 additions
and
4 deletions
src/A1/gpio.c
+
4
−
4
View file @
f435a738
...
...
@@ -9,7 +9,7 @@ volatile uint32_t* pads_bank0_base = (uint32_t *)0x4001c000;
volatile
uint32_t
*
sio_base
=
(
uint32_t
*
)
0xd0000000
;
/** Configures the pin to be in the given mode using IO_BANK0
* @param pin id of the gpio pin, make sure that it is between 0 and
31
* @param pin id of the gpio pin, make sure that it is between 0 and
29
* @param function function of the pin, make sure it is between 0 and 31. Functions are predefined as GPIO_FUNC_...
*/
void
set_gpio_function
(
const
int
pin
,
const
int
function
)
...
...
@@ -28,7 +28,7 @@ void set_gpio_function(const int pin, const int function)
}
/** Sets the input/output mode of the given pin using the SIO. Furthermore, the input enable bit in the corresponding PADS_BANK0 register is set.
* @param pin id of the gpio pin, make sure that it is between 0 and
31
* @param pin id of the gpio pin, make sure that it is between 0 and
29
* @param mode input/output mode, GPIO_IN for input, GPIO_OUT for output
*/
void
set_gpio_mode
(
const
int
pin
,
const
int
mode
)
...
...
@@ -49,7 +49,7 @@ void set_gpio_mode(const int pin, const int mode)
}
/** Sets the output level of the given pin using the SIO
* @param pin id of the gpio pin, make sure that it is between 0 and
31
* @param pin id of the gpio pin, make sure that it is between 0 and
29
* @param level output level, zero is low, non-zero-value is high
*/
void
set_gpio_level
(
const
int
pin
,
const
int
level
)
...
...
@@ -67,7 +67,7 @@ void set_gpio_level(const int pin, const int level)
}
/** Returns the input level of the given pin using the SIO
* @param pin id of the gpio pin, make sure that it is between 0 and
31
* @param pin id of the gpio pin, make sure that it is between 0 and
29
* @return zero if the pin is low, 1 if it is high. If pin is invalid, -1 is returned.
*/
int
get_gpio_level
(
const
int
pin
)
...
...
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