Skip to content

caternuson/kb2040_i2c_target

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basic I2C target example on KB2040 using zephyr RTOS.

  • Adapted from samples/drivers/i2c/custom_target example
  • Tested on Adafruit KB2040
  • I2C pins
    • SDA = 2
    • SCL = 3
  • UART pins
    • TX = A2
    • RX = A3

Building

west build -p always -b adafruit_kb2040 kb2040_i2c_target

Flashing

Just copy the zephyr.uf2 build artifact to RPI-RP2 bootloder folder.

Example

From an attached board running CircuitPython:

Adafruit CircuitPython 9.2.8 on 2025-05-28; Adafruit QT Py RP2040 with rp2040
>>> import board
>>> i2c = board.STEMMA_I2C()
>>> i2c.try_lock()
True
>>> i2c.scan()
[96]
>>> buf = bytearray(4)
>>> i2c.readfrom_into(96, buf)
>>> [hex(b) for b in buf]
['0x42', '0x42', '0x42', '0x42']
>>>

About

Basic I2C target example on KB2040 using zephyr RTOS.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published