forked from zephyrproject-rtos/zephyr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: drivers: counter: add rtc_ds3231_api
Cloned from counter_basic_api with modifications based on DS3231 limitations: * Only one device tested per board; * Counter cannot be stopped or started; * Alarms are serviced by worker thread, so are not invoked from ISR and require that test thread yield to allow processing (no k_busy_wait()); * Multiple Alarms test is disabled as documented in test. Additional tests were added for DS3231-specific API. Signed-off-by: Peter A. Bigot <[email protected]>
- Loading branch information
1 parent
e444274
commit e697656
Showing
11 changed files
with
1,089 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
cmake_minimum_required(VERSION 3.13.1) | ||
|
||
find_package(Zephyr HINTS $ENV{ZEPHYR_BASE}) | ||
project(NONE) | ||
|
||
FILE(GLOB app_sources src/*.c) | ||
target_sources(app PRIVATE ${app_sources}) |
15 changes: 15 additions & 0 deletions
15
tests/drivers/counter/maxim_ds3231_api/boards/efr32mg_sltb004a.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Copyright (c) 2019 Peter Bigot Consulting, LLC | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
&i2c0 { /* SDA H16=PC10, SCL H15=PC11, ISW H13=PF6 */ | ||
status = "okay"; | ||
ds3231: ds3231@68 { | ||
compatible = "maxim,ds3231"; | ||
reg = <0x68>; | ||
label = "DS3231"; | ||
isw-gpios = <&gpiof 6 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; | ||
}; | ||
}; |
15 changes: 15 additions & 0 deletions
15
tests/drivers/counter/maxim_ds3231_api/boards/frdm_k64f.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Copyright (c) 2019 Peter Bigot Consulting, LLC | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
&i2c0 { /* SDA PTE25, SCL PTE24, ISW PTE26 */ | ||
status = "okay"; | ||
ds3231: ds3231@68 { | ||
compatible = "maxim,ds3231"; | ||
reg = <0x68>; | ||
label = "DS3231"; | ||
isw-gpios = <&gpioe 26 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; | ||
}; | ||
}; |
15 changes: 15 additions & 0 deletions
15
tests/drivers/counter/maxim_ds3231_api/boards/nrf51dk_nrf51422.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Copyright (c) 2019 Peter Bigot Consulting, LLC | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
&i2c0 { /* SDA 30, SCL 7 */ | ||
status = "okay"; | ||
ds3231: ds3231@68 { | ||
compatible = "maxim,ds3231"; | ||
reg = <0x68>; | ||
label = "DS3231"; | ||
isw-gpios = <&gpio0 0 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; | ||
}; | ||
}; |
15 changes: 15 additions & 0 deletions
15
tests/drivers/counter/maxim_ds3231_api/boards/nrf52840dk_nrf52840.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Copyright (c) 2019 Peter Bigot Consulting, LLC | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
&i2c0 { /* SDA P0.26, SCL P0.27 */ | ||
status = "okay"; | ||
ds3231: ds3231@68 { | ||
compatible = "maxim,ds3231"; | ||
reg = <0x68>; | ||
label = "DS3231"; | ||
isw-gpios = <&gpio0 0 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; | ||
}; | ||
}; |
15 changes: 15 additions & 0 deletions
15
tests/drivers/counter/maxim_ds3231_api/boards/nucleo_l476rg.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Copyright (c) 2019 Peter Bigot Consulting, LLC | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
&i2c1 { /* SDA CN5.9=PB9, SCL CN5.10=PB8, ISW CN5.1=D8=PA9 */ | ||
status = "okay"; | ||
ds3231: ds3231@68 { | ||
compatible = "maxim,ds3231"; | ||
reg = <0x68>; | ||
label = "DS3231"; | ||
isw-gpios = <&gpioa 9 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; | ||
}; | ||
}; |
16 changes: 16 additions & 0 deletions
16
tests/drivers/counter/maxim_ds3231_api/boards/particle_xenon.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* Copyright (c) 2019 Peter Bigot Consulting, LLC | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
&i2c0 { /* SDA P0.26, SCL P0.27, ISW P1.1, 32K P1.2 */ | ||
status = "okay"; | ||
ds3231: ds3231@68 { | ||
compatible = "maxim,ds3231"; | ||
reg = <0x68>; | ||
label = "DS3231"; | ||
isw-gpios = <&gpio1 1 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; | ||
32k-gpios = <&gpio1 2 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CONFIG_I2C=y | ||
CONFIG_COUNTER=y | ||
CONFIG_COUNTER_MAXIM_DS3231=y | ||
CONFIG_BT=n | ||
CONFIG_ZTEST=y | ||
CONFIG_TEST_USERSPACE=y | ||
CONFIG_LOG=y |
Oops, something went wrong.