Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

AVR (ATmega328P): UART/SPI HAL, drivers.zig, and nRF24L01+ driver (Emakefun RF-Nano V3.0)

未關閉
#1,069 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

@matpala 已經在處理了。

開始於 2026年10月8日。

  • #1077 來自 @matpala —— 未關閉
  • #1083 來自 @matpala —— 未關閉

評估

難度
5/5
預估耗時
一週以上
新手友好度
35/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
zig
領域
embedded-iot

研究方向

Start with the referenced ATtiny port (#947), the related issues #637 and #701, and the existing work listed in the body, especially draft #1070. The plan spans an ATmega328P HAL, adapters, timing, an nRF24L01+ driver with unit tests, and examples; first get maintainer feedback on the open API and hardware questions. Done means the proposed steps are accepted and implemented, including tested send/receive examples.

由索引模型根據 Issue 內容生成。

描述

I'd like to add support for the Emakefun RF-Nano V3.0 (repo): an Arduino Nano clone (ATmega328P @ 16 MHz) with an onboard nRF24L01+ on the hardware SPI bus. I have the boards and test everything on hardware.

Already up: #1063 (blinky delay), #1064 (board), #1068 (.rodata in RAM, fixes #679), #1071 (GPIO read() fix) and #1070 (UART HAL, draft).

Plan, one PR per step, with HAL files under hals/atmega328p/ like the ATtiny port (#947):

  1. UART (#1070).
  2. SPI host HAL.
  3. drivers.zig adapting the HAL to DatagramDevice, Digital_IO and ClockDevice, like ch32v, plus a small Timer0-based time.zig.
  4. An MCU-agnostic nRF24L01+ driver in drivers/src/wireless, following ssd1306.zig, with unit tests. It polls STATUS, since IRQ isn't wired on this board.
  5. Send/receive examples between two boards.

Note: on AVR, Zig 0.17.0 fails to compile some error unions with a payload (ziglang/zig#37099, fix pending). So for now there's no std.Io for the UART, and drivers can't use DatagramDevice.read.

Questions:

  1. DatagramDevice has no full-duplex transfer, so the STATUS byte the nRF24 sends back with every command is lost, and the driver needs an extra transaction to read it. Is that fine, or would you rather add a transceive operation (related to #637/#701)?
  2. ClockDevice needs a monotonic u64 microsecond clock. I'd use the Timer0 overflow (4 µs ticks), with the HAL exporting the TIMER0_OVF handler for the app to register. That takes over PWM on D5/D6. OK, or is there a preferred approach?
  3. AVR GPIO uses sbi/cbi, which need comptime operands, so the Digital_IO adapter would be one type per comptime pin (e.g. GPIO_Device(.d, 7)). OK?

Is the nRF24 driver welcome in drivers/? Any feedback is appreciated!

主要語言
Zig
星號
2.3k
分支
198
平均合併
1 天 8 小時
30 天內合併 PR
37

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

ZigEmbeddedGroup/microzig 的其他 Issue

查看 ZigEmbeddedGroup/microzig 的全部 Issue

相似的 Issue

更多 Embedded & IoT Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。