AUTOSAR Classic Microcontroller Abstraction (MCAL)
Die Microcontroller Abstraction Layer (MCAL) enthält hardware-spezifische Treiber für interne Mikrocontroller-Peripherie (ADC-Wandler, PWM-Generatoren, Hardware-Watchdog) und entkoppelt obere BSW-Schichten von der Silizium-Plattform.
초기화 및 상태
Adc_DeInitAdc_GetVersionInfoAdc_InitCorTst_DeInitCorTst_GetVersionInfoCorTst_InitDio_GetVersionInfoGpt_DeInitGpt_GetVersionInfoGpt_InitIcu_DeInitIcu_GetVersionInfoIcu_InitIoHwAb_GetVersionInfoMcu_GetVersionInfoMcu_InitOcu_DeInitOcu_GetVersionInfoOcu_InitPort_GetVersionInfoPort_InitPwm_DeInitPwm_GetVersionInfoPwm_InitSpi_DeInitSpi_GetStatusSpi_GetVersionInfoSpi_InitWdg_GetVersionInfoWdg_InitWdgIf_GetVersionInfo서비스 · Get…
서비스 · Set…
서비스 · Disable…
서비스 · Enable…
서비스 · Start…
서비스 · Read…
서비스 · Stop…
서비스 · Write…
서비스 · Init…
서비스 · Notification…
서비스 · Prepare…
서비스 · Pwm…
서비스 · 기타
Adc_Main_PowerTransitionManagerAdc_SetupResultBufferCorTst_AbortCorTst_TestCompletedNotificationDio_FlipChannelDio_MaskedWritePortGpt_CheckWakeupIcu_CheckWakeupIcu_ResetEdgeCountIcu_SignalNotification_ChannelIcu_TimestampNotification_ChannelIoHwAb_Adc_NotifyReadyForPowerStateIoHwAb_Adc_NotifyReadyForPowerState#ModeIoHwAb_EnterPowerState#ModeIoHwAb_GptNotification#channelIoHwAb_IcuNotification#channelIoHwAb_OcuNotification#channelJobEndMcu_DistributePllClockMcu_PerformResetPort_RefreshPortDirectionPwm_Main_PowerTransitionManagerSeqEndSpi_AsyncTransmitSpi_CancelSpi_SetupEBSpi_SyncTransmitTst_CsumSignatureBgndTypeCorTst_GetSignatureTst_CsumSignatureTypeCorTst_GetFgndSignatureTst_StateTypeCorTst_GetState콜아웃 및 예상 인터페이스
<#group ID><Ecu Signal Name><Ecu Signal Name>#2주기적
CorTst_MainFunctionSpi_MainFunction_Handling타입
Adc_ChannelAdc_ChannelTypeAdc_ConfigTypeAdc_ConversionTimeTypeAdc_GroupAccessModeTypeAdc_GroupConvModeTypeAdc_GroupDefTypeAdc_GroupPriorityTypeAdc_GroupReplacementTypeAdc_GroupTypeAdc_HwTriggerSignalTypeAdc_HwTriggerTimerTypeAdc_PowerStateRequestResultTypeAdc_PowerStateTypeAdc_PrescaleTypeAdc_PriorityImplementationTypeAdc_ResolutionTypeAdc_ResultAlignmentTypeAdc_SamplingTimeTypeAdc_StatusTypeAdc_StreamBufferModeTypeAdc_StreamNumSampleTypeAdc_TriggerSourceTypeAdc_ValueGroupTypeCorTst_ConfigTypeCorTst_CsumSignatureBgndTypeCorTst_CsumSignatureTypeCorTst_ErrOkTypeCorTst_ResultTypeCorTst_StateTypeCorTst_TestIdFgndTypeDio_ChannelGroupTypeDio_ChannelTypeDio_LevelTypeDio_PortLevelTypeDio_PortTypeGpt_ChannelTypeGpt_ConfigTypeGpt_ModeTypeGpt_PredefTimerTypeGpt_ValueTypeIcu_ActivationTypeIcu_ChannelTypeIcu_ConfigTypeIcu_DutyCycleTypeIcu_EdgeNumberTypeIcu_IndexTypeIcu_InputStateTypeIcu_MeasurementModeTypeIcu_ModeTypeIcu_SignalMeasurementPropertyTypeIcu_TimestampBufferTypeIcu_ValueTypeIoHwAb{Init_Id}_ConfigTypeMcu_ClockTypeMcu_ConfigTypeMcu_ModeTypeMcu_PllStatusTypeMcu_RamSectionTypeMcu_RamStateTypeMcu_RawResetTypeMcu_ResetTypeOcu_ChannelTypeOcu_ConfigTypeOcu_PinActionTypeOcu_PinStateTypeOcu_ReturnTypeOcu_ValueTypePort_ConfigTypePort_PinDirectionTypePort_PinModeTypePort_PinTypePwm_ChannelClassTypePwm_ChannelTypePwm_ConfigTypePwm_EdgeNotificationTypePwm_OutputStateTypePwm_PeriodTypePwm_PowerStateRequestResultTypePwm_PowerStateTypeSpi_AsyncModeTypeSpi_ChannelTypeSpi_ConfigTypeSpi_DataBufferTypeSpi_HWUnitTypeSpi_JobResultTypeSpi_JobTypeSpi_NumberOfDataTypeSpi_SeqResultTypeSpi_SequenceTypeSpi_StatusTypeWdg_ConfigTypeWdgIf_ModeType함수
<#group ID><Ecu Signal Name><Ecu Signal Name>#2Adc_DeInitAdc_DisableGroupNotificationAdc_DisableHardwareTriggerAdc_EnableGroupNotificationAdc_EnableHardwareTriggerAdc_GetCurrentPowerStateAdc_GetGroupStatusAdc_GetStreamLastPointerAdc_GetTargetPowerStateAdc_GetVersionInfoAdc_InitAdc_Main_PowerTransitionManagerAdc_PreparePowerStateAdc_ReadGroupAdc_SetPowerStateAdc_SetupResultBufferAdc_StartGroupConversionAdc_StopGroupConversionCorTst_AbortCorTst_DeInitCorTst_GetCurrentStatusCorTst_GetVersionInfoCorTst_InitCorTst_MainFunctionCorTst_StartCorTst_TestCompletedNotificationDio_FlipChannelDio_GetVersionInfoDio_MaskedWritePortDio_ReadChannelDio_WriteChannelDio_WriteChannelGroupDio_WritePortGpt_CheckWakeupGpt_DeInitGpt_DisableNotificationGpt_DisableWakeupGpt_EnableNotificationGpt_EnableWakeupGpt_GetPredefTimerValueGpt_GetTimeElapsedGpt_GetTimeRemainingGpt_GetVersionInfoGpt_InitGpt_Notification_channelGpt_SetModeGpt_StartTimerGpt_StopTimerIcu_CheckWakeupIcu_DeInitIcu_DisableEdgeCountIcu_DisableEdgeDetectionIcu_DisableNotificationIcu_DisableNotificationAsyncIcu_DisableWakeupIcu_EnableEdgeCountIcu_EnableEdgeDetectionIcu_EnableNotificationIcu_EnableNotificationAsyncIcu_EnableWakeupIcu_GetDutyCycleValuesIcu_GetInputStateIcu_GetTimeElapsedIcu_GetTimestampIndexIcu_GetVersionInfoIcu_InitIcu_ResetEdgeCountIcu_SetActivationConditionIcu_SetModeIcu_SignalNotification_ChannelIcu_StartSignalMeasurementIcu_StartTimestampIcu_StopSignalMeasurementIcu_StopTimestampIcu_TimestampNotification_ChannelIoHwAb_Adc_NotifyReadyForPowerStateIoHwAb_Adc_NotifyReadyForPowerState#ModeIoHwAb_EnterPowerState#ModeIoHwAb_GetVersionInfoIoHwAb_GptNotification#channelIoHwAb_IcuNotification#channelIoHwAb_InitInit_IdIoHwAb_OcuNotification#channelIoHwAb_PreparePowerState#ModeIoHwAb_Pwm_NotifyReadyForPowerStateIoHwAb_Pwm_NotifyReadyForPowerState#ModeIoHwAb_PwmNotification#channelJobEndLevelTypeDio_ReadChannelGroupLevelTypeDio_ReadPortMcu_DistributePllClockMcu_GetRamStateMcu_GetResetReasonMcu_GetVersionInfoMcu_InitMcu_InitClockMcu_InitRamSectionMcu_PerformResetMcu_SetModeNumberTypeIcu_GetEdgeNumbersOcu_DeInitOcu_DisableNotificationOcu_EnableNotificationOcu_GetCounterOcu_GetVersionInfoOcu_InitOcu_Notification_ChannelOcu_SetAbsoluteThresholdOcu_SetPinActionOcu_SetPinStateOcu_SetRelativeThresholdOcu_StartChannelOcu_StopChannelPort_GetVersionInfoPort_InitPort_RefreshPortDirectionPort_SetPinDirectionPort_SetPinModePwm_DeInitPwm_DisableNotificationPwm_EnableNotificationPwm_GetCurrentPowerStatePwm_GetOutputStatePwm_GetTargetPowerStatePwm_GetVersionInfoPwm_InitPwm_Main_PowerTransitionManagerPwm_Notification_Pwm_PreparePowerStatePwm_SetDutyCyclePwm_SetOutputToIdlePwm_SetPeriodAndDutyPwm_SetPowerStateResetTypeMcu_GetResetRawValueResultTypeSpi_GetJobResultResultTypeSpi_GetSequenceResultSeqEndSpi_AsyncTransmitSpi_CancelSpi_DeInitSpi_GetHWUnitStatusSpi_GetStatusSpi_GetVersionInfoSpi_InitSpi_MainFunction_HandlingSpi_ReadIBSpi_SetAsyncModeSpi_SetupEBSpi_SyncTransmitSpi_WriteIBStatusTypeMcu_GetPllStatusTst_CsumSignatureBgndTypeCorTst_GetSignatureTst_CsumSignatureTypeCorTst_GetFgndSignatureTst_StateTypeCorTst_GetStateWdg_GetVersionInfoWdg_InitWdg_SetModeWdg_SetTriggerConditionWdgIf_GetVersionInfoWdgIf_SetModeWdgIf_SetTriggerCondition타입
Adc_ChannelAdc_ChannelTypeAdc_ConfigTypeAdc_ConversionTimeTypeAdc_GroupAccessModeTypeAdc_GroupConvModeTypeAdc_GroupDefTypeAdc_GroupPriorityTypeAdc_GroupReplacementTypeAdc_GroupTypeAdc_HwTriggerSignalTypeAdc_HwTriggerTimerTypeAdc_PowerStateRequestResultTypeAdc_PowerStateTypeAdc_PrescaleTypeAdc_PriorityImplementationTypeAdc_ResolutionTypeAdc_ResultAlignmentTypeAdc_SamplingTimeTypeAdc_StatusTypeAdc_StreamBufferModeTypeAdc_StreamNumSampleTypeAdc_TriggerSourceTypeAdc_ValueGroupTypeCorTst_ConfigTypeCorTst_CsumSignatureBgndTypeCorTst_CsumSignatureTypeCorTst_ErrOkTypeCorTst_ResultTypeCorTst_StateTypeCorTst_TestIdFgndTypeDio_ChannelGroupTypeDio_ChannelTypeDio_LevelTypeDio_PortLevelTypeDio_PortTypeGpt_ChannelTypeGpt_ConfigTypeGpt_ModeTypeGpt_PredefTimerTypeGpt_ValueTypeIcu_ActivationTypeIcu_ChannelTypeIcu_ConfigTypeIcu_DutyCycleTypeIcu_EdgeNumberTypeIcu_IndexTypeIcu_InputStateTypeIcu_MeasurementModeTypeIcu_ModeTypeIcu_SignalMeasurementPropertyTypeIcu_TimestampBufferTypeIcu_ValueTypeIoHwAb{Init_Id}_ConfigTypeMcu_ClockTypeMcu_ConfigTypeMcu_ModeTypeMcu_PllStatusTypeMcu_RamSectionTypeMcu_RamStateTypeMcu_RawResetTypeMcu_ResetTypeOcu_ChannelTypeOcu_ConfigTypeOcu_PinActionTypeOcu_PinStateTypeOcu_ReturnTypeOcu_ValueTypePort_ConfigTypePort_PinDirectionTypePort_PinModeTypePort_PinTypePwm_ChannelClassTypePwm_ChannelTypePwm_ConfigTypePwm_EdgeNotificationTypePwm_OutputStateTypePwm_PeriodTypePwm_PowerStateRequestResultTypePwm_PowerStateTypeSpi_AsyncModeTypeSpi_ChannelTypeSpi_ConfigTypeSpi_DataBufferTypeSpi_HWUnitTypeSpi_JobResultTypeSpi_JobTypeSpi_NumberOfDataTypeSpi_SeqResultTypeSpi_SequenceTypeSpi_StatusTypeWdg_ConfigTypeWdgIf_ModeType주제 맵
Adc
43CorTst
18Dio
14Gpt
20Icu
40IoHwAb
14Mcu
19Ocu
19Port
9Pwm
24Spi
28이 릴리스에 대한 요소 데이터가 없습니다
Adc
Returns all ADC HW Units to a state comparable to their power on reset state.
void Adc_DeInit (void);Disables the notification mechanism for the requested ADC Channel group.
void Adc_DisableGroupNotification (Adc_GroupType Group);Disables the hardware trigger for the requested ADC Channel group.
void Adc_DisableHardwareTrigger (Adc_GroupType Group);Enables the notification mechanism for the requested ADC Channel group.
void Adc_EnableGroupNotification (Adc_GroupType Group);Enables the hardware trigger for the requested ADC Channel group.
void Adc_EnableHardwareTrigger (Adc_GroupType Group);Service Adc_GetCurrentPowerState.
Std_ReturnType Adc_GetCurrentPowerState (Adc_PowerStateType* CurrentPowerState, Adc_PowerStateRequestResultType* Result);Returns the conversion status of the requested ADC Channel group.
Adc_StatusType Adc_GetGroupStatus (Adc_GroupType Group);Returns the number of valid samples per channel, stored in the result buffer. Reads a pointer, pointing to a position in the group result buffer. With the pointer position, the results of all group channels of the last completed conversion round can be acc essed. With the pointer and the return value, all valid group conversion results can be accessed (the user has to take the layout of the result buffer into account).
Adc_StreamNumSampleType Adc_GetStreamLastPointer (Adc_GroupType Group, Adc_ValueGroupType* * PtrToSamplePtr);Service Adc_GetTargetPowerState.
Std_ReturnType Adc_GetTargetPowerState (Adc_PowerStateType* TargetPowerState, Adc_PowerStateRequestResultType* Result);Returns the version information of this module.
void Adc_GetVersionInfo (Std_VersionInfoType* versioninfo);Initializes the ADC hardware units and driver.
void Adc_Init (const Adc_ConfigType* ConfigPtr);This API is cyclically called and supervises the power state transitions, checking for the readiness of the module and issuing the callbacks Io Hw Ab_ Adc_ Notify Ready For Power State (see Adc Power State Ready Cb k Ref configuration parameter).
void Adc_Main_PowerTransitionManager (void);This API starts the needed process to allow the ADC HW module to enter the AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_ADCDriver requested power state.
Std_ReturnType Adc_PreparePowerState (Adc_PowerStateType PowerState, Adc_PowerStateRequestResultType* Result);Reads the group conversion result of the last completed conversion round of the requested group and stores the channe l values starting at the Data Buffer Ptr address. The group channel values are stored in ascending channel number order ( in contrast to the storage layout of the result buffer if streaming access is configured).
Std_ReturnType Adc_ReadGroup (Adc_GroupType Group, Adc_ValueGroupType* DataBufferPtr);This API configures the Adc module so that it enters the already prepared power state, chosen between a predefined set of configured ones.
Std_ReturnType Adc_SetPowerState (Adc_PowerStateRequestResultType* Result);Initializes ADC driver with the group specific result buffer start address where the conversion results will be stored. The applicatio n has to ensure that the application buffer, where Data Buffer Ptr points to, can hold all the conversion results of the specified group. The initialization with Adc_ Setup Result Buffer is required after reset, before a group conversion can be started.
Std_ReturnType Adc_SetupResultBuffer (Adc_GroupType Group, Adc_ValueGroupType* DataBufferPtr);Starts the conversion of all channels of the requested ADC Channel group.
void Adc_StartGroupConversion (Adc_GroupType Group);Stops the conversion of the requested ADC Channel group.
void Adc_StopGroupConversion (Adc_GroupType Group);The API shall be invoked by the ADC Driver when the requested power state preparation for mode <#Mode> is completed.
void IoHwAb_Adc_NotifyReadyForPowerState<#Mode> (void);In case of active limit checking: defines which conversion values are taken into account related to the boardes defineed with Adc Channel Low Limit and Adc Channel High Limit.
Numeric ID of an ADC channel.
Data structure containing the set of configuration parameters required for initializing the ADC Driver and ADC HW Unit(s).
Type of conversion time, i.e. the time during which the sampled analogue value is converted into digital representation. (This is not an API type).
Type for configuring the access mode to group conversion results.
Type for configuring the conversion mode of an ADC Channel group. AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_ADCDriver
Type for assignment of channels to a channel group (this is not an API type).
Priority level of the channel. Lowest priority is 0.
Replacement mechanism, which is used on ADC group level, if a group conversion is interrupted by a group which has a higher priority.
Numeric ID of an ADC channel group.
Type for configuring on which edge of the hardware trigger signal the driver should react, i.e. start the conversion (only if supported by the ADC hardware).
Type for the reload value of the ADC module embedded timer (only if supported by the ADC hardware).
Type Adc_PowerStateRequestResultType.
Power state currently active or set as target power state.
Type of clock prescaler factor. (This is not an API type).
Type for configuring the prioritization mechanism.
Type of channel resolution in number of bits. (This is not an API type).
Type for alignment of ADC raw results in ADC result buffer (left/ right alignment).
Type of sampling time, i.e. the time during which the value is sampled, (in clock - cycles). (This is not an API type).
Current status of the conversion of the requested ADC Channel group.
Type for configuring the streaming access mode buffer type.
Type for configuring the number of group conversions in streaming access mode (in single access mode, parameter is 1). Available Adc.h AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_ADCDriver via
Type for configuring the trigger source for an ADC Channel group.
Type for reading the converted values of a channel group (raw, without further scaling, alignment according precompile switch ADC_ RESULT_ ALIGNMENT).
CorTst
Service to change from CORTST_ INIT to CORTST_ ABORT state
void CorTst_Abort(void);Service to change from CORTST_ ABORT or CORTST_ INIT to CORTST_ UNINIT state
void CorTst_DeInit(void);Service for Core Test to get indicator of the last executed Core Test result
void CorTst_GetCurrentStatus(CorTst_ErrOkType* ErrOk);Service returns the version information of this module.
void CorTst_GetVersionInfo(Std_VersionInfoType* versioninfo);Service for initialization and change of state of the Core Test
void CorTst_Init(const CorTst_ConfigType* ConfigPtr);Cyclically called by scheduler to perform processing of Core Test.
void CorTst_MainFunction(void);Service for executing foreground Core Test.
Std_ReturnType CorTst_Start(CorTst_TestIdFgndType TestId);The function Cor Tst_ Test Completed Notification shall be called every time when a complete test cycle has been executed.
void CorTst_TestCompletedNotification(CorTst_ErrOkType ResultOfLastCorTstRun);Service to get signature of the last executed Core Test in background mode.
CorTst_CsumSignatureBgndType CorTst_GetSignature(void);Service to get signature of the last executed Core Test in foreground mode.
CorTst_CsumSignatureType CorTst_GetFgndSignature(void);Service for Core Test to immediately return status on currently executed Core Test.
CorTst_StateType CorTst_GetState(void);Configuration data structure of the Cor Tst module.
Type for test signature in background mode
This is the type of the Core Test return value if a checksum/ signature is returned from API to the caller of the API.
This is the type of the Core Test test retu rn if a status is retuned from API to the caller of the API.
This is the type of the Core Test test return if a status is retuned from API to the caller of the API.
This is a status value returned by the API Cor Tst_ Get State().
This is the type of the parameter (Id) used for a specific foreground test configuration to run. (The Id shall be used in the call to the API Cor Tst_ Start(Cor Tst_ Test Id Fgnd Type Test Id)).
Dio
Service to flip (change from 1 to 0 or from 0 to 1) the level of a channel and return the level of the channel after flip.
Dio_LevelType Dio_FlipChannel(Dio_ChannelType ChannelId);Service to get the version information of this module.
void Dio_GetVersionInfo(Std_VersionInfoType* VersionInfo);Service to set the value of a given port with required mask.
void Dio_MaskedWritePort(Dio_PortType PortId, Dio_PortLevelType Level, Dio_PortLevelType Mask);Returns the value of the specified DIO channel.
Dio_LevelType Dio_ReadChannel(Dio_ChannelType ChannelId);Service to set a level of a channel.
void Dio_WriteChannel(Dio_ChannelType ChannelId, Dio_LevelType Level);Service to set a subset of the adjoining bits of a port to a specified level.
void Dio_WriteChannelGroup(const Dio_ChannelGroupType* ChannelGroupIdPtr, Dio_PortLevelType Level);Service to set a value of the port.
void Dio_WritePort(Dio_PortType PortId, Dio_PortLevelType Level);This Service reads a subset of the adjoining bits of a port.
Dio_PortLevelType Dio_ReadChannelGroup(const Dio_ChannelGroupType* ChannelGroupIdPtr);Returns the level of all channels of that port.
Dio_PortLevelType Dio_ReadPort(Dio_PortType PortId);Type for the definition of a channel group, which consists of several adjoining channels within a port.
Numeric ID of a DIO channel.
These are the possible levels a DIO channel can have (input or output)
If the µC owns ports of different port widths (e.g. 4, 8,16...Bit) Dio_ Port Level Type inherits the size of the larg est port.
Numeric ID of a DIO port.
Gpt
Checks if a wakeup capable GPT channel is the source for a wakeup event and calls the ECU state manager service Ecu M_ Set Wakeup Event in case of a valid GPT channel wakeup event.
void Gpt_CheckWakeup(EcuM_WakeupSourceType WakeupSource);Deinitializes the GPT driver.
void Gpt_DeInit(void);Disables the interrupt notification for a channel (relevant in normal mode).
void Gpt_DisableNotification(Gpt_ChannelType Channel);Disables the wakeup interrupt of a channel (relevant in sleep mode).
void Gpt_DisableWakeup(Gpt_ChannelType Channel);Enables the interrupt notification for a channel (relevant in normal mode).
void Gpt_EnableNotification(Gpt_ChannelType Channel);Enables the wakeup interrupt of a channel (relevant in sleep mode).
void Gpt_EnableWakeup(Gpt_ChannelType Channel);Delivers the current value of the desired GPT Predef Timer.
Std_ReturnType Gpt_GetPredefTimerValue(Gpt_PredefTimerType PredefTimer, uint32* TimeValuePtr);Returns the time already elapsed.
Gpt_ValueType Gpt_GetTimeElapsed(Gpt_ChannelType Channel);Returns the time remaining until the target time is reached.
Gpt_ValueType Gpt_GetTimeRemaining(Gpt_ChannelType Channel);Returns the version information of this module.
void Gpt_GetVersionInfo(Std_VersionInfoType* VersionInfoPtr);Initializes the GPT driver.
void Gpt_Init(const Gpt_ConfigType* ConfigPtr);-
void Gpt_Notification_<channel>(void);Sets the operation mode of the GPT.
void Gpt_SetMode(Gpt_ModeType Mode);Starts a timer channel.
void Gpt_StartTimer(Gpt_ChannelType Channel, Gpt_ValueType Value);Stops a timer channel.
void Gpt_StopTimer(Gpt_ChannelType Channel);Numeric ID of a GPT channel.
This is the type of the data structure including the configuration set required for initializing the GPT timer unit.
Modes of the GPT driver.
Type for GPT Predef Timers
Type for reading and setting the timer values (in number of ticks).
Icu
Checks if a wakeup capable ICU channel is the source for a wakeup event and calls the ECU state manager service Ecu M_ Set Wakeup Event in case of a valid ICU channel wakeup event.
void Icu_CheckWakeup(EcuM_WakeupSourceType WakeupSource);This function de - initializes the ICU module.
void Icu_DeInit(void);This function disables the counting of edges of the given channel.
void Icu_DisableEdgeCount(Icu_ChannelType Channel);This function disables the detection of edges of the given channel.
void Icu_DisableEdgeDetection(Icu_ChannelType Channel);This function disables the notification of a channel.
void Icu_DisableNotification(Icu_ChannelType Channel);This function disables the notification of a channel.
void Icu_DisableNotificationAsync(Icu_ChannelType Channel);This function disables the wakeup capability of a single ICU channel.
void Icu_DisableWakeup(Icu_ChannelType Channel);This function enables the counting of edges of the given channel.
void Icu_EnableEdgeCount(Icu_ChannelType Channel);This function enables / re - enables the detection of edges of the given channel.
void Icu_EnableEdgeDetection(Icu_ChannelType Channel);This function enables the notification on the given channel.
void Icu_EnableNotification(Icu_ChannelType Channel);This function enables the notification on the given channel.
void Icu_EnableNotificationAsync(Icu_ChannelType Channel);This function (re - )enables the wakeup capability of the given ICU channel.
void Icu_EnableWakeup(Icu_ChannelType Channel);This function reads the coherent active time and period time for the given ICU Channel.
void Icu_GetDutyCycleValues(Icu_ChannelType Channel, Icu_DutyCycleType* DutyCycleValues);This function returns the status of the ICU input.
Icu_InputStateType Icu_GetInputState(Icu_ChannelType Channel);Description This function reads the elapsed Signal Low Time for the given channel.
Icu_ValueType Icu_GetTimeElapsed(Icu_ChannelType Channel);This function reads the timestamp index of the given channel.
Icu_IndexType Icu_GetTimestampIndex(Icu_ChannelType Channel);This function returns the version information of this module.
void Icu_GetVersionInfo(Std_VersionInfoType* versioninfo);This function initializes the driver.
void Icu_Init(const Icu_ConfigType* ConfigPtr);This function resets the value of the counted edges to zero.
void Icu_ResetEdgeCount(Icu_ChannelType Channel);This function sets the activation - edge for the given channel.
void Icu_SetActivationCondition(Icu_ChannelType Channel, Icu_ActivationType Activation);This function sets the ICU mode.
void Icu_SetMode(Icu_ModeType Mode);According to the last call of Icu_ Enable Notification, this notification function to be called if the requested signal edge (rising / falling / both edges) occurs (once per edge).
void Icu_SignalNotification_<Channel>(void);This function starts the measurement of signals.
void Icu_StartSignalMeasurement(Icu_ChannelType Channel);This function stops the measurement of signals of the given channel.
void Icu_StopSignalMeasurement(Icu_ChannelType Channel);This function stops the timestamp measurement of the given channel.
void Icu_StopTimestamp(Icu_ChannelType Channel);This notification to be called if the number of requested timestamps (Notification interval > 0) are acquired and if the notification has been enabled by the call of Icu_ Enable Notification().
void Icu_TimestampNotification_<Channel>(void);This function reads the number of counted edges.
Icu_EdgeNumberType Icu_GetEdgeNumbers(Icu_ChannelType Channel);Definition of the type of activation of an ICU channel.
Numeric identifier of an ICU channel Avail able via Icu.h
This type contains initialization data.
Type which shall contain the values, needed for calculating duty cycles.
Type, to abstract the return value of the service Icu_ Get Edge Numbers().
Type, to abstract the return value of the service Icu_ Get Timestamp Index().Since circular buffer handling is supported and Icu_ Get Timestamp Index can return '0' as a legally true value ( not as an error according to ICU107 and ICU135), Icu_ Index Type may be implemented to have values 1..xyz.
Input state of an ICU channel
Definition of the measurement mode type
Allow enabling / disabling of all interrupts which are not required for the ECU wakeup.
Def inition of the measurement property type
Definition of the timestamp measurement property type
Width of the buffer for timestamp ticks and measured elapsed timeticks.
IoHwAb
Will be called by the ADC Driver when a group conversion is completed for group <#group ID>.
void IoHwAb_AdcNotification<#group ID>(void);This function provides control access to a certain ECU Signal t o the DCM module (<Ecu Signalname> is the symbolic name of an ECU Signal). The ECU signal can be locked and unlocked by this function. Locking 'freezes' the ECU signal to the current value, the configured default value or a value given by the parameter 'si gnal'.
void IoHwAb_Dcm_<Ecu Signal Name>(uint8 action, <Ecu Signal DataType> signal);This function provides read access to a certain ECU Signal to the DCM module (<Ecu Signalname> is the symbolic name of an ECU Signal).
void IoHwAb_Dcm_Read<Ecu Signal Name>(<Ecu Signal DataType>* signal);The API shall be invoked by the ADC Driver when the requested power state preparation for mode <#Mode> is completed.
void IoHwAb_Adc_NotifyReadyForPowerState<#Mode>(void);The API shall be invoked by the Io Hw Abs in order to effectively enter a power state which was prepared by the API Io Hw Ab_ Prepare Power State<#Mode> () . The aim of this API is to incapsulate all actions to set the HW in a power state corresponding to a predefined power mode, decoupling application power definition from HW power states.
void IoHwAb_EnterPowerState<#Mode>(void);Returns the version information of this module.
void IoHwAb_GetVersionInfo(Std_VersionInfoType* versioninfo);Will be called by the GPT driver when a timer value expires on channel <#channel>.
void IoHwAb_GptNotification<#channel>(void);Will be called by the ICU driver when a signal edge occurs on channel <#channel>.
void IoHwAb_IcuNotification<#channel>(void);Initializes either all the IO Hardware Abstraction software or is a part of the IO Hardware Abstraction.
void IoHwAb_Init<Init_Id>(const IoHwAb{Init_Id}_ConfigType* ConfigPtr);Will be called by the OCU driver when the current value of the threshold matches the threshold on the channel<#channel>.
void IoHwAb_OcuNotification<#channel>(void);The API shall be invoked by the Io Hw Abs in order to prepare the transition to a given power state. The aim of this API is to incapsulate all actions to prepare the HW for a predefined power mode, decoupling application power definition from HW power stat es.
void IoHwAb_PreparePowerState<#Mode>(void);The API shall be invoked by the PWM Driver when the requested power state preparation for mode <#Mode> is completed.
void IoHwAb_Pwm_NotifyReadyForPowerState<#Mode>(void);Will be called by the PWM Driver when a signal edge occurs on channel <#channel>.
void IoHwAb_PwmNotification<#channel>(void);Configuration data structure of the Io Hw Ab module.
Mcu
This service activates the PLL clock to the MCU clock distribution.
Std_ReturnType Mcu_DistributePllClock(void);This service provides the actual status of the microcontroller Ram. (if supported)
Mcu_RamStateType Mcu_GetRamState(void);The service reads the reset type from the hardware, if supported.
Mcu_ResetType Mcu_GetResetReason(void);This service returns the version information of this module.
void Mcu_GetVersionInfo(Std_VersionInfoType* versioninfo);This service initializes the MCU driver.
void Mcu_Init(const Mcu_ConfigType* ConfigPtr);This service initializes the PLL and other MCU specific clock options.
Std_ReturnType Mcu_InitClock(Mcu_ClockType ClockSetting);This service initializes the RAM section wise.
Std_ReturnType Mcu_InitRamSection(Mcu_RamSectionType RamSection);The service performs a microcontroller reset.
void Mcu_PerformReset(void);This service activates the MCU power modes.
void Mcu_SetMode(Mcu_ModeType McuMode);The service reads the reset type from the hardware register, if supported.
Mcu_RawResetType Mcu_GetResetRawValue(void);This service provides the lock status of the PLL.
Mcu_PllStatusType Mcu_GetPllStatus(void);Specifies the identification (ID) for a clock setting, which is configured in the configuration structure
A pointer to such a structure is provided to the MCU initialization routines for configuration.
Name Mcu_ Mode Type Kind Type Derived from uint Range 0..<number of MCU modes> - 1 -- The range is dependent on the number of MCU modes provided in the configuration structure. The type shall be chosen depending on MCU platform for best performance. Des cription This type specifies the identification (ID) for a MCU mode, which is configured in the configuration structure. Available via Mcu.h
This is a status value returned by the function Mcu_ Get Pll Status of the MCU module.
This type specifies the identification (ID) for a RAM section, which is conf igured in the configuration structure.
This is the Ram State data type returned by the function Mcu_ Get Ram State of the Mcu module. It is not required that all RAM state types are supported by the hardware.
This type specifies the reset reason in raw register format read from a reset status register.
This is the type of the reset enumerator containing the subset of reset types. It is not required that all reset types are supported by hardware.
Ocu
This function de - initializes the OCU module.
void Ocu_DeInit(void);This service is used to disable notifications from an OCU channel.
void Ocu_DisableNotification(Ocu_ChannelType ChannelNumber);This service is used to enable notifications from an OCU channel.
void Ocu_EnableNotification(Ocu_ChannelType ChannelNumber);Service to read the current value of the counter.
Ocu_ValueType Ocu_GetCounter(Ocu_ChannelType ChannelNumber);This service returns the version information of this module.
void Ocu_GetVersionInfo(Std_VersionInfoType* versioninfo);Service for OCU initialization.
void Ocu_Init(const Ocu_ConfigType* ConfigPtr);This notification function is called when a compare match occurs on the associated channel.
void Ocu_Notification_<Channel>(void);Service to set the value of the channel threshold using an absolute input data.
Ocu_ReturnType Ocu_SetAbsoluteThreshold(Ocu_ChannelType ChannelNumber, Ocu_ValueType ReferenceValue, Ocu_ValueType AbsoluteValue);Service to indicate the driver what shall be done automatically by hardware (if supported) upon compare match.
void Ocu_SetPinAction(Ocu_ChannelType ChannelNumber, Ocu_PinActionType PinAction);Service to set immediately the level of the pin associated to an OCU channel.
void Ocu_SetPinState(Ocu_ChannelType ChannelNumber, Ocu_PinStateType PinState);Service to set the value of the channel threshold relative to the current value of the counter.
Ocu_ReturnType Ocu_SetRelativeThreshold(Ocu_ChannelType ChannelNumber, Ocu_ValueType RelativeValue);Service to start an OCU channel.
Std_ReturnType Ocu_StartChannel(Ocu_ChannelType ChannelNumber);Service to stop an OCU channel.
void Ocu_StopChannel(Ocu_ChannelType ChannelNumber);Numeric identifier of an OCU channel.
This is the type of the data structure containing the initialization data for the OCU driver.
Automatic action (by hardware) to be performed on a pin attached to an OCU channel. A vailable via Ocu.h
Output state of the pin linked to an OCU channel.
Return information after setting a new threshold value.
Type for reading the counter and writing the threshold values (in number of ticks).
Port
Returns the version information of this module.
void Port_GetVersionInfo(Std_VersionInfoType* versioninfo);Initializes the Port Driver module.
void Port_Init(const Port_ConfigType* ConfigPtr);Refreshes port direction.
void Port_RefreshPortDirection(void);Sets the port pin direction
void Port_SetPinDirection(Port_PinType Pin, Port_PinDirectionType Direction);Sets the port pin mode.
void Port_SetPinMode(Port_PinType Pin, Port_PinModeType Mode);Type of the external data structure containing the initialization data for this module.
Possible directions of a port pin.
Different port pin modes.
Data type for the symbolic name of a port pin.
Pwm
The API shall be invoked by the PWM Driver when the requested power state preparation for mode <#Mode> is completed.
void IoHwAb_Pwm_NotifyReadyForPowerState<#Mode> (void);Service for PWM De - Initialization.
void Pwm_DeInit (void);Service to disable the PWM signal edge notification.
void Pwm_DisableNotification (Pwm_ChannelType ChannelNumber);Service to enable the PWM signal edge notification according to notification pa rameter.
void Pwm_EnableNotification (Pwm_ChannelType ChannelNumber, Pwm_EdgeNotificationType Notification);This API returns the current power state of the PWM HW unit. AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_PWMDriver
Std_ReturnType Pwm_GetCurrentPowerState (Pwm_PowerStateType* CurrentPowerState, Pwm_PowerStateRequestResultType* Result);Service to read the internal state of the PWM out put signal.
Pwm_OutputStateType Pwm_GetOutputState (Pwm_ChannelType ChannelNumber);This API returns the Target power state of the PWM HW unit.
Std_ReturnType Pwm_GetTargetPowerState (Pwm_PowerStateType* TargetPowerState, Pwm_PowerStateRequestResultType* Result);Service returns the version information of this module.
void Pwm_GetVersionInfo (Std_VersionInfoType* versioninfo);Service for PWM initialization.
void Pwm_Init (const Pwm_ConfigType* ConfigPtr);This API is cyclically called and supervises the power state transitions, checking for the readiness of the module and issuing the callbacks Io Hw Ab_ Pwm_ Notify Ready For Power State (see Pwm Power State Ready Cb k Ref configuration parameter). AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_PWMDriver
void Pwm_Main_PowerTransitionManager (void);The Pwm module shall call the function Pwm_ Notification_<#Channel> accordingly to the last call of Pwm_ Enable Notification for channel <#Channel>.
void Pwm_Notification_<#Channel> (void);This API starts the needed process to allow the PWM HW module to enter the requested power state. AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_PWMDriver
Std_ReturnType Pwm_PreparePowerState (Pwm_PowerStateType PowerState, Pwm_PowerStateRequestResultType* Result);Service sets the duty cycle of the PWM channel.
void Pwm_SetDutyCycle (Pwm_ChannelType ChannelNumber, uint16 DutyCycle);Service sets the PWM output to the configured Idle state.
void Pwm_SetOutputToIdle (Pwm_ChannelType ChannelNumber);Service sets the period and the duty cycle of a PWM channel
void Pwm_SetPeriodAndDuty (Pwm_ChannelType ChannelNumber, Pwm_PeriodType Period, uint16 DutyCycle);This API configures the Pwm module so that it enters the already prepared power st ate, chosen between a predefined set of configured ones.
Std_ReturnType Pwm_SetPowerState (Pwm_PowerStateRequestResultType* Result);Defines the class of a PWM channel
Nume ric identifier of a PWM channel.
This is the type of data structure containing the initialization data for the PWM driver.
Definition of the type of edge notification of a PWM channel.
Output state of a PWM channel.
Definition of the period of a PWM channel.
Result of the requests related to power state transitions.
Power state currently active or set as target power state.
Spi
Callback routine provided by the user for each Job to notify the caller that a job has been finished.
void(* Spi_JobEndNotification); ⚠️This service returns the last transmission result of the specified Job.
Spi_JobResultType Spi_GetJobResult(Spi_JobType Job);This service returns the last transmission result of the specified Sequence.
Spi_SeqResultType Spi_GetSequenceResult(Spi_SequenceType Sequence);Callback routine provided by the user for each Sequence to notify the caller that a sequence has been finished.
void(* Spi_SeqEndNotification); ⚠️Service to transmit data on the SPI bus.
Std_ReturnType Spi_AsyncTransmit(Spi_SequenceType Sequence);Service cancels the specified on - going sequence transmission.
void Spi_Cancel(Spi_SequenceType Sequence);Service for SPI de - initialization.
Std_ReturnType Spi_DeInit(void);This service returns the status of the specified SPI Hardware microcontroller peripheral.
Spi_StatusType Spi_GetHWUnitStatus(Spi_HWUnitType HWUnit);Service returns the SPI Handler/ Driver software module status.
Spi_StatusType Spi_GetStatus(void);This service returns the version information of this module.
void Spi_GetVersionInfo(Std_VersionInfoType* versioninfo);Service for SPI initialization.
void Spi_Init(const Spi_ConfigType* ConfigPtr);-
void Spi_MainFunction_Handling(void);Service for reading synchronously one or more data from an IB SPI Handler/ Driver Channel specified by parameter.
Std_ReturnType Spi_ReadIB(Spi_ChannelType Channel, Spi_DataBufferType* DataBufferPointer);Service to set the asynchronous mechanism mode for SPI busses handled asynchronously.
Std_ReturnType Spi_SetAsyncMode(Spi_AsyncModeType Mode);Service to setup the buffers and the length of data for the EB SPI Handle r/ Driver Channel specified.
Std_ReturnType Spi_SetupEB(Spi_ChannelType Channel, const Spi_DataBufferType* SrcDataBufferPtr, Spi_DataBufferType* DesDataBufferPtr, Spi_NumberOfDataType Length);Service to transmit data on the SPI bus
Std_ReturnType Spi_SyncTransmit(Spi_SequenceType Sequence);Service for writing one or more data to an IB SPI Handler/ Driver Channel specified by parameter.
Std_ReturnType Spi_WriteIB(Spi_ChannelType Channel, const Spi_DataBufferType* DataBufferPtr);Specifies the asynchronous mechanism mode for SPI busses handled asynchronously.
Specifies the identification (ID) for a Channel.
This type of the external data structure shall contain the initialization data for the SPI Handler/ Driver.
Type of application data buffer elements.
Specifies the identification (ID) for a SPI Hardware microcontroller peripheral (unit).
This type defines a range of specific Jobs status for SPI Handler/ Driver.
Specifies the identification (ID) for a Job.
Type for defining the number of data elements of the type Spi_ Data Buffer Type to send and / or receive by Channel
This type defines a range of specific Sequences status for SPI Handler/ Driver.
Specifies the identification (ID) for a sequence of jobs.
This type defines a range of specific status for SPI Handler/ Driver.
Wdg
Returns the version information of the module.
void Wdg_GetVersionInfo (Std_VersionInfoType* versioninfo);Initializes the module.
void Wdg_Init (const Wdg_ConfigType* ConfigPtr);Switches the watchdog into the mode Mode. AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_WatchdogDriver
Std_ReturnType Wdg_SetMode (WdgIf_ModeType Mode);Sets the timeout value for the trigger counter.
void Wdg_SetTriggerCondition (uint16 timeout);Used for pointers to structures holding configuration data provided to the Wdg module initialization routine for configuration of the module and watchdog hardware.
WdgIf
Returns the version information.
void WdgIf_GetVersionInfo(Std_VersionInfoType* VersionInfoPtr);Map the service Wdg If_ Set Mode to the serv ice Wdg_ Set Mode of the corresponding Watchdog Driver.
Std_ReturnType WdgIf_SetMode(uint8 DeviceIndex, WdgIf_ModeType WdgMode);Mode type of the Wdg If module
클러스터 가이드AI 생성
마이크로컨트롤러 주변 장치 및 내부 레지스터의 직접적인 캡슐화 및 제어를 위한 하드웨어 근접 드라이버를 제공합니다.
마이크로컨트롤러 주변 장치 및 내부 레지스터의 직접적인 캡슐화 및 제어를 위한 하드웨어 근접 드라이버를 제공합니다.
Microcontroller Abstraction (MCAL) 모듈 클러스터는 온칩 주변 장치(SWS_ECUStateManager 34쪽)의 하드웨어 근접 캡슐화 및 제어를 위한 드라이버 Port, Dio, Adc, Pwm, Spi 및 Wdg를 포함합니다. 핵심 작업에는 주변 장치 액세스 전 핀 구성, 아날로그 및 펄스 변조 신호 관리, 시간 모니터링 기반 시퀀스 제어([SWS_Adc_00507], [SWS_Wdg_00155])가 포함됩니다. 이때 중앙 모드 및 전원 상태 전환은 엄격하게 순차적이며 비재진입적으로 실행되어야 합니다([SWS_Wdg_00107]).
Microcontroller Abstraction (MCAL) 모듈 클러스터는 마이크로컨트롤러의 물리적 온칩 리소스를 캡슐화하고 I/O 하드웨어 추상화(IoHwAb), 워치독 인터페이스(WdgIf), EcuM 및 BswM을 위한 표준화된 인터페이스를 제공합니다(SWS_ECUStateManager 34쪽). 이는 6개의 드라이버 빌딩 블록인 Port(핀 멀티플렉싱), Dio(디지털 입출력), Adc(아날로그-디지털 변환), Pwm(펄스 폭 변조), Spi(직렬 주변 장치 통신) 및 Wdg(하드웨어 시퀀스 모니터링)으로 구성됩니다([SWS_Adc_00507], [SWS_Pwm_00197], [SWS_Wdg_00155]).
모듈들은 고정된 종속성 내에서 작동합니다: Port_Init은 Pwm 또는 Adc와 같은 드라이버가 관련 하드웨어 블록을 활성화하기 전에 핀 할당을 설정합니다(AUTOSAR_CP_RS_PWMDriver 14쪽, ModemanagementGuide 54쪽). 데이터 버퍼는 Adc_SetupResultBuffer를 통해 애플리케이션 측에서 제공되는([SWS_Adc_91000]) 반면, 워치독 서비스는 타이머 인터럽트를 통해 비동기적으로 분리됩니다(AUTOSAR_SWS_WatchdogDriver 31쪽).
아키텍처 다이어그램: MCAL 클러스터의 계층 아키텍처 및 분류. 출처: SWS_ECUStateManager 34쪽, AUTOSAR_CP_RS_PWMDriver 14쪽.
서로소인 인스턴스에 대한 채널 및 그룹 관련 드라이버 호출은 재진입 가능한([SWS_Pwm_91000], [SWS_Adc_00367]) 반면, 모드 및 상태 전환은 엄격하게 동기적이고 비재진입적인 경로를 요구합니다([SWS_Wdg_00107]). 에너지 요구량을 줄이기 위해 Adc 및 Pwm는 IoHwAb에 대한 비동기 준비 완료 알림과 함께 2단계 파워 상태 전환을 실행합니다([SWS_Adc_00478], [SWS_Pwm_00183], AUTOSAR_CP_SWS_IOHardwareAbstraction 57쪽).
초기화되지 않은 호출과 같은 잘못된 조작은 DET에 보고되는([SWS_Pwm_00177]) 반면, 하드웨어 결함은 DEM에 보고됩니다([SWS_Wdg_00111]). 기능 저하(degradation) 시 Wdg_SetTriggerCondition는 타임아웃 0을 전달하여 의도적으로 ECU 리셋을 유도할 수 있도록 합니다([SWS_Wdg_00155], SWS_WatchdogDriver 29쪽).
시스템 아키텍처 & 모듈 클러스터의 역할
마이크로컨트롤러 추상화 계층(Microcontroller Abstraction Layer, MCAL)의 모듈 클러스터는 AUTOSAR Classic Platform의 가장 하드웨어 근접한 기반을 형성합니다. 이는 온칩 주변 장치 유닛의 레지스터 액세스를 캡슐화하고 상위 계층에 표준화된 마이크로컨트롤러 독립적 인터페이스를 제공합니다. 계층 아키텍처 내에서 드라이버는 I/O 하드웨어 추상화(IoHwAb), 워치독 인터페이스(WdgIf) 및 ECU State Manager(EcuM), Basic Software Mode Manager(BswM)와 같은 중앙 시스템 서비스를 지원합니다(SWS_ECUStateManager 34쪽).
클러스터는 6개의 상호 보완적인 드라이버 빌딩 블록으로 구성됩니다: Port은 글로벌 핀 구성과 마이크로컨트롤러 핀의 멀티플렉싱을 담당합니다(AUTOSAR_CP_RS_PWMDriver 14쪽). Dio는 고속 비트 및 포트 단위 디지털 I/O 액세스를 구현하는 반면, Spi은 온보드 주변 장치 컴포넌트와의 동기 및 비동기 직렬 버스 통신을 캡슐화합니다. 아날로그 및 펄스 변조 신호의 경우 Adc([SWS_Adc_00507]) 및 Pwm([SWS_Pwm_00197])이 고도화된 변환 및 변조 서비스를 제공합니다. Wdg은 프로그램 흐름 무결성을 보호하기 위해 하드웨어 기반 시간 모니터링을 제어합니다([SWS_Wdg_00155]).
아키텍처 다이어그램: 시스템 서비스, 추상화 계층 및 주변 장치 사이에서 MCAL 클러스터의 계층 아키텍처 및 구조적 분류. 출처: SWS_ECUStateManager 34쪽, AUTOSAR_CP_RS_PWMDriver 14쪽, AUTOSAR_SWS_WatchdogDriver 11쪽.
모듈 간 상호작용 & 인터랙션 경로
모듈들은 명확하게 정의된 신호 및 버퍼 흐름 내에서 동작합니다. 드라이버 Port은 사전에 전기적 포트 로직과 멀티플렉싱을 초기화하며, 이에 따라 Pwm 또는 Adc와 같은 드라이버는 패드 결선에 대한 지식 없이도 할당된 주변 장치 블록을 제어할 수 있습니다(AUTOSAR_CP_RS_PWMDriver 14쪽). [SWS_Pwm_00100]를 통해 내부 로직 상태를 읽을 때 Pwm_GetOutputState는 물리적 포트 핀이 아닌 PWM 장치의 레지스터 상태를 읽습니다([SWS_Pwm_00108], AUTOSAR_SWS_PWMDriver 51쪽).
아날로그 경로에서는 상위 IoHwAb이 측정을 요청하고 애플리케이션 측 버퍼를 제공합니다(AUTOSAR_CP_SWS_IOHardwareAbstraction 55쪽). [SWS_Adc_91000]를 통해 Adc_SetupResultBuffer은 호출자의 메모리 영역에 대한 내부 포인터를 초기화합니다(AUTOSAR_SWS_ADCDriver 31쪽). 소프트웨어([SWS_Adc_00367]) 또는 하드웨어 트리거([SWS_Adc_91001])를 통해 변환이 시작된 후 원시 데이터가 버퍼에 기록됩니다. 읽기 액세스는 [SWS_Adc_00369]을 통한 동기 방식(최신 결과 복사) 또는 Adc_GetStreamLastPointer를 통한 [SWS_Adc_00375] 방식으로 수행됩니다(SWS_ADCDriver 27쪽).
워치독 경로는 논리적 시퀀스 제어와 하드웨어 서비스를 분리합니다: WdgM은 모니터링 예산을 제어하고 WdgIf을 통해 [SWS_Wdg_00155]로 Wdg_SetTriggerCondition의 시간 윈도우를 설정합니다(SWS_WatchdogDriver 29쪽). 실제 하드웨어 서비스는 하드웨어 타이머 인터럽트를 통해 주기적으로 수행됩니다(AUTOSAR_SWS_WatchdogDriver 31쪽). 외부 워치독 컴포넌트는 필요한 경우 Dio 또는 Spi의 드라이버 인스턴스를 통해 액세스됩니다([SWS_Wdg_00111], AUTOSAR_SWS_WatchdogDriver 11쪽).
시퀀스 다이어그램: 주기적 트리거 연장 및 모드 전환 시 WdgM, WdgIf 및 Wdg의 상호 작용. 출처: AUTOSAR_SWS_WatchdogDriver 31쪽, AUTOSAR_SWS_WatchdogDriver 34쪽, [SWS_Wdg_00155], [SWS_Wdg_00107].
동기화, 재진입성 및 태스크 컨텍스트
MCAL 드라이버는 세분화된 재진입성 규정을 따릅니다. 모듈 Pwm에서 Pwm_SetDutyCycle([SWS_Pwm_91000]), Pwm_SetPeriodAndDuty([SWS_Pwm_91001]) 및 Pwm_SetOutputToIdle([SWS_Pwm_91002])와 같은 제어 함수는 서로 다른 채널에 대해 재진입 가능하지만, 동일한 채널에 대해서는 동시에 호출할 수 없습니다(AUTOSAR_CP_SWS_PWMDriver 46쪽). 모듈 Adc에서 Adc_StartGroupConversion([SWS_Adc_00367]), Adc_StopGroupConversion([SWS_Adc_00368]) 및 Adc_ReadGroup([SWS_Adc_00369])과 같은 제어 및 읽기 API는 서로 다른 채널 그룹에 대해 재진입 가능합니다.
반면 중앙 구성 및 모드 API는 엄격하게 비재진입적으로 설계되었습니다. 이는 Wdg_SetMode([SWS_Wdg_00107]), Wdg_SetTriggerCondition([SWS_Wdg_00155]) 및 모든 드라이버의 초기화 및 초기화 해제 루틴에 적용됩니다([SWS_Adc_00366], [SWS_Pwm_00096]). 서로 다른 OS 태스크로부터의 동시 호출은 SchM 배타적 영역을 통해 보호되어야 합니다(AUTOSAR_SWS_WatchdogDriver 11쪽).
이벤트(예: 에지 변경 또는 변환 완료)에 대한 알림은 인터럽트 컨텍스트(ISR)에서 Pwm_Notification_<#Channel>([SWS_Pwm_00105]) 또는 Adc_Notification_Group_<x>([SWS_Adc_91003])와 같은 구성 가능한 콜백을 통해 트리거됩니다. 알림이 활성화되면 대기 중인 인터럽트 플래그가 재설정됩니다([SWS_Pwm_91004]). 여러 ADC 그룹이 변환 리소스를 두고 경쟁하는 경우 구성에 따라 하드웨어 우선순위 지정 또는 구성 가능한 중단/재시작(Abort/Restart) 또는 일시 중단/재개(Suspend/Resume) 메커니즘을 갖춘 소프트웨어 큐잉([SWS_Adc_00522])이 적용됩니다([SWS_Adc_00523], SWS_ADCDriver 97쪽).
일반적인 수명 주기 및 동작 모드
MCAL 드라이버의 수명 주기는 전체 시스템의 시작 단계에서 EcuM의 제어 하에 시작됩니다(SWS_ECUStateManager 34쪽). BswM 규칙을 통해 결정론적 순서가 강제됩니다: 먼저 Port_Init가 핀 기능을 초기화합니다(ModemanagementGuide 54쪽). 그 후에야 비로소 Dio_Init, Spi_Init, Adc_Init([SWS_Adc_00365]), Pwm_Init([SWS_Pwm_00095]) 및 Wdg_Init([SWS_Wdg_00106], AUTOSAR_CP_SWS_PWMDriver 47쪽)과 같은 주변 장치 드라이버가 뒤따릅니다.
작동 중에 Wdg은 세 가지 정적 모드인 WDGIF_OFF_MODE, WDGIF_SLOW_MODE 및 WDGIF_FAST_MODE을 가집니다([SWS_Wdg_00107]). 모듈 Adc는 원샷 및 연속 변환([SWS_Adc_00515])과 단일 및 스트리밍 액세스 모드([SWS_Adc_00528], [SWS_Adc_00519])를 구분합니다. 그룹 상태는 ADC_IDLE, ADC_BUSY, ADC_COMPLETED 및 ADC_STREAM_COMPLETED 상태를 거칩니다([SWS_Adc_00513], [SWS_Adc_00374], SWS_ADCDriver 37쪽).
저전력(Low Power) 모드를 위해 Adc과 Pwm은 표준화된 2단계 파워 상태 프로토콜을 구현합니다: 먼저 Adc_PreparePowerState([SWS_Adc_00478])와 Pwm_PreparePowerState([SWS_Pwm_00183])가 전환을 준비합니다([SWS_Pwm_00165], [SWS_Adc_00527]). 비동기적 완료 후 하드웨어 추상화는 IoHwAb_Adc_NotifyReadyForPowerState<#Mode>([SWS_Adc_00480])과 같은 콜백을 통해 준비 완료를 보고합니다. 마지막으로 Adc_SetPowerState([SWS_Adc_00475])과 Pwm_SetPowerState([SWS_Pwm_00166])가 하드웨어를 대상 상태로 전환합니다(AUTOSAR_CP_SWS_IOHardwareAbstraction 57쪽). 태스크 내 주기적 모니터링은 Pwm_Main_PowerTransitionManager에 의해 보장됩니다([SWS_Pwm_00189], [SWS_Pwm_00190]).
시스템 종료 또는 리셋 시 Adc_DeInit([SWS_Adc_00366], AUTOSAR_SWS_ADC_Driver 76쪽) 및 Pwm_DeInit([SWS_Pwm_00096], AUTOSAR_SWS_PWMDriver 47쪽)과 같은 초기화 해제 서비스는 유닛을 안전한 유휴 상태로 전환하고 모든 인터럽트를 비활성화합니다.
시퀀스 다이어그램: BswM 및 IoHwAb를 통한 MCAL 클러스터 내의 2단계 비동기 파워 상태 전환. 출처: AUTOSAR_CP_SWS_IOHardwareAbstraction 57쪽, [SWS_Adc_00478], [SWS_Pwm_00183], [SWS_Adc_00475], [SWS_Pwm_00166].
오류 처리, DET 추적 및 성능 저하
오류는 개발 오류와 프로덕션 오류로 엄격히 구분됩니다. 활성 개발 모니터링 시 드라이버는 초기화 완료 전 호출을 Default Error Tracer (DET)에 보고하며, 예를 들어 PWM_E_UNINIT([SWS_Pwm_00177], [SWS_Pwm_00104]) 또는 ADC_E_UNINIT([SWS_Adc_00476])을 통해 보고합니다. 포인터 파라미터는 NULL인지 확인되며, 이는 예를 들어 GetVersionInfo에서 ADC_E_PARAM_POINTER([SWS_Adc_00376]) 및 WDG_E_PARAM_POINTER([SWS_Wdg_00109])을 통해 이루어집니다.
런타임 오류는 허용되지 않는 작동 전환을 방지합니다: 채널이 IDLE 상태가 아니거나 아직 활성 알림이 있는 동안 Pwm_SetPowerState이 호출되면, 드라이버는 런타임 오류 PWM_E_NOT_DISENGAGED을 보고합니다([SWS_Pwm_00202]). Adc의 경우 큐잉이 없는 구성에서 사용 중인 채널 그룹을 새로 트리거하려고 시도하면 DET에 런타임 알림 ADC_E_BUSY가 발생합니다(SWS_ADCDriver 95쪽).
중대한 프로덕션 오류 및 주변 장치 장애는 Dem_SetEventStatus을 통해 Diagnostic Event Manager (DEM)에 보고됩니다([SWS_Wdg_00111]). 비상 운전 모드에서의 성능 저하(degradation)를 위해 Pwm_SetOutputToIdle는 개별 PWM 출력의 즉각적인 비활성화를 제공합니다([SWS_Pwm_91002]). 워치독 드라이버에서는 트리거 타임아웃을 값 0으로 설정하여 서비스의 즉각적인 중지를 허용하고 신속한 ECU 리셋을 강제합니다([SWS_Wdg_00155], [SWS_Wdg_00136], SWS_WatchdogDriver 29쪽).
이 가이드는 전적으로 AUTOSAR Classic R20-11 페이로드의 사양 및 추적성 아티팩트를 기반으로 합니다.
Module im Cluster
ADC Driver (Adc)
Provides initialization and conversion services for analog-to-digital converters.
Core Test (CorTst)
AUTOSAR Classic Microcontroller Drivers-Modul Core Test (CorTst, Spezifikation: AUTOSAR_CP_SWS_CoreTest.pdf, AUTOSAR_SWS_CoreTest.pdf).
DIO Driver (Dio)
AUTOSAR Classic I/O Drivers-Modul DIO Driver (Dio, Spezifikation: AUTOSAR_CP_SWS_DIODriver.pdf, AUTOSAR_SWS_DIODriver.pdf, AUTOSAR_SWS_DIO_Driver.pdf).
GPT Driver (Gpt)
AUTOSAR Classic Microcontroller Drivers-Modul GPT Driver (Gpt, Spezifikation: AUTOSAR_CP_SWS_GPTDriver.pdf, AUTOSAR_SWS_GPTDriver.pdf, AUTOSAR_SWS_GPT_Driver.pdf).
I2C Driver (I2c)
AUTOSAR Classic Communication Drivers-Modul I2C Driver (I2c, Spezifikation: AUTOSAR_CP_SWS_I2CDriver.pdf).
ICU Driver (Icu)
AUTOSAR Classic I/O Drivers-Modul ICU Driver (Icu, Spezifikation: AUTOSAR_CP_SWS_ICUDriver.pdf, AUTOSAR_SWS_ICUDriver.pdf, AUTOSAR_SWS_ICU_Driver.pdf).
I/O Hardware Abstraction (IoHwAb)
AUTOSAR Classic I/O HW Abstraction-Modul I/O Hardware Abstraction (IoHwAb, Spezifikation: AUTOSAR_CP_SWS_IOHardwareAbstraction.pdf, AUTOSAR_SWS_IOHardwareAbstraction.pdf, AUTOSAR_SWS_IO_HWAbstraction.pdf).
MCU Driver (Mcu)
AUTOSAR Classic Microcontroller Drivers-Modul MCU Driver (Mcu, Spezifikation: AUTOSAR_CP_SWS_MCUDriver.pdf, AUTOSAR_SWS_MCUDriver.pdf, AUTOSAR_SWS_MCU_Driver.pdf).
OCU Driver (Ocu)
AUTOSAR Classic I/O Drivers-Modul OCU Driver (Ocu, Spezifikation: AUTOSAR_CP_SWS_OCUDriver.pdf, AUTOSAR_SWS_OCUDriver.pdf).
Port Driver (Port)
AUTOSAR Classic I/O Drivers-Modul Port Driver (Port, Spezifikation: AUTOSAR_CP_SWS_PortDriver.pdf, AUTOSAR_SWS_PortDriver.pdf, AUTOSAR_SWS_Port_Driver.pdf).
PWM Driver (Pwm)
Generates pulse-width-modulated signals with configurable duty cycle and period.
SPI Handler Driver (Spi)
AUTOSAR Classic Communication Drivers-Modul SPI Handler Driver (Spi, Spezifikation: AUTOSAR_CP_SWS_SPIHandlerDriver.pdf, AUTOSAR_SWS_SPIHandlerDriver.pdf, AUTOSAR_SWS_SPI_HandlerDriver.pdf).
Watchdog Driver (Wdg)
Hardware watchdog timer servicing and mode configuration.
Watchdog Interface (WdgIf)
AUTOSAR Classic Onboard Device Abstraction-Modul Watchdog Interface (WdgIf, Spezifikation: AUTOSAR_CP_SWS_WatchdogInterface.pdf, AUTOSAR_SWS_WatchdogInterface.pdf).
추가 MCAL 모듈 (카탈로그)
Dio, Port und Spi gehören zum MCAL-Cluster, haben aber noch keine Modulseite (die festen 44 Modul-Records enthalten sie nicht). Die Tabellen sind die API-Kataloge aus den SWS-Definitionen von R23-11. Die Modulseiten selbst erzeugt die Modul-Registry; bis dahin steht der Katalog direkt auf dieser Seite.
DIO Driver (Dio)
| Service | Syntax | SWS |
|---|---|---|
Dio_ReadChannel | Dio_LevelType Dio_ReadChannel(Dio_ChannelType ChannelId); | SWS_Dio_00133 |
Dio_WriteChannel | void Dio_WriteChannel(Dio_ChannelType ChannelId, Dio_LevelType Level); | SWS_Dio_00134 |
Dio_ReadPort | Dio_PortLevelType Dio_ReadPort(Dio_PortType PortId); | SWS_Dio_00135 |
Dio_WritePort | void Dio_WritePort(Dio_PortType PortId, Dio_PortLevelType Level); | SWS_Dio_00136 |
Dio_ReadChannelGroup | Dio_PortLevelType Dio_ReadChannelGroup(const Dio_ChannelGroupType* ChannelGroupIdPtr); | SWS_Dio_00137 |
Dio_WriteChannelGroup | void Dio_WriteChannelGroup(const Dio_ChannelGroupType* ChannelGroupIdPtr, Dio_PortLevelType Level); | SWS_Dio_00138 |
Dio_GetVersionInfo | void Dio_GetVersionInfo(Std_VersionInfoType* VersionInfo); | SWS_Dio_00139 |
Dio_FlipChannel | Dio_LevelType Dio_FlipChannel(Dio_ChannelType ChannelId); | SWS_Dio_00190 |
Dio_MaskedWritePort | void Dio_MaskedWritePort(Dio_PortType PortId, Dio_PortLevelType Level, Dio_PortLevelType Mask); | SWS_Dio_00300 |
Port Driver (Port)
| Service | Syntax | SWS |
|---|---|---|
Port_Init | void Port_Init(const Port_ConfigType* ConfigPtr); | SWS_Port_00140 |
Port_SetPinDirection | void Port_SetPinDirection(Port_PinType Pin, Port_PinDirectionType Direction); | SWS_Port_00141 |
Port_RefreshPortDirection | void Port_RefreshPortDirection(void); | SWS_Port_00142 |
Port_GetVersionInfo | void Port_GetVersionInfo(Std_VersionInfoType* versioninfo); | SWS_Port_00143 |
Port_SetPinMode | void Port_SetPinMode(Port_PinType Pin, Port_PinModeType Mode); | SWS_Port_00145 |
SPI Handler/Driver (Spi)
| Service | Syntax | SWS |
|---|---|---|
Spi_Init | void Spi_Init(const Spi_ConfigType* ConfigPtr); | SWS_Spi_00175 |
Spi_DeInit | Std_ReturnType Spi_DeInit(void); | SWS_Spi_00176 |
Spi_WriteIB | Std_ReturnType Spi_WriteIB(Spi_ChannelType Channel, const Spi_DataBufferType* DataBufferPtr); | SWS_Spi_00177 |
Spi_AsyncTransmit | Std_ReturnType Spi_AsyncTransmit(Spi_SequenceType Sequence); | SWS_Spi_00178 |
Spi_ReadIB | Std_ReturnType Spi_ReadIB(Spi_ChannelType Channel, Spi_DataBufferType* DataBufferPointer); | SWS_Spi_00179 |
Spi_SetupEB | Std_ReturnType Spi_SetupEB(Spi_ChannelType Channel, const Spi_DataBufferType* SrcDataBufferPtr, Spi_DataBufferType* DesDataBufferPtr, Spi_NumberOfDataType Length); | SWS_Spi_00180 |
Spi_GetStatus | Spi_StatusType Spi_GetStatus(void); | SWS_Spi_00181 |
Spi_GetJobResult | Spi_JobResultType Spi_GetJobResult(Spi_JobType Job); | SWS_Spi_00182 |
Spi_GetSequenceResult | Spi_SeqResultType Spi_GetSequenceResult(Spi_SequenceType Sequence); | SWS_Spi_00183 |
Spi_GetVersionInfo | void Spi_GetVersionInfo(Std_VersionInfoType* versioninfo); | SWS_Spi_00184 |
Spi_SyncTransmit | Std_ReturnType Spi_SyncTransmit(Spi_SequenceType Sequence); | SWS_Spi_00185 |
Spi_GetHWUnitStatus | Spi_StatusType Spi_GetHWUnitStatus(Spi_HWUnitType HWUnit); | SWS_Spi_00186 |
Spi_Cancel | void Spi_Cancel(Spi_SequenceType Sequence); | SWS_Spi_00187 |
Spi_SetAsyncMode | Std_ReturnType Spi_SetAsyncMode(Spi_AsyncModeType Mode); | SWS_Spi_00188 |
Spi_MainFunction_Handling | void Spi_MainFunction_Handling(void); | SWS_Spi_00189 |
gemini-3.8-flash-low· 2026-10-13 · 독일어 원문