How to group GPIO pins into 4-pin port?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to group GPIO pins into 4-pin port?

846 Views
jmullen_condose
Contributor III

In Processor Expert under CW and 9SQE16 MCU we could add a Component called "General Multi-bits I/O" and assign pins to it as required, for instance I would use this for creating a 4-bit "port" called LCD_DATA that would connect to a 32 character LCD display. Data would be strobed in using other GPIO pins for "E" and "R/S" - easy stuff.

Moving this to LPC844 MCU and MCUXpresso - I have got the general idea of the new API, but I cannot seem to figure our how to implement this same "4-pin" port or group for this same nibble-size data to the LCD. I know I can just write some messy code to bit-bang using any 4 GPIO, but I think perhaps I am overlooking something already in the API.... am I?

Thanks much!

Tags (1)
0 Kudos
1 Reply

815 Views
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hi Jeffrey, I hope you're doing well!

 

There are some functions in the MCUXpresso SDK which can allow the user to set, toggle, and clear groups of pins at the same time. However, they all will be set configured the same, performing exactly the same operation to each of the specified pins.

 

The functions are:

static void GPIO_PortSet ( GPIO_Type * base, uint32_t port, uint32_t mask )
 
static void GPIO_PortClear ( GPIO_Type * base, uint32_t port, uint32_t mask )
 
static void GPIO_PortToggle ( GPIO_Type * base, uint32_t port, uint32_t mask )

 

More information about these functions can be found in the MCUXpresso SDK API User Guide.

Please let me know if you need any more information.

 

Best regards,

Sebastian

0 Kudos