You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
drivers.zig adapting the HAL to DatagramDevice, Digital_IO and ClockDevice, like ch32v, plus a small Timer0-based time.zig.
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.
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.
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?
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!
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 (
.rodatain RAM, fixes #679), #1071 (GPIOread()fix) and #1070 (UART HAL, draft).Plan, one PR per step, with HAL files under
hals/atmega328p/like the ATtiny port (#947):drivers.zigadapting the HAL toDatagramDevice,Digital_IOandClockDevice, like ch32v, plus a small Timer0-basedtime.zig.drivers/src/wireless, followingssd1306.zig, with unit tests. It polls STATUS, since IRQ isn't wired on this board.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.Iofor the UART, and drivers can't useDatagramDevice.read.Questions:
DatagramDevicehas 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 atransceiveoperation (related to Create i2c (and spi) generic interface #637/proposal: rework timeouts, StreamDevices and DatagramDevices #701)?ClockDeviceneeds a monotonicu64microsecond clock. I'd use the Timer0 overflow (4 µs ticks), with the HAL exporting theTIMER0_OVFhandler for the app to register. That takes over PWM on D5/D6. OK, or is there a preferred approach?sbi/cbi, which need comptime operands, so theDigital_IOadapter 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!