Hi Jack Monaghan,
Answer your 2 questions:
1.How do I setup a GPIO input and out put function
If you want to control GPIO, you should use these register: SIM_SCGC5, PORTx_PCRn, GPIO register.
SIM_SCGC5 is used to open port clock.
PORTx_PCRn is used to configure the pin as GPIO function, and whether have interrupt , pullup or pulldown,ect.
GPIO, is used to control the pin as output or input, and get the pin input data or set the port output data.
An example to set PTA5 as output high
SIM_SCGC5 |= SIM_SCGC5_PORTA_MASK; // enable pta port clock
PORTA_PCR5 = PORT_PCR_MUX(01); //pta5 as gapio
GPIOA_PDDR = 1<<5;// pta5 output
GPIOA_PDOR= 1<<5;// pta5 output higg
Input is the same, just congfigure PORTA_PCR5 use interrupt or not, pullup,etc. then clear GPIOA_PDOR bit5 to set pta5 as input.
If you want to use the interrupt, you should enable the global interrupt and the PORTA interrupt.
Actually, we have the sample code for the KL43, please download the code from this link:
http://cache.freescale.com/files/32bit/software/FRDM-KL43Z-SC-BAREMETAL.exe
2:Can you please give me a list of the GPIO names used on this MCU
You can find the pin name from the reference manual, chapter 10.1 KL43 Signal Multiplexing and Pin Assignments
Wish it helps you!
If you still have question, please contact me!
Have a great day,
Jingjing
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------