AnsweredAssumed Answered

FRDM-KL26Z GPIO programming knowhow?

Question asked by Daniel Truong on Nov 14, 2016
Latest reply on Nov 15, 2016 by Daniel Truong



I've just had a FRDM-KL26Z board and some SW tools (KSDK and KDS) installed. Starting to browse some code to see how the GPIOs are configured and programmed.

It gets down to the following code with the pin names defined as kGpioLED1kGpioLED2, etc. and I just can't figure out how they are defined the way as shown. It's got to have a place where user can manually enters the related information (as it differs from board to board). In the comments just above the code, gpioPinLookupTable is mentioned for this purpose. Can someone help give me a pointer as to where I can obtain this table and hopefully I can customize it for my project?


Thank you in advance,




/*! @file */


/*! This file contains gpio pin definitions used by gpio peripheral driver.*/

/*! The enums in _gpio_pins map to the real gpio pin numbers defined in*/

/*! gpioPinLookupTable. And this might be different in different board.*/



 * Definitions



/*! @brief gpio pin names.*/


/*! This should be defined according to board setting.*/

/* gpio_pins.h */

enum _gpio_pins


    kGpioLED1        = GPIO_MAKE_PIN(GPIOE_IDX, 31u),  /* FRDM-KL26Z4 Green LED */

    kGpioLED2        = GPIO_MAKE_PIN(GPIOE_IDX, 29u),  /* FRDM-KL26Z4 Red LED */

    kGpioLED3        = GPIO_MAKE_PIN(GPIOD_IDX, 5u),   /* FRDM-KL26Z4 Blue LED */

    kGpioSW1         = GPIO_MAKE_PIN(GPIOC_IDX, 3u),   /* FRDM-KL26Z4 switchPin1 */