docs: Add README for daplink_flash driver.#252
Conversation
There was a problem hiding this comment.
Review - PR #252
Points positifs
- Contenu exhaustif : toutes les méthodes de l'API sont documentées avec paramètres et valeurs de retour.
- Bon usage des exemples de code pour chaque méthode.
- Section config zone bien separée et expliquée.
- Table des exemples présente
Corrections requises
1. Niveaux de titres incohérents (bloquant)
Les sections Features, I2C Address, API, Examples, Notes utilisent # (H1) au lieu de ## (H2). Seul le titre principal doit être en H1. Compare avec les READMEs de référence (lib/ism330dl/README.md, lib/wsen-hids/README.md) : tout est en ## sauf le titre du driver.
2. Section "Sensor overview" manquante
Les READMEs de référence décrivent le composant (fabricant, datasheet, caractéristiques). Ici on ne sait pas que c'est un W25Q64JV de Winbond derrière le bridge, ni qu'il y a 8 Mo de flash. Ajoute une section qui présente brièvement l'architecture (STM32F103 bridge + W25Q64JV flash + config zone en flash interne).
3. Section Status incomplete
_status() et _error() ne sont pas documentés. Les READMEs de référence documentent _status()même si c est privé Pour un driver de flash, le registre d'erreur est important pour le debug.
4. Pas de section Installation
Les READMEs de référence montrent comment installer le driver (mpremote mip, firmware frozen, etc.).
5. write_config docstring inexact
Le README dit "existing data outside the written range is preserved". C'est faux : le driver fait clear_config() puis écrit, donc tout est effacé avant l'écriture. Vérifie le code dans device.py et corrige la doc.
Suggestion
Relis lib/ism330dl/README.md comme modèle et vérifie que la structure (sections, niveaux de titres, ordre) correspond.
There was a problem hiding this comment.
Pull request overview
Adds a driver-level README for daplink_flash, bringing it in line with the repository’s pattern of per-driver documentation and closing #177.
Changes:
- Introduces
lib/daplink_flash/README.mddocumenting the driver’s purpose, I²C address, and basic usage. - Documents the public
DaplinkFlashAPI (flash operations + config zone access). - Adds an examples table and an
mpremoteinvocation snippet for running examples.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| # I²C Address | ||
|
|
||
| Default 7-bit I²C address: ```0x3B``` |
There was a problem hiding this comment.
Inline values are formatted with triple backticks (e.g., 0x3B), which is uncommon and can be confusing next to fenced code blocks. For consistency with other driver READMEs, use single-backtick inline code spans for addresses/IDs (e.g., 0x3B).
| Default 7-bit I²C address: ```0x3B``` | |
| Default 7-bit I²C address: `0x3B` |
| Expected value: ```0x4C``` | ||
|
|
There was a problem hiding this comment.
The expected WHO_AM_I value is formatted as 0x4C. Prefer a normal inline code span (0x4C) to match the style used in other READMEs and avoid ambiguity with fenced code blocks.
| | Example | Description | | ||
| | ---------------- | -------------------------------------------------------------------------- | | ||
| | `flash_info.py` | Display bridge ID, status, error register, busy flag, and current filename | | ||
| | `write_csv.py` | Create a CSV file in flash, write a few lines, then read it back | | ||
| | `read_file.py` | Read and display the currently stored file | | ||
| | `erase_flash.py` | Erase the external flash memory | | ||
| | `sensor_log.py` | Log simulated sensor data to CSV, read it back, and compute statistics | | ||
| | `config_zone.py` | Test and demonstrate persistent config zone operations | | ||
|
|
There was a problem hiding this comment.
The Examples table has an extra empty column because rows start with || ... instead of a single leading |. This renders incorrectly on GitHub; use standard markdown table syntax with single | separators for the header and each row.
|
This PR is blocked by #256 — daplink_flash will be refactored into daplink_bridge + daplink_flash. Please put this on hold until the refactoring is merged, then adapt the README to the new architecture. |
|
Les remarques de Copilot sur le formatage Markdown ont été corrigées dans 8bdfdd1 :
Corrections rapides et évidentes, elles n'auraient pas dû rester en attente même si la PR doit rester en attente. |
8bdfdd1 to
9a9c828
Compare
9a9c828 to
51a66b1
Compare
|
Les deux réserves documentaires sont déjà résolues sur cette branche (héritées de main après rebase sur #285) :
La branche est prête à fusionner. |
|
🎉 This PR is included in version 0.2.5 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Summary
Rewrite the daplink_flash README to reflect the bridge refactor (#256):
DaplinkFlash(bridge)instead ofDaplinkFlash(i2c)daplink_bridgeCloses #177
Test plan