lib: os: onoff: add API for on-off service request and release management
There are various situations where it's necessary to support turning devices on or off at runtime, includin power rails, clocks, other peripherals, and binary device power management. The complexity of properly managing multiple consumers of a device in a multithreaded system suggests that a shared implementation is desirable. This commit provides an API that supports managing on-off resources. Signed-off-by: Peter A. Bigot <pab@pabigot.com>
This commit is contained in:
parent
cd2ff16a50
commit
1964bf08bb
11 changed files with 2384 additions and 0 deletions
8
tests/lib/onoff/CMakeLists.txt
Normal file
8
tests/lib/onoff/CMakeLists.txt
Normal file
|
@ -0,0 +1,8 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
cmake_minimum_required(VERSION 3.13.1)
|
||||
include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
|
||||
project(onoff)
|
||||
|
||||
FILE(GLOB app_sources src/*.c)
|
||||
target_sources(app PRIVATE ${app_sources})
|
0
tests/lib/onoff/README
Normal file
0
tests/lib/onoff/README
Normal file
2
tests/lib/onoff/prj.conf
Normal file
2
tests/lib/onoff/prj.conf
Normal file
|
@ -0,0 +1,2 @@
|
|||
CONFIG_POLL=y
|
||||
CONFIG_ZTEST=y
|
1164
tests/lib/onoff/src/main.c
Normal file
1164
tests/lib/onoff/src/main.c
Normal file
File diff suppressed because it is too large
Load diff
3
tests/lib/onoff/testcase.yaml
Normal file
3
tests/lib/onoff/testcase.yaml
Normal file
|
@ -0,0 +1,3 @@
|
|||
tests:
|
||||
libraries.onoff:
|
||||
tags: onoff timer
|
Loading…
Add table
Add a link
Reference in a new issue