-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[enhancement] Expose FSM_ROTARY_ENCODER macros for flexible rotary encoder support (with variant example) #8060
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Halcao
wants to merge
9
commits into
meshtastic:develop
Choose a base branch
from
Halcao:fsm_rotary_encoder
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+152
−7
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
92c4e71
expose FSM_ROTARY_ENCODER
Halcao 456792a
expose fsm rotary encoder internal parameter
Halcao 4e7a8fe
add example config
Halcao a1bdd1a
fix header include
Halcao 166843e
remove tlora_pager macro
Halcao 003579c
re-order board-level
Halcao 6045c92
format code
Halcao 299c0ee
Merge branch 'develop' into fsm_rotary_encoder
thebentern 2152aff
Merge branch 'develop' into fsm_rotary_encoder
Halcao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#ifndef Pins_Arduino_h | ||
#define Pins_Arduino_h | ||
|
||
#include <stdint.h> | ||
|
||
static const uint8_t TX = 0; | ||
static const uint8_t RX = 0; | ||
|
||
static const uint8_t SDA = 10; | ||
static const uint8_t SCL = 20; | ||
|
||
static const uint8_t SS = 7; | ||
static const uint8_t MOSI = 5; | ||
static const uint8_t MISO = 6; | ||
static const uint8_t SCK = 4; | ||
|
||
static const uint8_t A0 = 0; | ||
static const uint8_t A1 = 1; | ||
static const uint8_t A2 = 2; | ||
static const uint8_t A3 = 3; | ||
static const uint8_t A4 = 4; | ||
static const uint8_t A5 = 5; | ||
|
||
#endif /* Pins_Arduino_h */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
; ESP32 C3 Super Mini + Ebyte E22 400M30S Board | ||
; https://www.espboards.dev/esp32/esp32-c3-super-mini/ | ||
[env:esp32c3_nova_lora] | ||
extends = esp32c3_base | ||
board = esp32-c3-devkitm-1 | ||
board_level = extra | ||
build_flags = | ||
${esp32_base.build_flags} | ||
-D PRIVATE_HW | ||
-D NOVA_LORA | ||
-I variants/esp32c3/diy/esp32c3_nova_lora | ||
-D ARDUINO_USB_MODE=1 | ||
-D ARDUINO_USB_CDC_ON_BOOT=1 | ||
-D MESHTASTIC_EXCLUDE_ATAK=1 | ||
-D MESHTASTIC_EXCLUDE_DETECTIONSENSOR=1 | ||
|
||
lib_deps = ${esp32c3_base.lib_deps} | ||
https://github.com/mverch67/BQ27220/archive/07d92be846abd8a0258a50c23198dac0858b22ed.zip | ||
https://github.com/mverch67/RotaryEncoder/archive/25a59d5745a6645536f921427d80b08e78f886d4.zip | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#ifndef _VARIANT_ESP32C3_NOVA_LORA_ | ||
#define _VARIANT_ESP32C3_NOVA_LORA_ | ||
|
||
/*---------------------------------------------------------------------------- | ||
* Headers | ||
*----------------------------------------------------------------------------*/ | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif // __cplusplus | ||
|
||
// Status | ||
#define LED_PIN 8 | ||
#define LED_STATE_ON 1 // State when LED is lit | ||
|
||
// I2C (Wire) & OLED | ||
#define WIRE_INTERFACES_COUNT (1) | ||
#define I2C_SDA (10) | ||
#define I2C_SCL (20) | ||
|
||
#define HAS_SCREEN 1 | ||
#define USE_SSD1306 | ||
#define DISPLAY_FLIP_SCREEN | ||
|
||
// Button | ||
#define HAS_BUTTON 1 | ||
#define BUTTON_PIN (9) // BOOT button | ||
|
||
#define FSM_ROTARY_ENCODER 1 | ||
#define FSM_ROTARY_ENCODER_DEBOUNCE 300 | ||
#define FSM_ROTARY_ENCODER_CHECK_INTERVAL 2 | ||
#define ROTARY_A (2) | ||
#define ROTARY_B (1) | ||
#define ROTARY_PRESS (9) | ||
|
||
// #define USE_VIRTUAL_KEYBOARD 1 | ||
#define CANNED_MESSAGE_MODULE_ENABLE 1 | ||
|
||
// LoRa | ||
#define USE_LLCC68 | ||
#define USE_SX1262 | ||
// #define USE_RF95 | ||
#define USE_SX1268 | ||
|
||
#define LORA_DIO0 RADIOLIB_NC | ||
#define LORA_RESET (0) | ||
#define LORA_DIO1 (3) | ||
#define LORA_BUSY (21) | ||
#define LORA_SCK (4) | ||
#define LORA_MISO (6) | ||
#define LORA_MOSI (5) | ||
#define LORA_CS (7) | ||
|
||
#define LORA_RXEN RADIOLIB_NC | ||
#define LORA_TXEN RADIOLIB_NC | ||
#define SX126X_DIO2_AS_RF_SWITCH | ||
|
||
#define SX126X_CS LORA_CS | ||
#define SX126X_DIO1 LORA_DIO1 | ||
#define SX126X_BUSY LORA_BUSY | ||
#define SX126X_RESET LORA_RESET | ||
#define SX126X_RXEN LORA_RXEN | ||
#define SX126X_TXEN LORA_TXEN | ||
|
||
// Power | ||
// Outputting 22dBm from SX1262 results in ~30dBm E22-900M30S output (module only uses last stage of the YP2233W PA) | ||
#define SX126X_MAX_POWER 22 // SX126xInterface.cpp defaults to 22 if not defined, but here we define it for good practice | ||
// #ifdef EBYTE_E22_900M30S | ||
// 10dB PA gain and 30dB rated output; based on measurements from | ||
// https://github.com/S5NC/EBYTE_ESP32-S3/blob/main/E22-900M30S%20power%20output%20testing.txt | ||
// #define TX_GAIN_LORA 7 | ||
// #define SX126X_MAX_POWER 22 | ||
// #endif | ||
|
||
// E22 series TCXO voltage is 1.8V per https://www.ebyte.com/en/pdf-down.aspx?id=781 (source | ||
// https://github.com/jgromes/RadioLib/issues/12#issuecomment-520695575), so set it as such | ||
#define SX126X_DIO3_TCXO_VOLTAGE 1.8 | ||
// #define SX126X_DIO3_TCXO_VOLTAGE 2.2 | ||
#define TCXO_OPTIONAL // make it so that the firmware can try both TCXO and XTAL | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
/*---------------------------------------------------------------------------- | ||
* Arduino objects - C++ only | ||
*----------------------------------------------------------------------------*/ | ||
|
||
#endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.