Skip to content

Commit bfe6a1c

Browse files
authored
Tidy up Camera according to latest guidelines (#3375)
* Tidy up `Camera` according to latest guidelines * fmt * enum
1 parent 4ec4e6c commit bfe6a1c

File tree

5 files changed

+287
-189
lines changed

5 files changed

+287
-189
lines changed

esp-hal/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3939
- Moved numbered GPIO pin types from `esp_hal::gpio::GpioPin<N>` to `esp_hal::peripherals::GPION<'_>` (#3349)
4040
- Moved DMA channel types from `esp_hal::dma::DmaChannelN`/`esp_hal::dma::XYDmaChannel` to `esp_hal::peripherals::DMA_XY` (#3372)
4141
- `ParlIoFullDuplex`, `ParlIoTxOnly` and `ParlIoRxOnly` have been merged into `ParlIo` (#3366)
42+
- All `Camera` pins are now configured using `with_*()` methods (#3237)
4243

4344
### Fixed
4445

esp-hal/MIGRATING-1.0.0-beta.0.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,3 +224,39 @@ The affected types in the `gpio::interconnect` module are:
224224
+ BurstConfig::default(),
225225
).unwrap();
226226
```
227+
228+
## LCD_CAM Camera changes
229+
230+
The data and ctrl pins of the camera have been split out into individual `with_*` methods.
231+
232+
```diff
233+
- camera.with_ctrl_pins(vsync_pin, href_pin);
234+
+ camera.with_vsync(vsync_pin).with_h_enable(href_pin);
235+
+ config.with_vh_de_mode(VhdeMode::VsyncHsync);
236+
```
237+
238+
```diff
239+
- camera.with_ctrl_pins_and_de(vsync_pin, hsync_pin, href_pin);
240+
+ camera.with_vsync(vsync_pin).with_hsync(hsync_pin).with_h_enable(href_pin);
241+
+ config.with_vh_de_mode(VhdeMode::De); // Needed to enable HSYNC pin
242+
```
243+
244+
```diff
245+
- let data_pins = RxEightBits::new(
246+
- peripherals.GPIO11,
247+
- peripherals.GPIO9,
248+
- peripherals.GPIO8,
249+
- ....
250+
- );
251+
let mut camera = Camera::new(
252+
lcd_cam.cam,
253+
peripherals.DMA_CH0,
254+
- data_pins,
255+
- config,
256+
+ config.with_enable_2byte_mode(false) // If you were previously using RxEightBits (This is the default)
257+
+ config.with_enable_2byte_mode(true) // If you were previously using RxSixteenBits
258+
)?;
259+
260+
+ camera.with_data0(peripherals.GPIO11).with_data1(peripherals.GPIO9).with_dataX();
261+
262+
```

0 commit comments

Comments
 (0)