OCU Driver (Ocu)
AUTOSAR Classic I/O Drivers-Modul OCU Driver (Ocu, Spezifikation: AUTOSAR_CP_SWS_OCUDriver.pdf, AUTOSAR_SWS_OCUDriver.pdf).
Funktionen — Übersicht
void Ocu_Init (const Ocu_ConfigType* ConfigPtr);Service for OCU initialization.void Ocu_DeInit (void);This function de - initializes the OCU module.Std_ReturnType Ocu_StartChannel (Ocu_ChannelType ChannelNumber);Service to start an OCU channel.void Ocu_StopChannel (Ocu_ChannelType ChannelNumber);Service to stop an OCU channel.void Ocu_SetPinState (Ocu_ChannelType ChannelNumber, Ocu_PinStateType PinState);Service to set immediately the level of the pin associated to an OCU channel.void Ocu_SetPinAction (Ocu_ChannelType ChannelNumber, Ocu_PinActionType PinAction);Service to indicate the driver what shall be done automatically by hardware (if supported) upon compare match.Ocu_ValueType Ocu_GetCounter (Ocu_ChannelType ChannelNumber);Service to read the current value of the counter.Ocu_ReturnType Ocu_SetAbsoluteThreshold (Ocu_ChannelType ChannelNumber, Ocu_ValueType ReferenceValue, Ocu_ValueType AbsoluteValue);Service to set the value of the channel threshold using an absolute input data.Ocu_ReturnType Ocu_SetRelativeThreshold (Ocu_ChannelType ChannelNumber, Ocu_ValueType RelativeValue);Service to set the value of the channel threshold relative to the current value of the counter.void Ocu_DisableNotification (Ocu_ChannelType ChannelNumber);This service is used to disable notifications from an OCU channel.void Ocu_EnableNotification (Ocu_ChannelType ChannelNumber);This service is used to enable notifications from an OCU channel.void Ocu_GetVersionInfo (Std_VersionInfoType* versioninfo);This service returns the version information of this module.void Ocu_Notification_<Channel> (void);This notification function is called when a compare match occurs on the associated channel.
Typen — Übersicht
struct Ocu_ChannelTypeNumeric identifier of an OCU channel.struct Ocu_ValueTypeType for reading the counter and writing the threshold values (in number of ticks).enum Ocu_PinStateTypeOutput state of the pin linked to an OCU channel.enum Ocu_PinActionTypeAutomatic action (by hardware) to be performed on a pin attached to an OCU channel.struct Ocu_ConfigTypeThis is the type of the data structure containing the initialization data for the OCU driver.enum Ocu_ReturnTypeReturn information after setting a new threshold value.
Anforderungen — Übersicht
SWS_Ocu_00006Ocu.SWS_Ocu_00010If a free - running counter of the OCU cell can be used by another timer module then the Ocu driver must not start nor stop...SWS_Ocu_00011The API Ocu_Init shall start all free - running counters, which are exclusively used by this driver.SWS_Ocu_00012The O CU driver shall perform Inter Module Checks to avoid integration of incompatible files.SWS_Ocu_00013All time units used within the API services of the OCU driver shall be of the unit ticks.SWS_Ocu_00015Development error values are of type uint8.SWS_Ocu_00016The following errors shall be detectable by the OCU driver depending on its build version (development / production mode).SWS_Ocu_00018The detection of development errors is configurable ( ON / OFF ) at pre - compile time.SWS_Ocu_00019of the detected errors can be found in chapter Error classification and chapter API specification.SWS_Ocu_00020[SWS_Ocu_00020] ⌈The detection of production errors cannot be switched off.SWS_Ocu_00023Each variable that shall be accessible by AUTOSAR Debugging, shall be defined as global variable.SWS_Ocu_00024All type definitions of variables which shall be debugged shall be accessible by the header file O cu.SWS_Ocu_00025The declaration of variables in the header file shall be such that it is possible to calculate the size of the variables by C...SWS_Ocu_00026Variables available for debugging shall be described in the respective OCU driver Description.SWS_Ocu_00027Module Header File Imported Type Std Std_ Types.SWS_Ocu_00034Ocu _ConfigType is a type of data structure containing the initialization data for the OCU driver.SWS_Ocu_00036T he function Ocu _Init shall initialize all inte rnals variables and the used Ocu structure of the microcontroller according...SWS_Ocu_00037t he function Ocu _Init shall only initialize the configured resources and shall not touch resources that are not configured...SWS_Ocu_00038If the hardware allows for only one usage of the register (register dedicated only to the OCU resource) , the n the OCU driver...SWS_Ocu_00039The funct ion Ocu _Init shall stop all channels.SWS_Ocu_00040The function Ocu _Init shall disable all notifications.SWS_Ocu_00043If development error detection is enabled for the OCU driver and the function Ocu_Init is called when the OCU driver and...SWS_Ocu_00044A re - initialization of the OCU driver by executing the function Ocu_Init requires a de - initial ization before by executing...SWS_Ocu_00046The function Ocu_DeInit shall deinitialize the OCU variables and registers that were initialized by Ocu_Init to a state...SWS_Ocu_00047The function Ocu_DeInit shall disable all used int errupt s and notifications.SWS_Ocu_00048The function Ocu_DeInit shall influence only the peripherals which are allocated by static configuration and/or the runtime...SWS_Ocu_00050If development error detection is enabled for the OCU driver : If the driver is not initialized, the function Ocu _DeInit...SWS_Ocu_00052The function Ocu_StartChannel shall start an OCU channel by allowing all compare match configured a ctions to be performed.SWS_Ocu_00053The function Ocu_StartChannel shall be reentrant if it is called for different channels.SWS_Ocu_00054The state of the selected channel shall be set to “RUN N I NG” If the function Ocu_StartChannel has been succe ss fully performed.SWS_Ocu_00055If the function Ocu_StartChannel is called on a channel in the state " RU N NING” , then the function shall raise the error...SWS_Ocu_00056If development error detection is enabled for the OCU driver : If the parameter Channel Number is invalid (not within the...SWS_Ocu_00057If development error detection is enabled for the OCU driver : If the driver is not initialized, the function Ocu_StartChannel...SWS_Ocu_00059The function Ocu_St op Channel shall st op an OCU channel by halting compare match configured act ions for this channel.SWS_Ocu_00060The function Ocu_StopChannel shall not stop the free - running counter associated with a channel.SWS_Ocu_00061The function Ocu_St op Channel shall be reentrant if it is called for different channels.SWS_Ocu_00062The state of the selected channel shall be set to “ STOPPED”if the function Ocu_St op Channel is successfully performed.SWS_Ocu_00063I f the function Ocu_StopChannel is called on a channel in the state "STOPPED", then the function shall leave without any...SWS_Ocu_00064If development error detection is enabled for the OCU driver : If the parameter ChannelNumber is invalid (not within the range...SWS_Ocu_00065If developm ent error detection is enabled for the OCU driver : If the driver is not initialized, the function Ocu_St op...SWS_Ocu_00067The function Ocu_SetPinState shall set the pin associated with the channel to the level indicated by “PinState”.SWS_Ocu_00068The fuction Ocu_SetPinState shall be reentrant if it is called for different channels.SWS_Ocu_00069The fu n ction Ocu_SetPinState shall be used on ly if the channel is not in the RUNNING state.SWS_Ocu_00070The function Ocu_SetPinState shall be pre compile time configurable On/Off by the configuration parameter: Ocu SetPinState Api...SWS_Ocu_00071If development error detection is enabled for the OCU driver : If the parameter ChannelNumber is invalid (not within the range...SWS_Ocu_00072If developmen t error detection is enabled for the OCU driver : If a pin is not associated with th e channel (not defined in...SWS_Ocu_00073If development error detection is enabled for the OCU driver : If the parameter PinState is invalid (not within the range...SWS_Ocu_00074If development error detection is enabled for the OCU driver : If the driver is not initialized, the function Oc u_SetPinState...SWS_Ocu_00075If development error detection is enabled for the OCU driver : If the channel is in the RUNNING state , the function...SWS_Ocu_00077The function Ocu_SetPinAction s hall set the action to be performed by hardware automatically , at the next compar e match in...SWS_Ocu_00078The fuction OCU Ocu_SetPinAction shall be reentrant if it is called for different channels.SWS_Ocu_00079The function Ocu_SetPinAction shall be pre compile time configurable by the configuration parameter: Ocu SetPinActionApi...SWS_Ocu_00080If development error detection is enabled for the OCU driver : If the parameter ChannelNumber is invalid (not within the range...SWS_Ocu_00081If development error detection is enabled for the OCU driver : If a pin is not associated with th e channel (not defined in...SWS_Ocu_00082If development error detection is enabled for the OCU driver : If the parameter Pin Action is invalid (not within the range...SWS_Ocu_00083If development error detection is enabled for the OCU driver : If the driver is not initialized, the function Ocu_SetPinAction...SWS_Ocu_00084If a pin is associated with a channel; the relevant action with this pin shall be performed upon compare match.SWS_Ocu_00086The function Ocu_GetCounter shall read and return the value of the counter of the channel indicated by ChannelNumber.SWS_Ocu_00087The function Ocu_GetCounter shall be re - entrant.SWS_Ocu_00088T he function Ocu_GetCounter shall be pre compile time configurable by the configuration parameter: OcuGetCounterApi {OCU_...SWS_Ocu_00089If development error detection is enabled for the OCU driver : If the parameter ChannelNumber is invalid (not within the range...SWS_Ocu_00090If development error detection is enabled for the OCU driver : i f the driver is not initialized, then the function...SWS_Ocu_00092The function Ocu_Set Absolute Threshold shall set the channel threshold (the compare value) to the value given by AbsoluteValue.SWS_Ocu_00093The fuction Ocu_ SetAbsoluteThreshold shall be reentrant if it is called for different channels.SWS_Ocu_00094The function Ocu_SetAbsoluteThreshold shall be pre compile time configurable On/Off by the configuration parameter:...SWS_Ocu_00095If development error detection is enabled for the OCU dr iver : If the driver is not initialized, the function...SWS_Ocu_00096If development error detection is enabled for the OCU driver : If the parameter ChannelNumber is invalid (not within the range...SWS_Ocu_00097Upon actual setting of a new threshold value, the previous threshold value (written during the last call of this API) shall no...SWS_Ocu_00098After setting a new threshold value, the API Ocu_SetAbsoluteThreshold shall return a status to inform the caller whether the...SWS_Ocu_00101The function Ocu_ Set Relative Threshold shall add RelativeValue to the value of the counter on entering the function to...SWS_Ocu_00102The fuction OCU Ocu_SetAbsoluteThreshold shall be reentrant if it is called for different channels.SWS_Ocu_00103The function Ocu_SetRelativeThreshold shall be pre compile time configurable On/Off by the configuration parameter: Ocu...SWS_Ocu_00104If development error detection is enabled for the OCU driver : If the driver is not initialized, the function Ocu _...SWS_Ocu_00105If development error detection is enabled for the OCU driver : i f the parameter ChannelNumber is invalid (not within the...SWS_Ocu_00106After setting a new threshold value, the API Ocu_SetRelativeThreshold shall return a status to inform the caller whether the...SWS_Ocu_00107Upon actual setting of a new threshold va lue (absolute or relative), the previous threshold value shall no longer produce a...SWS_Ocu_00109The function Ocu _DisableNo tification shall disable the OCU compare match notification.SWS_Ocu_00110The fuction OCU Ocu_DisableNotification shall be reentrant if it is called for different channels.SWS_Ocu_00111The function Ocu _DisableNotification shall be pre compile time configurable On/Off by the configuration parameter:...SWS_Ocu_00112If development error detection is enabled for the OCU driver : If the driver is not initialized, the function Ocu...SWS_Ocu_00113If development error detection is enabled for the OCU driver : If the parameter Channel is invalid (not within the range...SWS_Ocu_00114If development error detection is enabled for the OCU driver : If the notification function is the NULL pointer , the function...SWS_Ocu_00116The function Ocu_ EnableNotification shall en able the OCU compare match notification of the indexed channel.SWS_Ocu_00117The function Ocu_EnableNotification shall be reentrant if it is called for different channels.SWS_Ocu_00118The function Ocu_ EnableNotification shall be pre compile time configurable On/Off by the configuration parameter:...SWS_Ocu_00119If development error detection is enabled for the OCU driver : If the driver is not initialized, the function Ocu_...SWS_Ocu_00120If development error detection is enabled for the OCU driver : If the parameter Channel is invalid (not within the range...SWS_Ocu_00121If development error detection is enabled for the OCU driver : If the notification function is the NULL pointer, the function...SWS_Ocu_00123The function Ocu _GetVersionInfo shall return the version information of this module.SWS_Ocu_00124The function Ocu _GetVersionInfo shall be pre compile time configurable On/Off by the configuration parameter: Ocu...SWS_Ocu_00125If source c ode for caller and callee of Ocu _GetVersionInfo is available; the OCU driver shou ld realize Ocu _GetVersionInfo...SWS_Ocu_00126If development error detection is enabled for the OCU driver , the function Ocu_GetVersionInfo shall raise development error...SWS_Ocu_00127Det _ Report Error Det.SWS_Ocu_00129The OCU driver shall call the function Ocu _Notification _ according to the last call of Ocu _EnableNotification...SWS_Ocu_00130The OCU driver shall reset the interrupt flag (if needed by hardware) as sociated with the notification Ocu _Notification_SWS_Ocu_00131The O cu notification functions shall be configurable as function pointers within the initialization data structure ( Oc...SWS_Ocu_00132⌈ If the NULL pointer is configured for a notification call - back, then no call - back shall be executed.SWS_Ocu_00133When the notification mechanism is disabled, the OCU driver shall send no notification.SWS_Ocu_00136The API Ocu_ DeI nit shall stop all free - running counters, which are exclusively used by this driver.SWS_Ocu_00137If development error detection is enabled for the OCU driver: i f a channel is still in the RUNNING state when the function...SWS_Ocu_00170The OCU module shall reject configurations with partition mappings which are not s upported by the implementation.SWS_Ocu_91001Type of error Related error code Error value API services other than Ocu_ Get Version Info() and Ocu_ init() used without...SWS_Ocu_91002Type of error Related error code Error value API Ocu_ Start Channel() called on a channel that is in state RUNNING OCU_ E_...SWS_Ocu_CONSTR_00001The ECUC partitions referenced by OcuKernelEcucPartitionRef shall be a subset of the ECUC partitions referenced by...SWS_Ocu_CONSTR_00002The ECUC partitions referenced by OcuChannelEcucPartitionRef shall be a subset of the ECUC partitions referenced by...SWS_Ocu_CONSTR_00004If OcuEcucPartitionRef references one or more ECUC partitions, OcuKernelEcucPartitionRef shall have a multiplicity of one and...SWS_Ocu_CONSTR_00005If OcuEcucPartitionRef references one or more ECUC partitions, OcuKernelEcucPartitionRef shall have a multiplicity of one and...
Funktionen & Typen — Detailansicht
फ़ंक्शन Ocu_Init [SWS_Ocu_00035] 📄 PDF
void Ocu_Init(const Ocu_ConfigType* ConfigPtr);
Service for OCU initialization.
फ़ंक्शन Ocu_DeInit [SWS_Ocu_00045] 📄 PDF
void Ocu_DeInit(void);
This function de - initializes the OCU module.
फ़ंक्शन Ocu_StartChannel [SWS_Ocu_00051] 📄 PDF
Std_ReturnType Ocu_StartChannel(Ocu_ChannelType ChannelNumber);
Service to start an OCU channel.
फ़ंक्शन Ocu_StopChannel [SWS_Ocu_00058] 📄 PDF
void Ocu_StopChannel(Ocu_ChannelType ChannelNumber);
Service to stop an OCU channel.
फ़ंक्शन Ocu_SetPinState [SWS_Ocu_00066] 📄 PDF
void Ocu_SetPinState(Ocu_ChannelType ChannelNumber, Ocu_PinStateType PinState);
Service to set immediately the level of the pin associated to an OCU channel.
फ़ंक्शन Ocu_SetPinAction [SWS_Ocu_00076] 📄 PDF
void Ocu_SetPinAction(Ocu_ChannelType ChannelNumber, Ocu_PinActionType PinAction);
Service to indicate the driver what shall be done automatically by hardware (if supported) upon compare match.
फ़ंक्शन Ocu_GetCounter [SWS_Ocu_00085] 📄 PDF
Ocu_ValueType Ocu_GetCounter(Ocu_ChannelType ChannelNumber);
Service to read the current value of the counter.
फ़ंक्शन Ocu_SetAbsoluteThreshold [SWS_Ocu_00091] 📄 PDF
Ocu_ReturnType Ocu_SetAbsoluteThreshold(Ocu_ChannelType ChannelNumber, Ocu_ValueType ReferenceValue, Ocu_ValueType AbsoluteValue);
Service to set the value of the channel threshold using an absolute input data.
फ़ंक्शन Ocu_SetRelativeThreshold [SWS_Ocu_00100] 📄 PDF
Ocu_ReturnType Ocu_SetRelativeThreshold(Ocu_ChannelType ChannelNumber, Ocu_ValueType RelativeValue);
Service to set the value of the channel threshold relative to the current value of the counter.
फ़ंक्शन Ocu_DisableNotification [SWS_Ocu_00108] 📄 PDF
void Ocu_DisableNotification(Ocu_ChannelType ChannelNumber);
This service is used to disable notifications from an OCU channel.
फ़ंक्शन Ocu_EnableNotification [SWS_Ocu_00115] 📄 PDF
void Ocu_EnableNotification(Ocu_ChannelType ChannelNumber);
This service is used to enable notifications from an OCU channel.
फ़ंक्शन Ocu_GetVersionInfo [SWS_Ocu_00122] 📄 PDF
void Ocu_GetVersionInfo(Std_VersionInfoType* versioninfo);
This service returns the version information of this module.
फ़ंक्शन Ocu_Notification_<Channel> [SWS_Ocu_00128] 📄 PDF
void Ocu_Notification_<Channel>(void);
This notification function is called when a compare match occurs on the associated channel.
टाइप Ocu_ChannelType [SWS_Ocu_00028] 📄 PDF
Numeric identifier of an OCU channel.
टाइप Ocu_ValueType [SWS_Ocu_00029] 📄 PDF
Type for reading the counter and writing the threshold values (in number of ticks).
टाइप Ocu_PinStateType [SWS_Ocu_00031] 📄 PDF
Output state of the pin linked to an OCU channel.
टाइप Ocu_PinActionType [SWS_Ocu_00032] 📄 PDF
Automatic action (by hardware) to be performed on a pin attached to an OCU channel. A vailable via Ocu.h
टाइप Ocu_ConfigType [SWS_Ocu_00033] 📄 PDF
This is the type of the data structure containing the initialization data for the OCU driver.
टाइप Ocu_ReturnType [SWS_Ocu_00138] 📄 PDF
Return information after setting a new threshold value.
requirement SWS_Ocu_00006 [SWS_Ocu_00006] 📄 PDF
Ocu .c shall include Ocu .h and Det.h .
requirement SWS_Ocu_00010 [SWS_Ocu_00010] 📄 PDF
If a free - running counter of the OCU cell can be used by another timer module then the Ocu driver must not start nor stop the free - running counter.
requirement SWS_Ocu_00011 [SWS_Ocu_00011] 📄 PDF
The API Ocu_Init shall start all free - running counters, which are exclusively used by this driver .
requirement SWS_Ocu_00012 [SWS_Ocu_00012] 📄 PDF
The O CU driver shall perform Inter Module Checks to avoid integration of incompatible files.The imported included files shall be checked by preprocessing directives. The following version numbers shall be verified: - <MODULENAME>_AR_RELEASE_MAJOR_VERSION - < MODULENAME>_AR_RELEASE_MINOR_VERSION Where <MODULENAME> is the module short name of the other (external) modules, which provide header files included by the OCU driver . If the values are not identical to the expected values, an error shall be reported.
requirement SWS_Ocu_00013 [SWS_Ocu_00013] 📄 PDF
All time units used within the API services of the OCU driver shall be of the unit ticks.
requirement SWS_Ocu_00015 [SWS_Ocu_00015] 📄 PDF
Development error values are of type uint8 .
requirement SWS_Ocu_00016 [SWS_Ocu_00016] 📄 PDF
The following errors shall be detectable by the OCU driver depending on its build version (development / production mode).
requirement SWS_Ocu_00018 [SWS_Ocu_00018] 📄 PDF
The detection of development errors is configurable ( ON / OFF ) at pre - compile time. The switch OcuDevErrorDetectApi shall activate or deactivate the detection of all development errors.
requirement SWS_Ocu_00019 [SWS_Ocu_00019] 📄 PDF
of the detected errors can be found in chapter Error classification and chapter API specification .
requirement SWS_Ocu_00020 [SWS_Ocu_00020] 📄 PDF
[SWS_Ocu_00020] ⌈The detection of production errors cannot be switched off.⌋ (SRS_BSW_00339)
requirement SWS_Ocu_00023 [SWS_Ocu_00023] 📄 PDF
Each variable that shall be accessible by AUTOSAR Debugging, shall be defined as global variable.
requirement SWS_Ocu_00024 [SWS_Ocu_00024] 📄 PDF
All type definitions of variables which shall be debugged shall be accessible by the header file O cu .h.
requirement SWS_Ocu_00025 [SWS_Ocu_00025] 📄 PDF
The declaration of variables in the header file shall be such that it is possible to calculate the size of the variables by C - "sizeof".
requirement SWS_Ocu_00026 [SWS_Ocu_00026] 📄 PDF
Variables available for debugging shall be described in the respective OCU driver Description.
requirement SWS_Ocu_00027 [SWS_Ocu_00027] 📄 PDF
Module Header File Imported Type Std Std_ Types.h Std _ Return Type Std_ Types.h Std _ Version Info Type
requirement SWS_Ocu_00034 [SWS_Ocu_00034] 📄 PDF
Ocu _ConfigType is a type of data structure containing the initialization data for the OCU driver. Mandatory parameters: Symbolic name for channel / channel ID maximum value of the counter Time resolution in number of ticks Notification function Default value of the threshold Minimu m v alue of the counter Optional parameters (if supported by hardware): count direction Ouput pin ( level s, and possible automatic actions). Hardware triggered events (ADC or DMA) . Microcontroller OCU - specific HW properties (optional prescaler , clock s ettings if supported by hardware) .
requirement SWS_Ocu_00036 [SWS_Ocu_00036] 📄 PDF
T he function Ocu _Init shall initialize all inte rnals variables and the used Ocu structure of the microcontroller according to a configuration set referenced by ConfigPtr .
requirement SWS_Ocu_00037 [SWS_Ocu_00037] 📄 PDF
t he function Ocu _Init shall only initialize the configured resources and shall not touch resources that are not configured in the configuration file.
requirement SWS_Ocu_00038 [SWS_Ocu_00038] 📄 PDF
If the hardware allows for only one usage of the register (register dedicated only to the OCU resource) , the n the OCU driver i s responsible for initializing the register.
requirement SWS_Ocu_00039 [SWS_Ocu_00039] 📄 PDF
The funct ion Ocu _Init shall stop all channels .
requirement SWS_Ocu_00040 [SWS_Ocu_00040] 📄 PDF
The function Ocu _Init shall disable all notifications.
requirement SWS_Ocu_00043 [SWS_Ocu_00043] 📄 PDF
If development error detection is enabled for the OCU driver and the function Ocu_Init is called when the OCU driver and hardware are already initialized, the function Ocu_Init shall raise development error OCU_E_ALREADY_INITIALIZED and return without any action .
requirement SWS_Ocu_00044 [SWS_Ocu_00044] 📄 PDF
A re - initialization of the OCU driver by executing the function Ocu_Init requires a de - initial ization before by executing the function Ocu_DeInit .
requirement SWS_Ocu_00046 [SWS_Ocu_00046] 📄 PDF
The function Ocu_DeInit shall deinitialize the OCU variables and registers that were initialized by Ocu_Init to a state comparable to their power on reset state. Values of registers which are not writeable are excluded.
requirement SWS_Ocu_00047 [SWS_Ocu_00047] 📄 PDF
The function Ocu_DeInit shall disable all used int errupt s and notifications .
requirement SWS_Ocu_00048 [SWS_Ocu_00048] 📄 PDF
The function Ocu_DeInit shall influence only the peripherals which are allocated by static configuration and/or the runtime configuration set passed by the previous ca ll of Ocu_Init() .
requirement SWS_Ocu_00050 [SWS_Ocu_00050] 📄 PDF
If development error detection is enabled for the OCU driver : If the driver is not initialized, the function Ocu _DeInit shall raise the error OCU _E_UNINIT .
requirement SWS_Ocu_00052 [SWS_Ocu_00052] 📄 PDF
The function Ocu_StartChannel shall start an OCU channel by allowing all compare match configured a ctions to be performed.
requirement SWS_Ocu_00053 [SWS_Ocu_00053] 📄 PDF
The function Ocu_StartChannel shall be reentrant if it is called for different channels.
requirement SWS_Ocu_00054 [SWS_Ocu_00054] 📄 PDF
The state of the selected channel shall be set to “RUN N I NG” If the function Ocu_StartChannel has been succe ss fully performed .
requirement SWS_Ocu_00055 [SWS_Ocu_00055] 📄 PDF
If the function Ocu_StartChannel is called on a channel in the state " RU N NING” , then the function shall raise the error OCU _E_BUSY and return without any action.
requirement SWS_Ocu_00056 [SWS_Ocu_00056] 📄 PDF
If development error detection is enabled for the OCU driver : If the parameter Channel Number is invalid (not within the range specified by the configuration), the function Ocu_StartChannel shall raise the error OCU _ E_PARAM_INVALID_CHANNEL and return without any action.
requirement SWS_Ocu_00057 [SWS_Ocu_00057] 📄 PDF
If development error detection is enabled for the OCU driver : If the driver is not initialized, the function Ocu_StartChannel shall raise the error OCU_ E_UNINIT and return without any action.
requirement SWS_Ocu_00059 [SWS_Ocu_00059] 📄 PDF
The function Ocu_St op Channel shall st op an OCU channel by halting compare match configured act ions for this channel.
requirement SWS_Ocu_00060 [SWS_Ocu_00060] 📄 PDF
The function Ocu_StopChannel shall not stop the free - running counter associated with a channel .
requirement SWS_Ocu_00061 [SWS_Ocu_00061] 📄 PDF
The function Ocu_St op Channel shall be reentrant if it is called for different channels.
requirement SWS_Ocu_00062 [SWS_Ocu_00062] 📄 PDF
The state of the selected channel shall be set to “ STOPPED”if the function Ocu_St op Channel is successfully performed .
requirement SWS_Ocu_00063 [SWS_Ocu_00063] 📄 PDF
I f the function Ocu_StopChannel is called on a channel in the state "STOPPED", then the function shall leave without any action (no change of the channel state), and shall not raise a development error.
requirement SWS_Ocu_00064 [SWS_Ocu_00064] 📄 PDF
If development error detection is enabled for the OCU driver : If the parameter ChannelNumber is invalid (not within the range specified by the configuration), the function Ocu_St op Channel shall raise the error OCU_ E_PARAM_INVALID_CHANNEL and return without any action.
requirement SWS_Ocu_00065 [SWS_Ocu_00065] 📄 PDF
If developm ent error detection is enabled for the OCU driver : If the driver is not initialized, the function Ocu_St op Channel shall raise the error OCU_ E_UNINIT and return without any action.
requirement SWS_Ocu_00067 [SWS_Ocu_00067] 📄 PDF
The function Ocu_SetPinState shall set the pin associated with the channel to the level indicated by “PinState” .
requirement SWS_Ocu_00068 [SWS_Ocu_00068] 📄 PDF
The fuction Ocu_SetPinState shall be reentrant if it is called for different channels.
requirement SWS_Ocu_00069 [SWS_Ocu_00069] 📄 PDF
The fu n ction Ocu_SetPinState shall be used on ly if the channel is not in the RUNNING state.
requirement SWS_Ocu_00070 [SWS_Ocu_00070] 📄 PDF
The function Ocu_SetPinState shall be pre compile time configurable On/Off by the configuration parameter: Ocu SetPinState Api {OCU_SET_PIN_STATE_API}.
requirement SWS_Ocu_00071 [SWS_Ocu_00071] 📄 PDF
If development error detection is enabled for the OCU driver : If the parameter ChannelNumber is invalid (not within the range specified by the configuration), the function Ocu_SetPinState shall raise the error OCU_ E_PARAM_INVALID_CHANNEL and return without any action.
requirement SWS_Ocu_00072 [SWS_Ocu_00072] 📄 PDF
If developmen t error detection is enabled for the OCU driver : If a pin is not associated with th e channel (not defined in the configuration of the channel ), the function Ocu_SetPinState shall raise the error OCU_E_PARAM_ NO _ PIN and return without any action.
requirement SWS_Ocu_00073 [SWS_Ocu_00073] 📄 PDF
If development error detection is enabled for the OCU driver : If the parameter PinState is invalid (not within the range specified by the configuration), the function Ocu_SetPinState shall raise the error OCU_E_PARAM_INVALID_ STATE and return without any action.
requirement SWS_Ocu_00074 [SWS_Ocu_00074] 📄 PDF
If development error detection is enabled for the OCU driver : If the driver is not initialized, the function Oc u_SetPinState shall raise the error OCU_ E_UNINIT and return without any action.
requirement SWS_Ocu_00075 [SWS_Ocu_00075] 📄 PDF
If development error detection is enabled for the OCU driver : If the channel is in the RUNNING state , the function Ocu_SetPinState shall raise the error OCU_E_PARAM_INVALID_STATE and return without any action.
requirement SWS_Ocu_00077 [SWS_Ocu_00077] 📄 PDF
The function Ocu_SetPinAction s hall set the action to be performed by hardware automatically , at the next compar e match in the corresponding OCU channel .
requirement SWS_Ocu_00078 [SWS_Ocu_00078] 📄 PDF
The fuction OCU Ocu_SetPinAction shall be reentrant if it is called for different channels.
requirement SWS_Ocu_00079 [SWS_Ocu_00079] 📄 PDF
The function Ocu_SetPinAction shall be pre compile time configurable by the configuration parameter: Ocu SetPinActionApi {OCU_SET_PIN_ACTION_API}.
requirement SWS_Ocu_00080 [SWS_Ocu_00080] 📄 PDF
If development error detection is enabled for the OCU driver : If the parameter ChannelNumber is invalid (not within the range specified by the configuration), the function Ocu_SetPinAction shall raise the error OCU_E_PARAM_INVALID_CHANNEL and return without any action.
requirement SWS_Ocu_00081 [SWS_Ocu_00081] 📄 PDF
If development error detection is enabled for the OCU driver : If a pin is not associated with th e channel (not defined in the configuration of the channel), the function Ocu_SetPin Action shall r aise the error OCU_E_PARAM_ NO _PIN and return without any action.
requirement SWS_Ocu_00082 [SWS_Ocu_00082] 📄 PDF
If development error detection is enabled for the OCU driver : If the parameter Pin Action is invalid (not within the range specified by the type ), the function Ocu_SetPin Action shall raise the error OCU_E_PARAM_INVALID_ ACTION and return without any action.
requirement SWS_Ocu_00083 [SWS_Ocu_00083] 📄 PDF
If development error detection is enabled for the OCU driver : If the driver is not initialized, the function Ocu_SetPinAction shall raise the error OCU_ E_UNINIT and return without any action.
requirement SWS_Ocu_00084 [SWS_Ocu_00084] 📄 PDF
If a pin is associated with a channel; the relevant action with this pin shall be performed upon compare match.
requirement SWS_Ocu_00086 [SWS_Ocu_00086] 📄 PDF
The function Ocu_GetCounter shall read and return the value of the counter of the channel indicated by ChannelNumber.
requirement SWS_Ocu_00087 [SWS_Ocu_00087] 📄 PDF
The function Ocu_GetCounter shall be re - entrant .
requirement SWS_Ocu_00088 [SWS_Ocu_00088] 📄 PDF
T he function Ocu_GetCounter shall be pre compile time configurable by the configuration parameter: OcuGetCounterApi {OCU_ GET_COUNTER_API }.
requirement SWS_Ocu_00089 [SWS_Ocu_00089] 📄 PDF
If development error detection is enabled for the OCU driver : If the parameter ChannelNumber is invalid (not within the range specified by the configuration), the function Ocu_GetCounter shall raise the error OCU_E_PARAM_INVALID_CHANNEL and shall return the value “ 0 ”.
requirement SWS_Ocu_00090 [SWS_Ocu_00090] 📄 PDF
If development error detection is enabled for the OCU driver : i f the driver is not initialized, then the function Ocu_GetCounterValue shall raise the error OCU_E_UNINIT and shall return the value “ 0 ”.
requirement SWS_Ocu_00092 [SWS_Ocu_00092] 📄 PDF
The function Ocu_Set Absolute Threshold shall set the channel threshold (the compare value) to the value given by AbsoluteValue .
requirement SWS_Ocu_00093 [SWS_Ocu_00093] 📄 PDF
The fuction Ocu_ SetAbsoluteThreshold shall be reentrant if it is called for different channels .
requirement SWS_Ocu_00094 [SWS_Ocu_00094] 📄 PDF
The function Ocu_SetAbsoluteThreshold shall be pre compile time configurable On/Off by the configuration parameter: OcuSetAbsoluteThresholdApi {OCU_ SET _ ABSOLUTE_THRESHOLD_API }.
requirement SWS_Ocu_00095 [SWS_Ocu_00095] 📄 PDF
If development error detection is enabled for the OCU dr iver : If the driver is not initialized, the function Ocu_SetAbsoluteThreshold shall raise the error OCU_E_UNINIT and return without any action.
requirement SWS_Ocu_00096 [SWS_Ocu_00096] 📄 PDF
If development error detection is enabled for the OCU driver : If the parameter ChannelNumber is invalid (not within the range specified by the configuration), the function Ocu _ SetAbsoluteThreshold shall raise the error OCU_E_PARAM_INVALID_CHANNEL and return without any action.
requirement SWS_Ocu_00097 [SWS_Ocu_00097] 📄 PDF
Upon actual setting of a new threshold value, the previous threshold value (written during the last call of this API) shall no longer produce a compare match.
requirement SWS_Ocu_00098 [SWS_Ocu_00098] 📄 PDF
After setting a new threshold value, the API Ocu_SetAbsoluteThreshold shall return a status to inform the caller whether the compare match will occur (or has already occured) during the current Reference Interval , as a result of setting the new threshold value.
requirement SWS_Ocu_00101 [SWS_Ocu_00101] 📄 PDF
The function Ocu_ Set Relative Threshold shall add RelativeValue to the value of the counter on entering the function to compute the new threshold relative to the counter .
requirement SWS_Ocu_00102 [SWS_Ocu_00102] 📄 PDF
The fuction OCU Ocu_SetAbsoluteThreshold shall be reentrant if it is called for different channels .
requirement SWS_Ocu_00103 [SWS_Ocu_00103] 📄 PDF
The function Ocu_SetRelativeThreshold shall be pre compile time configurable On/Off by the configuration parameter: Ocu SetRelative Threshold Api { OCU_SET_ RELATIVE_ THRESHOLD_API } .
requirement SWS_Ocu_00104 [SWS_Ocu_00104] 📄 PDF
If development error detection is enabled for the OCU driver : If the driver is not initialized, the function Ocu _ SetRelativeThreshold shall raise the error OCU_E_UNINIT and return without any action.
requirement SWS_Ocu_00105 [SWS_Ocu_00105] 📄 PDF
If development error detection is enabled for the OCU driver : i f the parameter ChannelNumber is invalid (not within the range specified by the configuration), the function Ocu_SetRelativeThreshold shall raise the error OCU_E_PARAM_INVALID_CHANNEL and return without any a ction.
requirement SWS_Ocu_00106 [SWS_Ocu_00106] 📄 PDF
After setting a new threshold value, the API Ocu_SetRelativeThreshold shall return a status to inform the caller whether the compare match will occur (or has already occured) during the current Reference Interval , as a result of setting the new threshold value.
requirement SWS_Ocu_00107 [SWS_Ocu_00107] 📄 PDF
Upon actual setting of a new threshold va lue (absolute or relative), the previous threshold value shall no longer produce a compare match.
requirement SWS_Ocu_00109 [SWS_Ocu_00109] 📄 PDF
The function Ocu _DisableNo tification shall disable the OCU compare match notification .
requirement SWS_Ocu_00110 [SWS_Ocu_00110] 📄 PDF
The fuction OCU Ocu_DisableNotification shall be reentrant if it is called for different channels .
requirement SWS_Ocu_00111 [SWS_Ocu_00111] 📄 PDF
The function Ocu _DisableNotification shall be pre compile time configurable On/Off by the configuration parameter: OcuNotificationSupported {OCU _NOTIFICATION_SUPPORTED}.
requirement SWS_Ocu_00112 [SWS_Ocu_00112] 📄 PDF
If development error detection is enabled for the OCU driver : If the driver is not initialized, the function Ocu _DisableNotification shall raise the error OCU _E_UNINIT and re t urn without any action.
requirement SWS_Ocu_00113 [SWS_Ocu_00113] 📄 PDF
If development error detection is enabled for the OCU driver : If the parameter Channel is invalid (not within the range specified by configuration), the function Ocu _DisableNotification shall raise the error OCU_E_PARAM_INVALID _CHANNEL and return without any action .
requirement SWS_Ocu_00114 [SWS_Ocu_00114] 📄 PDF
If development error detection is enabled for the OCU driver : If the notification function is the NULL pointer , the function Ocu _DisableNotification shall raise the error OCU_ E_ NO_VALID_NOTIF and re t urn without any action .
requirement SWS_Ocu_00116 [SWS_Ocu_00116] 📄 PDF
The function Ocu_ EnableNotification shall en able the OCU compare match notification of the indexed channel.
requirement SWS_Ocu_00117 [SWS_Ocu_00117] 📄 PDF
The function Ocu_EnableNotification shall be reentrant if it is called for different channels.
requirement SWS_Ocu_00118 [SWS_Ocu_00118] 📄 PDF
The function Ocu_ EnableNotification shall be pre compile time configurable On/Off by the configuration parameter: OcuNotificationSupported {OCU_NOTIFICATION_SUPPORTED} .
requirement SWS_Ocu_00119 [SWS_Ocu_00119] 📄 PDF
If development error detection is enabled for the OCU driver : If the driver is not initialized, the function Ocu_ EnableNotification shall raise the error OCU_E_UNINIT and re t urn without any action.
requirement SWS_Ocu_00120 [SWS_Ocu_00120] 📄 PDF
If development error detection is enabled for the OCU driver : If the parameter Channel is invalid (not within the range specified by configuration), then the function Ocu_ EnableNotification shall raise the error OCU_E_PARAM_INVALID _CHANNEL and return without any action .
requirement SWS_Ocu_00121 [SWS_Ocu_00121] 📄 PDF
If development error detection is enabled for the OCU driver : If the notification function is the NULL pointer, the function Ocu_ EnableNotification shall raise the error OCU_E_NO_VALID_NOTIF and return without any action .
requirement SWS_Ocu_00123 [SWS_Ocu_00123] 📄 PDF
The function Ocu _GetVersionInfo shall return the version information of this module. The version information includes: - Module Id - Vendor Id - Vendor specific version numbers .
requirement SWS_Ocu_00124 [SWS_Ocu_00124] 📄 PDF
The function Ocu _GetVersionInfo shall be pre compile time configurable On/Off by the configuration parameter: Ocu VersionInfoApi { OCU _VERSION_INFO_API}.
requirement SWS_Ocu_00125 [SWS_Ocu_00125] 📄 PDF
If source c ode for caller and callee of Ocu _GetVersionInfo is available; the OCU driver shou ld realize Ocu _GetVersionInfo as a macro, defined in the module’s header file .
requirement SWS_Ocu_00126 [SWS_Ocu_00126] 📄 PDF
If development error detection is enabled for the OCU driver , the function Ocu_GetVersionInfo shall raise development error OCU_E_PARAM_POINTER if parameter versioninfo is a null pointer, and return without any action
requirement SWS_Ocu_00127 [SWS_Ocu_00127] 📄 PDF
Det _ Report Error Det.h Service to report development errors.
requirement SWS_Ocu_00129 [SWS_Ocu_00129] 📄 PDF
The OCU driver shall call the function Ocu _Notification _< Channel # > according to the last call of Ocu _EnableNotification /Ocu_DisableNotification for channel < Channel # > , if there’s a compare match on that channel .
requirement SWS_Ocu_00130 [SWS_Ocu_00130] 📄 PDF
The OCU driver shall reset the interrupt flag (if needed by hardware) as sociated with the notification Ocu _Notification_< Channel # >
requirement SWS_Ocu_00131 [SWS_Ocu_00131] 📄 PDF
The O cu notification functions shall be configurable as function pointers within the initialization data structure ( Oc u_ConfigType ).
requirement SWS_Ocu_00132 [SWS_Ocu_00132] 📄 PDF
⌈ If the NULL pointer is configured for a notification call - back, then no call - back shall be executed.
requirement SWS_Ocu_00133 [SWS_Ocu_00133] 📄 PDF
When the notification mechanism is disabled, the OCU driver shall send no notification.
requirement SWS_Ocu_00136 [SWS_Ocu_00136] 📄 PDF
The API Ocu_ DeI nit shall stop all free - running counters, which are exclusively used by this driver.
requirement SWS_Ocu_00137 [SWS_Ocu_00137] 📄 PDF
If development error detection is enabled for the OCU driver: i f a channel is still in the RUNNING state when the function Ocu_DeInit is called, then the function sh all raise the development error ‘ OCU_E_PARAM_INVALID_STATE ’ and return without any action.
requirement SWS_Ocu_00170 [SWS_Ocu_00170] 📄 PDF
The OCU module shall reject configurations with partition mappings which are not s upported by the implementation.
requirement SWS_Ocu_91001 [SWS_Ocu_91001] 📄 PDF
Type of error Related error code Error value API services other than Ocu_ Get Version Info() and Ocu_ init() used without module initialization OCU_ E_ UNINIT 0x02 API service used with an invalid channel Identifier. OCU_ E_ PARAM_ INVALID_ CHANNEL 0x03 API Ocu_ Set Pin State() called with an invalid pin state or when the channel is in the RUNNING state. OCU_ E_ PARAM_ INVALID_ STATE 0x04 API Ocu_ Set Pin Action() called with an invalid pin action. OCU_ E_ PARAM_ INV ALID_ ACTION 0x05 Usage of Ocu_ Disable Notification() or Ocu_ Enable Notification() on a channel where a NULL pointer is configured as the notification function. OCU_ E_ NO_ VALID_ NOTIF 0x06 API Ocu_ Init() called while the OCU driver has already been initialized OCU_ E_ ALREADY_ INITIALIZED 0x07 API Ocu_ Get Version Info() is called with a NULL parameter. OCU_ E_ PARAM_ POINTER 0x08 Ocu_ Set Pin State() or Ocu_ Set Pin Action() called for a channel that doesn't have an associated output pin. OCU_ E_ PARAM_ NO_ PIN 0x0A OCU initialization has been failed, e.g. selected configuration set doesn't exist. OCU_ E_ INIT_ FAILED 0x0B
requirement SWS_Ocu_91002 [SWS_Ocu_91002] 📄 PDF
Type of error Related error code Error value API Ocu_ Start Channel() called on a channel that is in state RUNNING OCU_ E_ BUSY 0x09
requirement SWS_Ocu_CONSTR_00001 [SWS_Ocu_CONSTR_00001] 📄 PDF
The ECUC partitions referenced by OcuKernelEcucPartitionRef shall be a subset of the ECUC partitions referenced by OcuEcucPartitionRef.
requirement SWS_Ocu_CONSTR_00002 [SWS_Ocu_CONSTR_00002] 📄 PDF
The ECUC partitions referenced by OcuChannelEcucPartitionRef shall be a subset of the ECUC partitions referenced by OcuEcucPartitionRef.
requirement SWS_Ocu_CONSTR_00004 [SWS_Ocu_CONSTR_00004] 📄 PDF
If OcuEcucPartitionRef references one or more ECUC partitions, OcuKernelEcucPartitionRef shall have a multiplicity of one and reference one of these ECUC partitions as well
requirement SWS_Ocu_CONSTR_00005 [SWS_Ocu_CONSTR_00005] 📄 PDF
If OcuEcucPartitionRef references one or more ECUC partitions, OcuKernelEcucPartitionRef shall have a multiplicity of one and reference one of these ECUC partitions as well
Request a governed re-review of this record. The record is not changed immediately.
- Record
AUTOSAR/AP/record/CP_MOD_Ocu- Status
- unspecified
- Version
AUTOSAR/AP/record/CP_MOD_Ocu@rel:R20-11#dff8ce29- Content hash
dff8ce29- Source
- https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_OCUDriver.pdf#nameddest=SWS_Ocu_00035