0% found this document useful (0 votes)
11 views

AUTOSAR CP SWS IFXLibrary

Uploaded by

Chaos Xia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

AUTOSAR CP SWS IFXLibrary

Uploaded by

Chaos Xia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 75

Specification of Fixed Point Interpolation Routines

AUTOSAR CP R23-11

Specification of Fixed Point


Document Title Interpolation Routines
Document Owner AUTOSAR
Document Responsibility AUTOSAR
Document Identification No 396

Document Status published


Part of AUTOSAR Standard Classic Platform
Part of Standard Release R23-11

Document Change History


Date Release Changed by Description
AUTOSAR
2023-11-23 R23-11 Release • Fixed CheckDocumentSource errors.
Management
• Functions updated: SWS_Ifx_00014,
SWS_Ifx_00017, SWS_Ifx_00022,
SWS_Ifx_00027, SWS_Ifx_00032,
SWS_Ifx_00209, SWS_Ifx_00041,
SWS_Ifx_00051, SWS_Ifx_00062,
SWS_Ifx_00077, SWS_Ifx_00087,
SWS_Ifx_00097, SWS_Ifx_00110,
AUTOSAR SWS_Ifx_00122, SWS_Ifx_00222,
2022-11-24 R22-11 Release SWS_Ifx_00136, SWS_Ifx_00151,
Management SWS_Ifx_00236, SWS_Ifx_00166,
SWS_Ifx_00181, SWS_Ifx_00247,
SWS_Ifx_00185, SWS_Ifx_00186,
SWS_Ifx_00006 and SWS_Ifx_00821.

• Functions added: SWS_Ifx_91002,


SWS_Ifx_91003, SWS_Ifx_91004 and
SWS_Ifx_91005.
• No content changes (only converted to
AUTOSAR LaTex)
2021-11-25 R21-11 Release
Management • Artifact inclusion based on
ArtifactAnalysis corrected
AUTOSAR
2020-11-30 R20-11 Release • Chapter 7.1 Error sections updated
Management
5

1 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

4
AUTOSAR • Editorial changes
2019-11-28 R19-11 Release • Changed Document Status from Final to
Management published
AUTOSAR
2018-10-31 4.4.0 Release • Editorial changes
Management
• A new requirement (SWS_Ifx_00251)
has been added under Section 7.6 to
provide clarity on the rounding
AUTOSAR mechanism for intermediate result
2017-12-08 4.3.1 Release calculation.
Management
• A requirement (SWS_Ifx_00250) has
been removed as it is not realizable for
all the scenarios
• Added a new requirement (SWS_Ifx_
00250) to provide info on symmetricity
for interpolation services

• A note has been added in SWS_Ifx_


00016 as a suggestion to provide
hardware independent solution too

• Section 2 has been updated to include


abbreviation for (DET) Default Error
AUTOSAR
tracer
2016-11-30 4.3.0 Release
Management • Updated IFX document to support
MISRA 2012 standard. (Removed
redundant statements in SWS_Ifx_
00809 which already exist in SWS_BSW
document and SWS_SRS document)

• Modified the reference to SRS_BSW_


General (SRS_BSW_00437) & (SRS_
BSW_00448) for SWS_Ifx_00436 &
SWS_Ifx_00999 requirements
5

2 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

4
• Added a new statement in Section 8.5
below the formula to provide more clarity
to the users

• Updated the “Requirements tracea-bility“


AUTOSAR section
2015-07-31 4.2.2 Release
Management • Updated Record layouts for distributed
interpolation routines in SWS_Ifx_00185

• Updated SWS_Ifx_00001 for naming


convetion under Section 5.1, File
Structure
• IFX RecordLayout Blueprint reference in
section 3.1

• The usage of const is corrected in


function parameters for SWS_Ifx_00004,
AUTOSAR SWS_Ifx_00014, SWS_Ifx_00015,
2014-10-31 4.2.1 Release SWS_Ifx_00017, SWS_Ifx_00020,
Management SWS_Ifx_00022, SWS_Ifx_00025,
SWS_Ifx_00027, SWS_Ifx_00030,
SWS_Ifx_00032, SWS_Ifx_00205 &
SWS_Ifx_00209

• Modified serial numbers in Section 3.2


AUTOSAR • Removed columns Element6 &
2014-03-31 4.1.3 Release Element7 in the Record Layout table of
Management SWS_Ifx_00186
• Corrections made for IntMap_s16u8_s8
function in Record Layout Table of
AUTOSAR SWS_Ifx_00186
2013-10-31 4.1.2 Release
• Corrected array-out-of-bounds for Ifx_
Management
IpoMap function

• Editorial changes
5

3 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

4
• Rounding mechanism specified for
DPRatio calculation

• Corrected the formula for integrated map


interpolation and map interpolation

• Removed unwanted Ratio calculation for


integrated fix-I map look up with
AUTOSAR rounding and Integrated fix-map look up
2013-03-15 4.1.1
Administration without rounding and integrated map
look-up without rounding

• Modified the reference to non-existant


metamodel
elementCalprmElementPrototype to
Parameter-DataPrototype

• Corrected for ’DependencyOnArtifact’


AUTOSAR • Removal of rounding off feature from
2011-12-22 4.0.3
Administration ’MAP lookup routines’
AUTOSAR • DPSearch function optimised using
2010-09-30 3.1.5
Administration structure pointer
AUTOSAR
2010-02-02 3.1.4 • Initial Release
Administration

4 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

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 intel-
lectual 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.

5 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

Contents
1 Introduction and functional overview 8

2 Acronyms and Abbreviations 9

3 Related documentation 10
3.1 Input documents & related standards and norms . . . . . . . . . . . . . 10
3.2 Related specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4 Constraints and assumptions 11
4.1 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.2 Applicability to car domains . . . . . . . . . . . . . . . . . . . . . . . . . 11
5 Dependencies to other modules 12
5.1 File structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
6 Requirements Tracing 13

7 Functional specification 15
7.1 Error Classification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
7.1.1 Development Errors . . . . . . . . . . . . . . . . . . . . . . . . 15
7.1.2 Runtime Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
7.1.3 Transient Faults . . . . . . . . . . . . . . . . . . . . . . . . . . 15
7.1.4 Production Errors . . . . . . . . . . . . . . . . . . . . . . . . . 15
7.1.5 Extended Production Errors . . . . . . . . . . . . . . . . . . . . 15
7.2 Initialization and shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . 15
7.3 Using Library API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
7.4 library implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
8 API specification 18
8.1 Imported types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
8.2 Type definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
8.3 Comment about rounding . . . . . . . . . . . . . . . . . . . . . . . . . . 19
8.4 Comment about routines optimization . . . . . . . . . . . . . . . . . . . . 20
8.4.1 Target optimization . . . . . . . . . . . . . . . . . . . . . . . . . 20
8.4.2 Optimization for routine numbers . . . . . . . . . . . . . . . . . 20
8.5 Interpolation routines definitions . . . . . . . . . . . . . . . . . . . . . . . 20
8.5.1 Distributed data point search and interpolation . . . . . . . . . 22
8.5.1.1 Data Point Search . . . . . . . . . . . . . . . . . . . . 22
8.5.1.2 Curve interpolation . . . . . . . . . . . . . . . . . . . . 24
8.5.1.3 Curve look-up . . . . . . . . . . . . . . . . . . . . . . . 25
8.5.1.4 Map interpolation . . . . . . . . . . . . . . . . . . . . . 26
8.5.1.5 Map look-up . . . . . . . . . . . . . . . . . . . . . . . . 28
8.5.1.6 Map look-up without rounding . . . . . . . . . . . . . . 30
8.5.2 Integrated data point search and interpolation . . . . . . . . . 31
8.5.2.1 Integrated curve interpolation . . . . . . . . . . . . . . 31

6 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

8.5.2.2 Integrated curve look-up . . . . . . . . . . . . . . . . . 34


8.5.2.3 Integrated fix-curve interpolation . . . . . . . . . . . . 36
8.5.2.4 Integrated fix-curve look up . . . . . . . . . . . . . . . 37
8.5.2.5 Integrated fix- I curve interpolation . . . . . . . . . . . 39
8.5.2.6 Integrated fix- I curve look up . . . . . . . . . . . . . . 40
8.5.2.7 Integrated map interpolation . . . . . . . . . . . . . . . 42
8.5.2.8 Integrated map look-up . . . . . . . . . . . . . . . . . 46
8.5.2.9 Integrated map look-up without rounding . . . . . . . . 49
8.5.2.10 Integrated fix- map interpolation . . . . . . . . . . . . . 51
8.5.2.11 Integrated fix- map look up . . . . . . . . . . . . . . . 53
8.5.2.12 Integrated fix- map look up without rounding . . . . . . 56
8.5.2.13 Integrated fix- I map interpolation . . . . . . . . . . . . 58
8.5.2.14 Integrated fix- I map look up . . . . . . . . . . . . . . . 60
8.5.2.15 Integrated fix- I map look up without rounding . . . . . 63
8.5.2.16 Cuboid 3D interpolation . . . . . . . . . . . . . . . . . 65
8.5.3 Record layouts for interpolation routines . . . . . . . . . . . . . 66
8.5.3.1 Record layouts for map values . . . . . . . . . . . . . 66
8.5.3.2 Record layout definitions . . . . . . . . . . . . . . . . . 67
8.6 Examples of use of functions . . . . . . . . . . . . . . . . . . . . . . . . 68
8.7 Version API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
8.7.1 Ifx_GetVersionInfo . . . . . . . . . . . . . . . . . . . . . . . . . 69
8.8 Callback notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
8.9 Scheduled functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
8.10 Expected Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
8.10.1 Mandatory Interfaces . . . . . . . . . . . . . . . . . . . . . . . 70
8.10.2 Optional Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . 70
8.10.3 Configurable interfaces . . . . . . . . . . . . . . . . . . . . . . 70
9 Sequence diagrams 71

10 Configuration specification 72
10.1 How to read this chapter . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
10.2 Containers and configuration parameters . . . . . . . . . . . . . . . . . . 72
10.3 Published Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
A Not applicable requirements 73

B History of Specification Items 74


B.1 Specification Item History of this document compared to AUTOSAR
R22-11. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
B.1.1 Added Specification Items in R23-11 . . . . . . . . . . . . . . . 74
B.1.2 Changed Specification Items in R23-11 . . . . . . . . . . . . . 74
B.1.3 Deleted Specification Items in R23-11 . . . . . . . . . . . . . . 75

7 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

1 Introduction and functional overview


AUTOSAR Library routines are the part of system services in AUTOSAR architecture
and below figure shows position of AUTOSAR library in layered architecture.

Figure 1.1: Layered Architecture

Ifx routines specification specifies the functionality, API and the configuration of the
AUTOSAR library dedicated to interpolation routines for fixed point values.
The interpolation library contains the following routines:
• Distributed data point search and interpolation
• Integrated data point search and interpolation
All routines are re-entrant and can be used by multiple applications at the same time.

8 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

2 Acronyms and Abbreviations


The glossary below includes acronyms and abbreviations relevant to the IFX Library
module that are not included in the [1, AUTOSAR glossary].
Abbreviation / Acronym: Description:
Cur Curve for Interpolation
DET Default Error Tracer
DPSearch Data point search
DPResult Data point result
Ifx Interpolation Fixed point
IpoCur Interpolation of curve used for distributed search and
interpolation
LkUpCur Curve look-up used for distributed search and interpolation
IpoMap Interpolation of map used for distributed search and
interpolation
LkUpMap Map look-up used for distributed search and interpolation
IntIpoCur Integrated interpolation of curve
IntLkUpCur Integrated curve look-up
IntIpoFixCur Integrated interpolation of fixed curve
IntLkUpFixCur Integrated fixed curve look-up
IntIpoFixICur Integrated interpolation of fixed interval curve
IntLkUpFixICur Integrated fixed interval curve look-up
IntIpoMap Integrated interpolation of map
IntLkUpMap Integrated map look-up
IntIpoFixMap Integrated interpolation of fixed map
IntLkUpFixMap Integrated fixed map look-up
IntIpoFixIMap Integrated interpolation of fixed interval map
IntLkUpFixIMap Integrated fixed interval map look-up
Lib Library
Map Map for Interpolation
s8 Mnemonic for the sint8, specified in AUTOSAR_SWS_
PlatformTypes
s16 Mnemonic for the sint16, specified in AUTOSAR_SWS_
PlatformTypes
s32 Mnemonic for the sint32, specified in AUTOSAR_SWS_
PlatformTypes
u8 Mnemonic for the uint8, specified in AUTOSAR_SWS_
PlatformTypes
u16 Mnemonic for the uint16, specified in AUTOSAR_SWS_
PlatformTypes
u32 Mnemonic for the uint32, specified in AUTOSAR_SWS_
PlatformTypes

9 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

3 Related documentation

3.1 Input documents & related standards and norms

[1] Glossary
AUTOSAR_FO_TR_Glossary
[2] IFX_RecordLayout_Blueprint
AUTOSAR_MOD_IFX_RecordLayout_Blueprint.arxml
[3] ISO/IEC 9899:1990 Programming Language - C
https://www.iso.org
[4] ASAM MCD-2MC Version 1.6
http://www.asam.net
[5] General Specification of Basic Software Modules
AUTOSAR_CP_SWS_BSWGeneral
[6] Requirements on Libraries
AUTOSAR_CP_SRS_Libraries

3.2 Related specification


AUTOSAR provides a General Specification on Basic Software modules [5, SWS BSW
General], which is also valid for IFX Library.
Thus, the specification SWS BSW General shall be considered as additional and re-
quired specification for IFX Library.

10 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

4 Constraints and assumptions

4.1 Limitations
No limitations.

4.2 Applicability to car domains


No restrictions.

11 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

5 Dependencies to other modules

5.1 File structure


[SWS_Ifx_00001] dThe Ifx module shall provide the following files:
• C files, Ifx_<name>.c used to implement the library. All C files shall be prefixed
with ’Ifx_’.
Implementation & grouping of routines with respect to C files is recommended as per
below options and there is no restriction to follow the same.
Option 1 : <Name> can be function name providing one C file per function,
eg.: Ifx_IntIpoMap_u16u8_u8.c etc.
Option 2 : <Name> can have common name of group of functions:
• 2.1 Group by object family:
eg.:Ifx_IpoMap.c, Ifx_IpoCur.c, Ifx_DPSearch.c
• 2.2 Group by routine family:
eg.: Ifx_IpoMap.c, Ifx_IntIpoMap.c, Ifx_IpoCur.c etc.
• 2.3 Group by method family:
eg.: Ifx_Ipo.c, Ifx_IntIpo.c, Ifx_Lkup.c, Ifx_IntLkup.c, etc.
• 2.4 Group by architecture:
eg.: Ifx_IpoMap8.c, Ifx_IpoMap16.c
• 2.5 Group by other methods: (individual grouping allowed)
Option 3 : <Name> can be removed so that single C file shall contain all Ifx functions,
eg.: Ifx.c.
Using above options gives certain flexibility of choosing suitable granularity with re-
duced number of C files. Linking only on-demand is also possible in case of some
options.c()

12 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

6 Requirements Tracing
The following tables reference the requirements specified in [6] and links to the fulfill-
ment of these. Please note that if column “Satisfied by” is empty for a specific require-
ment this means that this requirement is not fulfilled by this document.
Requirement Description Satisfied by
[SRS_BSW_00003] All software modules shall provide [SWS_Ifx_00815]
version and identification information
[SRS_BSW_00007] All Basic SW Modules written in C [SWS_Ifx_00809]
language shall conform to the MISRA
C 2012 Standard.
[SRS_BSW_00304] All AUTOSAR Basic Software [SWS_Ifx_00812]
Modules shall use only AUTOSAR
data types instead of native C data
types
[SRS_BSW_00306] AUTOSAR Basic Software Modules [SWS_Ifx_00813]
shall be compiler and platform
independent
[SRS_BSW_00318] Each AUTOSAR Basic Software [SWS_Ifx_00815]
Module file shall provide version
numbers in the header file
[SRS_BSW_00321] The version numbers of AUTOSAR [SWS_Ifx_00815]
Basic Software Modules shall be
enumerated according specific rules
[SRS_BSW_00348] All AUTOSAR standard types and [SWS_Ifx_00811]
constants shall be placed and
organized in a standard type header
file
[SRS_BSW_00374] All Basic Software Modules shall [SWS_Ifx_00814]
provide a readable module vendor
identification
[SRS_BSW_00378] AUTOSAR shall provide a boolean [SWS_Ifx_00812]
type
[SRS_BSW_00379] All software modules shall provide a [SWS_Ifx_00814]
module identifier in the header file
and in the module XML description
file.
[SRS_BSW_00402] Each module shall provide version [SWS_Ifx_00814]
information
[SRS_BSW_00407] Each BSW module shall provide a [SWS_Ifx_00815] [SWS_Ifx_00816]
function to read out the version
information of a dedicated module
implementation
[SRS_BSW_00411] All AUTOSAR Basic Software [SWS_Ifx_00816]
Modules shall apply a naming rule for
enabling/disabling the existence of
the API
[SRS_BSW_00437] Memory mapping shall provide the [SWS_Ifx_00810]
possibility to define RAM segments
which are not to be initialized during
startup
[SRS_BSW_00448] Module SWS shall not contain [SWS_Ifx_00999]
requirements from other modules
[SRS_LIBS_00001] The functional behavior of each [SWS_Ifx_00818]
library functions shall not be
configurable
5

13 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

4
Requirement Description Satisfied by
[SRS_LIBS_00002] A library shall be operational before [SWS_Ifx_00800]
all BSW modules and application
SW-Cs
[SRS_LIBS_00003] A library shall be operational until the [SWS_Ifx_00801]
shutdown
[SRS_LIBS_00015] It shall be possible to configure the [SWS_Ifx_00806]
microcontroller so that the library
code is shared between all callers
[SRS_LIBS_00017] Usage of macros should be avoided [SWS_Ifx_00807]
[SRS_LIBS_00018] A library function may only call library [SWS_Ifx_00808]
functions
Table 6.1: RequirementsTracing

14 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

7 Functional specification

7.1 Error Classification


[SWS_Ifx_00823] dSection 7.1 "Error Handling" of the document "General Specifica-
tion of Basic Software Modules" describes the error handling of the Basic Software in
detail. Above all, it constitutes a classification scheme consisting of five error types
which may occur in BSW modules.c()
Based on this foundation, the following section specifies particular errors arranged in
the respective subsections below.

7.1.1 Development Errors

There are no development errors.

7.1.2 Runtime Errors

There are no runtime errors.

7.1.3 Transient Faults

There are no transient faults.

7.1.4 Production Errors

There are no production errors.

7.1.5 Extended Production Errors

There are no extended production errors.

7.2 Initialization and shutdown


[SWS_Ifx_00800] dIfx library shall not require initialization phase. A Library function
may be called at the very first step of ECU initialization, e.g. even by the OS or EcuM,
thus the library shall be ready.c(SRS_LIBS_00002)

15 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

[SWS_Ifx_00801] dIfx library shall not require a shutdown operation phase.c(SRS_-


LIBS_00003)

7.3 Using Library API


Ifx API can be directly called from BSW modules or SWC. No port definition is required.
It is a pure function call.
The statement ’Ifx.h’ shall be placed by the developer or an application code generator
but not by the RTE generator
Using a library should be documented. if a BSW module or a SWC uses a Library,
the developer should add an Implementation-DependencyOnArtifact in the BSW/SWC
template.
minVersion and maxVersion parameters correspond to the supplier version. In case
of AUTOSAR library, these parameters may be left empty because a SWC or BSW
module may rely on a library behaviour, not on a supplier implementation. However,
the SWC or BSW modules shall be compatible with the AUTOSAR platform where they
are integrated.

7.4 library implementation


[SWS_Ifx_00806] dThe Ifx library shall be implemented in a way that the code can be
shared among callers in different memory partitions.c(SRS_LIBS_00015)
[SWS_Ifx_00807] dUsage of macros should be avoided. The function should be de-
clared as function or inline function. Macro #define should not be used.c(SRS_LIBS_-
00017)
[SWS_Ifx_00808] dA library function can call other library functions because all library
functions shall be re-entrant. A library function shall not call any BSW modules func-
tions, e.g. the DET.c(SRS_LIBS_00018)
[SWS_Ifx_00809] dThe library, written in C programming language, should conform to
the MISRA C Standard.
Please refer to SWS_BSW_00115 for more details.c(SRS_BSW_00007)
[SWS_Ifx_00810] dEach AUTOSAR library Module implementation <library>*.c and
<library>*.h shall map their code to memory sections using the AUTOSAR memory
mapping mechanism.c(SRS_BSW_00437)
[SWS_Ifx_00811] dEach AUTOSAR library Module implementation <library>*.c, that
uses AUTOSAR integer data types and/or the standard return, shall include the header
file Std_Types.h.c(SRS_BSW_00348)

16 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

[SWS_Ifx_00812] dAll AUTOSAR library Modules should use the AUTOSAR data
types (integers, boolean) instead of native C data types, unless this library is clearly
identified to be compliant only with a platform.c(SRS_BSW_00304, SRS_BSW_00378)
[SWS_Ifx_00813] dAll AUTOSAR library Modules should avoid direct use of compiler
and platform specific keyword, unless this library is clearly identified to be compliant
only with a platform. eg. #pragma, typeof etc.c(SRS_BSW_00306)
[SWS_Ifx_00820] dIf input value is less than first distribution entry then first value of
the distribution array shall be returned or used in the interpolation routines. If input
value is greater than last distribution entry then last value of the distribution array shall
be returned or used in the interpolation routines.c()
[SWS_Ifx_00821] dAxis distribution passed to Ifx routines shall have normal monotony
sequence.c()
[SWS_Ifx_00251] dThe intermediate results during unscaling in interpolation calcula-
tion shall be Rounded towards zero.c()

17 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

8 API specification

8.1 Imported types


In this chapter, all types included from the following modules are listed :
[SWS_Ifx_91001] Definition of imported datatypes of module Ifx d
Module Header File Imported Type
Std Std_Types.h Std_VersionInfoType

c()
It is observed that since the sizes of the integer types provided by the C language are
implementation-defined, the range of values that may be represented within each of
the integer types will vary between implementations.
Thus, in order to improve the portability of the software these types are defined in Plat-
form_Types.h [AUTOSAR_SWS_PlatformTypes]. The following mnemonic are used in
the library routine names.
Size Platform Type Mnemonic Range
unsigned 8-Bit boolean NA [ TRUE, FALSE ]
signed 8-Bit sint8 s8 [ -128, 127 ]
signed 16-Bit sint16 s16 [ -32768, 32767 ]
signed 32-Bit sint32 s32 [ -2147483648, 2147483647
]
unsigned 8-Bit uint8 u8 [ 0, 255 ]
unsigned 16-Bit uint16 u16 [ 0, 65535 ]
unsigned 32-Bit uint32 u32 [ 0, 4294967295 ]

Table 8.1: Mnemonic for Base Types

As a convention in the rest of the document:


• mnemonics will be used in the name of the routines (using <InTypeMn1> that
means Type Mnemonic for Input )
• the real type will be used in the description of the prototypes of the routines (using
<InType> or <OutType>).

18 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

8.2 Type definitions


Structure definition :
[SWS_Ifx_00002] Definition of datatype Ifx_DPResultU16_Type d
Name Ifx_DPResultU16_Type
Kind Structure
Elements Index
Type uint16
Comment Data point index
Ratio
Type uint16
Comment Data point ratio
Description Structure used for data point search for index and ratio
Available via Ifx.h

c()
[SWS_Ifx_00003] dRatio shall have resolution of 2-16 c()
[SWS_Ifx_00248] dRatio shall be rounded towards zeroc()
[SWS_Ifx_00200] dIfx_DPResultU16_Type structure shall not be read/write/modified
by the user directly. Only Ifx routines shall have access to this structure.c()

8.3 Comment about rounding


Two types of rounding can be applied:
Results are ’rounded off’, it means:
• 0 <= X < 0.5 rounded to 0
• 0.5 <= X < 1 rounded to 1
• -0.5 < X <= 0 rounded to 0
• -1 < X <= -0.5 rounded to -1
Results are rounded towards zero.
• 0 <= X < 1 rounded to 0
• -1 < X <= 0 rounded to 0

19 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

8.4 Comment about routines optimization

8.4.1 Target optimization

The routines described in this library may be realized as regular routines or inline func-
tions. For ROM optimization purposes, it is recommended that the c routines be real-
ized as individual source files so they may be linked in on an as-needed basis.
For example, depending on the target, two types of optimization can be done:
• 00302
Some routines can be replaced by another routine using integer promotion
• Some routines can be replaced by the combination of a limiting routine and a
routine with a different signature.

8.4.2 Optimization for routine numbers

Many routines can be omitted by exchanging ’X’ and ’Y’ data types. With this method,
reduction in total number of routines is possible in case of Map interpolation routines.
This optimization of routine numbers is done based on below mentioned rules.
• Rule 1: Bigger data type of ’X’ and ’Y’ comes first . (16 Bit before 8 Bit)
• Rule 2: unsigned before signed (u16 before s16)
• Order: u32, s32, u16, s16, u8, s8
In this case, below routine can be replaced as :
Ifx_IntIpoMap_s8u16_u16
With
Ifx_IntIpoMap_u16s8_u16
Note: swapped inputs need another map value order in memory, see record layout
section

8.5 Interpolation routines definitions


Interpolation between two given points is calculated as shown below.
where: X is the input value
x0 = data point before X
x1 = data point after X
y0 = value at x0

20 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

y1 = value at x1
Quantization error is by design and shall not be compensated in implementation.

Figure 8.1: Linear and lookup interpolation

There are two interpolation methods.


• Linear interpolation
• Lookup interpolation
Above figure differentiates linear and lookup integration method. Linear method inter-
polates result considering two data points, whereas lookup interpolation returns entry
data point.
Data point arrays can be grouped as one array or one structure for all elements as
shown below.
one array for all elements :
uint8 Curve_u8 []={5,0,10,26,36,64,1,12,17,11,6};
one structure for all elements :
struct
{ sint16 N = 5;
uint8 X[] ={0,10,26,36,64};
uint8 Y[] ={1,12,17,11,6};
} Curve_u8;
where, number of samples = 5
X axis distribution = 0 to 64
Y axis distribution = 1 to 6

21 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

Interpolation routines accepts arguments separately to support above scenarios. Rou-


tine call example is given below for array and structure grouping respectively.
Example :
uint8 Ifx_IntIpoCur_u8_u8 (15, Curve_u8[0], &Curve_u8[1], &Curve_u8[6]);
uint8 Ifx_IntIpoCur_u8_u8 (15, Curve_u8.N, &Curve_u8.X, &Curve_u8.Y);
Interpolation can be calculated in two ways as shown below:
1. Distributed data point search and interpolation
2. Integrated data point search and interpolation

8.5.1 Distributed data point search and interpolation

In this interpolation method data point search (e.g. index and ratio) is calculated using
routine Ifx_DPSearch_<InTypeMn> which returns result structure Ifx_DPResultU16_
Type. It contains index and ratio information. This result can be used by curve interpo-
lation, curve look-up interpolation, map interpolation and map look-up interpolation.

8.5.1.1 Data Point Search

[SWS_Ifx_00004] Definition of API function Ifx_DPSearch_<InTypeMn> d


Service Name Ifx_DPSearch_<InTypeMn>
Syntax void Ifx_DPSearch_<InTypeMn> (
Ifx_DPResultU16_Type* dpResult,
<InType> Xin,
<InType> N,
const <InType>* X_array
)
Service ID [hex] 0x001 to 0x004
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) Xin Input value
N Number of samples
X_array Pointer to the X axis distribution array
Parameters (inout) None
Parameters (out) dpResult Pointer to the result structure
Return value None
Description Ifx_DPSearch_<InTypeMn> routine searches the position of input Xin within the given
distribution array X_array, and returns index and ratio necessary for interpolation.
Available via Ifx.h

c()
[SWS_Ifx_00006] dIf (X_array[0] <= Xin <= X_array[N-1]), then returned Index shall be
the lowest index.

22 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

dpResult ->Index = index- dpResult ->Ratio = (Xin - X_array[index]) / (X_array [index+1]


- X_array [index])c()
[SWS_Ifx_00008] dIf the input value matches with one of the distribution array values,
then return the respective index and ratio = 0.
If (Xin == X_array[index]), then
dpResult ->Index = index
dpResult ->Ratio = 0c()
[SWS_Ifx_00009] dIf (Xin < X_array[0]), then return first index of an array and ratio = 0
dpResult ->Index = 0
dpResult ->Ratio = 0c()
[SWS_Ifx_00010] dIf (Xin > X_array[N-1]), then return last index of an array and ratio
=0
dpResult ->Index = N - 1
dpResult ->Ratio = 0c()
[SWS_Ifx_00011] dThe minimum value of N shall be 1c()
[SWS_Ifx_00013] dThis routine returns index and ratio through the structure of type
Ifx_DPResultU16_Typec()
[SWS_Ifx_00014] dHere is the list of implemented routines.c()
Service ID[hex] Service prototype
0x001 void Ifx_DPSearch_u8 (Ifx_DPResultU16_Type*, uint8,
uint8, const uint8 *)
0x002 void Ifx_DPSearch_s8 (Ifx_DPResultU16_Type*, sint8, sint8,
const sint8 *)
0x003 void Ifx_DPSearch_u16 (Ifx_DPResultU16_Type*, uint16,
uint16, const uint16 * )
0x004 void Ifx_DPSearch_s16 (Ifx_DPResultU16_Type*, sint16,
sint16, const sint16 *)
0x0C1 void Ifx_DPSearch_u32 (Ifx_DPResultU16_Type* dpResult,
uint32 Xin, uint32 N, const uint32 * X_array)
0x0C2 void Ifx_DPSearch_s32 (Ifx_DPResultU16_Type* dpResult,
sint32 Xin, sint32 N, const sint32 * X_array)

23 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

8.5.1.2 Curve interpolation

[SWS_Ifx_00015] Definition of API function Ifx_IpoCur_<OutTypeMn> d


Service Name Ifx_IpoCur_<OutTypeMn>
Syntax <OutType> Ifx_IpoCur_<OutTypeMn> (
const Ifx_DPResultU16_Type* dpResult,
const <InType>* Val_array
)
Service ID [hex] 0x005 to 0x008
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) dpResult Data point search result
Val_array Pointer to the result axis distribution array
Parameters (inout) None
Parameters (out) None
Return value <OutType> Result of the Interpolation
Description Based on searched index and ratio information, this routine calculates and returns interpolation
for curve.
Available via Ifx.h

c()
[SWS_Ifx_00016] dindex = dpResult->Index
if dPResult->Ratio == 0
Result = Val_array[index]
else
Result = Val_array[index] + (Val_array[index+1] - Val_array[index]) * dpResult->Ratio
Note:
In case of missing HW support the Software solution mentioned below could also be
used to avoid 64-bit arithmetic operation.
if (Val_array[index] <= Val_array[index+1]) then
Result = Val_array[index] + (Val_array[index+1] - Val_array[index]) * dpResult->Ratio
if (Val_array[index] > Val_array[index+1]) then
Result = Val_array[index] - (Val_array[index] - Val_array[index+1]) * dpResult->Ratioc()
[SWS_Ifx_00201] dDo not call this routine until you have searched the axis using the
Ifx_DPSearch routine. Only then it is ensured that the search result (Ifx_DPResult
U16_Type) contains valid data and is not used uninitialized.c()

24 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

[SWS_Ifx_00017] dHere is the list of implemented routines.c()


Routine ID[hex] Routine prototype
0x005 sint8 Ifx_IpoCur_s8 (const Ifx_DPResultU16_Type*, const
sint8 *)
0x006 sint16 Ifx_IpoCur_s16 (const Ifx_DPResultU16_Type*, const
sint16 *)
0x007 uint16 Ifx_IpoCur_u16 (const Ifx_DPResultU16_Type*, const
uint16 *)
0x008 uint8 Ifx_IpoCur_u8 (const Ifx_DPResultU16_Type*, const
uint8 *)
0x0C3 uint32 Ifx_IpoCur_u32 (const Ifx_DPResultU16_
Type*dpResult, const uint32* Val_array )
0x0C4 sint32 Ifx_IpoCur_s32 (const Ifx_DPResultU16_
Type*dpResult, const sint32* Val_array )

8.5.1.3 Curve look-up

[SWS_Ifx_00020] Definition of API function Ifx_LkUpCur_<OutTypeMn> d


Service Name Ifx_LkUpCur_<OutTypeMn>
Syntax <OutType> Ifx_LkUpCur_<OutTypeMn> (
const Ifx_DPResultU16_Type* dpResult,
const <InType>* Val_array
)
Service ID [hex] 0x00A to 0x00D
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) dpResult Data point search result
Val_array Pointer to the result axis distribution array
Parameters (inout) None
Parameters (out) None
Return value <OutType> Entry point of the result array
Description Based on searched index and ratio information, this routine calculates and returns entry point
of the result array.
Available via Ifx.h

c()
[SWS_Ifx_00021] dResult = Val_array[dpResult->Index]c()
[SWS_Ifx_00202] dDo not call this routine until you have searched the axis using the
Ifx_DPSearch routine. Only then it is ensured that the search result (Ifx_DPResult
U16_Type) contains valid data and is not used uninitialized.c()

25 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

[SWS_Ifx_00022] dHere is the list of implemented routines.c()


Routine ID[hex] Routine prototype
0x00A sint8 Ifx_LkUpCur_s8 (const Ifx_DPResultU16_Type*, const
sint8 *)
0x00B sint16 Ifx_LkUpCur_s16 (const Ifx_DPResultU16_Type*,
const sint16 *)
0x00C uint16 Ifx_LkUpCur_u16 (const Ifx_DPResultU16_Type*,
const uint16 *)
0x00D uint8 Ifx_LkUpCur_u8 (const Ifx_DPResultU16_Type*, const
uint8 *)
0x0C5 sint32 Ifx_LkUpCur_s32 (const Ifx_DPResultU16_Type*
dpResult, const sint32 * Val_array)
0x0C6 uint32 Ifx_LkUpCur_u32 (const Ifx_DPResultU16_Type*
dpResult, const uint32 * Val_array)

8.5.1.4 Map interpolation

[SWS_Ifx_00025] Definition of API function Ifx_IpoMap_<OutTypeMn> d


Service Name Ifx_IpoMap_<OutTypeMn>
Syntax <OutType> Ifx_IpoMap_<OutTypeMn> (
const Ifx_DPResultU16_Type* dpResultX,
const Ifx_DPResultU16_Type* dpResultY,
uint16 num_value,
const <InType>* Val_array
)
Service ID [hex] 0x010 to 0x013
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) dpResultX Data point search result for x axis
dpResultY Data point search result for y axis
num_value Number of y axis points
Val_array Pointer to the result axis distribution array
Parameters (inout) None
Parameters (out) None
Return value <OutType> Result of the Interpolation
Description Based on searched indices and ratios information using the relevant Ifx_DPSearch routine, this
routine calculates and returns the interpolation result for map.
Available via Ifx.h

c()
[SWS_Ifx_00026] dBased on searched indices and ratios information using the rele-
vant Ifx_DPSearch routine, this routine calculates and returns the interpolation result
for map.
BaseIndex = dpResultX->Index * num_value + dpResultY->Index
if (dpResultX->Ratio == 0)

26 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

if (dpResultY->Ratio == 0)
Result = Val_array [BaseIndex]
else
LowerY = Val_array [BaseIndex]
UpperY = Val_array [BaseIndex + 1]
Result = LowerY + (UpperY - LowerY) * dpResultY->Ratio
else
if (dpResultY->Ratio == 0)
LowerX = Val_array[BaseIndex]
UpperX = Val_array[BaseIndex + num_value]
Result = LowerX + (UpperX - LowerX) * dpResultX->Ratio
else
LowerY = Val_array [BaseIndex]
UpperY = Val_array [BaseIndex + 1]
LowerX = LowerY + (UpperY - LowerY) * dpResultY->Ratio
LowerY = Val_array[BaseIndex + num_value]
UpperY = Val_array[BaseIndex + num_value + 1]
UpperX = LowerY + (UpperY - LowerY) * dpResultY->Ratio
Result = LowerX + (UpperX - LowerX) * dpResultX->Ratioc()
[SWS_Ifx_00203] dDo not call this routine until you have searched the axis using the
Ifx_DPSearch routine. Only then it is ensured that the search result (Ifx_DPResult
U16_Type) contains valid data and is not used uninitialized.c()
[SWS_Ifx_00027] dHere is the list of implemented routines.c()
Routine ID[hex] Routine prototype
0x010 uint8 Ifx_IpoMap_u8 ( const Ifx_DPResultU16_Type*,
const Ifx_DPResultU16_Type*,
uint16,
const uint8 *)
0x011 uint16 Ifx_IpoMap_u16 ( const Ifx_DPResultU16_Type*,
const Ifx_DPResultU16_Type*,
uint16,
const uint16 *)
5

27 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

4
Routine ID[hex] Routine prototype
0x012 sint8 Ifx_IpoMap_s8 ( const Ifx_DPResultU16_Type*,
const Ifx_DPResultU16_Type*,
uint16,
const sint8 *)
0x013 sint16 Ifx_IpoMap_s16 ( const Ifx_DPResultU16_Type*,
const Ifx_DPResultU16_Type*,
uint16,
const sint16 *)
0x0C7 sint32 Ifx_IpoMap_s32 ( const Ifx_DPResultU16_
Type*dpResultX,
const Ifx_DPResultU16_Type*dpResultY,
uint16 num_value,
const sint32 * Val_array)
0x0C8 uint32 Ifx_IpoMap_u32 ( const Ifx_DPResultU16_
Type*dpResultX,
const Ifx_DPResultU16_Type*dpResultY,
uint16 num_value,
const uint32 * Val_array)

8.5.1.5 Map look-up

[SWS_Ifx_00030] Definition of API function Ifx_LkUpMap_<OutTypeMn> d


Service Name Ifx_LkUpMap_<OutTypeMn>
Syntax <OutType> Ifx_LkUpMap_<OutTypeMn> (
const Ifx_DPResultU16_Type* dpResultX,
const Ifx_DPResultU16_Type* dpResultY,
uint16 num_value,
const <InType>* Val_array
)
Service ID [hex] 0x015 to 0x018
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) dpResultX Data point search result for x axis
dpResultY Data point search result for y axis
num_value Number of y axis points
Val_array Pointer to the result axis distribution array
Parameters (inout) None
Parameters (out) None
Return value <OutType> Entry point of the result array
Description Based on searched index and ratio information, this routine calculates and returns entry value
of the result distribution array.
Available via Ifx.h

c()

28 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

[SWS_Ifx_00031] dBaseIndex = dpResultX->Index * num_value + dpResultY->Indexc


()
[SWS_Ifx_00033] dif(dpResultX->Ratio < 0.5 && dpResultY->Ratio < 0.5) then
return Val_array [BaseIndex]
if(dpResultX->Ratio ≥ 0.5 && dpResultY->Ratio < 0.5) then
return Val_array [BaseIndex + num_value]
if(dpResultX->Ratio < 0.5 && dpResultY->Ratio ≥ 0.5) then
return Val_array [BaseIndex + 1]
if(dpResultX->Ratio ≥ 0.5 && dpResultY->Ratio ≥ 0.5) then
return Val_array [BaseIndex + num_value + 1]c()
[SWS_Ifx_00204] dDo not call this routine until you have searched the axis to ensure
the search result contains valid data and is not used uninitialized.c()
[SWS_Ifx_00032] dHere is the list of implemented routines.c()
Routine ID[hex] Routine prototype
0x015 uint8 Ifx_LkUpMap_u8 ( const Ifx_DPResultU16_Type*,
const Ifx_DPResultU16_Type*,
uint16,
const uint8 *)
0x016 uint16 Ifx_LkUpMap_u16 ( const Ifx_DPResultU16_Type*,
const Ifx_DPResultU16_Type*,
uint16,
const uint16 *)
0x017 sint8 Ifx_LkUpMap_s8 ( const Ifx_DPResultU16_Type*,
const Ifx_DPResultU16_Type*,
uint16,
const sint8 *)
0x018 sint16 Ifx_LkUpMap_s16 ( const Ifx_DPResultU16_Type*,
const Ifx_DPResultU16_Type*,
uint16,
const sint16 *)
0x0C9 sint32 Ifx_LkUpMap_s32 ( const Ifx_DPResultU16_
Type*dpResultX,
const Ifx_DPResultU16_Type*dpResultY,
uint16 num_value,
const sint32* Val_array)
0x0CA uint32 Ifx_LkUpMap_u32 ( const Ifx_DPResultU16_Type*
dpResultX,
const Ifx_DPResultU16_Type*dpResultY,
uint16 num_value,
const uint32* Val_array)

29 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

8.5.1.6 Map look-up without rounding

[SWS_Ifx_00205] Definition of API function Ifx_LkUpBaseMap_<OutTypeMn> d


Service Name Ifx_LkUpBaseMap_<OutTypeMn>
Syntax <OutType> Ifx_LkUpBaseMap_<OutTypeMn> (
const Ifx_DPResultU16_Type* dpResultX,
const Ifx_DPResultU16_Type* dpResultY,
uint16 num_value,
const <InType>* Val_array
)
Service ID [hex] 0x0A5 to 0x0A8
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) dpResultX Data point search result for x axis
dpResultY Data point search result for y axis
num_value Number of y axis points
Val_array Pointer to the result axis distribution array
Parameters (inout) None
Parameters (out) None
Return value <OutType> Entry point of the result array
Description Based on searched index and ratio information, this routine calculates and returns entry value
of the result distribution array.
Available via Ifx.h

c()
[SWS_Ifx_00206] dBaseIndex = dpResultX->Index * num_value + dpResultY->Indexc
()
[SWS_Ifx_00207] dReturn Value = Val_array [BaseIndex]c()
[SWS_Ifx_00208] dDo not call this routine until you have searched the axis using the
Ifx_DPSearch routine. Only then it is ensured that the search result (Ifx_DPResult
U16_Type) contains valid data and is not used uninitialized.c()
[SWS_Ifx_00209] dHere is the list of implemented routines.c()
Routine ID[hex] Routine prototype
0x0A5 uint8 Ifx_LkUpBaseMap_u8 ( const Ifx_DPResultU16_Type*,
const Ifx_DPResultU16_Type*,
uint16,
const uint8 *)
0x0A6 uint16 Ifx_LkUpBaseMap_u16 ( const Ifx_DPResultU16_
Type*,
const Ifx_DPResultU16_Type*,
uint16,
const uint16 *)
5

30 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

4
Routine ID[hex] Routine prototype
0x0A7 sint8 Ifx_LkUpBaseMap_s8 ( const Ifx_DPResultU16_Type*,
const Ifx_DPResultU16_Type*,
uint16,
const sint8 *)
0x0A8 sint16 Ifx_LkUpBaseMap_s16 ( const Ifx_DPResultU16_
Type*,
const Ifx_DPResultU16_Type*,
uint16,
const sint16 *)
0x0CB sint32 Ifx_LkUpBaseMap_s32 ( const Ifx_DPResultU16_
Type* dpResultX,
const Ifx_DPResultU16_Type* dpResultY,
uint16 num_value,
const sint32* Val_array)
0x0CC uint32 Ifx_LkUpBaseMap_u32 ( const Ifx_DPResultU16_
Type* dpResultX,
const Ifx_DPResultU16_Type* dpResultY,
uint16 num_Val,
const uint32* Val_array)

8.5.2 Integrated data point search and interpolation

In this method of interpolation, single routine does data point search (e.g. Index and
ratio) and interpolation for curve, map or look-up table.

8.5.2.1 Integrated curve interpolation

[SWS_Ifx_00035] Definition of API function Ifx_IntIpoCur_<InTypeMn>_<OutType


Mn> d
Service Name Ifx_IntIpoCur_<InTypeMn>_<OutTypeMn>
Syntax <OutType> Ifx_IntIpoCur_<InTypeMn>_<OutTypeMn> (
<InType> Xin,
<InType> N,
const <InType>* X_array,
const <InType>* Val_array
)
Service ID [hex] 0x01A to 0x029
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) Xin Input value
N Number of samples
5

31 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

4
X_array Pointer to the X axis distribution array
Val_array Pointer to the result axis distribution array
Parameters (inout) None
Parameters (out) None
Return value <OutType> Result of the Interpolation
Description This routine calculates interpolation of a curve at position Xin using below equation.
Available via Ifx.h

c()
[SWS_Ifx_00036] dIf (X_array[0] < Xin < X_array[N -1]), then
index = lowest index for which (Xin < X_array[index + 1]).
RatioX = (Xin - X_array[index]) / (X_array [index+1] - X_array [index])
Result = Val_array[index] + (Val_array[index+1] - Val_array[index])*RatioXc()
[SWS_Ifx_00037] dInput value matches with one of the distribution array value then
result shall be respective Y array element indicated by index.
If (Xin == X_array[index]) then,
Result = Val_array[index]c()
[SWS_Ifx_00038] dIf (Xin < X_array[0]) then,
Result = Val_array[0]c()

32 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

[SWS_Ifx_00039] dIf (Xin > X_array[N-1]) then,


Result = Val_array[N-1]c()
[SWS_Ifx_00040] dThe minimum value of N shall be 1c()
[SWS_Ifx_00041] dHere is the list of implemented routines.c()
Routine ID[hex] Routine prototype
0x01A uint8 Ifx_IntIpoCur_u8_u8 ( uint8, uint8, const uint8 *, const
uint8 *)
0x01B uint16 Ifx_IntIpoCur_u8_u16 ( uint8, uint8, const uint8 *,
const uint16 *)
0x01C sint8 Ifx_IntIpoCur_u8_s8 ( uint8, uint8, const uint8 *, const
sint8 *)
0x01D sint16 Ifx_IntIpoCur_u8_s16 ( uint8, uint8, const uint8 *,
const sint16 *)
0x01E uint8 Ifx_IntIpoCur_u16_u8 ( uint16, uint16, const uint16 *,
const uint8 *)
0x01F uint16 Ifx_IntIpoCur_u16_u16 ( uint16, uint16, const uint16
*, const uint16 *)
0x020 sint8 Ifx_IntIpoCur_u16_s8 ( uint16, uint16, const uint16 *,
const sint8 *)
0x021 sint16 Ifx_IntIpoCur_u16_s16 ( uint16, uint16, const uint16 *,
const sint16 *)
0x022 uint8 Ifx_IntIpoCur_s8_u8 ( sint8, sint8, const sint8 *, const
uint8 *)
0x023 uint16 Ifx_IntIpoCur_s8_u16 ( sint8, sint8, const sint8 *,
const uint16 *)
0x024 sint8 Ifx_IntIpoCur_s8_s8 ( sint8, sint8, const sint8 *, const
sint8 *)
0x025 sint16 Ifx_IntIpoCur_s8_s16 ( sint8, sint8, const sint8 *,
const sint16 *)
0x026 uint8 Ifx_IntIpoCur_s16_u8 ( sint16, sint16, const sint16 *,
const uint8 *)
0x027 uint16 Ifx_IntIpoCur_s16_u16 ( sint16, sint16, const sint16 *,
const uint16 *)
0x028 sint8 Ifx_IntIpoCur_s16_s8 ( sint16, sint16, const sint16 *,
const sint8 *)
0x029 sint16 Ifx_IntIpoCur_s16_s16 ( sint16, sint16, const sint16 *,
const sint16 *)
0x0CD sint32 Ifx_IntIpoCur_s32_s32 ( sint32 Xin, sint32 N, const
sint32* X_array, const sint32* Val_array)
0x0CE uint32 Ifx_IntIpoCur_u32_u32 ( uint32 Xin, uint32 N, const
uint32* X_array, const uint32* Val_array)

33 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

8.5.2.2 Integrated curve look-up

[SWS_Ifx_00045] Definition of API function Ifx_IntLkUpCur_<InTypeMn>_<Out


TypeMn> d
Service Name Ifx_IntLkUpCur_<InTypeMn>_<OutTypeMn>
Syntax <OutType> Ifx_IntLkUpCur_<InTypeMn>_<OutTypeMn> (
<InType> Xin,
<InType> N,
const <InType>* X_array,
const <InType>* Val_array
)
Service ID [hex] 0x030 to 0x03F
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) Xin Input value
N Number of samples
X_array Pointer to the X axis distribution array
Val_array Pointer to the result axis distribution array
Parameters (inout) None
Parameters (out) None
Return value <OutType> Entry point of the result array
Description This routine returns respective entry value of the result at position Xin based on below
equations.
Available via Ifx.h

c()
[SWS_Ifx_00046] dIf (X_array[0] < Xin < X_array[N -1]), then
index = lowest index for which (Xin < X_array[index + 1]).
Result = Val_array[index]c()
[SWS_Ifx_00047] dInput value matches with one of the distribution array value then
result shall be respective Y array element indicated by index.
If (Xin == X_array[index]) then,
Result = Val_array[index]c()
[SWS_Ifx_00048] dIf (Xin < X_array[0]) then,
Result = Val_array[0]c()
[SWS_Ifx_00049] dIf (Xin > X_array[N-1]) then,
Result = Val_array[N-1]c()
[SWS_Ifx_00050] dThe minimum value of N shall be 1c()

34 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

[SWS_Ifx_00051] dHere is the list of implemented routines.c()


Routine ID[hex] Routine prototype
0x030 uint8 Ifx_IntLkUpCur_u8_u8 ( uint8 , uint8, const uint8 *,
const uint8 * )
0x031 uint16 Ifx_IntLkUpCur_u8_u16 ( uint8 , uint8, const uint8 *,
const uint16 * )
0x032 sint8 Ifx_IntLkUpCur_u8_s8 ( uint8 , uint8, const uint8 *,
const sint8 * )
0x033 sint16 Ifx_IntLkUpCur_u8_s16 ( uint8 , uint8, const uint8 *,
const sint16 * )
0x034 uint8 Ifx_IntLkUpCur_u16_u8 ( uint16 , uint16, const uint16
*, const uint8 * )
0x035 uint16 Ifx_IntLkUpCur_u16_u16 ( uint16 , uint16, const
uint16 *, const uint16 * )
0x036 sint8 Ifx_IntLkUpCur_u16_s8 ( uint16 , uint16, const uint16
*, const sint8 * )
0x037 sint16 Ifx_IntLkUpCur_u16_s16 ( uint16 , uint16, const
uint16 *, const sint16 * )
0x038 uint8 Ifx_IntLkUpCur_s8_u8 ( sint8 , sint8, const sint8 *,
const uint8 * )
0x039 uint16 Ifx_IntLkUpCur_s8_u16 ( sint8 , sint8, const sint8 *,
const uint16 * )
0x03A sint8 Ifx_IntLkUpCur_s8_s8 ( sint8, sint8, const sint8 *, const
sint8 * )
0x03B sint16 Ifx_IntLkUpCur_s8_s16 ( sint8, sint8, const sint8 *,
const sint16 * )
0x03C uint8 Ifx_IntLkUpCur_s16_u8 ( sint16, sint16, const sint16 *,
const uint8 * )
0x03D uint16 Ifx_IntLkUpCur_s16_u16 ( sint16, sint16, const sint16
*, const uint16 * )
0x03E sint8 Ifx_IntLkUpCur_s16_s8 ( sint16, sint16, const sint16 *,
const sint8 * )
0x03F sint16 Ifx_IntLkUpCur_s16_s16 ( sint16, sint16, const sint16
*, const sint16 * )
0x0CF sint32 Ifx_IntLkUpCur_s32_s32 ( sint32 Xin, sint32 N, const
sint32* X_array, const sint32* Val_array )
0x0D0 uint32 Ifx_IntLkUpCur_u32_u32 ( uint32 Xin, uint32 N, const
uint32* X_array, const uint32* Val_array )

35 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

8.5.2.3 Integrated fix-curve interpolation

[SWS_Ifx_00055] Definition of API function Ifx_IntIpoFixCur_<InTypeMn>_<Out


TypeMn> d
Service Name Ifx_IntIpoFixCur_<InTypeMn>_<OutTypeMn>
Syntax <OutType> Ifx_IntIpoFixCur_<InTypeMn>_<OutTypeMn> (
<InType> Xin,
<InType> N,
const <InType>* Val_array,
<InType> Offset,
<InType> Shift
)
Service ID [hex] 0x040 to 0x043
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) Xin Input value
N Number of samples
Val_array Pointer to the result axis distribution array
Offset Offset of the first sampling value for X-axis
Shift ’Shift’ is the power of 2, (2ˆShift) represents X-axis distribution
point interval
Parameters (inout) None
Parameters (out) None
Return value <OutType> Result of the Interpolation
Description This routine calculates interpolation of a curve at position Xin using below equations.
Available via Ifx.h

c()
[SWS_Ifx_00056] dX axis distribution points shall be calculated based on Offset and
Shift values.
X_array [index] = Offset + index * 2Shift
If Offset = 10, Shift = 2 and N = 5 then,
X_array[5] = {10, 14, 18, 22, 26}c()
[SWS_Ifx_00057] dIf (X_array[0] < Xin < X_array[N -1]), then
index = lowest index for which (Xin < X_array[index + 1]).
RatioX = (Xin - X_array[index]) / (X_array [index+1] - X_array [index])
Result = Val_array[index] + (Val_array[index+1] - Val_array[index]) * RatioXc()
[SWS_Ifx_00058] dInput value matches with one of the distribution array value then
result shall be respective Y array element indicated by index.
If (Xin == X_array[index])
Result = Val_array[index]c()

36 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

[SWS_Ifx_00059] dIf (Xin < X_array[0]) then,


Result = Val_array[0]c()
[SWS_Ifx_00060] dIf (Xin > X_array[N-1]) then,
Result = Val_array[N-1]c()
[SWS_Ifx_00061] dThe minimum value of N shall be 1c()
[SWS_Ifx_00062] dHere is the list of implemented routines.c()
Routine ID[hex] Routine prototype
0x040 uint8 Ifx_IntIpoFixCur_u8_u8 ( uint8, uint8, const uint8 *,
uint8, uint8)
0x041 uint16 Ifx_IntIpoFixCur_u16_u16 (uint16, uint16, const
uint16 *, uint16, uint16)
0x042 sint8 Ifx_IntIpoFixCur_s8_s8 ( sint8, sint8, const sint8 *,
sint8, sint8)
0x043 sint16 Ifx_IntIpoFixCur_s16_s16 ( sint16, sint16, const
sint16 *, sint16, sint16)
0x0D1 sint32 Ifx_IntIpoFixCur_s32_s32 ( sint32 Xin, sint32 N, const
sint32* Val_array, sint32 offset, sint32 shift)
0x0D2 uint32 Ifx_IntIpoFixCur_u32_u32 ( uint32 Xin, uint32 N,
const uint32* Val_array, uint32 offset, uint32 shift)

8.5.2.4 Integrated fix-curve look up

[SWS_Ifx_00070] Definition of API function Ifx_IntLkUpFixCur_<InType


Mn>_<OutTypeMn> d
Service Name Ifx_IntLkUpFixCur_<InTypeMn>_<OutTypeMn>
Syntax <OutType> Ifx_IntLkUpFixCur_<InTypeMn>_<OutTypeMn> (
<InType> Xin,
<InType> N,
const <InType>* Val_array,
<InType> Offset,
<InType> Shift
)
Service ID [hex] 0x045 to 0x048
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) Xin Input value
N Number of samples
Val_array Pointer to the result axis distribution array
Offset Offset of the first sampling value for X-axis
Shift ’Shift’ is the power of 2, (2ˆShift) represents X-axis distribution
point interval
Parameters (inout) None
5

37 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

4
Parameters (out) None
Return value <OutType> Entry point of the result array
Description This routine returns respective entry value of the result distribution array at position Xin based
on below equations.
Available via Ifx.h

c()
[SWS_Ifx_00071] dX axis distribution points shall be calculated based on Offset and
Shift values.
X_array [index] = Offset + index * 2Shift
If Offset = 10, Shift = 2 and N = 5 then,
X_array[5] = {10, 14, 18, 22, 26}c()
[SWS_Ifx_00072] dIf (X_array[0] < Xin < X_array[N -1]), then
index = lowest index for which (Xin < X_array[index + 1]).
Result = Val_array[index]c()
[SWS_Ifx_00073] dInput value matches with one of the distribution array value then
result shall be respective Y array element indicated by index.
If (Xin == X_array[index]) then,
Result = Val_array[index]c()
[SWS_Ifx_00074] dIf (Xin < X_array[0]) then,
Result = Val_array[0]c()
[SWS_Ifx_00075] dIf (Xin > X_array[N-1]) then,
Result = Val_array[N-1]c()
[SWS_Ifx_00076] dThe minimum value of N shall be 1c()
[SWS_Ifx_00077] dHere is the list of implemented routinesc()
Routine ID[hex] Routine prototype
0x045 uint8 Ifx_IntLkUpFixCur_u8_u8 (uint8, uint8, const uint8 *,
uint8, uint8)
0x046 uint16 Ifx_IntLkUpFixCur_u16_u16 (uint16, uint16, const
uint16 *, uint16, uint16)
0x047 sint8 Ifx_IntLkUpFixCur_s8_s8 (sint8, sint8, const sint8 *,
sint8, sint8)
0x048 sint16 Ifx_IntLkUpFixCur_s16_s16 (sint16, sint16, const
sint16 *, sint16, sint16)
0x0D3 sint32 Ifx_IntLkUpFixCur_s32_s32 (sint32 Xin, sint32 N,
const sint32* Val_array, sint32 offset, sint32 shift)
0x0D4 uint32 Ifx_IntLkUpFixCur_u32_u32 (uint32 Xin, uint32 N,
const uint32* Val_array, uint32 offset, uint32 shift)

38 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

8.5.2.5 Integrated fix- I curve interpolation

[SWS_Ifx_00080] Definition of API function Ifx_IntIpoFixICur_<InTypeMn>_<Out


TypeMn> d
Service Name Ifx_IntIpoFixICur_<InTypeMn>_<OutTypeMn>
Syntax <OutType> Ifx_IntIpoFixICur_<InTypeMn>_<OutTypeMn> (
<InType> Xin,
<InType> N,
const <InType>* Val_array,
<InType> Offset,
<InType> Interval
)
Service ID [hex] 0x04A to 0x04D
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) Xin Input value
N Number of samples
Val_array Pointer to the result axis distribution array
Offset Offset of the first sampling value for X-axis
Interval represents X-axis distribution point fix interval
Parameters (inout) None
Parameters (out) None
Return value <OutType> Result of the Interpolation
Description This routine calculates interpolation of a curve at position Xin using below equations.
Available via Ifx.h

c()
[SWS_Ifx_00081] dX axis distribution points shall be calculated based on Offset and
Interval values.
X_array [index] = offset + index * Interval
If Offset = 5, Interval = 12 and N = 5 then,
X_array[5] = {5, 17, 29, 41, 53}c()
[SWS_Ifx_00082] dIf (X_array[0] < Xin < X_array[N -1]), then
index = lowest index for which (Xin < X_array[index + 1]).
RatioX = (Xin - X_array[index]) / (X_array [index+1] - X_array [index])
Result = Val_array[index] + (Val_array[index+1] - Val_array[index]) * RatioXc()
[SWS_Ifx_00083] dInput value matches with one of the distribution array value then
result shall be respective Y array element indicated by index.
If (Xin == X_array[index])
Result = Val_array[index]c()

39 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

[SWS_Ifx_00084] dIf (Xin < X_array[0]) then,


Result = Val_array[0]c()
[SWS_Ifx_00085] dIf (Xin > X_array[N-1]) then,
Result = Val_array[N-1]c()
[SWS_Ifx_00086] dThe minimum value of N shall be 1c()
[SWS_Ifx_00087] dHere is the list of implemented routines.c()
Routine ID[hex] Routine prototype
0x04A uint8 Ifx_IntIpoFixICur_u8_u8 ( uint8, uint8, const uint8 *,
uint8, uint8)
0x04B uint16 Ifx_IntIpoFixICur_u16_u16 (uint16, uint16, const
uint16 *, uint16, uint16)
0x04C sint8 Ifx_IntIpoFixICur_s8_s8 ( sint8, sint8, const sint8 *,
sint8, sint8)
0x04D sint16 Ifx_IntIpoFixICur_s16_s16 ( sint16, sint16, const
sint16 *, sint16, sint16)
0x0D5 sint32 Ifx_IntIpoFixICur_s32_s32 ( sint32 Xin, sint32 N,
const sint32 * Val_array, sint32 offset, sint32 Interval)
0x0D6 uint32 Ifx_IntIpoFixICur_u32_u32 ( uint32 Xin, uint32 N,
const uint32 * Val_array, uint32 offset, uint32 Interval)

8.5.2.6 Integrated fix- I curve look up

[SWS_Ifx_00090] Definition of API function Ifx_IntLkUpFixICur_<InType


Mn>_<OutTypeMnt> d
Service Name Ifx_IntLkUpFixICur_<InTypeMn>_<OutTypeMnt>
Syntax <OutType> Ifx_IntLkUpFixICur_<InTypeMn>_<OutTypeMnt> (
<InType> Xin,
<InType> N,
const <InType>* Val_array,
<InType> Offset,
<InType> Interval
)
Service ID [hex] 0x050 to 0x053
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) Xin Input value
N Number of samples
Val_array Pointer to the result axis distribution array
Offset Offset of the first sampling value for X-axis
Interval represents X-axis distribution point fix interval
Parameters (inout) None
Parameters (out) None
5

40 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

4
Return value <OutType> Entry point of the result array
Description This routine returns respective entry value of the result distribution array at position Xin based
on below equations.
Available via Ifx.h

c()
[SWS_Ifx_00091] dX axis distribution points shall be calculated based on Offset and
Interval values.
X_array [index] = offset + index * Interval
If Offset = 5, Interval = 12 and N = 5 then,
X_array[5] = {5, 17, 29, 41, 53}c()
[SWS_Ifx_00092] dIf (X_array[0] < Xin < X_array[N -1]), then
index = lowest index for which (Xin < X_array[index + 1]).
Result = Val_array[index]c()
[SWS_Ifx_00093] dInput value matches with one of the distribution array value then
result shall be respective Y array element indicated by index.
If (Xin == X_array[index])
Result = Val_array[index]c()
[SWS_Ifx_00094] dIf (Xin < X_array[0]) then,
Result = Val_array[0]c()
[SWS_Ifx_00095] dIf (Xin > X_array[N-1]) then,
Result = Val_array[N-1]c()
[SWS_Ifx_00096] dThe minimum value of N shall be 1c()
[SWS_Ifx_00097] dHere is the list of implemented routines.c()
Routine ID[hex] Routine prototype
0x050 uint8 Ifx_IntLkUpFixICur_u8_u8 ( uint8, uint8, const uint8 *,
uint8, uint8)
0x051 uint16 Ifx_IntLkUpFixICur_u16_u16 (uint16, uint16, const
uint16 *, uint16, uint16)
0x052 sint8 Ifx_IntLkUpFixICur_s8_s8 ( sint8, sint8, const sint8 *,
sint8, sint8)
0x053 sint16 Ifx_IntLkUpFixICur_s16_s16 ( sint16, sint16, const
sint16 *, sint16, sint16)
0x0D7 sint32 Ifx_IntLkUpFixICur_s32_s32 ( sint32 Xin, sint32 N,
const sint32 * Val_array, sint32 offset, sint32 Interval)
0x0D8 uint32 Ifx_IntLkUpFixICur_u32_u32 ( uint32 Xin, uint32 N,
const uint32 * Val_array, uint32 offset, uint32 Interval)

41 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

8.5.2.7 Integrated map interpolation

[SWS_Ifx_00098] Definition of API function Ifx_IntIpoMap_<InTypeMn><InType


Mn>_<OutTypeMn> d
Service Name Ifx_IntIpoMap_<InTypeMn><InTypeMn>_<OutTypeMn>
Syntax <OutType> Ifx_IntIpoMap_<InTypeMn><InTypeMn>_<OutTypeMn> (
<InType> Xin,
<InType> Yin,
<InType> Nx,
<InType> Ny,
const <InType>* X_array,
const <InType>* Y_array,
const <InType>* Val_array
)
Service ID [hex] 0x060 to 0x087
Sync/Async Synchronous
Reentrancy Reentrant

Parameters (in) Xin Input value for X axis


Yin Input value for Y axis
Nx Number of X axis samples
Ny Number of Y axis samples
X_array Pointer to the X axis distribution array
Y_array Pointer to the Y axis distribution array
Val_array Pointer to the result axis distribution array
Parameters (inout) None
Parameters (out) None
Return value <OutType> Result of the Map Interpolation
Description This routine calculates Interpolation of a map at position X and Y using below equations.
Available via Ifx.h

c()
[SWS_Ifx_00099] dIndex calculation :
indexX = minimum value of index if (X_array[indexX] < Xin < X_array[indexX+1])
indexY = minimum value of index if (Y_array[indexY] < Yin < Y_array[indexY+1])
BaseIndex = IndexX * Ny + indexYc()
[SWS_Ifx_00100] dRatio calculation :
RatioX = (Xin - X_array[indexX]) / (X_array [indexX+1] - X_array [indexX])
RatioY = (Yin - Y_array[indexY]) / (Y_array [indexY+1] - Y_array [indexY])c()
[SWS_Ifx_00101] dLowerY = Val_array [BaseIndex]
UpperY = Val_array [BaseIndex + 1]
LowerX = LowerY + (UpperY - LowerY) * RatioY
LowerY = Val_array [BaseIndex + Ny]

42 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

UpperY = Val_array [BaseIndex + Ny + 1]


UpperX = LowerY + (UpperY - LowerY) * RatioY
Result = LowerX + (UpperX - LowerX) * RatioXc()
[SWS_Ifx_00102] dIf (Xin == X_array[indexX]) and (Y_array[indexY] < Yin < Y_ar-
ray[indexY+1])
Result = Val_array [BaseIndex] + (Val_array [BaseIndex+1] - Val_array[BaseIndex]) *
RatioYc()
[SWS_Ifx_00103] dIf (Yin == Y_array[indexY]) and (X_array[indexX] < Xin < X_ar-
ray[indexX+1])
Result = Val_array [BaseIndex] + (Val_array [BaseIndex+Ny] - Val_array[BaseIndex]) *
RatioXc()
[SWS_Ifx_00104] dIf (Xin == X_array[indexX]) and (Yin == Y_array[indexY])
Result = Val_array [BaseIndex]c()
[SWS_Ifx_00105] dIf Xin < X_array[0], then
indexX = 0,
RatioX = 0c()
[SWS_Ifx_00106] dIf Xin > X_array[Nx-1], then
indexX = Nx - 1,
RatioX = 0c()
[SWS_Ifx_00107] dIf Yin < Y_array[0], then
indexY = 0,
RatioY = 0c()
[SWS_Ifx_00108] dIf Yin > Y_array[Ny-1], then
indexY = Ny - 1,
RatioY = 0c()
[SWS_Ifx_00109] dThe minimum value of Nx and Ny shall be 1c()
[SWS_Ifx_00110] dHere is the list of implemented routines.c()
Routine ID[hex] Routine prototype
0x060 uint8 Ifx_IntIpoMap_u16u8_u8 (uint16, uint8, uint16, uint16,
const uint16 *, const uint8 *, const uint8 * )
0x061 uint16 Ifx_IntIpoMap_u16u8_u16 (uint16, uint8, uint16,
uint16, const uint16 *, const uint8 *, const uint16 * )
5

43 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

4
Routine ID[hex] Routine prototype
0x062 sint8 Ifx_IntIpoMap_u16u8_s8 (uint16, uint8, uint16, uint16,
const uint16 *, const uint8 *, const sint8 * )
0x063 sint16 Ifx_IntIpoMap_u16u8_s16 (uint16, uint8, uint16,
uint16, const uint16 *, const uint8 *, const sint16 * )
0x064 uint8 Ifx_IntIpoMap_u16u16_u8 (uint16, uint16, uint16,
uint16, const uint16 *, const uint16 *, const uint8 * )
0x065 uint16 Ifx_IntIpoMap_u16u16_u16 (uint16, uint16, uint16,
uint16, const uint16 *, const uint16 *, const uint16 * )
0x066 sint8 Ifx_IntIpoMap_u16u16_s8 (uint16, uint16, uint16,
uint16, const uint16 *, const uint16 *, const sint8 * )
0x067 sint16 Ifx_IntIpoMap_u16u16_s16 (uint16, uint16, uint16,
uint16, const uint16 *, const uint16 *, const sint16 * )
0x068 uint8 Ifx_IntIpoMap_u16s8_u8 (uint16, sint8, uint16, uint16,
const uint16 *, const sint8 *, const uint8 * )
0x069 uint16 Ifx_IntIpoMap_u16s8_u16 (uint16, sint8, uint16,
uint16, const uint16 *, const sint8 *, const uint16 * )
0x06A sint8 Ifx_IntIpoMap_u16s8_s8 (uint16, sint8, uint16, uint16,
const uint16 *, const sint8 *, const sint8 * )
0x06B sint16 Ifx_IntIpoMap_u16s8_s16 (uint16, sint8, uint16,
uint16, const uint16 *, const sint8 *, const sint16 * )
0x06C uint8 Ifx_IntIpoMap_u16s16_u8 (uint16, sint16, uint16,
uint16, const uint16 *, const sint16 *, const uint8 * )
0x06D uint16 Ifx_IntIpoMap_u16s16_u16 (uint16, sint16, uint16,
uint16, const uint16 *, const sint16 *, const uint16 * )
0x06E sint8 Ifx_IntIpoMap_u16s16_s8 (uint16, sint16, uint16,
uint16, const uint16 *, const sint16 *, const sint8 * )
0x06F sint16 Ifx_IntIpoMap_u16s16_s16 (uint16, sint16, uint16,
uint16, const uint16 *, const sint16 *, const sint16 * )
0x070 uint8 Ifx_IntIpoMap_s16u8_u8 (sint16, uint8, sint16, sint16,
const sint16 *, const uint8 *, const uint8 * )
0x071 uint16 Ifx_IntIpoMap_s16u8_u16 (sint16, uint8, sint16,
sint16, const sint16 *, const uint8 *, const uint16 * )
0x072 sint8 Ifx_IntIpoMap_s16u8_s8 (sint16, uint8, sint16, sint16,
const sint16 *, const uint8 *, const sint8 * )
0x073 sint16 Ifx_IntIpoMap_s16u8_s16 (sint16, uint8, sint16,
sint16, const sint16 *, const uint8 *, const sint16 * )
0x074 uint8 Ifx_IntIpoMap_s16s8_u8 (sint16, sint8, sint16, sint16,
const sint16 *, const sint8 *, const uint8 * )
0x075 uint16 Ifx_IntIpoMap_s16s8_u16 (sint16, sint8, sint16,
sint16, const sint16 *, const sint8 *, const uint16 * )
0x076 sint8 Ifx_IntIpoMap_s16s8_s8 (sint16, sint8, sint16, sint16,
const sint16 *, const sint8 *, const sint8 * )
0x077 sint16 Ifx_IntIpoMap_s16s8_s16 (sint16, sint8, sint16,
sint16, const sint16 *, const sint8 *, const sint16 * )
0x078 uint8 Ifx_IntIpoMap_s16s16_u8 (sint16, sint16, sint16,
sint16, const sint16 *, const sint16 *, const uint8 * )
0x079 uint16 Ifx_IntIpoMap_s16s16_u16 (sint16, sint16, sint16,
sint16, const sint16 *, const sint16 *, const uint16 * )
0x07A sint8 Ifx_IntIpoMap_s16s16_s8 (sint16, sint16, sint16,
sint16, const sint16 *, const sint16 *, const sint8 * )
0x07B sint16 Ifx_IntIpoMap_s16s16_s16 (sint16, sint16, sint16,
sint16, const sint16 *, const sint16 *, const sint16 * )
5

44 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

4
Routine ID[hex] Routine prototype
0x07C uint8 Ifx_IntIpoMap_u8u8_u8 (uint8, uint8, uint8, uint8, const
uint8 *, const uint8 *, const uint8 * )
0x07D uint16 Ifx_IntIpoMap_u8u8_u16 (uint8, uint8, uint8, uint8,
const uint8 *, const uint8 *, const uint16 * )
0x07E sint8 Ifx_IntIpoMap_u8u8_s8 (uint8, uint8, uint8, uint8, const
uint8 *, const uint8 *, const sint8 * )
0x07F sint16 Ifx_IntIpoMap_u8u8_s16 (uint8, uint8, uint8, uint8,
const uint8 *, const uint8 *, const sint16 * )
0x080 uint8 Ifx_IntIpoMap_u8s8_u8 (uint8, sint8, uint8, uint8, const
uint8 *, const sint8 *, const uint8 * )
0x081 uint16 Ifx_IntIpoMap_u8s8_u16 (uint8, sint8, uint8, uint8,
const uint8 *, const sint8 *, const uint16 * )
0x082 sint8 Ifx_IntIpoMap_u8s8_s8 (uint8, sint8, uint8, uint8, const
uint8 *, const sint8 *, const sint8 * )
0x083 sint16 Ifx_IntIpoMap_u8s8_s16 (uint8, sint8, uint8, uint8,
const uint8 *, const sint8 *, const sint16 * )
0x084 uint8 Ifx_IntIpoMap_s8s8_u8 (sint8, sint8, sint8, sint8, const
sint8 *, const sint8 *, const uint8 * )
0x085 uint16 Ifx_IntIpoMap_s8s8_u16 (sint8, sint8, sint8, sint8,
const sint8 *, const sint8 *, const uint16 * )
0x086 sint8 Ifx_IntIpoMap_s8s8_s8 (sint8, sint8, sint8, sint8, const
sint8 *, const sint8 *, const sint8 * )
0x087 sint16 Ifx_IntIpoMap_s8s8_s16 (sint8, sint8, sint8, sint8,
const sint8 *, const sint8 *, const sint16 * )
0x0D9 sint32 Ifx_IntIpoMap_s32s32_s32 (sint32 Xin, sint32 Yin,
sint32 Nx, sint32 Ny, const sint32 * X_array, const sint32 *
Y_array, const sint32 * Val_array)
0x0DA uint32 Ifx_IntIpoMap_u32u32_u32 (uint32 Xin, uint32 Yin,
uint32 Nx, uint32 Ny, const uint32 * X_array, const uint32 *
Y_array, const uint32 * Val_array)

45 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

8.5.2.8 Integrated map look-up

[SWS_Ifx_00111] Definition of API function Ifx_IntLkUpMap_<InTypeMn><InType


Mn>_<OutTypeMn> d
Service Name Ifx_IntLkUpMap_<InTypeMn><InTypeMn>_<OutTypeMn>
Syntax <OutType> Ifx_IntLkUpMap_<InTypeMn><InTypeMn>_<OutTypeMn> (
<InType> Xin,
<InType> Yin,
<InType> Nx,
<InType> Ny,
const <InType>* X_array,
const <InType>* Y_array,
const <InType>* Val_array
)
Service ID [hex] 0x08A to 0x08D
Sync/Async Synchronous
Reentrancy Reentrant

Parameters (in) Xin Input value for X axis


Yin Input value for Y axis
Nx Number of X axis samples
Ny Number of Y axis samples
X_array Pointer to the X axis distribution array
Y_array Pointer to the Y axis distribution array
Val_array Pointer to the result axis distribution array
Parameters (inout) None
Parameters (out) None
Return value <OutType> Entry point of the result array
Description This routine returns respective entry value of the result distribution array at position Xin and Yin
based on below equations.
Available via Ifx.h

c()
[SWS_Ifx_00112] dIndex calculation:
indexX = minimum value of index if (X_array[indexX] < Xin < X_array[indexX+1])
indexY = minimum value of index if (Y_array[indexY] < Yin < Y_array[indexY+1])
BaseIndex = IndexX * Ny + indexYc()
[SWS_Ifx_00113] dRatio calculation:
if (indexX < (Nx - 1))
RatioX = (Xin - X_array[indexX]) / (X_array [indexX+1] - X_array [indexX])
else
RatioX = 0
if (indexY < (Ny - 1))
RatioY = (Yin - Y_array[indexY]) / (Y_array [indexY+1] - Y_array [indexY])

46 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

else
RatioY = 0c()
[SWS_Ifx_00114] dif(RatioX < 0.5 && RatioY < 0.5) then
Result = Val_array [BaseIndex]
if(RatioX ≥ 0.5 && RatioY < 0.5) then
Result = Val_array [BaseIndex + Ny]
if(RatioX < 0.5 && RatioY ≥ 0.5) then
Result = Val_array [BaseIndex + 1]
if(RatioX ≥ 0.5 && RatioY ≥ 0.5) then
Result = Val_array [BaseIndex + Ny + 1]c()
[SWS_Ifx_00116] dIf (Xin == X_array[indexX]) and (Yin == Y_array[indexY])
Result = Val_array [BaseIndex]c()
[SWS_Ifx_00117] dIf Xin < X_array[0], then
indexX = 0c()
[SWS_Ifx_00118] dIf Xin > X_array[Nx-1], then
indexX = Nx - 1c()
[SWS_Ifx_00119] dIf Yin < Y_array[0], then
indexY = 0c()
[SWS_Ifx_00120] dIf Yin > Y_array[Ny-1], then
indexY = Ny - 1c()
[SWS_Ifx_00121] dThe minimum value of Nx and Ny shall be 1c()
[SWS_Ifx_00122] dHere is the list of implemented routines.c()
Routine ID[hex] Routine prototype
0x08A uint8 Ifx_IntLkUpMap_u8u8_u8(uint8, uint8, uint8, uint8,
const uint8 *, const uint8 *, const uint8 *)
0x08B sint8 Ifx_IntLkUpMap_s8s8_s8 (sint8, sint8, sint8, sint8,
const sint8 *, const sint8 *, const sint8 *)
0x08C uint16 Ifx_IntLkUpMap_u16u16_u16 (uint16, uint16, uint16,
uint16, const uint16 *, const uint16 *, const uint16 *)
0x08D sint16 Ifx_IntLkUpMap_s16s16_s16 (sint16, sint16, sint16,
sint16, const sint16 *, const sint16 *, const sint16 *)
0x0DB sint32 Ifx_IntLkUpMap_s32s32_s32 (sint32 Xin, sint32 Yin,
sint32 Nx, sint32 Ny, const sint32 * X_array, const sint32 *
Y_array, const sint32 * Val_array)
5

47 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

4
Routine ID[hex] Routine prototype
0x0DC uint32 Ifx_IntLkUpMap_u32u32_u32 (uint32 Xin, uint32 Yin,
uint32 Nx, uint32 Ny, const uint32 * X_array, const uint32 *
Y_array, const uint32 * Val_array)

48 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

8.5.2.9 Integrated map look-up without rounding

[SWS_Ifx_00211] Definition of API function Ifx_IntLkUpBaseMap_<InTypeMn><In


TypeMn>_<OutTypeMn> d
Service Name Ifx_IntLkUpBaseMap_<InTypeMn><InTypeMn>_<OutTypeMn>
Syntax <OutType> Ifx_IntLkUpBaseMap_<InTypeMn><InTypeMn>_<OutTypeMn> (
<InType> Xin,
<InType> Yin,
<InType> Nx,
<InType> Ny,
const <InType>* X_array,
const <InType>* Y_array,
const <InType>* Val_array
)
Service ID [hex] 0x0AA to 0x0AD
Sync/Async Synchronous
Reentrancy Reentrant

Parameters (in) Xin Input value for X axis


Yin Input value for Y axis
Nx Number of X axis samples
Ny Number of Y axis samples
X_array Pointer to the X axis distribution array
Y_array Pointer to the Y axis distribution array
Val_array Pointer to the result axis distribution array
Parameters (inout) None
Parameters (out) None
Return value <OutType> Entry point of the result array
Description This routine returns respective entry value of the result distribution array at position Xin and Yin
based on below equations.
Available via Ifx.h

c()
[SWS_Ifx_00212] dIndex calculation:
indexX = minimum value of index if (X_array[indexX] < Xin < X_array[indexX+1])
indexY = minimum value of index if (Y_array[indexY] < Yin < Y_array[indexY+1])
BaseIndex = IndexX * Ny + indexYc()
[SWS_Ifx_00214] dReturn Value = Val_array [BaseIndex]c()
[SWS_Ifx_00216] dIf (Xin == X_array[indexX]) and (Yin == Y_array[indexY])
Result = Val_array [BaseIndex]c()
[SWS_Ifx_00217] dIf Xin < X_array[0], then
indexX = 0c()
[SWS_Ifx_00218] dIf Xin > X_array[Nx-1], then
indexX = Nx - 1c()

49 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

[SWS_Ifx_00219] dIf Yin < Y_array[0], then


indexY = 0c()
[SWS_Ifx_00220] dIf Yin > Y_array[Ny-1], then
indexY = Ny - 1c()
[SWS_Ifx_00221] dThe minimum value of Nx and Ny shall be 1c()
[SWS_Ifx_00222] dHere is the list of implemented routines.c()
Routine ID[hex] Routine prototype
0x0AA uint8 Ifx_IntLkUpBaseMap_u8u8_u8(uint8, uint8, uint8,
uint8, const uint8 *, const uint8 *, const uint8 *)
0x0AB sint8 Ifx_IntLkUpBaseMap_s8s8_s8 (sint8, sint8, sint8,
sint8, const sint8 *, const sint8 *, const sint8 *)
0x0AC uint16 Ifx_IntLkUpBaseMap_u16u16_u16 (uint16, uint16,
uint16, uint16, const uint16 *, const uint16 *, const uint16 *)
0x0AD sint16 Ifx_IntLkUpBaseMap_s16s16_s16 (sint16, sint16,
sint16, sint16, const sint16 *, const sint16 *, const sint16 *)
0x0DD sint32 Ifx_IntLkUpBaseMap_s32s32_s32 (sint32 Xin, sint32
Yin, sint32 Nx, sint32 Ny, const sint32 * X_array, const sint32
* Y_array, const sint32 * Val_array)
0x0DE uint32 Ifx_IntLkUpBaseMap_u32u32_u32 (uint32 Xin, uint32
Yin, uint32 Nx, uint32 Ny, const uint32 * X_array, const
uint32 * Y_array, const uint32 * Val_array)

50 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

8.5.2.10 Integrated fix- map interpolation

[SWS_Ifx_00123] Definition of API function Ifx_IntIpoFixMap_<InTypeMn><In


TypeMn>_<OutTypeMn> d
Service Name Ifx_IntIpoFixMap_<InTypeMn><InTypeMn>_<OutTypeMn>
Syntax <OutType> Ifx_IntIpoFixMap_<InTypeMn><InTypeMn>_<OutTypeMn> (
<InType> Xin,
<InType> Yin,
<InType> Nx,
<inType> Ny,
const <InType>* Val_array,
<InType> OffsetX,
<InType> ShiftX,
<InType> OffsetY,
<InType> ShiftY
)
Service ID [hex] 0x090 to 0x093
Sync/Async Synchronous
Reentrancy Reentrant
Xin Input value for X axis
Parameters (in)
Yin Input value for Y axis
Nx Number to X axis samples
Ny Number to Y axis samples
Val_array Pointer to the result axis distribution array
OffsetX Offset of the first sampling value for X-axis
ShiftX ’Shift’ is the power of 2, (2ˆShiftX) represents X-axis distribution
point interval
OffsetY Offset of the first sampling value for Y-axis
ShiftY ’Shift’ is the power of 2, (2ˆShiftY) represents Y-axis distribution
point interval
Parameters (inout) None
Parameters (out) None
Return value <OutType> Result of the Interpolation
Description This routine calculates Interpolation of a map at position X and Y using below equations.
Available via Ifx.h

c()
[SWS_Ifx_00124] dX and Y axis distribution points shall be calculated based on Offset
and Shift values.
X_array[index] = OffsetX + index * 2ShiftX
Y_array[index] = OffsetY + index * 2ShiftY
If Offset = 10, Shift = 2 and N = 5 then,
axis = {10, 14, 18, 22, 26} (applicable to X and Y axis)c()
[SWS_Ifx_00125] dIndex calculation :
indexX = minimum value of index if (X_array[indexX] < Xin < X_array[indexX+1])
indexY = minimum value of index if (Y_array[indexY] < Yin < Y_array[indexY+1])

51 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

BaseIndex = IndexX * Ny + indexYc()


[SWS_Ifx_00126] dRatio calculation :
RatioX = (Xin - X_array[indexX]) / (X_array [indexX+1] - X_array [indexX])
RatioY = (Yin - Y_array[indexY]) / (Y_array [indexY+1] - Y_array [indexY])c()
[SWS_Ifx_00127] dLowerY = Val_array [BaseIndex]
UpperY = Val_array [BaseIndex + 1]
LowerX = LowerY + (UpperY - LowerY) * RatioY
LowerY = Val_array [BaseIndex + Ny]
UpperY = Val_array [BaseIndex + Ny + 1]
UpperX = LowerY + (UpperY - LowerY) * RatioY
Result = LowerX + (UpperX - LowerX) * RatioXc()
[SWS_Ifx_00128] dIf (Xin == X_array[indexX]) and (Y_array[indexY] < Yin < Y_ar-
ray[indexY+1])
Result = Val_array [BaseIndex] + (Val_array [BaseIndex+1] - Val_array[BaseIndex]) *
RatioYc()
[SWS_Ifx_00129] dIf (Yin == Y_array[indexY]) and (X_array[indexX] < Xin < X_ar-
ray[indexX+1])
Result = Val_array [BaseIndex] + (Val_array [BaseIndex+Ny] - Val_array[BaseIndex]) *
RatioXc()
[SWS_Ifx_00130] dIf (Xin == X_array[indexX]) and (Yin == Y_array[indexY])
Result = Val_array [BaseIndex]c()
[SWS_Ifx_00131] dIf Xin < X_array[0], then
indexX = 0,
RatioX = 0c()
[SWS_Ifx_00132] dIf Xin > X_array[Nx-1], then
indexX = Nx - 1,
RatioX = 0c()
[SWS_Ifx_00133] dIf Yin < Y_array[0], then
indexY = 0,
RatioY = 0c()

52 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

[SWS_Ifx_00134] dIf Yin > Y_array[Ny-1], then


indexY = Ny - 1,
RatioY = 0c()
[SWS_Ifx_00135] dThe minimum value of Nx and Ny shall be 1c()
[SWS_Ifx_00136] dHere is the list of implemented routines.c()
Routine ID[hex] Routine prototype
0x090 uint8 Ifx_IntIpoFixMap_u8u8_u8 ( uint8, uint8, uint8, uint8,
const uint8 *, uint8, uint8, uint8, uint8)
0x091 uint16 Ifx_IntIpoFixMap_u16u16_u16 ( uint16, uint16,
uint16, uint16, const uint16 *, uint16, uint16, uint16, uint16)
0x092 sint8 Ifx_IntIpoFixMap_s8s8_s8 ( sint8, sint8, sint8, sint8,
const sint8 *, sint8, sint8, sint8, sint8)
0x093 sint16 Ifx_IntIpoFixMap_s16s16_s16 ( sint16, sint16, sint16,
sint16, const sint16 *, sint16, sint16, sint16, sint16)
0x0DF sint32 Ifx_IntIpoFixMap_s32s32_s32 (sint32 Xin, sint32 Yin,
sint32 Nx, sint32 Ny, const sint32 * Val_array, sint32 offsetX,
sint32 ShiftX, sint32 offsetY, sint32 shiftY)
0x0E0 uint32 Ifx_IntIpoFixMap_u32u32_u32 (uint32 Xin, uint32 Yin,
uint32 Nx, uint32 Ny, const uint32 * Val_array, uint32 offsetX,
uint32 ShiftX, uint32 offsetY, uint32 shiftY)

8.5.2.11 Integrated fix- map look up

[SWS_Ifx_00139] Definition of API function Ifx_IntLkUpFixMap_<InTypeMn><In


TypeMn>_<OutTypeMn> d
Service Name Ifx_IntLkUpFixMap_<InTypeMn><InTypeMn>_<OutTypeMn>
Syntax <OutType> Ifx_IntLkUpFixMap_<InTypeMn><InTypeMn>_<OutTypeMn> (
<InType> Xin,
<InType> Yin,
<InType> Nx,
<InType> Ny,
const <InType>* Val_array,
<InType> OffsetX,
<InType> ShiftX,
<InType> OffsetY,
<InType> ShiftY
)
Service ID [hex] 0x095 to 0x098
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) Xin Input value for X axis
Yin Input value for Y axis
Nx Number to X axis samples
Ny Number to Y axis samples
Val_array Pointer to the result axis distribution array
5

53 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

4
OffsetX Offset of the first sampling value for X-axis
ShiftX ’Shift’ is the power of 2, (2ˆShiftX) represents X-axis distribution
point interval
OffsetY Offset of the first sampling value for Y-axis
ShiftY ’Shift’ is the power of 2, (2ˆShiftY) represents Y-axis distribution
point interval
Parameters (inout) None
Parameters (out) None
Return value <OutType> Entry point of the result array
Description This routine returns respective entry value of the result distribution array at position Xin and Yin
based on below equations.
Available via Ifx.h

c()
[SWS_Ifx_00140] dX and Y axis distribution points shall be calculated based on Offset
and Shift values.
X_array[index] = offsetX + index * 2ShiftX
Y_array[index] = offsetY + index * 2ShiftY
If Offset = 10, shift = 2 and N = 5 then,
axis = {10, 14, 18, 22, 26} (applicable to X and Y axis)c()
[SWS_Ifx_00141] dIndex calculation:
indexX = minimum value of index if (X_array[indexX] < Xin < X_array[indexX+1])
indexY = minimum value of index if (Y_array[indexY] < Yin < Y_array[indexY+1])
BaseIndex = IndexX * Ny + indexYc()
[SWS_Ifx_00143] dRatio calculation:
if (indexX < (Nx - 1))
RatioX = (Xin - X_array[indexX]) / (X_array [indexX+1] - X_array [indexX])
else
RatioX = 0
if (indexY < (Ny - 1))
RatioY = (Yin - Y_array[indexY]) / (Y_array [indexY+1] - Y_array [indexY])
else
RatioY = 0c()
[SWS_Ifx_00144] dif(RatioX < 0.5 && RatioY < 0.5) then
Result = Val_array [BaseIndex]

54 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

if(RatioX ≥ 0.5 && RatioY < 0.5) then


Result = Val_array [BaseIndex + Ny]
if(RatioX < 0.5 && RatioY ≥ 0.5) then
Result = Val_array [BaseIndex + 1]
if(RatioX ≥ 0.5 && RatioY ≥ 0.5) then
Result = Val_array [BaseIndex + Ny + 1]c()
[SWS_Ifx_00145] dIf (Xin == X_array[indexX]) and (Yin == Y_array[indexY])
Result = Val_array [BaseIndex]c()
[SWS_Ifx_00146] dIf Xin < X_array[0], then
indexX = 0c()
[SWS_Ifx_00147] dIf Xin > X_array[Nx-1], then
indexX = Nx - 1c()
[SWS_Ifx_00148] dIf Yin < Y_array[0], then
indexY = 0c()
[SWS_Ifx_00149] dIf Yin > Y_array[Ny-1], then
indexY = Ny - 1c()
[SWS_Ifx_00150] dThe minimum value of Nx and Ny shall be 1c()
[SWS_Ifx_00151] dHere is the list of implemented routines.c()
Routine ID[hex] Routine prototype
0x095 uint8 Ifx_IntLkUpFixMap_u8u8_u8 ( uint8, uint8, uint8, uint8,
const uint8 *, uint8, uint8, uint8, uint8)
0x096 uint16 Ifx_IntLkUpFixMap_u16u16_u16 ( uint16, uint16,
uint16, uint16, const uint16 *, uint16, uint16, uint16, uint16)
0x097 sint8 Ifx_IntLkUpFixMap_s8s8_s8 ( sint8, sint8, sint8, sint8,
const sint8 *, sint8, sint8, sint8, sint8)
0x098 sint16 Ifx_IntLkUpFixMap_s16s16_s16 ( sint16, sint16,
sint16, sint16, const sint16 *, sint16, sint16, sint16, sint16)
0x0E1 sint32 Ifx_IntLkUpFixMap_s32s32_s32 (sint32 Xin, sint32
Yin, sint32 Nx, sint32 Ny, const sint32 * Val_array, sint32
offsetX, sint32 ShiftX, sint32 offsetY, sint32 shiftY)
0x0E2 uint32 Ifx_IntLkUpFixMap_u32u32_u32 (uint32 Xin, uint32
Yin, uint32 Nx, uint32 Ny, const uint32 * Val_array, uint32
offsetX, uint32 ShiftX, uint32 offsetY, uint32 shiftY)

55 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

8.5.2.12 Integrated fix- map look up without rounding

[SWS_Ifx_00225] Definition of API function Ifx_IntLkUpFixBaseMap_<InType


Mn><InTypeMn>_<OutTypeMn> d
Service Name Ifx_IntLkUpFixBaseMap_<InTypeMn><InTypeMn>_<OutTypeMn>
Syntax <OutType> Ifx_IntLkUpFixBaseMap_<InTypeMn><InTypeMn>_<OutTypeMn> (
<InType> Xin,
<InType> Yin,
<InType> Nx,
<InType> Ny,
const <InType>* Val_array,
<InType> OffsetX,
<InType> ShiftX,
<InType> OffsetY,
<InType> ShiftY
)
Service ID [hex] 0x0B0 to 0x0B3
Sync/Async Synchronous
Reentrancy Reentrant
Xin Input value for X axis
Parameters (in)
Yin Input value for Y axis
Nx Number to X axis samples
Ny Number to Y axis samples
Val_array Pointer to the result axis distribution array
OffsetX Offset of the first sampling value for X-axis
ShiftX ’Shift’ is the power of 2, (2ˆShiftX) represents X-axis distribution
point interval
OffsetY Offset of the first sampling value for Y-axis
ShiftY ’Shift’ is the power of 2, (2ˆShiftY) represents Y-axis distribution
point interval
Parameters (inout) None
Parameters (out) None
Return value <OutType> Entry point of the result array
Description This routine returns respective entry value of the result distribution array at position Xin and Yin
based on below equations.
Available via Ifx.h

c()
[SWS_Ifx_00226] dX and Y axis distribution points shall be calculated based on Offset
and Shift values.
X_array[index] = offsetX + index * 2ShiftX
Y_array[index] = offsetY + index * 2ShiftY
If Offset = 10, shift = 2 and N = 5 then,
axis = {10, 14, 18, 22, 26} (applicable to X and Y axis)c()
[SWS_Ifx_00227] dIndex calculation:
indexX = minimum value of index if (X_array[indexX] < Xin < X_array[indexX+1])

56 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

indexY = minimum value of index if (Y_array[indexY] < Yin < Y_array[indexY+1])


BaseIndex = IndexX * Ny + indexYc()
[SWS_Ifx_00229] dReturn Value = Val_array [BaseIndex]c()
[SWS_Ifx_00230] dIf (Xin == X_array[indexX]) and (Yin == Y_array[indexY])
Result = Val_array [BaseIndex]c()
[SWS_Ifx_00231] dIf Xin < X_array[0], then
indexX = 0c()
[SWS_Ifx_00232] dIf Xin > X_array[Nx-1], then
indexX = Nx - 1c()
[SWS_Ifx_00233] dIf Yin < Y_array[0], then
indexY = 0c()
[SWS_Ifx_00234] dIf Yin > Y_array[Ny-1], then
indexY = Ny - 1c()
[SWS_Ifx_00235] dThe minimum value of Nx and Ny shall be 1c()
[SWS_Ifx_00236] dHere is the list of implemented routinesc()
Routine ID[hex] Routine prototype
0x0B0 uint8 Ifx_IntLkUpFixBaseMap_u8u8_u8 ( uint8, uint8, uint8,
uint8, const uint8 *, uint8, uint8, uint8, uint8)
0x0B1 uint16 Ifx_IntLkUpFixBaseMap_u16u16_u16 ( uint16, uint16,
uint16, uint16, const uint16 *, uint16, uint16, uint16, uint16)
0x0B2 sint8 Ifx_IntLkUpFixBaseMap_s8s8_s8 ( sint8, sint8, sint8,
sint8, const sint8 *, sint8, sint8, sint8, sint8)
0x0B3 sint16 Ifx_IntLkUpFixBaseMap_s16s16_s16 ( sint16, sint16,
sint16, sint16, const sint16 *, sint16, sint16, sint16, sint16)
0x0E3 sint32 Ifx_IntLkUpFixBaseMap_s32s32_s32 (sint32 Xin,
sint32 Yin, sint32 Nx, sint32 Ny, const sint32 * Val_array,
sint32 offsetX, sint32 ShiftX, sint32 offsetY, sint32 shiftY)
0x0E4 uint32 Ifx_IntLkUpFixBaseMap_u32u32_u32 (uint32 Xin,
uint32 Yin, uint32 Nx, uint32 Ny, const uint32 * Val_array,
uint32 offsetX, uint32 ShiftX, uint32 offsetY, uint32 shiftY)

57 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

8.5.2.13 Integrated fix- I map interpolation

[SWS_Ifx_00153] Definition of API function Ifx_IntIpoFixIMap_<InTypeMn><In


TypeMn>_<OutTypeMn> d
Service Name Ifx_IntIpoFixIMap_<InTypeMn><InTypeMn>_<OutTypeMn>
Syntax <OutType> Ifx_IntIpoFixIMap_<InTypeMn><InTypeMn>_<OutTypeMn> (
<InType> Xin,
<InType> Yin,
<InType> Nx,
<InType> Ny,
const <InType>* Val_array,
<InType> OffsetX,
<InType> IntervalX,
<InType> OffsetY,
<InType> IntervalY
)
Service ID [hex] 0x09A to 0x09D
Sync/Async Synchronous
Reentrancy Reentrant
Xin Input value for X axis
Parameters (in)
Yin Input value for Y axis
Nx Number to X axis samples
Ny Number to Y axis samples
Val_array Pointer to the result axis distribution array
OffsetX Offset of the first sampling value for X-axis
IntervalX represents X-axis distribution point interval
OffsetY Offset of the first sampling value for Y-axis
IntervalY represents Y-axis distribution point interval
Parameters (inout) None
Parameters (out) None
Return value <OutType> Result of the Interpolation
Description This routine calculates Interpolation of a map at position X and Y using below equations.
Available via Ifx.h

c()
[SWS_Ifx_00154] dX and Y axis distribution points shall be calculated based on Offset
and Interval values.
X_array[index] = offsetX + index * IntervalX
Y_array[index] = offsetY + index * IntervalY
If Offset = 10, Interval = 2 and N = 5 then,
axis = {10, 12, 14, 16, 18} (applicable to X and Y axis)c()
[SWS_Ifx_00155] dIndex calculation :
indexX = minimum value of index if (X_array[indexX] < Xin < X_array[indexX+1])
indexY = minimum value of index if (Y_array[indexY] < Yin < Y_array[indexY+1])
BaseIndex = IndexX * Ny + indexYc()

58 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

[SWS_Ifx_00156] dRatio Calculation :


RatioX = (Xin - X_array[indexX]) / (X_array [indexX+1] - X_array [indexX])
RatioY = (Yin - Y_array[indexY]) / (Y_array [indexY+1] - Y_array [indexY])c()
[SWS_Ifx_00157] dLowerY = Val_array [BaseIndex]
UpperY = Val_array [BaseIndex + 1]
LowerX = LowerY + (UpperY - LowerY) * RatioY
LowerY = Val_array [BaseIndex + Ny]
UpperY = Val_array [BaseIndex + Ny + 1]
UpperX = LowerY + (UpperY - LowerY) * RatioY
Result = LowerX + (UpperX - LowerX) * RatioXc()
[SWS_Ifx_00158] dIf (Xin == X_array[indexX]) and (Y_array[indexY] < Yin < Y_ar-
ray[indexY+1])
Result = Val_array [BaseIndex] + (Val_array [BaseIndex+1] - Val_array[BaseIndex]) *
RatioYc()
[SWS_Ifx_00159] dIf (Yin == Y_array[indexY]) and (X_array[indexX] < Xin < X_ar-
ray[indexX+1])
Result = Val_array [BaseIndex] + (Val_array [BaseIndex+Ny] - Val_array[BaseIndex]) *
RatioXc()
[SWS_Ifx_00160] dIf (Xin == X_array[indexX]) and (Yin == Y_array[indexY])
Result = Val_array [BaseIndex]c()
[SWS_Ifx_00161] dIf Xin < X_array[0], then
indexX = 0,
RatioX = 0c()
[SWS_Ifx_00162] dIf Xin > X_array[Nx-1], then
indexX = Nx - 1,
RatioX = 0c()
[SWS_Ifx_00163] dIf Yin < Y_array[0], then
indexY = 0,
RatioY = 0c()

59 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

[SWS_Ifx_00164] dIf Yin > Y_array[Ny-1], then


indexY = Ny - 1,
RatioY = 0c()
[SWS_Ifx_00165] dThe minimum value of Nx and Ny shall be 1c()
[SWS_Ifx_00166] dHere is the list of implemented routines.c()
Routine ID[hex] Routine prototype
0x09A uint8 Ifx_IntIpoFixIMap_u8u8_u8 ( uint8, uint8, uint8, uint8,
const uint8 *, uint8, uint8, uint8, uint8)
0x09B uint16 Ifx_IntIpoFixIMap_u16u16_u16 ( uint16, uint16,
uint16, uint16, const uint16 *, uint16, uint16, uint16, uint16)
0x09C sint8 Ifx_IntIpoFixIMap_s8s8_s8 ( sint8, sint8, sint8, sint8,
const sint8 *, sint8, sint8, sint8, sint8)
0x09D sint16 Ifx_IntIpoFixIMap_s16s16_s16 ( sint16, sint16, sint16,
sint16, const sint16 *, sint16, sint16, sint16, sint16)
0x0E5 sint32 Ifx_IntIpoFixIMap_s32s32_s32 (sint32 Xin, sint32 Yin,
sint32 Nx, sint32 Ny, const sint32 * Val_array, sint32 offsetX,
sint32 ShiftX, sint32 offsetY, sint32 shiftY)
0x0E6 uint32 Ifx_IntIpoFixIMap_u32u32_u32 (uint32 Xin, uint32
Yin, uint32 Nx, uint32 Ny, const uint32 * Val_array, uint32
offsetX, uint32 ShiftX, uint32 offsetY, uint32 shiftY)

8.5.2.14 Integrated fix- I map look up

[SWS_Ifx_00169] Definition of API function Ifx_IntLkUpFixIMap_<InTypeMn><In


TypeMn>_<OutTypeMn> d
Service Name Ifx_IntLkUpFixIMap_<InTypeMn><InTypeMn>_<OutTypeMn>
Syntax <OutType> Ifx_IntLkUpFixIMap_<InTypeMn><InTypeMn>_<OutTypeMn> (
<InType> Xin,
<InType> Yin,
<InType> Nx,
<InType> Ny,
const <InType>* Val_array,
<InType> OffsetX,
<InType> IntervalX,
<InType> OffsetY,
<InType> IntervalY
)
Service ID [hex] 0x0A0 to 0x0A3
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) Xin Input value for X axis
Yin Input value for Y axis
Nx Number to X axis samples
Ny Number to Y axis samples
Val_array Pointer to the result axis distribution array
5

60 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

4
OffsetX Offset of the first sampling value for X-axis
IntervalX represents X-axis distribution point interval
OffsetY Offset of the first sampling value for Y-axis
IntervalY represents Y-axis distribution point interval
Parameters (inout) None
Parameters (out) None
Return value <OutType> Entry point of the result array
Description This routine returns respective entry value of the result distribution array at position Xin and Yin
based on below equations.
Available via Ifx.h

c()
[SWS_Ifx_00170] dX and Y axis distribution points shall be calculated based on Offset
and Interval values.
X_array[index] = offsetX + index * IntervalX
Y_array[index] = offsetY + index * IntervalY
If Offset = 10, Interval = 2 and N = 5 then,
axis = {10, 12, 14, 16, 18} (applicable to X and Y axis)c()
[SWS_Ifx_00171] dIndex calculation:
indexX = minimum value of index if (X_array[indexX] < Xin < X_array[indexX+1])
indexY = minimum value of index if (Y_array[indexY] < Yin < Y_array[indexY+1])
BaseIndex = IndexX * Ny + indexYc()
[SWS_Ifx_00173] dRatio calculation:
if (indexX < (Nx - 1))
RatioX = (Xin - X_array[indexX]) / (X_array [indexX+1] - X_array [indexX])
else
RatioX = 0
if (indexY < (Ny - 1))
RatioY = (Yin - Y_array[indexY]) / (Y_array [indexY+1] - Y_array [indexY])
else
RatioY = 0c()
[SWS_Ifx_00174] dif(RatioX < 0.5 && RatioY < 0.5) then
Result = Val_array [BaseIndex]
if(RatioX ≥ 0.5 && RatioY < 0.5) then

61 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

Result = Val_array [BaseIndex + Ny]


if(RatioX < 0.5 && RatioY ≥ 0.5) then
Result = Val_array [BaseIndex + 1]
if(RatioX ≥ 0.5 && RatioY ≥ 0.5) then
Result = Val_array [BaseIndex + Ny + 1]c()
[SWS_Ifx_00175] dIf (Xin == X_array[indexX]) and (Yin == Y_array[indexY])
Result = Val_array [BaseIndex]c()
[SWS_Ifx_00176] dIf Xin < X_array[0], then
indexX = 0c()
[SWS_Ifx_00177] dIf Xin > X_array[Nx-1], then
indexX = Nx - 1c()
[SWS_Ifx_00178] dIf Yin < Y_array[0], then
indexY = 0c()
[SWS_Ifx_00179] dIf Yin > Y_array[Ny-1], then
indexY = Ny - 1c()
[SWS_Ifx_00180] dThe minimum value of Nx and Ny shall be 1c()
[SWS_Ifx_00181] dHere is the list of implemented routines.c()
Routine ID[hex] Routine prototype
0x0A0 uint8 Ifx_IntLkUpFixIMap_u8u8_u8 ( uint8, uint8, uint8,
uint8, const uint8 *, uint8, uint8, uint8, uint8)
0x0A1 uint16 Ifx_IntLkUpFixIMap_u16u16_u16 ( uint16, uint16,
uint16, uint16, const uint16 *, uint16, uint16, uint16, uint16)
0x0A2 sint8 Ifx_IntLkUpFixIMap_s8s8_s8 ( sint8, sint8, sint8, sint8,
const sint8 *, sint8, sint8, sint8, sint8)
0x0A3 sint16 Ifx_IntLkUpFixIMap_s16s16_s16 ( sint16, sint16,
sint16, sint16, const sint16 *, sint16, sint16, sint16, sint16)
0x0E7 sint32 Ifx_IntLkUpFixIMap_s32s32_s32 (sint32 Xin, sint32
Yin, sint32 Nx, sint32 Ny, const sint32 * Val_array, sint32
offsetX, sint32 IntervalX, sint32 offsetY, sint32 IntervalY)
0x0E8 uint32 Ifx_IntLkUpFixIMap_u32u32_u32 (uint32 Xin, uint32
Yin, uint32 Nx, uint32 Ny, const uint32 * Val_array, uint32
offsetX, uint32 IntervalX, uint32 offsetY, uint32 IntervalY)

62 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

8.5.2.15 Integrated fix- I map look up without rounding

[SWS_Ifx_00249] Definition of API function Ifx_IntLkUpFixIBaseMap_<InType


Mn><InTypeMn>_<OutTypeMn> d
Service Name Ifx_IntLkUpFixIBaseMap_<InTypeMn><InTypeMn>_<OutTypeMn>
Syntax <OutType> Ifx_IntLkUpFixIBaseMap_<InTypeMn><InTypeMn>_<OutTypeMn> (
<InType> Xin,
<InType> Yin,
<InType> Nx,
<InType> Ny,
const <InType>* Val_array,
<InType> OffsetX,
<InType> IntervalX,
<InType> OffsetY,
<InType> IntervalY
)
Service ID [hex] 0x0B4 to 0x0B7
Sync/Async Synchronous
Reentrancy Reentrant
Xin Input value for X axis
Parameters (in)
Yin Input value for Y axis
Nx Number to X axis samples
Ny Number to Y axis samples
Val_array Pointer to the result axis distribution array
OffsetX Offset of the first sampling value for X-axis
IntervalX represents X-axis distribution point interval
OffsetY Offset of the first sampling value for Y-axis
IntervalY represents Y-axis distribution point interval
Parameters (inout) None
Parameters (out) None
Return value <OutType> Entry point of the result array
Description This routine returns respective entry value of the result distribution array at position Xin and Yin
based on below equations.
Available via Ifx.h

c()
[SWS_Ifx_00237] dX and Y axis distribution points shall be calculated based on Offset
and Interval values.
X_array[index] = offsetX + index * IntervalX
Y_array[index] = offsetY + index * IntervalY
If Offset = 10, Interval = 2 and N = 5 then,
axis = {10, 12, 14, 16, 18} (applicable to X and Y axis)c()
[SWS_Ifx_00238] dIndex calculation:
indexX = minimum value of index if (X_array[indexX] < Xin < X_array[indexX+1])
indexY = minimum value of index if (Y_array[indexY] < Yin < Y_array[indexY+1])

63 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

BaseIndex = IndexX * Ny + indexYc()


[SWS_Ifx_00240] dReturn Value = Val_array [BaseIndex]c()
[SWS_Ifx_00241] dIf (Xin == X_array[indexX]) and (Yin == Y_array[indexY])
Result = Val_array [BaseIndex]c()
[SWS_Ifx_00242] dIf Xin < X_array[0], then
indexX = 0c()
[SWS_Ifx_00243] dIf Xin > X_array[Nx-1], then
indexX = Nx - 1c()
[SWS_Ifx_00244] dIf Yin < Y_array[0], then
indexY = 0c()
[SWS_Ifx_00245] dIf Yin > Y_array[Ny-1], then
indexY = Ny - 1c()
[SWS_Ifx_00246] dThe minimum value of Nx and Ny shall be 1c()
[SWS_Ifx_00247] dHere is the list of implemented routines.c()
Routine ID[hex] Routine prototype
0x0B4 uint8 Ifx_IntLkUpFixIBaseMap_u8u8_u8 ( uint8, uint8, uint8,
uint8, const uint8 *, uint8, uint8, uint8, uint8)
0x0B5 uint16 Ifx_IntLkUpFixIBaseMap_u16u16_u16 ( uint16,
uint16, uint16, uint16, const uint16 *, uint16, uint16, uint16,
uint16)
0x0B6 sint8 Ifx_IntLkUpFixIBaseMap_s8s8_s8 ( sint8, sint8, sint8,
sint8, const sint8 *, sint8, sint8, sint8, sint8)
0x0B7 sint16 Ifx_IntLkUpFixIBaseMap_s16s16_s16 ( sint16, sint16,
sint16, sint16, const sint16 *, sint16, sint16, sint16, sint16)
0x0E9 sint32 Ifx_IntLkUpFixIBaseMap_s32s32_s32 (sint32 Xin,
sint32 Yin, sint32 Nx, sint32 Ny, const sint32 * Val_array,
sint32 offsetX, sint32 IntervalX, sint32 offsetY, sint32
IntervalY)
0x0EA uint32 Ifx_IntLkUpFixIBaseMap_u32u32_u32 (uint32 Xin,
uint32 Yin, uint32 Nx, uint32 Ny, const uint32 * Val_array,
uint32 offsetX, uint32 IntervalX, uint32 offsetY, uint32
IntervalY)

64 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

8.5.2.16 Cuboid 3D interpolation

[SWS_Ifx_91002] Definition of API function Ifx_IpoCub_<OutTypeMn> d


Service Name Ifx_IpoCub_<OutTypeMn>
Syntax <OutType> Ifx_IpoCub_<OutTypeMn> (
const Ifx_DPResultU16_Type* dpResultX,
const Ifx_DPResultU16_Type* dpResultY,
const Ifx_DPResultU16_Type* dpResultZ,
uint16 num_x,
uint16 num_y,
const <InType>* Val_array
)
Service ID [hex] 0x100
Sync/Async Synchronous
Reentrancy Reentrant

Parameters (in) dpResultX Data point search result for X axis


dpResultY Data point search result for Y axis
dpResultZ Data point search result for Z axis
num_x Number of X axis points
num_y Number of Y axis points
Val_array Pointer to the result axis distribution array
Parameters (inout) None
Parameters (out) None
Return value <OutType> Result of the interpolation
Description Based on searched indices and ratios information using the relevant Ifx_DPSearch routine, this
routine calculates and returns the interpolation result for a 3D cuboid.
Available via Ifx.h

c()
[SWS_Ifx_91003] d
Based on searched indices and ratios information using the relevant Ifx_DPSearch
routine, this routine calculates and returns the interpolation result for 3D cuboids.
The axis order memory representation is [z][x][y]. This is the column-major orientation
COLUMN_DIR from the ASAM standard. The first axis z specifies the selected slice.
Implementation:
Linear interpolation along x-axis between the result of two 2D interpolations between
neighbouring X/Y Maps.
num_slice = num_x * num_y
if(dpResultZ->Ratio==0)
Result=Ifx_IpoMap_<OutTypeMn> (dpResultX, dpResultY, num_y, Val_array[num_
slice * dpResultZ->Index])
else
LowerXY=Ifx_IpoMap_<OutTypeMn> (dpResultX, dpResultY, num_y, Val_array[num_
slice * dpResultZ ->Index])

65 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

UpperXY=Ifx_IpoMap_<OutTypeMn> (dpResultX, dpResultY, num_y, Val_array[num_


slice * dpResultZ ->Index + 1])
Result=LowerXY + dpResultZ->Ratio * (UpperXY - LowerXY)
c()
[SWS_Ifx_91004] d
Do not call this routine without using the Ifx_DPSearch routine. It is ensures a valid
search result (Ifx_DPResultU16_Type) and initialization.
c()
[SWS_Ifx_91005] d
Routine ID[hex] Routine prototype
0x0F1 sint8 Ifx_IpoCub_s8 ( const Ifx_DPResultU16_Type *
dpResultX, const Ifx_DPResultU16_Type * dpResultY, const
Ifx_DPResultU16_Type * dpResultZ, uint16 num_x, uint16
num_y, const sint8 * Val_array)
0x0F2 uint8 Ifx_IpoCub_u8 ( const Ifx_DPResultU16_Type *
dpResultX, const Ifx_DPResultU16_Type * dpResultY, const
Ifx_DPResultU16_Type * dpResultZ, uint16 num_x, uint16
num_y, const uint8 * Val_array)
0x0F3 sint16 Ifx_IpoCub_s16 ( const Ifx_DPResultU16_Type *
dpResultX, const Ifx_DPResultU16_Type * dpResultY, const
Ifx_DPResultU16_Type * dpResultZ, uint16 num_x, uint16
num_y, const sint16 * Val_array)
0x0F4 uint16 Ifx_IpoCub_u16 ( const Ifx_DPResultU16_Type *
dpResult, const Ifx_DPResultU16_Type * dpResultY, const
Ifx_DPResultU16_Type * dpResultZ, uint16 num_x, uint16_
num y, const uint16 * Val_array)

c()

8.5.3 Record layouts for interpolation routines

Record layout specifies calibration data serialization in the ECU memory which de-
scribes the shape of the characteristics. Single record layout can be referred by multi-
ple instances of interpolation ParameterDataPrototype. Record layouts can be nested
particular values refer to the particular property of the object. With different properties
of record layouts it is possible to specify complex objects.

8.5.3.1 Record layouts for map values

Due to optimization, the orientation of map values in memory is different depending on


the usage of the inputs. See section 8.4.2.
1. If the "X" and "Y" inputs are not swapped then, values "Val" of maps have to be in
COLUMN_DIR order.

66 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

2. If the "X" and "Y" inputs are swapped then, values "Val" of maps have to be in ROW_
DIR order.
According to ASAM standard [ASAM MCD-2MC Version 1.5.1 and 1.6], COLUMN_DIR
and ROW_DIR are formats of storing map values (Val[]) and more information can be
found in ASAM standard.
The "Z" input of cuboids is the third dimension and selects the slice X / Y or Y / X - 2D
maps.
Example for cuboids order:
2x2x2 cuboid representation in memory shall be COLUMN_DIR according to the ASAM
standard : [1 2 3 4 5 6 7 8]
COLUMN_DIR order [z][x][y]:
Slice 1:
[1 2
3 4]
Slice 2:
[5 6
7 8]

8.5.3.2 Record layout definitions

Below table specifies record layouts supported for distributed interpolation routines.
[SWS_Ifx_00185] d
Record layout Name Element1 Element2
Distr_s8 sint8 N sint8 X[]
Distr_u8 uint8 N uint8 X[]
Distr_s16 sint16 N sint16 X[]
Distr_u16 uint16 N uint16 X[]
Cur_u8 uint8 Val[]
Cur_u16 uint16 Val[]
Cur_s8 sint8 Val[]
Cur_s16 sint16 Val[]
Map_u8 uint8 Val[]
Map_u16 uint16 Val[]
Map_s8 sint8 Val[]
Map_s16 sint16 Val[]
Cur_u32 uint32 Val[]
Cur_s32 sint32 Val[]
5

67 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

4
Map_u32 uint32 Val[]
Map_s32 sint32 Val[]
Cub_s8 sint8 Val[]
Cub_s16 sint16 Val[]
Cub_u8 uint8 Val[]
Cub_u16 uint16 Val[]

Table 8.2: Record layouts for distributed interpolation routines

c()
Below table specifies record layouts supported for integrated interpolation routines.
[SWS_Ifx_00186] d
For IntTypeMn, OutTypeMN of {s8, u8,s16, u16,s32, u32}
IntCur_<nTypeMn>_<OutTypeMn>
FixIntCur_<InTypeMn>_<OutTypeMn>
IntMap_<InTypeMn><InTypeMn>_<OutTypeMn>
FixIntMap_<InTypeMn><InTypeMn>_<OutTypeMn>
For InTypeMn, OutTypeMn of {s8, u8, s16, u16}
IntCub_<InTypeMn><InTypeMn><InTypeMn>_<OutTypeMn>
Remark:
All combinations have to be defined in IFX_RecordLayout_Blueprint, AUTOSAR_
MOD_IFX_RecordLayout_Blueprint.arxml
Note: As mentioned in in chapter 8.4, interpolation routines optimization is achieved
by swaping X and Y axis during function call for Call-back notifications for below men-
tioned record layouts.
From Map_u8u16_u8 (S. No 61) to Map_s16u16_s16 (S. No 84)c()

8.6 Examples of use of functions


None

68 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

8.7 Version API

8.7.1 Ifx_GetVersionInfo

[SWS_Ifx_00815] Definition of API function Ifx_GetVersionInfo d


Service Name Ifx_GetVersionInfo
Syntax void Ifx_GetVersionInfo (
Std_VersionInfoType* versioninfo
)
Service ID [hex] 0xff
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) None
Parameters (inout) None
Parameters (out) versioninfo Pointer to where to store the version information of this module.
Format according [BSW00321]
Return value None
Description Returns the version information of this library.
Available via Ifx.h

c(SRS_BSW_00407, SRS_BSW_00003, SRS_BSW_00318, SRS_BSW_00321) The


version information of a BSW module generally contains:
Module Id
Vendor Id
Vendor specific version numbers (SRS_BSW_00407).
[SWS_Ifx_00816] dIf source code for caller and callee of Ifx_GetVersionInfo is avail-
able, the Ifx library should realize Ifx_GetVersionInfo as a macro defined in the mod-
ule’s header file.c(SRS_BSW_00407, SRS_BSW_00411)

8.8 Callback notifications


None

8.9 Scheduled functions


The Ifx library does not have scheduled functions.

8.10 Expected Interfaces


None

69 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

8.10.1 Mandatory Interfaces

None

8.10.2 Optional Interfaces

None

8.10.3 Configurable interfaces

None

70 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

9 Sequence diagrams
Not applicable.

71 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

10 Configuration specification
In general, this chapter defines configuration parameters and their clustering into con-
tainers. In order to support the specification Chapter 10.1 describes fundamentals.
It also specifies a template (table) you shall use for the parameter specification. We
intend to leave Chapter 10.1 in the specification to guarantee comprehension.
Chapter 10.2 specifies the structure (containers) and the parameters of the module
Ifx.
Chapter 10.3 specifies published information of the module Ifx.

10.1 How to read this chapter


For details refer to the chapter 10.1 “Introduction to configuration specification” in
SWS_BSWGeneral.

10.2 Containers and configuration parameters


[SWS_Ifx_00818] dThe Ifx library shall not have any configuration options that may
affect the functional behavior of the routines. I.e. for a given set of input parameters,
the outputs shall be always the same. For example, the returned value in case of error
shall not be configurable.c(SRS_LIBS_00001)
However, a library vendor is allowed to add specific configuration options concerning
library implementation, e.g. for resources consumption optimization.

10.3 Published Information


For details refer to the chapter 10.3 “Published Information” in SWS_BSWGeneral.
[SWS_Ifx_00814] dThe standardized common published parameters as required by
SRS_BSW_00402 in the General Requirements on Basic Software Modules [REF]
shall be published within the header file of this module and need to be provided in
the BSW Module Description. The according module abbreviation can be found in the
List of Basic Software Modules [REF].c(SRS_BSW_00402, SRS_BSW_00374, SRS_-
BSW_00379)

72 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

A Not applicable requirements


[SWS_Ifx_00999] dThese requirements are not applicable to this specification.c
(SRS_BSW_00448)

73 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

B History of Specification Items


Please note that the lists in this chapter also include specification items that have been
removed from the specification in a later version. These specification items do not
appear as hyperlinks in the document.

B.1 Specification Item History of this document compared to


AUTOSAR R22-11.

B.1.1 Added Specification Items in R23-11

none

B.1.2 Changed Specification Items in R23-11

Number Heading
[SWS_Ifx_00002] Definition of datatype Ifx_DPResultU16_Type
[SWS_Ifx_00014]
[SWS_Ifx_00017]
[SWS_Ifx_00022]
[SWS_Ifx_00027]
[SWS_Ifx_00032]
[SWS_Ifx_00041]
[SWS_Ifx_00051]
[SWS_Ifx_00062]
[SWS_Ifx_00077]
[SWS_Ifx_00087]
[SWS_Ifx_00097]
[SWS_Ifx_00110]
[SWS_Ifx_00122]
[SWS_Ifx_00136]
[SWS_Ifx_00151]
[SWS_Ifx_00166]
[SWS_Ifx_00181]
[SWS_Ifx_00209]
[SWS_Ifx_00222]
[SWS_Ifx_00236]
[SWS_Ifx_00247]
[SWS_Ifx_91001] Definition of imported datatypes of module Ifx
Table B.1: Changed Specification Items in R23-11

74 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary


Specification of Fixed Point Interpolation Routines
AUTOSAR CP R23-11

B.1.3 Deleted Specification Items in R23-11

none

75 of 75 Document ID 396: AUTOSAR_CP_SWS_IFXLibrary

You might also like