File tree Expand file tree Collapse file tree 5 files changed +32
-5
lines changed
samples/sensor/adxl362/boards Expand file tree Collapse file tree 5 files changed +32
-5
lines changed Original file line number Diff line number Diff line change @@ -794,6 +794,7 @@ static const struct adxl362_config adxl362_config = {
794794#if defined(CONFIG_ADXL362_TRIGGER )
795795 .gpio_port = DT_INST_0_ADI_ADXL362_INT1_GPIOS_CONTROLLER ,
796796 .int_gpio = DT_INST_0_ADI_ADXL362_INT1_GPIOS_PIN ,
797+ .int_flags = DT_INST_0_ADI_ADXL362_INT1_GPIOS_FLAGS ,
797798#endif
798799};
799800
Original file line number Diff line number Diff line change @@ -176,11 +176,12 @@ struct adxl362_config {
176176 u16_t spi_slave ;
177177#if defined(DT_INST_0_ADI_ADXL362_CS_GPIOS_CONTROLLER )
178178 const char * gpio_cs_port ;
179- u8_t cs_gpio ;
179+ gpio_pin_t cs_gpio ;
180180#endif
181181#if defined(CONFIG_ADXL362_TRIGGER )
182182 const char * gpio_port ;
183- u8_t int_gpio ;
183+ gpio_pin_t int_gpio ;
184+ gpio_devicetree_flags_t int_flags ;
184185 u8_t int1_config ;
185186 u8_t int2_config ;
186187#endif
Original file line number Diff line number Diff line change @@ -140,8 +140,7 @@ int adxl362_init_interrupt(struct device *dev)
140140 }
141141
142142 gpio_pin_configure (drv_data -> gpio , cfg -> int_gpio ,
143- GPIO_DIR_IN | GPIO_INT | GPIO_INT_EDGE |
144- GPIO_INT_ACTIVE_HIGH | GPIO_INT_DEBOUNCE );
143+ GPIO_INPUT | cfg -> int_flags );
145144
146145 gpio_init_callback (& drv_data -> gpio_cb ,
147146 adxl362_gpio_callback ,
@@ -165,7 +164,8 @@ int adxl362_init_interrupt(struct device *dev)
165164 drv_data -> dev = dev ;
166165#endif
167166
168- gpio_pin_enable_callback (drv_data -> gpio , cfg -> int_gpio );
167+ gpio_pin_interrupt_configure (drv_data -> gpio , cfg -> int_gpio ,
168+ GPIO_INT_EDGE_TO_ACTIVE );
169169
170170 return 0 ;
171171}
Original file line number Diff line number Diff line change @@ -11,3 +11,7 @@ properties:
1111 int1-gpios :
1212 type : phandle-array
1313 required : false
14+ description : |
15+ The INT1 signal defaults to active high as produced by the
16+ sensor. The property value should ensure the flags properly
17+ describe the signal that is presented to the driver.
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (c) 2019 Nordic Semiconductor ASA
3+ *
4+ * SPDX-License-Identifier: Apache-2.0
5+ */
6+
7+ &spi1 {
8+ status = "okay";
9+ sck-pin = <25>;
10+ mosi-pin = <23>;
11+ miso-pin = <24>;
12+ cs-gpios = <&gpio0 22 0>;
13+
14+ adxl362@0 {
15+ compatible = "adi,adxl362";
16+ label = "ADXL362";
17+ spi-max-frequency = <8000000>;
18+ reg = <0>;
19+ int1-gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>;
20+ };
21+ };
You can’t perform that action at this time.
0 commit comments