This post describes how to use the two pushbuttons on the new Hercules LaunchPad type II.
Button A connects to pin 55, and is multiplexed as:
- MIBSPI3NCS_0
- AD2EVT
- GIOB_2
- EQEP1I
In the HALCoGen PINMUX tab, we set the pin 55 to GIO
The pin 55 is a special case. It also requires that you make the following Special Pin Muxing setting:
That's all that's needed in HALCoGen.
In Code Composer Studio, add this call to sys_main.c to initialize the gio driver.
gioInit(); // user button A is on the GIOB port, 2
You can check the state of the button in your code by executing:
gioGetBit(gioPORTB, 2);
Button BButton B connects to pin 41, and multiplexes as
- N2HET1_15
- MIBSPI1NCS_4
- ECAP1
We MUX Button B as NHET (NHET1 pin 15). This port/pin combination can be used in the GIO API as a generic GIO pin.
You need to enable the NHET driver in HALCoGen so that the header files with the HET registers are created. I also call the init of the HET driver.
gioInit();
hetInit(); // user button B is on the HET1 port, 15
You can check the state of the button in your code by executing:
gioGetBit(hetPORT1, 15);
Comments
Please log in or sign up to comment.