# WF100DPZ Arduino Library

Arduino library for the WF100DPZ pressure sensor family using the sensor's 3-wire SPI interface.

## WF100DPZ Sensor Features
- Callibrated digital pressure sensor with integrated temperature output
- SPI / I2C Interface
- Pressure-ranges from 5kPa to 1000 kPa
- Integrated 24-bit ADC
- Sample rates >480Hz (Individual) or >240Hz (Combined).

## Library Features
- Blocking reads: `readTemp`, `readPressure`, `readCombined`
- Non-blocking one-shot reads: `start`, `ready`, `getResult`
- Non-blocking continuous reads: `startContinuous`, `continuousReady`, `getContinuousResult`
- Runtime configuration via `Config`, including `sample_interval`
- Dual backend design: `BitBang` for broad Arduino compatibility and `EspIdf3Wire` on ESP32 for higher SPI clock rates

## Hardware Interface
Connect the sensor pins as:
| WF100DPZ Pin | Pin Function | Arduino Uno Pin Connection | ESP32-S3 Pin Connection |
|:--------------|:--------------:|:----------------------------:|:-------------------------:|
| CSB          | Chip Select  | D10                        | GPIO10                  |
| SDA          | SPI Data     | D11                        | GPIO11                  |
| CLK          | SPI Clock    | D13                        | GPIO12                  |
| VDD          | VDD          | 3.3V (recommended)         | 3.3V                    |
| GND          | GND          | GND                        | GND                     |



## Installation
Install using Arduino Library Manager or manually:
1. Download/clone this repository.
2. Place it in your Arduino `libraries` folder as `WF100DPZ`.
3. Restart Arduino IDE.

## Examples
- `examples/QuickStart/QuickStart.ino`  
  Basic startup, part ID read, and blocking combined temperature/pressure measurements.
- `examples/AdvancedConfig/AdvancedConfig.ino`  
  Shows how to build and apply a custom `WF100DPZ::Config` (backend, SPI clock, sample interval, and auto-refresh policy).
- `examples/NonBlockingRead/NonBlockingRead.ino`  
  Demonstrates one-shot non-blocking workflow: `start` -> `ready` -> `getResult`.
- `examples/ContinuousRead/ContinuousRead.ino`  
  Demonstrates continuous non-blocking workflow: `startContinuous` -> `continuousReady` -> `getContinuousResult`.

## Library Documentation
A detailed API is provided in [API.md](docs/API.md) with detailed explanations of all the provided library methods and constructors.

## Platform Notes
- The three-wire SPI interface is only available on ESP32.
- On other platforms a bit-bang backend is provided.

## License
This project is licensed under the [MIT License](LICENSE).

## Support
Use GitHub Issues in this repository for bug reports and feature requests.
