diff --git a/boards/shields/sparkfun_rv8803/Kconfig.shield b/boards/shields/sparkfun_rv8803/Kconfig.shield new file mode 100644 index 0000000000000..0272ddcd3b336 --- /dev/null +++ b/boards/shields/sparkfun_rv8803/Kconfig.shield @@ -0,0 +1,5 @@ +# Copyright (c) 2025 Jonas Berg +# SPDX-License-Identifier: Apache-2.0 + +config SHIELD_SPARKFUN_RV8803 + def_bool $(shields_list_contains,sparkfun_rv8803) diff --git a/boards/shields/sparkfun_rv8803/doc/index.rst b/boards/shields/sparkfun_rv8803/doc/index.rst new file mode 100644 index 0000000000000..4dfc9c997fb9a --- /dev/null +++ b/boards/shields/sparkfun_rv8803/doc/index.rst @@ -0,0 +1,69 @@ +.. _sparkfun_rv8803: + +Sparkfun RV8803 Shield +###################### + +Overview +******** + +The `SparkFun RV8803 Real Time Clock Shield`_ features +a `Micro Crystal RV-8803-C7 Real-Time-Clock`_ and two Qwiic connectors. +It has a 3 Volt back-up coin-cell battery. + +.. figure:: sparkfun_rv8803.webp + :align: center + :alt: Sparkfun RV8803 Shield + + Sparkfun RV8803 Shield (Credit: Sparkfun) + + +Requirements +************ + +This shield can be used with boards which provide an I2C connector, for +example STEMMA QT or Qwiic connectors. +The target board must define a ``zephyr_i2c`` node label. +See :ref:`shields` for more details. + + +Pin Assignments +=============== + ++--------------+-------------------------------------------------------------------------------------------------+ +| Shield Pin | Function | ++==============+=================================================================================================+ +| SDA | RV8803 I2C SDA. Also connected to the Qwiic connector. | ++--------------+-------------------------------------------------------------------------------------------------+ +| SCL | RV8803 I2C SCL. Also connected to the Qwiic connector. | ++--------------+-------------------------------------------------------------------------------------------------+ +| EVI | RV8803 event input. Active low by default, with external pull-up and on-shield button. | ++--------------+-------------------------------------------------------------------------------------------------+ +| INT | RV8803 interrupt output. Active low (open drain), with external pull-up. | ++--------------+-------------------------------------------------------------------------------------------------+ +| CLKOUT | RV8803 clock output. 32768, 1024 or 1 Hz (controlled by devicetree setting). Enabled by CLKOE. | ++--------------+-------------------------------------------------------------------------------------------------+ +| CLKOE | RV8803 control of CLKOUT, which is enabled when this pin is high. External pull-down on shield. | ++--------------+-------------------------------------------------------------------------------------------------+ + +To use the interrupt output from the RV-8803, you need to connect a wire from +the shield INT output to a suitable GPIO on your microcontroller board, and to +modify the devicetree settings. See :dtcompatible:`microcrystal,rv8803` for options. + + +Programming +*********** + +Set ``--shield sparkfun_rv8803`` when you invoke ``west build``. For example +when running the :zephyr:code-sample:`rtc` sample: + +.. zephyr-app-commands:: + :zephyr-app: samples/drivers/rtc + :board: adafruit_qt_py_rp2040 + :shield: sparkfun_rv8803 + :goals: build + +.. _SparkFun RV8803 Real Time Clock Shield: + https://www.sparkfun.com/sparkfun-real-time-clock-module-rv-8803-qwiic.html + +.. _Micro Crystal RV-8803-C7 Real-Time-Clock: + https://www.microcrystal.com/en/products/real-time-clock-rtc-modules/rv-8803-c7 diff --git a/boards/shields/sparkfun_rv8803/doc/sparkfun_rv8803.webp b/boards/shields/sparkfun_rv8803/doc/sparkfun_rv8803.webp new file mode 100644 index 0000000000000..0a6aba315fc9c Binary files /dev/null and b/boards/shields/sparkfun_rv8803/doc/sparkfun_rv8803.webp differ diff --git a/boards/shields/sparkfun_rv8803/shield.yml b/boards/shields/sparkfun_rv8803/shield.yml new file mode 100644 index 0000000000000..3a9bfa0d79a19 --- /dev/null +++ b/boards/shields/sparkfun_rv8803/shield.yml @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright (c) 2025, Jonas Berg + +shield: + name: sparkfun_rv8803 + full_name: Sparkfun RV8803 Real Time Clock Shield + vendor: sparkfun + supported_features: + - rtc diff --git a/boards/shields/sparkfun_rv8803/sparkfun_rv8803.overlay b/boards/shields/sparkfun_rv8803/sparkfun_rv8803.overlay new file mode 100644 index 0000000000000..8867aacbac45c --- /dev/null +++ b/boards/shields/sparkfun_rv8803/sparkfun_rv8803.overlay @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2025 Jonas Berg + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + aliases { + rtc = &sparkfun_rv8803; + }; +}; + +&zephyr_i2c { + status = "okay"; + + sparkfun_rv8803: rv8803@32 { + status = "okay"; + compatible = "microcrystal,rv8803"; + reg = <0x32>; + }; +}; diff --git a/samples/drivers/rtc/sample.yaml b/samples/drivers/rtc/sample.yaml index 2d57ba0fff0e3..26b3397a6b116 100644 --- a/samples/drivers/rtc/sample.yaml +++ b/samples/drivers/rtc/sample.yaml @@ -6,8 +6,11 @@ tests: - stm32f3_disco - mimxrt700_evk/mimxrt798s/cm33_cpu0 - mimxrt700_evk/mimxrt798s/cm33_cpu1 + - adafruit_qt_py_rp2040/rp2040 integration_platforms: - stm32f3_disco + extra_args: + - platform:adafruit_qt_py_rp2040/rp2040:SHIELD="sparkfun_rv8803" tags: - samples - rtc