dts: Add support for Nordic QDEC

Add QDEC binding and entry in Nordic SoC DTSI files.

This closes issue #9364

Jira:DESK-259

Signed-off-by: Pawel Dunaj <pawel.dunaj@nordicsemi.no>
This commit is contained in:
Pawel Dunaj 2018-09-24 14:46:38 +02:00 committed by Maureen Helm
commit ecae736e0b
8 changed files with 142 additions and 0 deletions

View file

@ -32,6 +32,13 @@ config HAS_DTS_SPI
This option specifies that the target platform supports device tree
configuration for SPI.
config HAS_DTS_QDEC
bool
depends on HAS_DTS
help
This option specifies that the target platform supports device tree
configuration for QDEC.
config HAS_DTS_USB
bool
depends on HAS_DTS

View file

@ -93,6 +93,14 @@
label = "I2C_1";
};
qdec: qdec@40012000 {
compatible = "nordic,nrf-qdec";
reg = <0x40012000 0x1000>;
interrupts = <18 1>;
status = "disabled";
label = "QDEC";
};
spi0: spi@40003000 {
compatible = "nordic,nrf-spi";
#address-cells = <1>;

View file

@ -82,6 +82,14 @@
label = "I2C_0";
};
qdec: qdec@40012000 {
compatible = "nordic,nrf-qdec";
reg = <0x40012000 0x1000>;
interrupts = <18 1>;
status = "disabled";
label = "QDEC";
};
spi0: spi@40004000 {
compatible = "nordic,nrf-spi";
#address-cells = <1>;

View file

@ -95,6 +95,14 @@
label = "I2C_1";
};
qdec: qdec@40012000 {
compatible = "nordic,nrf-qdec";
reg = <0x40012000 0x1000>;
interrupts = <18 1>;
status = "disabled";
label = "QDEC";
};
spi0: spi@40003000 {
compatible = "nordic,nrf-spi";
#address-cells = <1>;

View file

@ -113,6 +113,14 @@
label = "I2C_1";
};
qdec: qdec@40012000 {
compatible = "nordic,nrf-qdec";
reg = <0x40012000 0x1000>;
interrupts = <18 1>;
status = "disabled";
label = "QDEC";
};
spi0: spi@40003000 {
compatible = "nordic,nrf-spi";
#address-cells = <1>;

View file

@ -0,0 +1,73 @@
#
# Copyright (c) 2018, Nordic Semiconductor ASA
#
# SPDX-License-Identifier: Apache-2.0
#
---
title: Nordic nRF Family QDEC node
version: 0.1
description: >
This is a representation of the Nordic nRF QDEC node
properties:
compatible:
type: string
category: required
description: compatible strings
constraint: "nordic,nrf-qdec"
reg:
type: array
description: mmio register space
generation: define
category: required
interrupts:
type: array
category: required
description: required interrupts
generation: define
a-pin:
type: int
description: A pin
generation: define
category: required
b-pin:
type: int
description: B pin
generation: define
category: required
led-pin:
type: int
description: LED pin for light based QDEC device
generation: define
category: optional
enable-pin:
type: int
description: Enables connected QDEC device
generation: define
category: optional
led-pre:
type: int
description: Time LED is enabled prior to sampling event (in us)
generation: define
category: required
steps:
type: int
description: Number of steps on the rotating wheel
generation: define
category: required
label:
type: string
category: required
description: Human readable string describing the device (used by Zephyr for API name)
generation: define
...

View file

@ -42,6 +42,21 @@
#define CONFIG_I2C_1_SDA_PIN NORDIC_NRF_I2C_40004000_SDA_PIN
#define CONFIG_I2C_1_SCL_PIN NORDIC_NRF_I2C_40004000_SCL_PIN
#define CONFIG_QDEC_BASE_ADDR NORDIC_NRF_QDEC_40012000_BASE_ADDRESS
#define CONFIG_QDEC_NAME NORDIC_NRF_QDEC_40012000_LABEL
#define CONFIG_QDEC_IRQ_PRI NORDIC_NRF_QDEC_40012000_IRQ_0_PRIORITY
#define CONFIG_QDEC_IRQ NORDIC_NRF_QDEC_40012000_IRQ_0
#define CONFIG_QDEC_A_PIN NORDIC_NRF_QDEC_40012000_A_PIN
#define CONFIG_QDEC_B_PIN NORDIC_NRF_QDEC_40012000_B_PIN
#if defined(NORDIC_NRF_QDEC_40012000_LED_PIN)
#define CONFIG_QDEC_LED_PIN NORDIC_NRF_QDEC_40012000_LED_PIN
#endif
#if defined(NORDIC_NRF_QDEC_40012000_ENABLE_PIN)
#define CONFIG_QDEC_ENABLE_PIN NORDIC_NRF_QDEC_40012000_ENABLE_PIN
#endif
#define CONFIG_QDEC_LED_PRE NORDIC_NRF_QDEC_40012000_LED_PRE
#define CONFIG_QDEC_STEPS NORDIC_NRF_QDEC_40012000_STEPS
#define CONFIG_SPI_0_BASE_ADDRESS NORDIC_NRF_SPI_40003000_BASE_ADDRESS
#define CONFIG_SPI_0_NAME NORDIC_NRF_SPI_40003000_LABEL
#define CONFIG_SPI_0_IRQ_PRI NORDIC_NRF_SPI_40003000_IRQ_0_PRIORITY

View file

@ -75,6 +75,21 @@
#define CONFIG_I2C_1_SDA_PIN NORDIC_NRF_I2C_40004000_SDA_PIN
#define CONFIG_I2C_1_SCL_PIN NORDIC_NRF_I2C_40004000_SCL_PIN
#define CONFIG_QDEC_BASE_ADDR NORDIC_NRF_QDEC_40012000_BASE_ADDRESS
#define CONFIG_QDEC_NAME NORDIC_NRF_QDEC_40012000_LABEL
#define CONFIG_QDEC_IRQ_PRI NORDIC_NRF_QDEC_40012000_IRQ_0_PRIORITY
#define CONFIG_QDEC_IRQ NORDIC_NRF_QDEC_40012000_IRQ_0
#define CONFIG_QDEC_A_PIN NORDIC_NRF_QDEC_40012000_A_PIN
#define CONFIG_QDEC_B_PIN NORDIC_NRF_QDEC_40012000_B_PIN
#if defined(NORDIC_NRF_QDEC_40012000_LED_PIN)
#define CONFIG_QDEC_LED_PIN NORDIC_NRF_QDEC_40012000_LED_PIN
#endif
#if defined(NORDIC_NRF_QDEC_40012000_ENABLE_PIN)
#define CONFIG_QDEC_ENABLE_PIN NORDIC_NRF_QDEC_40012000_ENABLE_PIN
#endif
#define CONFIG_QDEC_LED_PRE NORDIC_NRF_QDEC_40012000_LED_PRE
#define CONFIG_QDEC_STEPS NORDIC_NRF_QDEC_40012000_STEPS
#define CONFIG_SPI_0_BASE_ADDRESS NORDIC_NRF_SPI_40003000_BASE_ADDRESS
#define CONFIG_SPI_0_NAME NORDIC_NRF_SPI_40003000_LABEL
#define CONFIG_SPI_0_IRQ_PRI NORDIC_NRF_SPI_40003000_IRQ_0_PRIORITY