Understanding the Use of GPIO Control Functions in the SPRESENSE SDK

Asked 1 years ago, Updated 1 years ago, 100 views

I'm trying to control GPIO with SPRESENSE SDK.

Include the following
I tried to use board_gpio_config or board_gpio_write, but
I got an error message and couldn't use it.

Do I need any special settings to use these functions?

I tried 1.3 and 1.5 versions of the SPRENSE SDK and found the same result.
I am using MSYS2MSYS in Windows 10.

Include:

#include<arch/board/board.h>
# include <arch/chip/pin.h>

Description within the main function:

board_gpio_config(97,0, false, true, 0);
board_gpio_write(97,1);

error messages:

 undefined reference to `board_gpio_config'
undefined reference to `board_gpio_write'

I look forward to your kind cooperation.

(Additional)
Thank you for your reply, y_waiwai and Fumu7.

Among the #include<arch/board/board.h> above, cxd56_gpioif.h is included.
Just in case, including additional cxd56_gpioif.h did not improve.

The spelling of the function name seems to be correct.
https://developer.sony.com/develop/spresense/developer-tools/api-reference/api-references-spresense-sdk/group__gpioif.html

In order to use these functions, is the above include not sufficient, and does it require any configuration for Config, Lib, etc.?

spresense gpio

2022-09-30 11:11

2 Answers

The error board_gpio_config and board_gpio_write are not defined.
Why don't you look in the header file where these functions are defined?


2022-09-30 11:11

Spresense SDK Library page https://developer.sony.com/develop/spresense/developer-tools/api-reference/api-references-spresense-sdk/group__gpioif.html#ga1844b81ca3136ecb8c4a3d4bb3f36677
Looking at , the board_gpio_config and board_gpio_write appear to be written in cxd56_gpioif.h.

#include<cxd56_gpioif.h>

You might want to add the line to the end of the include.
(I don't have SPRESENSE, so I haven't been able to confirm it.)


2022-09-30 11:11

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.