AUTOSAR SRS ICUDriver
AUTOSAR SRS ICUDriver
AUTOSAR SRS ICUDriver
Disclaimer
This work (specification and/or software implementation) and the material contained
in it, as released by AUTOSAR, is for the purpose of information only. AUTOSAR
and the companies that have contributed to it shall not be liable for any use of the
work.
The material contained in this work is protected by copyright and other types of
intellectual property rights. The commercial exploitation of the material contained in
this work requires a license to such intellectual property rights.
This work may be utilized or reproduced without any modification, in any form or by
any means, for informational purposes only. For any other purpose, no part of the
work may be utilized or reproduced, in any form or by any means, without permission
in writing from the publisher.
The work has been developed for automotive applications only. It has neither been
developed, nor tested for non-automotive applications.
The word AUTOSAR and the AUTOSAR logo are registered trademarks.
Table of Contents
1 Scope of document
This document specifies requirements on the module ICU Driver.
Constraints
First scopes for specification of requirements on basic software modules are systems
which are not safety relevant. For this reason safety requirements are assigned to
medium priority.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted . Note that the requirement level of the document in
which they are used modifies the force of these words.
MUST: This word, or the terms "REQUIRED" or "SHALL", mean that the
definition is an absolute requirement of the specification.
MUST NOT: This phrase, or the phrase „SHALL NOT“, means that the
definition is an absolute prohibition of the specification.
SHOULD: This word, or the adjective "RECOMMENDED", mean that there
may exist valid reasons in particular circumstances to ignore a particular item,
but the full implications must be understood and carefully weighed before
choosing a different course.
SHOULD NOT: This phrase, or the phrase "NOT RECOMMENDED" mean
that there may exist valid reasons in particular circumstances when the
particular behavior is acceptable or even useful, but the full implications
should be understood and the case carefully weighed before implementing
any behavior described with this label.
MAY: This word, or the adjective „OPTIONAL“, means that an item is truly
optional. One vendor may choose to include the item because a particular
marketplace requires it or because the vendor feels that it enhances the
product while another vendor may omit the same item. An implementation,
which does not include a particular option, MUST be prepared to interoperate
with another implementation, which does include the option, though perhaps
with reduced functionality. In the same vein an implementation, which does
include a particular option, MUST be prepared to interoperate with another
implementation, which does not include the option (except, of course, for the
feature the option provides.)
Functional Requirements:
- Configuration (which elements of the module need to be configurable)
- Initialization
- Normal Operation
- Shutdown Operation
- Fault Operation
- ...
Non-Functional Requirements:
- Timing Requirements
- Resource Usage
- Usability
- Output for other WPs (e.g. Description Templates, Tooling,...)
- ...
Acronym Description
Circular buffer An area of memory used to store a continuous stream of data by starting
again at the beginning of the buffer after reaching the end.
DIO Digital Input Output
Duty Cycle Percentage of High Time to Period Time
(High Time / Period Time) * 100%
ECU Electric Control Unit
High Time See Figure “ICU time definitions”. The standard type STD_HIGH shall be
used.
ICU Input Capture Unit
ICU channel Represents a logical ICU entity bound to one input signal and the hardware
resources for the configured measurement mode.
Linear buffer An area of memory used to store a stream of data by starting at the
beginning of the buffer and stopping at the latest on reaching the end.
Low Time See Figure “ICU time definitions”
MAL Old name of Microcontroller Abstraction Layer (replaced by MCAL because
‘MAL’ is a French term meaning ‘male’)
MCAL Microcontroller Abstraction Layer
MCU Microcontroller Unit
Measurement mode The measurement mode defines the capability for signal acquisition and
evaluation. Possible modes:
Signal Edge Detection / Notification
Signal Measurement
Timestamp
Edge Counter
Measurement mode, Functionality of an Edge Counter, counting of external edges
Edge counter
Measurement mode, Notification on signal edges.
Signal Edge Detection
Measurement mode, Measurement of elapsed High Time, elapsed Low Time, elapsed Period
Signal Measurement Time and Duty Cycle of an input signal.
Measurement mode, Generation of timestamps for signal edges, see Figure “ICU time stamp”
Timestamp
Period Time See Figure “ICU time definitions”
PWD Pulse width demodulation
SPAL Standard Peripheral Abstraction Layer
Abbreviation Description
STD Standard
UNINIT Uninitialized (= not initialized)
As this is a document from professionals for professionals, all other terms are
expected to be known.
8 of 25 Document ID 112: AUTOSAR_SRS_ICUDriver
- AUTOSAR confidential -
Requirements on ICU Driver
AUTOSAR CP Release 4.4.0
4 Functional Overview
4.1 ICU Driver
The ICU Driver controls the input capture unit of the microcontroller. It provides the
following features:
Period-, Low-, High time measurement
Edge detection and notification
Edge counting
Edge time stamping
Wake-up interrupts
The picture below shows the typical key resources of a Capture Compare Unit:
Capture Timer 0
Notification Interrupts
f in x
Capture Timer 1
f in z
Capture Timer
Notification Interrupts
Control
f in extern x
Capture Timer y
f in extern y
Notification Interrupts
Timer
values
Signal 1
Capture Register 0
Notification Interrupts
Signal 2
Capture Register 1
Notification Interrupts
capture mode
& edge
Capture Register 2
detection
control Notification Interrupts
Signal n
Capture Register n
Notification Interrupts
For signal edge detection the edge detector of a capture compare unit or the interrupt
controller for external events is used.
For signal measuring a capture timer and at least one capture register is needed.
Simple signal edge detection without time measurement can also be implemented
with external interrupt control units:
Signal m
level / edge Notification Interrupts
detection
&
Signal z interrupt
control Notification Interrupts
However Non Maskable Interrupts (NMI) are not in the scope of this module,
because there is nothing which can be controlled.
Period Time
0xFFFF
Timstamp
Timer
High
Input Signal
Low
t
Input Signal Timestamp
Level Timer
High 5461
Low 10922
High 22937
Low 32767
High 43690
Low 49151
High 58981
Low 6553
High 16383
5 Requirements Tracing
Requirement Description Satisfied by
RS_BRF_01056 AUTOSAR BSW modules shall SRS_Icu_12429
provide standardized interfaces
RS_BRF_01096 AUTOSAR shall support start-up SRS_Icu_12407
and shutdown of ECUs
RS_BRF_01104 AUTOSAR shall support sleep and SRS_Icu_12408
wake-up of ECUs and buses
RS_BRF_01432 AUTOSAR services shall support SRS_Icu_12430, SRS_Icu_12431,
system time services SRS_Icu_12434, SRS_Icu_12435,
SRS_Icu_12436, SRS_Icu_12437,
SRS_Icu_12442, SRS_Icu_12443,
SRS_Icu_12444, SRS_Icu_12453,
SRS_Icu_13100
RS_BRF_01448 AUTOSAR services shall support SRS_Icu_12371
mode and state management
RS_BRF_01488 AUTOSAR RTE and BSW shall SRS_Icu_12370
support standardized modes for
ECU start up, ECU shut down with
restart, and for putting an ECU to
sleep
RS_BRF_01904 AUTOSAR microcontroller SRS_Icu_12438
abstraction shall provide access to
hardware timers
RS_BRF_01968 AUTOSAR IO Hardware SRS_Icu_12369, SRS_Icu_12432,
Abstraction shall support edge SRS_Icu_12433, SRS_Icu_12435,
triggered I/O signals SRS_Icu_12436, SRS_Icu_12439,
SRS_Icu_12442, SRS_Icu_12443
RS_BRF_02200 AUTOSAR diagnostic shall provide SRS_Icu_12327, SRS_Icu_12368,
external access to internal SRS_Icu_12425
configuration and calibration data
6 Requirement Specification
6.1 Functional Requirements
6.1.1.1 Configuration
6.1.1.1.1 [SRS_Icu_12327] The ICU driver shall allow the configuration of global
parameters
⌈
Type: Valid
Description: The ICU driver shall allow the configuration of the following parameters:
Clock source with optional prescaler (module wide)
MCU Hardware dependent settings (only ICU-peripheral specific
settings)
Rationale: Configuration of microcontroller specific ICU features
Use Case: --
Dependencies: --
Supporting Material: --
⌋(RS_BRF_02200)
Mandatory parameters
Symbolic name for channel
Notification function(s)
Wake-up capability
Optional parameters
Signal Source (Configured Port Pin or Input from a Signal Matrix) if
provided by hardware (if multiple sources are selectable)
Measurement Mode: (if multiple modes are selectable)
Signal Edge Detection / Notification
Signal Measurement
Timestamp
Edge Counter
6.1.1.1.3 [SRS_Icu_12425] For each ICU Channel the ‘property’ that could be
measured shall be configurable
⌈
Type: Valid
Description: For each ICU Channel the ‘property’ that could be measured shall be
configurable and the values available (at least) shall be :
High Level
Low Level
Period Time
Rationale: Definition of the measurement purpose to allocate the required HW
resources during configuration.
Use Case: --
Dependencies: --
Supporting Material: --
⌋( RS_BRF_02200)
6.1.1.2 Initialization
All used registers shall be initialized (including pending flags for interrupts) .
Rationale: The user of an ICU channel shall be responsible to enable / disable the
notification.
Use Case: --
Dependencies: --
Supporting Material: --
⌋(RS_BRF_01096)
6.1.1.3.2 [SRS_Icu_12369] The ICU driver shall provide notification for an ICU
Channel at the configured signal edge
⌈
Type: Valid
Description: The ICU driver shall provide notification for an ICU Channel at the configured
signal edge (rising / falling / both edges) in the following configuration:
Notification function configured as no null pointer
and only if notifications are enabled
Rationale: Notification on signal edge
Use Case: Signal edge detection
Dependencies: --
Supporting Material: --
⌋(RS_BRF_01968)
6.1.1.3.3 [SRS_Icu_12370] The ICU driver shall provide a service for selecting
the sleep mode
⌈
Type: Valid
Description: The ICU driver shall provide a service for selecting the sleep mode:
Normal mode (mandatory)
sleep mode
In Normal mode all notifications are available as configured.
In sleep mode only those interrupts which cause wake-up capable
notifications are available.
All other interrupts are disabled and must not lead to an exit of the reduced
power mode state (e.g. idle, halt) of the MCU if the event occurs.
Rationale: Allow enabling / disabling of all interrupts which are not required for the ECU
wake-up.
Use Case: During entry in the reduced power mode of an ECU all interrupts of the MCU
shall be disabled without disabling the wake-up sources in between.
Otherwise wake-up events can be lost.
Dependencies: --
Supporting Material: --
⌋(RS_BRF_01488)
Type: Valid
Description: If linear buffer handling is configured, when the capture functionality reaches
the end of the buffer, the driver stops capturing timer values.
Only the configured edges are counted (rising edge / falling edge / both
edges)
6.1.1.3.17 [SRS_Icu_12442] The elapsed Signal Low Time for each ICU
Channel shall be provided
⌈
Type: Valid
Description: The ICU driver shall provide a service to get the elapsed Signal Low Time for
each ICU Channel that is configured in Measurement Mode
“Signal Measurement, Signal Low Time”.
The elapsed time is measured between a falling edge and the consecutive
rising edge of the channel.
Rationale: get the elapsed Signal Low Time
Use Case: PWD
Dependencies: --
Supporting Material: --
⌋( RS_BRF_01432,RS_BRF_01968)
6.1.1.3.18 [SRS_Icu_12435] The elapsed Signal High Time for each ICU
Channel shall be provided
⌈
Type: Valid
Description: The ICU driver shall provide a service to get the Signal High Time for each
ICU Channel that is configured in Measurement Mode “Signal Measurement,
Signal High Time”.
The elapsed time is measured between a rising edge and the consecutive
falling edge of the channel.
Rationale: --
Use Case: PWD
Dependencies: --
Supporting Material: --
⌋( RS_BRF_01432,RS_BRF_01968)
Type: Valid
Description: The ICU driver shall provide a service to get the elapsed Period time for
each ICU Channel that is configured in Measurement Mode “Signal
Measurement, Period Time”.
The elapsed time is measured between two consecutive rising (or falling)
edges of the channel.
Rationale: --
Use Case: PWD
Dependencies: --
Supporting Material: --
⌋( RS_BRF_01432,RS_BRF_01968)
6.1.1.3.21 [SRS_Icu_12437] All time units used within the API services of the
ICU driver shall be of the unit ticks
⌈
Type: Valid
Description: All time units used within the API services of the ICU driver shall be of the
unit ticks.
Rationale: Conversions between microseconds and ticks shall be part of the ECU
Abstraction Layer.
Use Case: --
Dependencies: --
Supporting Material: --
⌋(RS_BRF_01432)
6.1.1.4.1 [SRS_Icu_12408] The ICU driver shall provide a service for enabling /
disabling the wake-up capability of single ICU channels
⌈
Type: Valid
Description: The ICU driver shall provide a service for enabling / disabling the wake-up
capability of single ICU channels.
Rationale: Controlling the wake-up conditions of a MCU needs to enable or disable the
23 of 25 Document ID 112: AUTOSAR_SRS_ICUDriver
- AUTOSAR confidential -
Requirements on ICU Driver
AUTOSAR CP Release 4.4.0
7 References
[1] Glossary
AUTOSAR_TR_Glossary.pdf