William,
The project is created using the Kinetis Design Studio Project wizard, selecting Board>Kinetis>FRDM-K22F in the Devices prompt. PE is not selected.
Where can I see where pins are being defined? Like I said, I have been using the Arduino family of devices, and there is a lot less "grunt work" that has to be done to use GPIO pins. I realize that the Arduino IDE is hiding most/all of the register/pin configuration process, and I don't mind doing it explicitly for the K22F, but as a new KDS user (and new to Kinetis micros and boards) this is all very confusing to me. That's why a demo would be so helpful.
By the way, after following the tutorial (substituting the K22F directories/files for K64F ones where appropriate), I get the following errors when building the project:
nested redefinition of 'enum _gpio_pins'
redeclaration of 'enum _gpio_pins'
Am I doing something majorly wrong, or am I close to getting operating code?
-------
#include "fsl_device_registers.h"
#include "board.h"
enum _gpio_pins
{
kGpioLED4 = GPIO_MAKE_PIN(HW_PORTE, 0x1A),//PTE26
};
static int i = 0;
int main(void)
{
short value = 1; /* Write your code here */
hardware_init();
GPIO_DRV_SetPinDir(kGpioLED4, kGpioDigitalOutput);
/* This for loop should be replaced. By default this loop allows a single stepping. */
for (;;) {
for (i = 0; i<0xFFFFFF; i++)
{
}
value = value^1;
GPIO_DRV_WritePinOutput(kGpioLED4, value);
}
/* Never leave main */
return 0;
}