|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | + <head> |
| 4 | + <meta charset="utf-8" /> |
| 5 | + <meta name="viewport" content="width=device-width, initial-scale=1" /> |
| 6 | + <title>Developer Hub • ESP-HACK</title> |
| 7 | + <link rel="stylesheet" href="../css/style.css" /> |
| 8 | + <script src="../js/site-nav.js?v=5" defer></script> |
| 9 | + </head> |
| 10 | + <body> |
| 11 | + <div class="lang-switch lang-switch--en" role="navigation" aria-label="Language"> |
| 12 | + <div class="lang-switch__track"> |
| 13 | + <span class="lang-switch__thumb" aria-hidden="true"></span> |
| 14 | + <a href="../page-developers.html" class="lang-switch__opt">RU</a> |
| 15 | + <span class="lang-switch__opt lang-switch__opt--current" aria-current="page">EN</span> |
| 16 | + </div> |
| 17 | + </div> |
| 18 | + <div class="shell shell--nav-left"> |
| 19 | + <aside class="sidebar" aria-label="Section navigation"> |
| 20 | + <div class="sidebar__inner"> |
| 21 | + <a class="sidebar__brand" href="https://github.com/Teapot174/ESP-HACK" aria-label="ESP-HACK GitHub">ESP-HACK</a> |
| 22 | + <nav aria-label="Wiki sections"> |
| 23 | + <div id="site-nav-container"></div> |
| 24 | + </nav> |
| 25 | + </div> |
| 26 | + </aside> |
| 27 | + |
| 28 | + <main class="content"> |
| 29 | + <div class="content__wrap"> |
| 30 | + <h1>For Developers</h1> |
| 31 | + |
| 32 | + <h2 id="pinout">Pinout</h2> |
| 33 | + <div class="code-block"> |
| 34 | + <button type="button" class="code-block__copy" aria-label="Copy pinout">Copy</button> |
| 35 | + <pre><code>// Display |
| 36 | +#define SCREEN_WIDTH 128 |
| 37 | +#define SCREEN_HEIGHT 64 |
| 38 | +#define OLED_ADR 0x3C |
| 39 | +#define OLED_RESET -1 |
| 40 | +#define OLED_SCL 22 |
| 41 | +#define OLED_SDA 21 |
| 42 | + |
| 43 | +// Buttons |
| 44 | +#define BUTTON_UP 27 // Up |
| 45 | +#define BUTTON_DOWN 26 // Down |
| 46 | +#define BUTTON_OK 33 // OK |
| 47 | +#define BUTTON_BACK 32 // Back |
| 48 | + |
| 49 | +// SD Card |
| 50 | +#define SD_CS 15 |
| 51 | +#define SD_MOSI 13 |
| 52 | +#define SD_CLK 14 |
| 53 | +#define SD_MISO 17 |
| 54 | + |
| 55 | +// CC1101 |
| 56 | +#define CC1101_GDO0 4 |
| 57 | +#define CC1101_CS 5 |
| 58 | +#define CC1101_SCK 18 |
| 59 | +#define CC1101_MOSI 23 |
| 60 | +#define CC1101_MISO 19 |
| 61 | + |
| 62 | +// Infrared |
| 63 | +#define IR_TRANSMITTER 16 |
| 64 | +#define IR_RECIVER 35 |
| 65 | + |
| 66 | +// GPIO |
| 67 | +#define GPIO_A 16 |
| 68 | +#define GPIO_B 2 |
| 69 | +#define GPIO_C 18 |
| 70 | +#define GPIO_D 23 |
| 71 | +#define GPIO_E 19 |
| 72 | +#define GPIO_F 25</code></pre> |
| 73 | + </div> |
| 74 | + |
| 75 | + <h2 id="gpio-feature">GPIO Peculiarity</h2> |
| 76 | + <p> |
| 77 | + GPIO uses 3 free pins - pin A (G16, IR-TX is used) which can be safely used, B (G2), F (G25) and pins C, D, E - these are VSPI pins and they are shared with CC1101 via CS pin (CC1101 has G5), so select another module in GPIO via CS pin. |
| 78 | + </p> |
| 79 | + </div> |
| 80 | + </main> |
| 81 | + </div> |
| 82 | + <script> |
| 83 | + (function () { |
| 84 | + document.querySelectorAll(".code-block__copy").forEach(function (btn) { |
| 85 | + btn.addEventListener("click", function () { |
| 86 | + var block = btn.closest(".code-block"); |
| 87 | + var code = block && block.querySelector("pre code"); |
| 88 | + if (!code) return; |
| 89 | + var text = code.textContent; |
| 90 | + var label = btn.textContent; |
| 91 | + function done() { |
| 92 | + btn.textContent = "Copied"; |
| 93 | + setTimeout(function () { |
| 94 | + btn.textContent = label; |
| 95 | + }, 1400); |
| 96 | + } |
| 97 | + if (navigator.clipboard && navigator.clipboard.writeText) { |
| 98 | + navigator.clipboard.writeText(text).then(done).catch(function () {}); |
| 99 | + } |
| 100 | + }); |
| 101 | + }); |
| 102 | + })(); |
| 103 | + </script> |
| 104 | + </body> |
| 105 | +</html> |
0 commit comments