Skip to content

Commit 7428a84

Browse files
pyhyskartben
authored andcommitted
boards: shields: Add Adafruit 24LC32 EEPROM shield
Product photo from https://learn.adafruit.com/assets/123033 with license CC BY-SA 3.0. Tested with the command mentioned on the index.rst page. Signed-off-by: Jonas Berg <[email protected]>
1 parent 97d5bae commit 7428a84

File tree

6 files changed

+107
-0
lines changed

6 files changed

+107
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2025 Jonas Berg
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SHIELD_ADAFRUIT_24LC32
5+
def_bool $(shields_list_contains,adafruit_24lc32)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (c) 2025 Jonas Berg
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
aliases {
9+
eeprom-0 = &eeprom_adafruit_24lc32;
10+
};
11+
};
12+
13+
&zephyr_i2c {
14+
status = "okay";
15+
16+
eeprom_adafruit_24lc32: eeprom@50 {
17+
status = "okay";
18+
compatible = "atmel,at24lc32", "atmel,at24";
19+
reg = <0x50>;
20+
size = <DT_SIZE_K(4)>;
21+
pagesize = <8>;
22+
address-width = <16>;
23+
timeout = <5>;
24+
};
25+
};
47.1 KB
Loading
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
.. _adafruit_24lc32:
2+
3+
Adafruit 24LC32 EEPROM Shield
4+
#############################
5+
6+
Overview
7+
********
8+
9+
The `Adafruit 24LC32 EEPROM Shield`_ features a `Microchip 24LC32 EEPROM`_ (or
10+
equivalent) and two STEMMA QT connectors.
11+
It has a size of 32 kbit (4 kByte).
12+
13+
.. figure:: adafruit_24lc32.webp
14+
:align: center
15+
:alt: Adafruit 24LC32 EEPROM Shield
16+
17+
Adafruit 24LC32 EEPROM Shield (Credit: Adafruit)
18+
19+
20+
Requirements
21+
************
22+
23+
This shield can be used with boards which provide an I2C connector, for
24+
example STEMMA QT or Qwiic connectors.
25+
The target board must define a ``zephyr_i2c`` node label.
26+
See :ref:`shields` for more details.
27+
28+
29+
Pin Assignments
30+
===============
31+
32+
+--------------+------------------------------+
33+
| Shield Pin | Function |
34+
+==============+==============================+
35+
| SDA | 24LC32 I2C SDA |
36+
+--------------+------------------------------+
37+
| SCL | 24LC32 I2C SCL |
38+
+--------------+------------------------------+
39+
| WP | 24LC32 write protection |
40+
+--------------+------------------------------+
41+
| A0 - A2 | 24LC32 I2C address selection |
42+
+--------------+------------------------------+
43+
44+
See :dtcompatible:`atmel,at24` for documentation on how to adjust the
45+
devicetree file, for example to make the EEPROM read-only.
46+
47+
48+
Programming
49+
***********
50+
51+
Set ``--shield adafruit_24lc32`` when you invoke ``west build``. For example
52+
when running the :zephyr:code-sample:`eeprom` sample:
53+
54+
.. zephyr-app-commands::
55+
:zephyr-app: samples/drivers/eeprom
56+
:board: adafruit_qt_py_rp2040
57+
:shield: adafruit_24lc32
58+
:goals: build
59+
60+
.. _Adafruit 24LC32 EEPROM Shield:
61+
https://learn.adafruit.com/adafruit-24lc32-i2c-eeprom-breakout-32kbit-4-kb
62+
63+
.. _Microchip 24LC32 EEPROM:
64+
https://www.microchip.com/en-us/product/24lc32
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
#
3+
# Copyright (c) 2025, Jonas Berg
4+
5+
shield:
6+
name: adafruit_24lc32
7+
full_name: Adafruit 24LC32 EEPROM Shield
8+
vendor: adafruit
9+
supported_features:
10+
- mtd

samples/drivers/eeprom/sample.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ tests:
88
- gd32f450i_eval
99
- native_sim
1010
- native_sim/native/64
11+
- adafruit_qt_py_rp2040/rp2040
1112
integration_platforms:
1213
- native_sim/native/64
14+
extra_args:
15+
- platform:adafruit_qt_py_rp2040/rp2040:SHIELD="adafruit_24lc32"
1316
harness: console
1417
harness_config:
1518
type: one_line

0 commit comments

Comments
 (0)