Skip to content

Conversation

@Kampi
Copy link
Contributor

@Kampi Kampi commented May 28, 2024

Description

This PR adds support for Micro Crystal RV-8263-C8 RTC connected to the I2C bus.

Supported functions

  • Alarm with interrupt
  • Time
  • Update with interrupt
  • Calibration

Tested

  • Time set / get
  • Clkout
  • Calibration set / get
  • Update
  • Alarm set / get
  • Alarm pending
  • On real hardware incl. unit test

Closes #73384

@Kampi Kampi force-pushed the Feature_73384 branch 5 times, most recently from 21edc49 to 1db2263 Compare May 28, 2024 12:08
@Kampi Kampi force-pushed the Feature_73384 branch 2 times, most recently from e287368 to 5166977 Compare May 28, 2024 19:38
@Kampi Kampi changed the title drivers: rtc: Add RV-3028-C8 and RV-8263-C7 driver drivers: rtc: Add Micro Crystal RV-8263-C7 driver May 28, 2024
@Kampi Kampi changed the title drivers: rtc: Add Micro Crystal RV-8263-C7 driver drivers: rtc: Add Micro Crystal RV-8263-C8 driver May 29, 2024
@Kampi Kampi marked this pull request as ready for review May 30, 2024 06:34
@zephyrbot zephyrbot added area: RTC Real Time Clock area: Devicetree Binding PR modifies or adds a Device Tree binding labels May 30, 2024
@Kampi Kampi force-pushed the Feature_73384 branch 5 times, most recently from e9bdfc9 to 53637d2 Compare May 30, 2024 06:50
decsny
decsny previously requested changes May 30, 2024
Copy link
Member

@decsny decsny left a comment

Choose a reason for hiding this comment

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

comments apply to all the properties in the DT binding

@Kampi Kampi force-pushed the Feature_73384 branch 2 times, most recently from 3ecde5c to b9c31c5 Compare June 17, 2024 08:23
@cyliangtw
Copy link
Contributor

edit b39dbd9beb40f drivers: rtc: Add support for Micro Crystal RV-8263-C8
pick e082bad227 Update drivers/rtc/rtc_rv8263.c
pick c97b331600 Update drivers/rtc/rtc_rv8263.c
pick eeb1cd298f Update drivers/rtc/rtc_rv8263.c

I save it and run git rebase --continue and git push -f origin Feature_73384 but Git is mentioning that everything is up-to- date.

  1. keep
    edit b39dbd9 drivers: rtc: Add support for Micro Crystal RV-8263-C8
  2. delete below 3 picks
    pick e082bad227 Update drivers/rtc/rtc_rv8263.c
    pick c97b331600 Update drivers/rtc/rtc_rv8263.c
    pick eeb1cd298f Update drivers/rtc/rtc_rv8263.c

After save it, to modify rtc_rv8263.c to merge the changes of the above 3 picks.
Then, git add --> git commit --amend --> git rebase --continue.

@Kampi Kampi requested a review from cyliangtw June 17, 2024 08:48
cyliangtw
cyliangtw previously approved these changes Jun 17, 2024
@aescolar aescolar added this to the v4.0.0 milestone Jun 17, 2024
Copy link
Member

@jakubtopic jakubtopic left a comment

Choose a reason for hiding this comment

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

The driver looks really good :) Some minor suggestions...

@Kampi Kampi dismissed stale reviews from bjarki-andreasen and cyliangtw via d3dd5e8 June 30, 2024 06:21
@Kampi Kampi force-pushed the Feature_73384 branch 2 times, most recently from d3dd5e8 to 1babe06 Compare June 30, 2024 06:21
@Kampi
Copy link
Contributor Author

Kampi commented Jun 30, 2024

The driver looks really good :) Some minor suggestions...

@bjarki-andreasen @jakubtopic

I´ve added the points from @jakubtopic. The unit test is successful so it should be fine. I found a missing option for clkout 1024 Hz and fixed it too:

*** Booting Zephyr OS build ef2df7af14e9 ***
Running TESTSUITE rtc_api
===================================================================
START - test_alarm
 PASS - test_alarm in 26.003 seconds
===================================================================
START - test_alarm_callback
 PASS - test_alarm_callback in 26.004 seconds
===================================================================
START - test_set_get_calibration
Calibrate (set,get): 1, 0
Calibrate (set,get): -1, 0
Calibrate (set,get): -10000, -8680
Calibrate (set,get): -20000, -17360
Calibrate (set,get): -30000, -30380
Calibrate (set,get): -40000, -39060
Calibrate (set,get): -50000, -52080
Calibrate (set,get): -60000, -60760
Calibrate (set,get): -70000, -69440
Calibrate (set,get): -80000, -78120
Calibrate (set,get): -90000, -95480
Calibrate (set,get): -100000, -99820
Calibrate (set,get): -110000, -117180
Calibrate (set,get): -120000, -125860
Calibrate (set,get): -130000, -134540
Calibrate (set,get): -140000, -138880
Calibrate (set,get): -150000, -147560
Calibrate (set,get): -160000, -169260
Calibrate (set,get): -170000, -169260
Calibrate (set,get): -180000, -190960
Calibrate (set,get): -190000, -199640
Calibrate (set,get): -200000, -199640
Calibrate (set,get): 10000, 8138
Calibrate (set,get): 20000, 16276
Calibrate (set,get): 30000, 30380
Calibrate (set,get): 40000, 36621
Calibrate (set,get): 50000, 52080
Calibrate (set,get): 60000, 60760
Calibrate (set,get): 70000, 65104
Calibrate (set,get): 80000, 73242
Calibrate (set,get): 90000, 95480
Calibrate (set,get): 100000, 93587
Calibrate (set,get): 110000, 117180
Calibrate (set,get): 120000, 125860
Calibrate (set,get): 130000, 134540
Calibrate (set,get): 140000, 130208
Calibrate (set,get): 150000, 138346
Calibrate (set,get): 160000, 169260
Calibrate (set,get): 170000, 158691
Calibrate (set,get): 180000, 190960
Calibrate (set,get): 190000, 199640
Calibrate (set,get): 200000, 187174
 PASS - test_set_get_calibration in 0.172 seconds
===================================================================
START - test_set_get_time
 PASS - test_set_get_time in 0.003 seconds
===================================================================
START - test_time_counting
 PASS - test_time_counting in 9.525 seconds
===================================================================
START - test_update_callback
 PASS - test_update_callback in 15.002 seconds
===================================================================
START - test_y2k
E: invalid time
Rollover not supported
 SKIP - test_y2k in 0.004 seconds
===================================================================
TESTSUITE rtc_api succeeded

------ TESTSUITE SUMMARY START ------

SUITE PASS - 100.00% [rtc_api]: pass = 6, fail = 0, skip = 1, total = 7 duration = 76.713 seconds
 - PASS - [rtc_api.test_alarm] duration = 26.003 seconds
 - PASS - [rtc_api.test_alarm_callback] duration = 26.004 seconds
 - PASS - [rtc_api.test_set_get_calibration] duration = 0.172 seconds
 - PASS - [rtc_api.test_set_get_time] duration = 0.003 seconds
 - PASS - [rtc_api.test_time_counting] duration = 9.525 seconds
 - PASS - [rtc_api.test_update_callback] duration = 15.002 seconds
 - SKIP - [rtc_api.test_y2k] duration = 0.004 seconds

------ TESTSUITE SUMMARY END ------

Remove redundant code

Signed-off-by: Daniel Kampert <[email protected]>
@Kampi
Copy link
Contributor Author

Kampi commented Jun 30, 2024

@bjarki-andreasen @jakubtopic

I changed the line 333 to err = i2c_reg_write_byte_dt(&config->i2c_bus, RV8263C8_REGISTER_CONTROL_2, RV8263C8_BM_AF | temp); to handle existing interrupts correctly as @jakubtopic mentioned it in his comment.

@aescolar aescolar merged commit 73c05e2 into zephyrproject-rtos:main Jul 29, 2024
@Kampi Kampi deleted the Feature_73384 branch July 29, 2024 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Devicetree Binding PR modifies or adds a Device Tree binding area: RTC Real Time Clock

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for Micro Crystal RV-8263-C8 RTC

7 participants