MCPcopy Create free account
hub / github.com/bmorcelli/Launcher / _setup_gpio

Function _setup_gpio

boards/m5stack-sticks3/interface.cpp:15–45  ·  view source on GitHub ↗

** Function name: _setup_gpio() ** Location: main.cpp ** Description: initial setup for the device ***************************************************************************************/

Source from the content-addressed store, hash-verified

13** Description: initial setup for the device
14***************************************************************************************/
15void _setup_gpio() {
16 M5.begin();
17 M5.Power.setExtOutput(false);
18 // Disable 5V output to external port
19 /*
20 | Device | SCK | MISO | MOSI | CS | GDO0/CE |
21 | --- | :---: | :---: | :---: | :---: | :---: |
22 | SD Card | 5 | 4 | 6 | 7 | --- |
23 | CC1101 | 5 | 4 | 6 | 2 | 3 |
24 | NRF24 | 5 | 4 | 6 | 8 | 1 |
25 | PN532 | 5 | 4 | 6 | 43 | -- |
26 | WS500 | 5 | 4 | 6 | ** | ** |
27 | LoRa | 5 | 4 | 6 | ** | ** |
28 */
29 launcherGpioOutput(7);
30 launcherGpioWrite(7, HIGH); // SD Card CS
31 launcherGpioOutput(2);
32 launcherGpioWrite(2, HIGH); // CC1101 CS
33 launcherGpioOutput(8);
34 launcherGpioWrite(8, HIGH); // nRF24L01 CS
35 launcherGpioOutput(43);
36 launcherGpioWrite(43, HIGH); // PN532 CS
37 launcherGpioOutput(9);
38 launcherGpioWrite(9, LOW); // M5RF433 avoid Jamming
39 launcherGpioOutput(46);
40 launcherGpioWrite(46, LOW); // Infrared LED Off
41
42 M5.BtnA.setDebounceThresh(8);
43 M5.BtnB.setDebounceThresh(8);
44 M5.BtnB.setHoldThresh(kBtnBLongPressMs);
45}
46/*********************************************************************
47** Function: setBrightness
48** location: settings.cpp

Callers

nothing calls this directly

Calls 3

launcherGpioOutputFunction · 0.85
launcherGpioWriteFunction · 0.85
beginMethod · 0.45

Tested by

no test coverage detected