ec1ba14e46
PDWN 浮空导致 ADS1256 进入 power-down 模式,DRDY 无响应且 SPI 总线 无输出。同时将 CS 管理从手动 GPIO 改为 SPIM 驱动自动控制,消除引脚 所有权冲突;读寄存器和读数据改用 spi_transceive 保证单次 CS 内完成。
67 lines
1.5 KiB
Plaintext
67 lines
1.5 KiB
Plaintext
/*
|
|
* Copyright (c) 2022 Nordic Semiconductor ASA
|
|
*
|
|
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
|
|
*/
|
|
|
|
/*
|
|
* nRF5340 DK (App Core) Overlay for ADS1256
|
|
* 仅保留 SPI 和 GPIO 定义
|
|
*/
|
|
|
|
&spi1 {
|
|
compatible = "nordic,nrf-spim";
|
|
status = "okay";
|
|
pinctrl-0 = <&spi1_default>;
|
|
pinctrl-1 = <&spi1_sleep>;
|
|
pinctrl-names = "default", "sleep";
|
|
|
|
/* CS 引脚配置 */
|
|
cs-gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
|
|
|
|
ads1256: ads1256@0 {
|
|
compatible = "ti,ads1256";
|
|
reg = <0>;
|
|
spi-max-frequency = <1000000>;
|
|
};
|
|
};
|
|
|
|
&pinctrl {
|
|
spi1_default: spi1_default {
|
|
group1 {
|
|
psels = <NRF_PSEL(SPIM_SCK, 1, 15)>,
|
|
<NRF_PSEL(SPIM_MOSI, 1, 13)>,
|
|
<NRF_PSEL(SPIM_MISO, 1, 14)>;
|
|
};
|
|
};
|
|
spi1_sleep: spi1_sleep {
|
|
group1 {
|
|
psels = <NRF_PSEL(SPIM_SCK, 1, 15)>,
|
|
<NRF_PSEL(SPIM_MOSI, 1, 13)>,
|
|
<NRF_PSEL(SPIM_MISO, 1, 14)>;
|
|
low-power-enable;
|
|
};
|
|
};
|
|
};
|
|
|
|
/ {
|
|
aliases {
|
|
ads-drdy = &ads_drdy_pin;
|
|
ads-reset = &ads_reset_pin;
|
|
ads-pdwn = &ads_pdwn_pin;
|
|
};
|
|
|
|
ads1256_control {
|
|
compatible = "gpio-keys";
|
|
ads_drdy_pin: ads_drdy {
|
|
gpios = <&gpio1 11 GPIO_ACTIVE_LOW>;
|
|
};
|
|
ads_reset_pin: ads_reset {
|
|
gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
|
|
};
|
|
ads_pdwn_pin: ads_pdwn {
|
|
gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
|
|
};
|
|
};
|
|
};
|