Skip to content

Conversation

@gKits
Copy link

@gKits gKits commented Oct 29, 2025

It seems the original PR #758 was abandoned by @mfulz.

I tried to contact them and contribute the missing Alarm2 features to their PR but sadly I got no response.
Therefore I forked their fork and added the proposed changes in #758.

This PR adds:

  • Alarm1 set, enable, read
  • Alarm2 set, enable, read
  • SQW set, read for interrupts

@gKits gKits changed the base branch from release to dev October 29, 2025 07:54
@deadprogram
Copy link
Member

Hello @gKits thanks for picking up on this work.

Perhaps you might want to replace the legacy package calls with the new regmap package, to avoid heap allocations.

Please see https://github.com/tinygo-org/drivers/blob/dev/internal/regmap/i2c-spi.go#L67

What do you think?

@gKits
Copy link
Author

gKits commented Nov 9, 2025

@deadprogram Sure can do. I used the regmap package everywhere I could. Only in SetTime and SetAlarm2 I used the Tx method of the bus directly because there I need to write chunks of data that would require more than 1 write because they have an odd number of bytes.

Maybe the regmap.Device8I2C type could provide a fitting WriteData method for the already existing ReadData method in the future?

@gKits gKits marked this pull request as draft November 9, 2025 18:50
@gKits gKits marked this pull request as ready for review November 9, 2025 18:58
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.

2 participants