Hi,
I am really straggling with programing LPC4330 with LPCXpresso IDE. I have no idea how to set gpio as an out pin?
for example; I am going to use GPIO0[14]. where is P2_10
The code I want to modified it was for LED blinky example;
#if defined (__USE_LPCOPEN)
#if defined(NO_BOARD_LIB)
#include "chip.h"
#else
#include "board.h"
#endif
#endif
#include <cr_section_macros.h>
// TODO: insert other include files here
// TODO: insert other definitions and declarations here
//#define GPIOP1 0x50020004 /* GPIO port 1 register location */
int main(void) {
#if defined (__USE_LPCOPEN)
// Read clock settings and update SystemCoreClock variable
SystemCoreClockUpdate();
#if !defined(NO_BOARD_LIB)
// Set up and initialize all required blocks and
/////////////////between this lines added by me /////////////////////
void Chip_GPIO_Init(LPC_GPIO_T *pGPIO)
{
}
STATIC INLINE void Chip_GPIO_SetPinDIROutput(LPC_GPIO_T *pGPIO, uint8_t 0, uint8_t 14) //port 0 , pin 14
{
pGPIO->DIR[0] |= 1UL << 14;
}
Chip_GPIO_SetPortOutHigh();
Chip_GPIO_ClearValue();
////////////////////////////////////////////
// functions related to the board hardware
Board_Init();
// Set the LED to the state of "On"
Board_LED_Set(0, true);
#endif
#endif
while(1) {
Board_LED_Toggle(0);
Delay (10000);
}
return 0 ;
}
void Delay (unsigned int ms)
{
volatile static int x,y;
while (ms)
{
for (x=0; x<=140; x++)
{
y++;
}
ms--;
}
}