623***567
We use the GR5515IGND chip with our custom (!) board, and at the first stages I ran into difficulties.
To control the GPIO, logic that isn't very clear (for me) is used. In the libs, GPIO0-15 numbers are fixed as some constants (gr55xx_hal_gpio.h: 0x0400U for Pin 10 for example), but there is nothing about GPIO16-31 being physically present.
For our project, we need access to many pins (as GPIO/SPI roles and so on), for example, 29th as GPIO. I found an example in which this pin is controlled - gpio_output_input. However, there, to control pin 29, the constant GPIO_PIN_13 is used. Please explain why so? How to implement access to all 31m GPOS of the chip that we are using?
Darren
Hi
GR5515IGND chip has 2 groups of GPIO, each group has 16 GPIOs.
The corresponding IO pins of GPIO0 are GPIO_0 - GPIO_15
The corresponding IO pins of GPIO1 are GPIO_16 - GPIO_31
When using the API, you need to pay attention to the following points:
hal_gpio_read_pin(GPIO0, GPIO_PIN_0); Read the state of GPIO0
hal_gpio_read_pin(GPIO0, GPIO_PIN_1); Read the state of GPIO1
..........
hal_gpio_read_pin(GPIO1, GPIO_PIN_0); Read the state of GPIO16
hal_gpio_read_pin(GPIO1, GPIO_PIN_1); Read the state of GPIO17
......
Open WeChat, use "Scan" to follow.