Skip to content

Commit c66e7e3

Browse files
Cleanup docs
1 parent ec8e039 commit c66e7e3

File tree

11 files changed

+397
-1015
lines changed

11 files changed

+397
-1015
lines changed

README.md

Lines changed: 45 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,9 @@ High-performance DMA-based driver for HUB75 RGB LED matrix panels, supporting ES
2222
-**PSRAM support** - ESP32-P4 PARLIO uses PSRAM for large buffers (frees internal SRAM)
2323
-**Temporal dithering** - Planned
2424

25-
## Platform Status
26-
27-
-**ESP32-S3 (GDMA)** - Working
28-
-**ESP32/S2 (I2S)** - Implemented, untested on hardware
29-
-**ESP32-P4 (PARLIO)** - Working (uses PSRAM via EDMA)
30-
-**ESP32-C6 (PARLIO)** - Implemented, untested on hardware
31-
3225
## Installation
3326

34-
This is an **ESP-IDF component**. It can be used in ESP-IDF or ESPHome projects.
35-
36-
**For ESP-IDF projects:** Add via Component Manager in your `idf_component.yml`:
27+
Add to your project via Component Manager (`idf_component.yml`):
3728

3829
```yaml
3930
dependencies:
@@ -42,197 +33,97 @@ dependencies:
4233
path: components/hub75 # Important: point to the component subdirectory!
4334
```
4435
45-
See [components/hub75/README.md](components/hub75/README.md) for detailed installation instructions and API documentation.
36+
See [Component Documentation](components/hub75/README.md) for manual installation options.
4637
4738
## Quick Start
4839
49-
```cpp
50-
#include "hub75.h"
51-
52-
void app_main() {
53-
// Configure for your panel
54-
Hub75Config config{};
55-
config.panel_width = 64;
56-
config.panel_height = 64;
57-
config.scan_pattern = Hub75ScanPattern::SCAN_1_32;
58-
config.scan_wiring = ScanPattern::STANDARD_TWO_SCAN; // Most panels use this
59-
config.shift_driver = ShiftDriver::FM6126A; // Or GENERIC if unsure
60-
61-
// Set GPIO pins (see examples/common/pins_example.h for board-specific configs)
62-
config.pins.r1 = 25;
63-
config.pins.g1 = 26;
64-
config.pins.b1 = 27;
65-
config.pins.r2 = 14;
66-
config.pins.g2 = 12;
67-
config.pins.b2 = 13;
68-
config.pins.a = 23;
69-
config.pins.b = 19;
70-
config.pins.c = 5;
71-
config.pins.d = 17;
72-
config.pins.e = -1;
73-
config.pins.lat = 4;
74-
config.pins.oe = 15;
75-
config.pins.clk = 16;
76-
77-
// Create and start driver
78-
Hub75Driver driver(config);
79-
driver.begin(); // Starts continuous refresh
80-
81-
// Just draw - changes appear automatically!
82-
driver.set_pixel(10, 10, 255, 0, 0); // Red pixel
83-
driver.set_pixel(20, 20, 0, 255, 0); // Green pixel
84-
driver.set_pixel(30, 30, 0, 0, 255); // Blue pixel
85-
86-
// Optional: Double buffering for tear-free animation
87-
if (config.double_buffer) {
88-
driver.clear(); // Clear back buffer
89-
// ... draw frame ...
90-
driver.flip_buffer(); // Atomic swap
91-
}
92-
}
93-
```
40+
Configure your panel hardware, set GPIO pins, call `begin()`, and start drawing pixels. The driver handles continuous DMA refresh automatically - no CPU intervention needed after initialization. Supports single pixels (`set_pixel`), bulk writes (`draw_pixels`), and double buffering for tear-free animation.
9441

95-
**See [components/hub75/README.md](components/hub75/README.md) for detailed API reference and configuration options.**
42+
See [examples/](examples/) for working code and [Component Documentation](components/hub75/README.md) for complete API reference.
9643

9744
## Building & Testing Standalone
9845

9946
This repository includes a standalone test application and examples that can be built and run directly.
10047

10148
### Build and Run Test Application
10249

103-
The root project contains a simple test application in `main/`:
104-
10550
```bash
10651
cd esp-hub75
10752
idf.py set-target esp32s3 # or esp32, esp32s2, esp32c6, esp32p4
10853
idf.py build
10954
idf.py flash monitor
11055
```
11156

112-
The test application is based on `examples/01_simple_test` and demonstrates basic pixel drawing.
113-
11457
### Build and Run Examples
11558

116-
Each example can be built independently:
117-
11859
```bash
119-
cd examples/01_simple_test
60+
cd examples/01_basic/simple_colors
12061
idf.py set-target esp32s3
12162
idf.py build
12263
idf.py flash monitor
12364
```
12465

12566
**Available Examples:**
67+
- `01_basic/` - Simple color tests, gradients, brightness control
68+
- `02_multi_panel/` - Multi-panel layout demonstrations
69+
- `03_lvgl/` - LVGL graphics library integration
70+
- `common/` - Shared pin configuration examples
12671

127-
- **01_simple_test** - Basic pixel drawing and color test patterns
128-
- **02_rgb565_test** - RGB565 pixel format usage
129-
- **03_double_buffer** - Double buffering for tear-free animation
130-
- **04_lvgl_integration** - LVGL graphics library integration
131-
132-
Each example includes a `README.md` with specific instructions and pin configuration guidance.
72+
Each example includes specific instructions and pin configuration guidance.
13373

13474
## ESPHome Integration
13575

136-
```yaml
137-
external_components:
138-
- source: github://stuartparmenter/hub75-esphome
139-
components: [ hub75_display ]
140-
141-
display:
142-
- platform: hub75_display
143-
id: my_display
144-
panel_width: 64
145-
panel_height: 64
146-
scan_pattern: SCAN_1_32
147-
shift_driver: FM6126A # Optional: for panels that need special init
148-
149-
# Multi-panel layout (optional)
150-
layout_rows: 2
151-
layout_cols: 2
152-
layout: TOP_LEFT_DOWN # Serpentine wiring
153-
154-
# Pin configuration
155-
pin_r1: 25
156-
pin_g1: 26
157-
pin_b1: 27
158-
pin_r2: 14
159-
pin_g2: 12
160-
pin_b2: 13
161-
pin_a: 23
162-
pin_b: 19
163-
pin_c: 5
164-
pin_d: 17
165-
pin_e: -1
166-
pin_lat: 4
167-
pin_oe: 15
168-
pin_clk: 16
169-
```
76+
An ESPHome component is available that wraps this driver for easy integration with ESPHome projects. Supports all driver features including multi-panel layouts, shift driver initialization, and platform auto-detection.
17077

171-
See [hub75-esphome](https://github.com/stuartparmenter/hub75-esphome) repository for the full ESPHome component documentation.
78+
See [hub75-esphome](https://github.com/stuartparmenter/hub75-esphome) for installation and configuration.
17279

17380
## Project Structure
17481

17582
This repository is structured as an **ESP-IDF component** with a standalone test application:
17683

17784
```
178-
esp-hub75/ # Repository root
179-
├── CMakeLists.txt # Root project (for standalone idf.py build)
180-
├── main/ # Test application (for standalone build)
181-
│ ├── CMakeLists.txt
182-
│ └── main.cpp # Simple test example
85+
esp-hub75/ # Repository root
86+
├── main/ # Standalone test application
18387
├── components/
184-
│ └── hub75/ # ← THE COMPONENT (point here when including!)
185-
│ ├── CMakeLists.txt # Component build rules
186-
│ ├── idf_component.yml # Component manifest
187-
│ ├── include/ # Public API headers
188-
│ │ ├── hub75.h # Main API
189-
│ │ ├── hub75_types.h # Common types
190-
│ │ └── hub75_config.h # Compile-time config
191-
│ └── src/ # Implementation
192-
│ ├── core/ # Core driver
193-
│ │ └── hub75_driver.cpp # Main driver coordinator (~200 lines)
194-
│ ├── color/ # Color conversion
195-
│ │ ├── color_lut.cpp # CIE 1931 gamma LUTs
196-
│ │ └── color_convert.cpp # RGB888/RGB565 conversion
197-
│ ├── panels/ # Panel compatibility
198-
│ │ ├── scan_patterns.h # Non-standard scan coordinate remapping
199-
│ │ └── panel_layout.h # Multi-panel chaining (serpentine/zigzag)
200-
│ └── platforms/ # Platform-specific DMA
201-
│ ├── platform_dma.h # Abstract DMA interface
202-
│ ├── platform_detect.cpp # Platform detection
203-
│ ├── i2s/ # ESP32/ESP32-S2 (~871 lines)
204-
│ │ ├── i2s_dma.cpp
205-
│ │ └── i2s_dma.h
206-
│ ├── gdma/ # ESP32-S3 (~857 lines)
207-
│ │ ├── gdma_dma.cpp
208-
│ │ └── gdma_dma.h
209-
│ └── parlio/ # ESP32-P4 (~730 lines, untested)
210-
│ ├── parlio_dma.cpp
211-
│ └── parlio_dma.h
212-
└── examples/ # Additional examples
213-
├── common/
214-
│ └── pins_example.h # Pin configuration examples
215-
├── 01_simple_test/
216-
├── 02_rgb565_test/
217-
├── 03_double_buffer/
218-
└── 04_lvgl_integration/
88+
│ └── hub75/ # ← THE COMPONENT (point here when including!)
89+
│ ├── include/ # Public API headers
90+
│ └── src/
91+
│ ├── core/ # Core driver coordinator
92+
│ ├── color/ # CIE 1931 gamma LUTs & pixel format conversion
93+
│ ├── panels/ # Scan pattern & multi-panel layout remapping
94+
│ └── platforms/ # Platform-specific DMA implementations
95+
│ ├── i2s/ # ESP32/ESP32-S2
96+
│ ├── gdma/ # ESP32-S3
97+
│ └── parlio/ # ESP32-P4/C6
98+
└── examples/
99+
├── common/ # Pin configuration examples
100+
├── 01_basic/ # Simple color tests
101+
├── 02_multi_panel/ # Multi-panel layouts
102+
└── 03_lvgl/ # LVGL integration
219103
```
220104

221105
**Important**: When including this component in your project, point to `components/hub75/` subdirectory, not the repository root.
222106

223-
## Configuration & API
107+
## Documentation
108+
109+
### API Reference & Quick Start
224110

225-
The driver is highly configurable with support for:
111+
Complete API documentation is available in [components/hub75/README.md](components/hub75/README.md):
112+
- Installation options (Component Manager, manual copy)
113+
- API methods (initialization, drawing, brightness control, double buffering)
114+
- Configuration options (hardware specs, scan patterns, multi-panel layouts)
115+
- Brief troubleshooting guide
226116

227-
- **Hardware specs:** Panel dimensions, scan patterns, shift driver chips
228-
- **Multi-panel layouts:** Serpentine and zigzag chaining for M×N grids
229-
- **Performance tuning:** Clock speed, bit depth, refresh rate
230-
- **Color control:** Gamma correction (CIE 1931, Gamma 2.2), brightness, intensity
231-
- **Advanced features:** Double buffering, temporal dithering (planned)
117+
### Technical Deep-Dives
232118

233-
**Pin configuration examples:** See [examples/common/pins_example.h](examples/common/pins_example.h) for board-specific GPIO layouts.
119+
For architecture, platform specifics, and advanced topics, see [docs/](docs/):
120+
- **[Architecture Overview](docs/ARCHITECTURE.md)** - How BCM timing and static DMA chains work
121+
- **[Platform Details](docs/PLATFORMS.md)** - Platform comparison, memory calculations, and optimization strategies
122+
- **[Troubleshooting Guide](docs/TROUBLESHOOTING.md)** - Complete debugging reference
123+
- **[Multi-Panel Guide](docs/MULTI_PANEL.md)** - Layout patterns, wiring diagrams, coordinate remapping
124+
- **[Color & Gamma](docs/COLOR_GAMMA.md)** - CIE 1931 correction and bit depth guide
234125

235-
**Full documentation:** See [components/hub75/README.md](components/hub75/README.md) for complete API reference, configuration options, multi-panel layouts, and troubleshooting guidance.
126+
**Pin configuration examples:** See [examples/common/](examples/common/) for board-specific GPIO layouts.
236127

237128
## References
238129

0 commit comments

Comments
 (0)