6 years, 3 months ago.

Where is gpio_t declared?

Hi all,

I have been trying to understand how some of the simple mbed driver classes work and I keep coming across a data type called gpio_t. I would like to know what it is, but have been unable to track down its declaration, despite spending several hours following include chains.

I presume that I'm looking in the wrong places. Could any kind soul please either advise me where to find the declaration, post a copy of the declaration, or (preferably) both.

Many thanks in anticipation.

Pete.

1 Answer

6 years, 3 months ago.

Hi Peter,

Depending on your target, gpio_t should be declared in the gpio_object.h file. So for example, if my target was the Toshiba TMPM 64B chip, then gpio_t is declared in the following file:

/mbed-os/targets/TARGET_TOSHIBA/TARGET_TMPM46B/gpio_object.h.

This data type and its definitions are different for different targets. Therefore, make sure that you are looking at the correct definition for your target's gpio_t.

Please let me know if you have any questions!

- Peter, team Mbed

If this solved your question, please make sure to click the "Thanks" link below!

Also, gpio_t objects can also be defined in the target's objects.h file. For example, for the Realtek Ameba board: https://github.com/ARMmbed/mbed-os/blob/master/targets/TARGET_Realtek/TARGET_AMEBA/TARGET_RTL8195A/objects.h#L39

- Jenny, team Mbed

posted by Jenny Plunkett 25 Jul 2018