GPIO port basic information
port | Pin | Signal name | Remarks |
---|---|---|---|
Button SW2 | 15 | GPIO22 | Low level is not pressed 0 |
Button SW3 | 04 | GPIO13 | Same as above |
LED D5 | 02 | GPIO11 | 0 off 1 on |
LED D6 | 01 | GPIO10 | Same as above |
LED D7 | 64 | GPIO09 | Same as above |
Because you want to use buttons to control the LED, you need to configure the ports corresponding to these devices. In order to save the port location of CC3200, one port corresponds to 7 or 8 modes. Manual configuration is very troublesome. At this time, we need to use the official software PinMux to help us.
- Open PinMux, select Device as CC3200
- Click the plus sign of GPIO under "Available Peripherals" and click the box in front of GPIO Signals to deselect all signals;
- Click "GPIO22" and "GPIO13", these two correspond to buttons, select these two as input "Input" pins; select GPIO9-11 as output "Output" pins, and these three correspond to LEDs.
- Download the corresponding file to the desktop;
- Renamed pin_mux_config.c to pinmux.c is mainly to facilitate the replacement of the original file, without having to modify the references in other places.
The Pinmux.h file is the same. Drag the rom_pin_mux_config.c file directly into the blinky folder, as shown in the figure below.
- Change the header files cited in the pinmux.c and rom_pin_mux_config.c files to pinmux.h;
- In this way, you can develop your own code on the basis of the water lamp project. Generally, our development projects will be modified in the sample project provided by the SDK, instead of creating a new file from a blank, so that we can reference the already defined functions, such as turning off the LED function, lighting up the LED function, etc.