LP4370 Fast GPIO
Using the code (pasted below) I see the clock speed is set as 204000000 (204MHz) and I get ~50MHz frequency using Port/Pin 3_3.
This has very few instructions but I will need to add more to bit-bang out a changeable binary pattern.
- Is there a faster way to set/clear GPIO?
- I read something about Fast GPIO. How would one go about setting that?
- Do I need to go back to assembler
I've hunted around in here but while I see glimpses of a solution I've not found the answer:
/*******************************************************************/
STATIC INLINE void Chip_GPIO_SetPinOutHigh(LPC_GPIO_T *pGPIO, uint8_t port, uint8_t pin)
{
pGPIO->SET[port] = (1 << pin);
}
STATIC INLINE void Chip_GPIO_SetPinOutLow(LPC_GPIO_T *pGPIO, uint8_t port, uint8_t pin)
{
pGPIO->CLR[port] = (1 << pin);
}
/*******************************************************************/
int main(void)
{
SystemCoreClockUpdate();
/* Initialise GPIO */
Chip_GPIO_Init(LPC_GPIO_PORT);
/* Set pin output */
Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 3, 3);
/* Set pin low */
Chip_GPIO_SetPinOutLow(LPC_GPIO_PORT, 3, 3);
// Enter an infinite loop
while(1)
{
/* Set pin high */
Chip_GPIO_SetPinOutHigh(LPC_GPIO_PORT, 3, 3);
/* Set pin low */
Chip_GPIO_SetPinOutLow(LPC_GPIO_PORT, 3, 3);
}
}
/*******************************************************************/