Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add I2C support to TI cc23x0 SoC #84526

Draft
wants to merge 22 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f439185
west.yml: Update hal_ti
jpanisbl Jul 24, 2024
635cdb1
modules: simplelink: Add support for cc23x0 SoC
jpanisbl Jul 24, 2024
9662bf8
soc: ti: Add support for new SoC cc23x0
vmyklebust Jul 24, 2024
08230dd
boards: ti: Add support for new board lp_em_cc2340r5
vmyklebust Jul 24, 2024
02ced30
drivers: flash: Add support for cc23x0 flash
bogdanovs Jul 24, 2024
c1b1095
dts: bindings: mtd: Add support for cc23x0 flash CCFG sector
jpanisbl Oct 16, 2024
e7b0d0a
dts: arm: ti: cc23x0: Add flash support
bogdanovs Jul 24, 2024
f016a58
boards: ti: lp_em_cc2340r5: Add flash support
bogdanovs Jul 24, 2024
7899a28
drivers: pinctrl: Add support for cc23x0 pinctrl
vmyklebust Jul 24, 2024
d9ff98b
dts: arm: ti: cc23x0: Add pinctrl support
jpanisbl Jul 24, 2024
bf60b36
drivers: timer: Add support for cc23x0 systim
vmyklebust Jul 24, 2024
e158deb
drivers: gpio: Add support for cc23x0 GPIO
vmyklebust Jul 24, 2024
3c816cf
dts: arm: ti: cc23x0: Add GPIO support
bogdanovs Jul 24, 2024
0c9e243
boards: ti: lp_em_cc2340r5: Add GPIO support
bogdanovs Jul 24, 2024
d40bcb6
boards: ti: lp_em_cc2340r5: Add leds and keys support
bogdanovs Jul 24, 2024
a062e54
drivers: serial: Add support for cc23x0 UART
vmyklebust Jul 24, 2024
6a5b049
dts: arm: ti: cc23x0: Add UART support
bogdanovs Jul 24, 2024
287aeab
boards: ti: lp_em_cc2340r5: Add UART support
bogdanovs Jul 24, 2024
12c6151
drivers: i2c: Add support for cc23x0 I2C
bogdanovs Aug 6, 2024
dfc3415
dts: arm: ti: cc23x0: Add I2C support
bogdanovs Aug 6, 2024
c5f2267
boards: ti: lp_em_cc2340r5: Add I2C support
bogdanovs Aug 6, 2024
38e32dc
samples: sensors: bme280: Add lp_em_cc2340r5 overlay
bogdanovs Aug 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions boards/ti/lp_em_cc2340r5/Kconfig.lp_em_cc2340r5
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright (c) 2024 Texas Instruments Incorporated
# Copyright (c) 2024 BayLibre, SAS
#
# SPDX-License-Identifier: Apache-2.0

config BOARD_LP_EM_CC2340R5
select SOC_CC2340R5
5 changes: 5 additions & 0 deletions boards/ti/lp_em_cc2340r5/board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
board:
name: lp_em_cc2340r5
vendor: ti
socs:
- name: cc2340r5
39 changes: 39 additions & 0 deletions boards/ti/lp_em_cc2340r5/boosterpack_connector.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright (c) 2024 Texas Instruments Incorporated
* Copyright (c) 2024 BayLibre, SAS
*
* SPDX-License-Identifier: Apache-2.0
*/

/ {
boosterpack_header: connector {
compatible = "ti,boosterpack-header";
#gpio-cells = <2>;
gpio-map = <3 0 &gpio0 22 0>,
<4 0 &gpio0 20 0>,
<7 0 &gpio0 18 0>,
<8 0 &gpio0 3 0>,
<9 0 &gpio0 24 0>,
<10 0 &gpio0 0 0>,

<12 0 &gpio0 9 0>,
<13 0 &gpio0 10 0>,
<14 0 &gpio0 12 0>,
<15 0 &gpio0 13 0>,
<17 0 &gpio0 19 0>,
<18 0 &gpio0 11 0>,

<23 0 &gpio0 23 0>,
<24 0 &gpio0 25 0>,
<25 0 &gpio0 1 0>,
<26 0 &gpio0 2 0>,
<27 0 &gpio0 5 0>,
<28 0 &gpio0 7 0>,

<36 0 &gpio0 8 0>,
<37 0 &gpio0 21 0>,
<38 0 &gpio0 6 0>,
<39 0 &gpio0 14 0>,
<40 0 &gpio0 15 0>;
};
};
Binary file not shown.
128 changes: 128 additions & 0 deletions boards/ti/lp_em_cc2340r5/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
.. _lp_em_cc2340r5:

TI CC2340R5 Launchpad
#####################

Overview
********

The Texas Instruments CC2340R5 LaunchPad |trade| (LP_EM_CC2340R5) is a
development kit for the SimpleLink |trade| multi-Standard CC2340R5 wireless MCU.

See the `TI CC2340R5 LaunchPad Product Page`_ for details.

.. figure:: img/lp_em_cc2340r5.webp
:align: center
:alt: TI CC2340R5 Launchpad

Texas Instruments CC2340R5 LaunchPad |trade|

Hardware
********

The CC2340R5 LaunchPad |trade| development kit features the CC2340R5 wireless MCU.
The board is equipped with two LEDs, two push buttons and BoosterPack connectors
for expansion.

The CC2340R5 wireless MCU has a 48 MHz Arm |reg| Cortex |reg|-M0+ SoC and an
integrated 2.4 GHz transceiver supporting multiple protocols including Bluetooth
|reg| Low Energy and IEEE |reg| 802.15.4.

See the `TI CC2340R5 Product Page`_ for additional details.

Supported Features
==================

The ``lp_em_cc2340r5`` board supports the following hardware features:

+-----------+------------+----------------------+
| Interface | Controller | Driver/Component |
+===========+============+======================+
| NVIC | on-chip | arch/arm |
+-----------+------------+----------------------+
| GPIO | on-chip | gpio |
+-----------+------------+----------------------+
| PINMUX | on-chip | pinmux |
+-----------+------------+----------------------+
| UART | on-chip | serial port |
+-----------+------------+----------------------+
| SYSTIM | on-chip | system timer |
+-----------+------------+----------------------+
| FLASH | on-chip | flash memory |
+-----------+------------+----------------------+

Other hardware features have not been enabled yet for this board.

Connections and IOs
===================

All I/O signals are accessible from the BoosterPack connectors. Pin function
aligns with the LaunchPad standard.

+-------+-----------+---------------------+
| Pin | Function | Usage |
+=======+===========+=====================+
| DIO0 | GPIO | |
+-------+-----------+---------------------+
| DIO1 | ANALOG_IO | A4 |
+-------+-----------+---------------------+
| DIO2 | ANALOG_IO | A3 |
+-------+-----------+---------------------+
| DIO5 | ANALOG_IO | A5 |
+-------+-----------+---------------------+
| DIO6 | SPI_CSN | SPI CS |
+-------+-----------+---------------------+
| DIO7 | ANALOG_IO | A0 |
+-------+-----------+---------------------+
| DIO8 | GPIO | |
+-------+-----------+---------------------+
| DIO9 | GPIO | Button 2 |
+-------+-----------+---------------------+
| DIO10 | GPIO | Button 1 |
+-------+-----------+---------------------+
| DIO11 | SPI_CSN | SPI CS |
+-------+-----------+---------------------+
| DIO12 | SPI_POCI | SPI POCI |
+-------+-----------+---------------------+
| DIO13 | SPI_PICO | SPI_PICO |
+-------+-----------+---------------------+
| DIO14 | GPIO | Red LED |
+-------+-----------+---------------------+
| DIO15 | GPIO | Green LED |
+-------+-----------+---------------------+
| DIO18 | SPI_CLK | SPI CLK |
+-------+-----------+---------------------+
| DIO19 | GPIO | |
+-------+-----------+---------------------+
| DIO20 | UART0_TX | UART TX |
+-------+-----------+---------------------+
| DIO21 | GPIO | |
+-------+-----------+---------------------+
| DIO22 | UART0_RX | UART RX |
+-------+-----------+---------------------+
| DIO23 | ANALOG_IO | A8 |
+-------+-----------+---------------------+
| DIO24 | ANALOG_IO | A7 |
+-------+-----------+---------------------+

Programming and Debugging
*************************

The LP_EM_CC2340R5 requires an external debug probe such as the LP-XDS110 or
LP-XDS110ET.

Currently there is no debug support in Zephyr for the LP_EM_CC2340R5, and the
built binaries for this target must be flashed/debugged using either Uniflash
or Code Composer Studio.

References
**********

CC2340R5 LaunchPad Quick Start Guide:
https://www.ti.com/lit/pdf/swru588

.. _TI CC2340R5 LaunchPad Product Page:
https://www.ti.com/tool/LP-EM-CC2340R5

.. _TI CC2340R5 Product Page:
https://www.ti.com/product/CC2340R5
35 changes: 35 additions & 0 deletions boards/ti/lp_em_cc2340r5/lp_em_cc2340r5-pinctrl.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright (c) 2024 Texas Instruments Incorporated
* Copyright (c) 2024 BayLibre, SAS
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/pinctrl/cc23x0-pinctrl.h>

&pinctrl {
/* UART0 */
uart0_tx_default: uart0_tx_default {
pinmux = <20 DIO20_UART0_TXD>;
bias-disable;
};
uart0_rx_default: uart0_rx_default {
pinmux = <22 DIO22_UART0_RXD>;
bias-disable;
input-enable;
};

/* I2C0 */
i2c0_scl_default: i2c0_scl_default {
pinmux = <24 DIO24_I2C0_SCL>;
bias-pull-up;
drive-open-drain;
input-enable;
};
i2c0_sda_default: i2c0_sda_default {
pinmux = <0 DIO0_I2C0_SDA>;
bias-pull-up;
drive-open-drain;
input-enable;
};
};
83 changes: 83 additions & 0 deletions boards/ti/lp_em_cc2340r5/lp_em_cc2340r5.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*
* Copyright (c) 2024 Texas Instruments Incorporated
* Copyright (c) 2024 BayLibre, SAS
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;

#include <ti/cc2340r5.dtsi>
#include "boosterpack_connector.dtsi"
#include "lp_em_cc2340r5-pinctrl.dtsi"
#include <zephyr/dt-bindings/gpio/gpio.h>
#include <zephyr/dt-bindings/input/input-event-codes.h>

/ {
model = "LP_EM_CC2340R5";
compatible = "ti,lp_em_cc2340r5";

chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
};

aliases {
led0 = &led0;
led1 = &led1;
sw0 = &btn0;
sw1 = &btn1;
};

leds {
compatible = "gpio-leds";

led0: led_0 {
gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>;
label = "Green LED";
};

led1: led_1 {
gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
label = "Red LED";
};
};

keys {
compatible = "gpio-keys";

btn0: btn_0 {
gpios = <&gpio0 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
label = "Button 1";
zephyr,code = <INPUT_KEY_0>;
};

btn1: btn_1 {
gpios = <&gpio0 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
label = "Button 2";
zephyr,code = <INPUT_KEY_1>;
};
};
};

&gpio0 {
status = "okay";
};

&uart0 {
status = "okay";
current-speed = <115200>;
pinctrl-0 = <&uart0_rx_default &uart0_tx_default>;
pinctrl-names = "default";
};

&i2c0 {
status = "okay";
pinctrl-0 = <&i2c0_scl_default
&i2c0_sda_default>;
clock-frequency = <100000>;
pinctrl-names = "default";
};
14 changes: 14 additions & 0 deletions boards/ti/lp_em_cc2340r5/lp_em_cc2340r5.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
identifier: lp_em_cc2340r5
name: TI SimpleLink CC2340R5 LaunchPad
type: mcu
arch: arm
ram: 80
flash: 512
toolchain:
- zephyr
- gnuarmemb
- xtools
supported:
- gpio
- uart
vendor: ti
10 changes: 10 additions & 0 deletions boards/ti/lp_em_cc2340r5/lp_em_cc2340r5_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (c) 2024 Texas Instruments Incorporated
# Copyright (c) 2024 BayLibre, SAS
#
# SPDX-License-Identifier: Apache-2.0

CONFIG_GPIO=y
CONFIG_SERIAL=y

CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
1 change: 1 addition & 0 deletions drivers/flash/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ zephyr_library_sources_ifdef(CONFIG_FLASH_STM32_XSPI flash_stm32_xspi.c)
zephyr_library_sources_ifdef(CONFIG_INFINEON_CAT1_QSPI_FLASH flash_ifx_cat1_qspi.c)
zephyr_library_sources_ifdef(CONFIG_NORDIC_QSPI_NOR nrf_qspi_nor.c)
zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_CC13XX_CC26XX soc_flash_cc13xx_cc26xx.c)
zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_CC23X0 soc_flash_cc23x0.c)
zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_ESP32 flash_esp32.c)
zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_GECKO flash_gecko.c)
zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_ITE_IT8XXX2 flash_ite_it8xxx2.c)
Expand Down
1 change: 1 addition & 0 deletions drivers/flash/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ source "drivers/flash/Kconfig.b91"
source "drivers/flash/Kconfig.cadence_nand"
source "drivers/flash/Kconfig.cadence_qspi_nor"
source "drivers/flash/Kconfig.cc13xx_cc26xx"
source "drivers/flash/Kconfig.cc23x0"
source "drivers/flash/Kconfig.esp32"
source "drivers/flash/Kconfig.gd32"
source "drivers/flash/Kconfig.gecko"
Expand Down
14 changes: 14 additions & 0 deletions drivers/flash/Kconfig.cc23x0
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (c) 2024 Texas Instruments Incorporated
# Copyright (c) 2024 BayLibre, SAS
#
# SPDX-License-Identifier: Apache-2.0

config SOC_FLASH_CC23X0
bool "TI SimpleLink CC23x0 flash controller driver"
default y
depends on DT_HAS_TI_CC23X0_FLASH_CONTROLLER_ENABLED
select FLASH_HAS_PAGE_LAYOUT
select FLASH_HAS_DRIVER_ENABLED
select MPU_ALLOW_FLASH_WRITE if ARM_MPU
help
Enables TI SimpleLink CC23x0 flash controller driver.
Loading
Loading