Skip to content

YWF: Peripherals#566

Merged
alevy merged 5 commits intomasterfrom
dev/ywf-peripherals
Apr 24, 2026
Merged

YWF: Peripherals#566
alevy merged 5 commits intomasterfrom
dev/ywf-peripherals

Conversation

@bradjc
Copy link
Copy Markdown
Contributor

@bradjc bradjc commented Mar 30, 2026

I used claude to convert the libtock-sync/peripherals syscalls to YWF.

I am reviewing all changes now.

I have reviewed all changes and tested crc/gpio/rng.

bradjc and others added 3 commits March 30, 2026 12:31
…sync

Add GPIO and ADC utility functions to libtock-sync so that examples only
need to use libtock-sync for peripheral operations rather than mixing in
raw libtock or syscall headers.

libtock/peripherals/gpio_types.h (new):
  Move libtock_gpio_input_mode_t and libtock_gpio_interrupt_mode_t enums
  out of gpio.h into a shared types header so libtock-sync can include
  only the types without pulling in the full libtock GPIO API.

libtock-sync/peripherals/gpio:
  Add libtocksync_gpio_enable_input() and libtocksync_gpio_read() for
  non-blocking GPIO configuration and pin reads.

libtock-sync/peripherals/adc:
  Add libtocksync_adc_channel_count(), libtocksync_adc_reference_voltage(),
  and libtocksync_adc_resolution_bits() query helpers.

examples:
  Update adc, hail, imix, and microbit_v2 examples to use the new
  libtock-sync functions instead of mixing in libtock peripheral or
  syscall headers directly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bradjc bradjc force-pushed the dev/ywf-peripherals branch from 430afea to a4c1108 Compare March 30, 2026 18:04
@bradjc bradjc force-pushed the dev/ywf-peripherals branch from a4c1108 to e52fa93 Compare March 30, 2026 18:07
Copy link
Copy Markdown
Contributor

@brghena brghena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty mechanical, looks fine overall.

There are some bit manipulations for date and time that are nonsense. I'm sure they're technically correct, but there's a much more human-readable way to do them. I guess the AI is just smarter than I.

Comment thread libtock-sync/peripherals/syscalls/rtc_syscalls.c Outdated
Comment thread libtock-sync/peripherals/rtc.c
@brghena
Copy link
Copy Markdown
Contributor

brghena commented Apr 23, 2026

I think you'll manually have to move stuff in from #570 since you moved locations?

@bradjc
Copy link
Copy Markdown
Contributor Author

bradjc commented Apr 23, 2026

I think you'll manually have to move stuff in from #570 since you moved locations?

Done

@alevy alevy added this pull request to the merge queue Apr 24, 2026
Merged via the queue into master with commit 08e9adf Apr 24, 2026
6 checks passed
@alevy alevy deleted the dev/ywf-peripherals branch April 24, 2026 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants