Questions to the RTEMS sample application (rtems-gpio.c)

I’m a newbie working with the NOEL-ARTYA7 example design.

I got the SoC running the RTEMS operating system (refer to Appendix 1) and am confused about the example application “rtems-gpio.c” (refer to Appendix 2). The description shows the application uses the GPIO library and GRGPIO driver.

But instead of the GRGPIO driver (grgpio.c), the gpiolib driver (gpiolib.c) is used in this application. The application calls functions that refer to the GPIO library (gpiolib.h) and all functions (e.g. void gpiolib_open(int port)) are defined in the gpiolib.c.

Only a driver registration function (void grgpio_register_drv(void)) is declared in the grgpio.h file.

*From my point of view, if a user wants to use the GRGPIO driver, he must call functions (e.g. static int grgpio_gpiolib_open(void handle)) defined in the GRGPIO driver (grgpio.c) and the grgpio.h also needs to be extended.

Q1. My point of view is shown above. Can someone tell me if it’s correct?

Q2. Both drivers (gpiolib.c and grgpio.c) can not be found in rtems-noel-1.0.4 version in Appendix 1. I can’t figure out how can the GPIO library (gpiolib.h) call the drivers defined in the gpiolib.c? Can someone tell me the reason?

Note: I finally found the drivers in the rtems-5.3 version shown in Appendix 3.

This issue is important to me. I plan to build a new driver for the DDR3 to have access to it. It’s difficult to go further if the issue remains unfixed.

Appendix:

  1. The [NOEL-V RTEMS5 Software Development Environment] ([rtems-noel-1.0.4]) can be downloaded here.

  2. The rtems-gpio.c can be found in the directory of rtems-noel-1.0.4: [RTEMS]/rtems-noel-1.0.4/examples/drvmgr/rtems-gpio.c.

  3. The rtems-5.3 can be downloaded here.