Skip to content
Snippets Groups Projects
Commit 59eabb62 authored by Valentini, Matteo's avatar Valentini, Matteo
Browse files

Merge branch '66D5D24A535E2417-main-patch-37004' into 'main'

Fixed wrong max pin number in comments in gpio.c

See merge request microcontroller/upstream-ws24!2
parents 8e86c1eb f435a738
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment