Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add and update Timer requirements #75

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
337 changes: 328 additions & 9 deletions docs/software_requirements/timers.sdoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@ UID: ZEP-SRS-4-1
STATUS: Draft
TYPE: Functional
COMPONENT: Timers
TITLE: Kernel Clock
TITLE: Timer definition at run time
STATEMENT: >>>
The Zephyr RTOS shall provide a interface for checking the current value of the real-time clock.
<<<
USER_STORY: >>>
As a Zephyr RTOS user, I want to be able to track the passed real time in the OS with a dedicated hardware counter and interrupt.
The Zephyr RTOS shall provide a mechanism to define and initialize a timer at run time.
<<<
RELATIONS:
- TYPE: Parent
Expand All @@ -26,12 +23,334 @@ UID: ZEP-SRS-4-2
STATUS: Draft
TYPE: Functional
COMPONENT: Timers
TITLE: Call functions in interrupt context
TITLE: Timer definition at compile time
STATEMENT: >>>
The Zephyr RTOS shall provide a mechanism to define and initialize a timer at compile time.
<<<
RELATIONS:
- TYPE: Parent
VALUE: ZEP-SYRS-18

[REQUIREMENT]
UID: ZEP-SRS-4-3
STATUS: Draft
TYPE: Non-Functional
COMPONENT: Timers
TITLE: Timer status
STATEMENT: >>>
A Zephyr RTOS timer shall have a status which indicates the expiration of the timer.
<<<
RELATIONS:
- TYPE: Parent
VALUE: ZEP-SYRS-18

[REQUIREMENT]
UID: ZEP-SRS-4-4
STATUS: Draft
TYPE: Non-Functional
COMPONENT: Timers
TITLE: Timer period
STATEMENT: >>>
A Zephyr RTOS timer shall have a period which indicates the time interval between expirations.
<<<
RELATIONS:
- TYPE: Parent
VALUE: ZEP-SYRS-18

[REQUIREMENT]
UID: ZEP-SRS-4-5
STATUS: Draft
TYPE: Non-Functional
COMPONENT: Timers
TITLE: Timer duration
STATEMENT: >>>
A Zephyr RTOS timer shall have a duration which indicates when the timer expires for the first time.
<<<
RELATIONS:
- TYPE: Parent
VALUE: ZEP-SYRS-18

[REQUIREMENT]
UID: ZEP-SRS-4-6
STATUS: Draft
TYPE: Non-Functional
COMPONENT: Timers
TITLE: Timer expiry function
STATEMENT: >>>
A Zephyr RTOS timer shall have a expiry function which is called when the timer expires.
<<<
RELATIONS:
- TYPE: Parent
VALUE: ZEP-SYRS-18

[REQUIREMENT]
UID: ZEP-SRS-4-7
STATUS: Draft
TYPE: Non-Functional
COMPONENT: Timers
TITLE: Timer stop function
STATEMENT: >>>
A Zephyr RTOS timer shall have a stop function which is called when the timer stopped while running.
<<<
RELATIONS:
- TYPE: Parent
VALUE: ZEP-SYRS-18

[REQUIREMENT]
UID: ZEP-SRS-4-8
STATUS: Draft
TYPE: Functional
COMPONENT: Timers
TITLE: Initialialization with expiry function
STATEMENT: >>>
The Zephyr RTOS shall provide an interface to schedule user mode call back function triggered by a real time clock value.
When initializing a timer, the epiry function a timer can have shall be set.
<<<
USER_STORY: >>>
As a Zephyr RTOS user, I want to be able to execute functions in the interrupt context and the interrupt context shall be base on a real-time counter.
RELATIONS:
- TYPE: Parent
VALUE: ZEP-SYRS-18

[REQUIREMENT]
UID: ZEP-SRS-4-9
STATUS: Draft
TYPE: Functional
COMPONENT: Timers
TITLE: Initialialization with stop function
STATEMENT: >>>
When initializing a timer, the stop function a timer can have shall be set.
<<<
RELATIONS:
- TYPE: Parent
VALUE: ZEP-SYRS-18

[REQUIREMENT]
UID: ZEP-SRS-4-10
STATUS: Draft
TYPE: Functional
COMPONENT: Timers
TITLE: Timer start
STATEMENT: >>>
The Zephyr RTOS shall provide a mechanism to start a defined and initialized timer.
<<<
RELATIONS:
- TYPE: Parent
VALUE: ZEP-SYRS-18

[REQUIREMENT]
UID: ZEP-SRS-4-11
STATUS: Draft
TYPE: Functional
COMPONENT: Timers
TITLE: Start timer status reset
STATEMENT: >>>
When a timer is started with the start mechanism the status of the timer is set to zero.
<<<
RELATIONS:
- TYPE: Parent
VALUE: ZEP-SYRS-18

[REQUIREMENT]
UID: ZEP-SRS-4-12
STATUS: Draft
TYPE: Functional
COMPONENT: Timers
TITLE: Start timer counting values
STATEMENT: >>>
When a timer is started with the start mechanism, the timer starts counting with the given persiod and duration values
<<<
RELATIONS:
- TYPE: Parent
VALUE: ZEP-SYRS-18

[REQUIREMENT]
UID: ZEP-SRS-4-13
STATUS: Draft
TYPE: Functional
COMPONENT: Timers
TITLE: Timer stop
STATEMENT: >>>
The Zephyr RTOS shall provide a mechanism to stop a running timer prematurely.
<<<
RELATIONS:
- TYPE: Parent
VALUE: ZEP-SYRS-18

[REQUIREMENT]
UID: ZEP-SRS-4-14
STATUS: Draft
TYPE: Functional
COMPONENT: Timers
TITLE: Timer stop invocation
STATEMENT: >>>
When a Timer is stopped with the provide stop mechanism, the stop function is called if one is defined.
<<<
RELATIONS:
- TYPE: Parent
VALUE: ZEP-SYRS-18

[REQUIREMENT]
UID: ZEP-SRS-4-15
STATUS: Draft
TYPE: Functional
COMPONENT: Timers
TITLE: Timer status read
STATEMENT: >>>
The Zephyr RTOS shall provide a mechanism to read the status of a timer.
<<<
RELATIONS:
- TYPE: Parent
VALUE: ZEP-SYRS-18

[REQUIREMENT]
UID: ZEP-SRS-4-16
STATUS: Draft
TYPE: Functional
COMPONENT: Timers
TITLE: Timer status read reset
STATEMENT: >>>
When the timer is read via the timer status read mechanism, the status shall be reset.
<<<
RELATIONS:
- TYPE: Parent
VALUE: ZEP-SYRS-18

[REQUIREMENT]
UID: ZEP-SRS-4-17
STATUS: Draft
TYPE: Functional
COMPONENT: Timers
TITLE: Timer status read reset
STATEMENT: >>>
When the timer is read via the timer status read mechanism, the status shall be reset.
<<<
RELATIONS:
- TYPE: Parent
VALUE: ZEP-SYRS-18

[REQUIREMENT]
UID: ZEP-SRS-4-18
STATUS: Draft
TYPE: Functional
COMPONENT: Timers
TITLE: Timer thread synchronization
STATEMENT: >>>
The Zephyr RTOS shall provide a mechanism to synchronize a thread with a defined and initialized timer.
<<<
RELATIONS:
- TYPE: Parent
VALUE: ZEP-SYRS-18

[REQUIREMENT]
UID: ZEP-SRS-4-19
STATUS: Draft
TYPE: Functional
COMPONENT: Timers
TITLE: Timer expire when thread synchronization is used
STATEMENT: >>>
When the thread synchronization mechanism is used, the thread shall be blocked until the timer expires.
<<<
RELATIONS:
- TYPE: Parent
VALUE: ZEP-SYRS-18

[REQUIREMENT]
UID: ZEP-SRS-4-20
STATUS: Draft
TYPE: Functional
COMPONENT: Timers
TITLE: Timer is stopped when thread synchronization is used
STATEMENT: >>>
When the thread synchronization mechanism is used, the thread shall be blocked until the timer is stopped.
<<<
RELATIONS:
- TYPE: Parent
VALUE: ZEP-SYRS-18

[REQUIREMENT]
UID: ZEP-SRS-4-21
STATUS: Draft
TYPE: Functional
COMPONENT: Timers
TITLE: Timer thread synchronization status reset
STATEMENT: >>>
When the thread synchronization mechanism is used, the status of the timer shall be reset.
<<<
RELATIONS:
- TYPE: Parent
VALUE: ZEP-SYRS-18

[REQUIREMENT]
UID: ZEP-SRS-4-22
STATUS: Draft
TYPE: Functional
COMPONENT: Timers
TITLE: Timer remaining expiration system tick time
STATEMENT: >>>
The Zephyr RTOS shall provide a mechanism to get the timer remaining until expiration time in system ticks.
<<<
RELATIONS:
- TYPE: Parent
VALUE: ZEP-SYRS-18

[REQUIREMENT]
UID: ZEP-SRS-4-23
STATUS: Draft
TYPE: Functional
COMPONENT: Timers
TITLE: Timer remaining expiration time
STATEMENT: >>>
The Zephyr RTOS shall provide a mechanism to get the timer remaining until expiration time in milliseconds.
<<<
RELATIONS:
- TYPE: Parent
VALUE: ZEP-SYRS-18

[REQUIREMENT]
UID: ZEP-SRS-4-24
STATUS: Draft
TYPE: Functional
COMPONENT: Timers
TITLE: Timer remaining expiration time
STATEMENT: >>>
The Zephyr RTOS shall provide a mechanism to get the timer remaining until expiration time in milliseconds.
<<<
RELATIONS:
- TYPE: Parent
VALUE: ZEP-SYRS-18

[REQUIREMENT]
UID: ZEP-SRS-4-25
STATUS: Draft
TYPE: Functional
COMPONENT: Timers
TITLE: Timer set user data
STATEMENT: >>>
The Zephyr RTOS shall provide a mechanism to set user data to a timer.
<<<
RELATIONS:
- TYPE: Parent
VALUE: ZEP-SYRS-18

[REQUIREMENT]
UID: ZEP-SRS-4-26
STATUS: Draft
TYPE: Functional
COMPONENT: Timers
TITLE: Timer get user data
STATEMENT: >>>
The Zephyr RTOS shall provide a mechanism to get user data from a timer.
<<<
RELATIONS:
- TYPE: Parent
VALUE: ZEP-SYRS-18

[REQUIREMENT]
UID: ZEP-SRS-4-27
STATUS: Draft
TYPE: Functional
COMPONENT: Timers
TITLE: Timer expire functions in interrupt context
STATEMENT: >>>
When the timer expiry function is defined, it shall be called in the interrupt context.
<<<
RELATIONS:
- TYPE: Parent
Expand Down
20 changes: 16 additions & 4 deletions docs/system_requirements/index.sdoc
Original file line number Diff line number Diff line change
Expand Up @@ -241,19 +241,31 @@ As a Zephyr RTOS user, I want to be able to give my threads different priorities

[/SECTION]

[SECTION]
TITLE: Timers

[REQUIREMENT]
UID: ZEP-SYRS-18
STATUS: Draft
TYPE: High Level
TYPE: Non-Functional
COMPONENT: Timers
TITLE: Timers
TITLE: Time based events
STATEMENT: >>>
The Zephyr RTOS shall provide a framework for managing time-based events.
<<<
USER_STORY: >>>
As a Zephyr RTOS user, I want to start, suspend, resume and stop timers which shall trigger an event on a set expiration time.

[REQUIREMENT]
UID: ZEP-SYRS-20
STATUS: Draft
TYPE: Non-Functional
COMPONENT: Timers
TITLE: Timers time base
STATEMENT: >>>
The Timers of the Zephyr RTOS shall use the kernel's system clock to measure time.
<<<

[/SECTION]

[REQUIREMENT]
UID: ZEP-SYRS-19
STATUS: Draft
Expand Down
Loading