HFCC-01 Low-Level Software (LLSW) Rel_6802_HFCC-01-RP-CSAR-CB
Loading...
Searching...
No Matches
pwm.c File Reference

Pwm driver layer. More...

#include "pwm.h"
#include "interDrv.h"
#include "interStatus.h"
#include "utilHelper.h"
#include "mmapPwm.h"
Include dependency graph for pwm.c:
pwm.c Node1 pwm.c Node2 pwm.h Node1->Node2 Node5 interDrv.h Node1->Node5 Node6 interStatus.h Node1->Node6 Node7 utilHelper.h Node1->Node7 Node9 mmapPwm.h Node1->Node9 Node3 commonDataTypes.h Node2->Node3 Node4 driverStatus.h Node2->Node4 Node5->Node3 Node5->Node6 Node8 INTEGRITY.h Node7->Node8 Node9->Node3 Node9->Node4

Functions

static DriverStatus readPwmReg (const UInt32 baseAddress, const UInt32 offset, UInt32 *data)
 readPwmReg - pwm PCIe read function.
static DriverStatus writePwmReg (const UInt32 baseAddress, const UInt32 offset, const UInt32 data)
 writePwmReg - pwm PCIe write function.
DriverStatus pwm_getPbit (const PwmDevHandler pwmDevHdl, PwmPbitStatus *pbitStatus)
 pwm_getPbit.
DriverStatus pwm_getCbit (const PwmDevHandler pwmDevHdl, PwmCbitStatus *cbitStatus)
 pwm_getCbit.
DriverStatus pwm_getTemp (const PwmDevHandler pwmDevHdl, Float32 *temp)
 pwm_getTemp.
DriverStatus pwm_enable (const PwmDevHandler pwmDevHdl, const UInt8 pwmChannel)
 pwm_enable.
DriverStatus pwm_disable (const PwmDevHandler pwmDevHdl, const UInt8 pwmChannel)
 pwm_disable.
DriverStatus pwm_setFrequencyDutycycle (const PwmDevHandler pwmDevHdl, const UInt16 frequency, const UInt16 dutyCycle)
 pwm_setFrequencyDutycycle.

Detailed Description

Pwm driver layer.

Author
Ramza Anuar ramza.nosp@m..anu.nosp@m.ar@tu.nosp@m.sas..nosp@m.my

PWM device driver file

Function Documentation

◆ pwm_disable()

DriverStatus pwm_disable ( const PwmDevHandler pwmDevHdl,
const UInt8 pwmChannel )

pwm_disable.

Disable PWM channel.

Parameters
[in]pwmDevHdlThe pwm device handler.
[in]pwmChannelThe pwm channel.
Returns
DriverStatus - Driver status return code, If no error occurs during the operation of the function, it returns DRV_SUCCESS. Otherwise related error message is returned.
Return values
DRV_SUCCESS: Success.
DRV_WRITE_FAILED: Failed to write to the device.
DRV_READ_FAILED: Failed to read from the device.
DRV_INVALID_CHANNEL: The channel number is invalid.
DRV_OP_ALREADY_PERFORMED: The pwm channel is already disabled.

Low-Level Software Requirements (LLR)

Low-Level Requirement Specification: pwm_disable

Requirement ID Parent HLR ID Detailed Low-Level Requirement Statement (EARS Format) Software Unit Reference Verification Method Status
LLR_PWM_PWM_DISABLE_01 HLR_PWM_23291 WHEN pwmChannel is greater than PWM_CHANNEL_MAX, the pwm_disable() function SHALL abort processing and return DRV_INVALID_CHANNEL. pwm.c:pwm_disable() Test Closed
LLR_PWM_PWM_DISABLE_02 HLR_PWM_23291 WHEN a driver operation reports a failure status other than DRV_SUCCESS, the pwm_disable() function SHALL abort processing and return that driver failure status. pwm.c:pwm_disable() Test Closed
LLR_PWM_PWM_DISABLE_03 HLR_PWM_23291 WHEN READ_BIT(data, pwmChannel) == FALSE, the pwm_disable() function SHALL abort processing and return DRV_OP_ALREADY_PERFORMED. pwm.c:pwm_disable() Test Closed
LLR_PWM_PWM_DISABLE_04 HLR_PWM_23291 WHEN preconditions are satisfied, the pwm_disable() function SHALL read the device block members memory offset (PWM_BANK_CH_STATE) at physical offset 0x0078 (MMAP_PWM_BANK_CH_STATE) using readPwmReg(). pwm.c:pwm_disable() Test Closed
LLR_PWM_PWM_DISABLE_05 HLR_PWM_23291 WHEN preconditions are satisfied, the pwm_disable() function SHALL write the device block members memory offset (PWM_BANK_CH_STATE) at physical offset 0x0078 (MMAP_PWM_BANK_CH_STATE) using writePwmReg(). pwm.c:pwm_disable() Test Closed
LLR_PWM_PWM_DISABLE_06 HLR_PWM_23291 WHEN all operational processing completes successfully, the pwm_disable() function SHALL return DRV_SUCCESS. pwm.c:pwm_disable() Test Closed

Control Coupling Diagram (CCD)

ControlCouplingStructureChart Caller pwm_disable() [Low-Level Device Drivers] Target readPwmReg() [Low-Level Driver Helper] Caller:s->Target:n l_t0->l_b0   pwmDevHdl (Flag) l_t1->l_b1   pwmChannel (Flag) r_b0->r_t0   statusCode (DriverStatus)
Control Coupling Structure Chart

Data Coupling Diagram (DCD)

DataCouplingStructureChart Caller pwm_disable() [Low-Level Device Drivers] Target readPwmReg() [Low-Level Driver Helper] Caller:s->Target:n l_t0->l_b0   pwmDevHdl (Payload) l_t1->l_b1   pwmChannel (Payload) r_b0->r_t0   stateTelemetry (Internal State)
Data Coupling Structure Chart

Control Flow Diagram (CFD)

cfd_pwm_disable start Entry: pwm_disable() guard_1 LLR_01: Guard Check Is `pwmChannel` is greater than `PWM_CHANNEL_MAX`? start->guard_1 err_exit_1 LLR_01 Error Exit abort processing and return `DRV_INVALID_CHANNEL` guard_1->err_exit_1 YES (TRUE) guard_2 LLR_02: Guard Check Is a driver operation reports a failure status other than DRV_SUCCESS? guard_1->guard_2 err_exit_2 LLR_02 Error Exit abort processing and return `retStatus` guard_2->err_exit_2 YES (TRUE) guard_3 LLR_03: Guard Check Is READ_BIT(data, pwmChannel) == FALSE? guard_2->guard_3 err_exit_3 LLR_03 Error Exit abort processing and return `DRV_OP_ALREADY_PERFORMED` guard_3->err_exit_3 YES (TRUE) act_4 LLR_04: Action Step read the device block members memory offset (PWM_BANK_CH_STATE) at physical offset `0x0078` (`MMAP_PWM_BANK_CH_STATE`) using `readPwmReg()` guard_3->act_4 NO (FALSE) act_5 LLR_05: Action Step write the device block members memory offset (PWM_BANK_CH_STATE) at physical offset `0x0078` (`MMAP_PWM_BANK_CH_STATE`) using `writePwmReg()` act_4->act_5 success_exit LLR_06: Final Exit return `DRV_SUCCESS` act_5->success_exit
Control Flow Diagram

Data Flow Diagram (DFD)

dfd_pwm_disable in_store Input Data Sources & Parameters • pwmDevHdl (const PwmDevHandler) • pwmChannel (const UInt8) proc_1 LLR_01: Data Validation Check • Evaluate Parameter / State: pwmChannel in_store->proc_1 Validated Input Data proc_2 LLR_02: Data Validation Check • Evaluate Parameter / State: retStatus proc_1->proc_2 Validated Input Data proc_3 LLR_03: Data Validation Check • Evaluate Parameter / State: READ_BIT proc_2->proc_3 Validated Input Data proc_4 LLR_04: Data Payload Transformation • Process payload via readPwmReg() proc_3->proc_4 Data Payload (readPwmReg) proc_5 LLR_05: Data Payload Transformation • Process payload via writePwmReg() proc_4->proc_5 Data Payload (writePwmReg) proc_6 LLR_06: Status Output Packaging • Format Return Payload: DriverStatus proc_5->proc_6 Final Output Data out_sink Output Data Sinks & Status Return • Status Payload (DriverStatus) proc_6->out_sink Output Data & Status Code
Data Flow Diagram
Here is the call graph for this function:
pwm_disable Node1 pwm_disable Node1->Node1 Node2 readPwmReg Node1->Node2 Node6 writePwmReg Node1->Node6 Node2->Node2 Node3 interDrv_Read32 Node2->Node3 Node3->Node3 Node4 interDrv_isAddressValid Node3->Node4 Node5 memoryMap_Read32 Node3->Node5 Node4->Node4 Node5->Node5 Node6->Node6 Node7 interDrv_Write32 Node6->Node7 Node7->Node4 Node7->Node7 Node8 memoryMap_Write32 Node7->Node8 Node8->Node8
Here is the caller graph for this function:
pwm_disable Node1 pwm_disable Node1->Node1 Node2 modPwm_disable Node1->Node2 Node2->Node2 Node3 modPwm_initReset Node2->Node3 Node3->Node3 Node4 modConfig_init Node3->Node4 Node5 modConfig_reset Node3->Node5 Node4->Node4 Node5->Node5 Node6 modConfig_close Node5->Node6 Node6->Node6

◆ pwm_enable()

DriverStatus pwm_enable ( const PwmDevHandler pwmDevHdl,
const UInt8 pwmChannel )

pwm_enable.

Enable PWM channel.

Parameters
[in]pwmDevHdlThe pwm device handler.
[in]pwmChannelThe pwm channel.
Returns
DriverStatus - Driver status return code, If no error occurs during the operation of the function, it returns DRV_SUCCESS. Otherwise related error message is returned.
Return values
DRV_SUCCESS: Success.
DRV_WRITE_FAILED: Failed to write to the device.
DRV_READ_FAILED: Failed to read from the device.
DRV_INVALID_CHANNEL: The channel number is invalid.
DRV_OP_ALREADY_PERFORMED: The pwm channel is already enabled.

Low-Level Software Requirements (LLR)

Low-Level Requirement Specification: pwm_enable

Requirement ID Parent HLR ID Detailed Low-Level Requirement Statement (EARS Format) Software Unit Reference Verification Method Status
LLR_PWM_PWM_ENABLE_01 HLR_PWM_23291 WHEN pwmChannel is greater than PWM_CHANNEL_MAX, the pwm_enable() function SHALL abort processing and return DRV_INVALID_CHANNEL. pwm.c:pwm_enable() Test Closed
LLR_PWM_PWM_ENABLE_02 HLR_PWM_23291 WHEN a driver operation reports a failure status other than DRV_SUCCESS, the pwm_enable() function SHALL abort processing and return that driver failure status. pwm.c:pwm_enable() Test Closed
LLR_PWM_PWM_ENABLE_03 HLR_PWM_23291 WHEN READ_BIT(data, pwmChannel) == TRUE, the pwm_enable() function SHALL abort processing and return DRV_OP_ALREADY_PERFORMED. pwm.c:pwm_enable() Test Closed
LLR_PWM_PWM_ENABLE_04 HLR_PWM_23291 WHEN preconditions are satisfied, the pwm_enable() function SHALL read the device block members memory offset (PWM_BANK_CH_STATE) at physical offset 0x0078 (MMAP_PWM_BANK_CH_STATE) using readPwmReg(). pwm.c:pwm_enable() Test Closed
LLR_PWM_PWM_ENABLE_05 HLR_PWM_23291 WHEN preconditions are satisfied, the pwm_enable() function SHALL write the device block members memory offset (PWM_BANK_CH_STATE) at physical offset 0x0078 (MMAP_PWM_BANK_CH_STATE) using writePwmReg(). pwm.c:pwm_enable() Test Closed
LLR_PWM_PWM_ENABLE_06 HLR_PWM_23291 WHEN all operational processing completes successfully, the pwm_enable() function SHALL return DRV_SUCCESS. pwm.c:pwm_enable() Test Closed

Control Coupling Diagram (CCD)

ControlCouplingStructureChart Caller pwm_enable() [Low-Level Device Drivers] Target readPwmReg() [Low-Level Driver Helper] Caller:s->Target:n l_t0->l_b0   pwmDevHdl (Flag) l_t1->l_b1   pwmChannel (Flag) r_b0->r_t0   statusCode (DriverStatus)
Control Coupling Structure Chart

Data Coupling Diagram (DCD)

DataCouplingStructureChart Caller pwm_enable() [Low-Level Device Drivers] Target readPwmReg() [Low-Level Driver Helper] Caller:s->Target:n l_t0->l_b0   pwmDevHdl (Payload) l_t1->l_b1   pwmChannel (Payload) r_b0->r_t0   stateTelemetry (Internal State)
Data Coupling Structure Chart

Control Flow Diagram (CFD)

cfd_pwm_enable start Entry: pwm_enable() guard_1 LLR_01: Guard Check Is `pwmChannel` is greater than `PWM_CHANNEL_MAX`? start->guard_1 err_exit_1 LLR_01 Error Exit abort processing and return `DRV_INVALID_CHANNEL` guard_1->err_exit_1 YES (TRUE) guard_2 LLR_02: Guard Check Is a driver operation reports a failure status other than DRV_SUCCESS? guard_1->guard_2 err_exit_2 LLR_02 Error Exit abort processing and return `retStatus` guard_2->err_exit_2 YES (TRUE) guard_3 LLR_03: Guard Check Is READ_BIT(data, pwmChannel) == TRUE? guard_2->guard_3 err_exit_3 LLR_03 Error Exit abort processing and return `DRV_OP_ALREADY_PERFORMED` guard_3->err_exit_3 YES (TRUE) act_4 LLR_04: Action Step read the device block members memory offset (PWM_BANK_CH_STATE) at physical offset `0x0078` (`MMAP_PWM_BANK_CH_STATE`) using `readPwmReg()` guard_3->act_4 NO (FALSE) act_5 LLR_05: Action Step write the device block members memory offset (PWM_BANK_CH_STATE) at physical offset `0x0078` (`MMAP_PWM_BANK_CH_STATE`) using `writePwmReg()` act_4->act_5 success_exit LLR_06: Final Exit return `DRV_SUCCESS` act_5->success_exit
Control Flow Diagram

Data Flow Diagram (DFD)

dfd_pwm_enable in_store Input Data Sources & Parameters • pwmDevHdl (const PwmDevHandler) • pwmChannel (const UInt8) proc_1 LLR_01: Data Validation Check • Evaluate Parameter / State: pwmChannel in_store->proc_1 Validated Input Data proc_2 LLR_02: Data Validation Check • Evaluate Parameter / State: retStatus proc_1->proc_2 Validated Input Data proc_3 LLR_03: Data Validation Check • Evaluate Parameter / State: READ_BIT proc_2->proc_3 Validated Input Data proc_4 LLR_04: Data Payload Transformation • Process payload via readPwmReg() proc_3->proc_4 Data Payload (readPwmReg) proc_5 LLR_05: Data Payload Transformation • Process payload via writePwmReg() proc_4->proc_5 Data Payload (writePwmReg) proc_6 LLR_06: Status Output Packaging • Format Return Payload: DriverStatus proc_5->proc_6 Final Output Data out_sink Output Data Sinks & Status Return • Status Payload (DriverStatus) proc_6->out_sink Output Data & Status Code
Data Flow Diagram
Here is the call graph for this function:
pwm_enable Node1 pwm_enable Node1->Node1 Node2 readPwmReg Node1->Node2 Node6 writePwmReg Node1->Node6 Node2->Node2 Node3 interDrv_Read32 Node2->Node3 Node3->Node3 Node4 interDrv_isAddressValid Node3->Node4 Node5 memoryMap_Read32 Node3->Node5 Node4->Node4 Node5->Node5 Node6->Node6 Node7 interDrv_Write32 Node6->Node7 Node7->Node4 Node7->Node7 Node8 memoryMap_Write32 Node7->Node8 Node8->Node8
Here is the caller graph for this function:
pwm_enable Node1 pwm_enable Node1->Node1 Node2 modPwm_enable Node1->Node2 Node2->Node2

◆ pwm_getCbit()

DriverStatus pwm_getCbit ( const PwmDevHandler pwmDevHdl,
PwmCbitStatus * cbitStatus )

pwm_getCbit.

PWM get CBIT status.

Parameters
[in]pwmDevHdlThe pwm device handler.
[out]cbitStatusThe pointer of CBIT status value.
Returns
DriverStatus - Driver status return code, If no error occurs during the operation of the function, it returns DRV_SUCCESS. Otherwise related error message is returned.
Return values
DRV_SUCCESS: Success.
DRV_READ_FAILED: Failed to read from the device.
DRV_INVALID_PARAM: The provided address pointer is invalid.

Low-Level Software Requirements (LLR)

Low-Level Requirement Specification: pwm_getCbit

Requirement ID Parent HLR ID Detailed Low-Level Requirement Statement (EARS Format) Software Unit Reference Verification Method Status
LLR_PWM_PWM_GETCBIT_01 HLR_PWM_26203 WHEN the pointer cbitStatus is NULL (invalid), the pwm_getCbit() function SHALL abort processing and return DRV_INVALID_PARAM. pwm.c:pwm_getCbit() Test Closed
LLR_PWM_PWM_GETCBIT_02 HLR_PWM_26203 WHEN a driver operation reports a failure status other than DRV_SUCCESS, the pwm_getCbit() function SHALL abort processing and return that driver failure status. pwm.c:pwm_getCbit() Test Closed
LLR_PWM_PWM_GETCBIT_03 HLR_PWM_26203 WHEN querying PWM Channel Bank 1, the pwm_getCbit() function SHALL read the global CBIT execution status (MMAP_PWM_POS_CBIT_NOT_RUN) and 5.5V supply fault status (MMAP_PWM_POS_CBIT_F_5V5) from the bank status register. pwm.c:pwm_getCbit() Test Closed
LLR_PWM_PWM_GETCBIT_04 HLR_PWM_26203 FOR each PWM device bank, WHEN the soft-ground clutch state is not active (TRUE), the pwm_getCbit() function SHALL clear the under-load fault status (PWM_BIT_PASS) for that bank. pwm.c:pwm_getCbit() Test Closed
LLR_PWM_PWM_GETCBIT_05 HLR_PWM_26203 FOR each configured PWM device bank (0 through PWM_DEV_CH_MAX - 1), the pwm_getCbit() function SHALL calculate the register offset using MMAP_PWM_DEV_OFFSET and read the bank fault status (MMAP_PWM_BANK_STATUS_FAULT) via readPwmReg(). pwm.c:pwm_getCbit() Test Closed
LLR_PWM_PWM_GETCBIT_06 HLR_PWM_26203 WHEN preconditions are satisfied, the pwm_getCbit() function SHALL invoke bitwise routine READ_BIT() to extract target channel status bit from register payload. pwm.c:pwm_getCbit() Test Closed
LLR_PWM_PWM_GETCBIT_07 HLR_PWM_26203 WHEN all operational processing completes successfully, the pwm_getCbit() function SHALL return DRV_SUCCESS. pwm.c:pwm_getCbit() Test Closed

Control Coupling Diagram (CCD)

ControlCouplingStructureChart Caller pwm_getCbit() [Low-Level Device Drivers] Target readPwmReg() [Low-Level Driver Helper] Caller:s->Target:n l_t0->l_b0   pwmDevHdl (Flag) r_b0->r_t0   statusCode (DriverStatus)
Control Coupling Structure Chart

Data Coupling Diagram (DCD)

DataCouplingStructureChart Caller pwm_getCbit() [Low-Level Device Drivers] Target readPwmReg() [Low-Level Driver Helper] Caller:s->Target:n l_t0->l_b0   pwmDevHdl (Payload) r_b0->r_t0   *cbitStatus (Output Data)
Data Coupling Structure Chart

Control Flow Diagram (CFD)

cfd_pwm_getCbit start Entry: pwm_getCbit() guard_1 LLR_01: Guard Check Is the pointer `cbitStatus` is NULL (invalid)? start->guard_1 err_exit_1 LLR_01 Error Exit abort processing and return `DRV_INVALID_PARAM` guard_1->err_exit_1 YES (TRUE) guard_2 LLR_02: Guard Check Is a driver operation reports a failure status other than DRV_SUCCESS? guard_1->guard_2 err_exit_2 LLR_02 Error Exit abort processing and return `retStatus` guard_2->err_exit_2 YES (TRUE) guard_3 LLR_03: Guard Check Is `i` is equal to `0U`? guard_2->guard_3 err_exit_3 LLR_03 Error Exit execute conditional operational branch guard_3->err_exit_3 YES (TRUE) guard_4 LLR_04: Guard Check Is `bankSGClchState` is not equal to `TRUE`? guard_3->guard_4 err_exit_4 LLR_04 Error Exit execute conditional operational branch guard_4->err_exit_4 YES (TRUE) act_5 LLR_05: Action Step read the device block members memory offset (PWM_BANK_STATUS_FAULT) at physical offset `0x0050 + (MMAP_PWM_DEV_OFFSET * i)` (`MMAP_PWM_BANK_STATUS_FAULT`) using `readPwmReg()` guard_4->act_5 NO (FALSE) act_6 LLR_06: Action Step invoke bitwise routine `READ_BIT()` to extract target channel status bit from register payload act_5->act_6 success_exit LLR_07: Final Exit return `DRV_SUCCESS` act_6->success_exit
Control Flow Diagram

Data Flow Diagram (DFD)

dfd_pwm_getCbit in_store Input Data Sources & Parameters • pwmDevHdl (const PwmDevHandler) proc_1 LLR_01: Data Validation Check • Evaluate Parameter / State: cbitStatus in_store->proc_1 Validated Input Data proc_2 LLR_02: Data Validation Check • Evaluate Parameter / State: retStatus proc_1->proc_2 Validated Input Data proc_3 LLR_03: Data Validation Check • Evaluate Parameter / State: i proc_2->proc_3 Validated Input Data proc_4 LLR_04: Data Validation Check • Evaluate Parameter / State: bankSGClchState proc_3->proc_4 Validated Input Data proc_5 LLR_05: Data Payload Transformation • Process payload via readPwmReg() proc_4->proc_5 Data Payload (readPwmReg) proc_6 LLR_06: Data Payload Transformation • Process payload via READ_BIT() proc_5->proc_6 Data Payload (READ_BIT) proc_7 LLR_07: Status Output Packaging • Format Return Payload: DriverStatus proc_6->proc_7 Final Output Data out_sink Output Data Sinks & Status Return • cbitStatus (PwmCbitStatus) proc_7->out_sink Output Data & Status Code
Data Flow Diagram
Here is the call graph for this function:
pwm_getCbit Node1 pwm_getCbit Node1->Node1 Node2 readPwmReg Node1->Node2 Node2->Node2 Node3 interDrv_Read32 Node2->Node3 Node3->Node3 Node4 interDrv_isAddressValid Node3->Node4 Node5 memoryMap_Read32 Node3->Node5 Node4->Node4 Node5->Node5
Here is the caller graph for this function:
pwm_getCbit Node1 pwm_getCbit Node1->Node1 Node2 modHsb_getPwmCbit Node1->Node2 Node2->Node2

◆ pwm_getPbit()

DriverStatus pwm_getPbit ( const PwmDevHandler pwmDevHdl,
PwmPbitStatus * pbitStatus )

pwm_getPbit.

PWM get PBIT status.

Parameters
[in]pwmDevHdlThe pwm device handler.
[out]pbitStatusThe pointer of PBIT status value.
Returns
DriverStatus - Driver status return code, If no error occurs during the operation of the function, it returns DRV_SUCCESS. Otherwise related error message is returned.
Return values
DRV_SUCCESS: Success.
DRV_READ_FAILED: Failed to read from the device.
DRV_INVALID_PARAM: The provided address pointer is invalid.

Low-Level Software Requirements (LLR)

Low-Level Requirement Specification: pwm_getPbit

Requirement ID Parent HLR ID Detailed Low-Level Requirement Statement (EARS Format) Software Unit Reference Verification Method Status
LLR_PWM_PWM_GETPBIT_01 HLR_PWM_26200 WHEN the pointer pbitStatus is NULL (invalid), the pwm_getPbit() function SHALL abort processing and return DRV_INVALID_PARAM. pwm.c:pwm_getPbit() Test Closed
LLR_PWM_PWM_GETPBIT_02 HLR_PWM_26200 WHEN a driver operation reports a failure status other than DRV_SUCCESS, the pwm_getPbit() function SHALL abort processing and return that driver failure status. pwm.c:pwm_getPbit() Test Closed
LLR_PWM_PWM_GETPBIT_03 HLR_PWM_26200 WHEN querying PWM Channel Bank 1, the pwm_getPbit() function SHALL read the global PBIT incomplete status (MMAP_PWM_POS_PBIT_INCOMPLETED) and 5.5V supply fault status (MMAP_PWM_POS_PBIT_F_5V5) from the PBIT status register. pwm.c:pwm_getPbit() Test Closed
LLR_PWM_PWM_GETPBIT_04 HLR_PWM_26200 FOR each configured PWM device bank (0 through PWM_DEV_CH_MAX - 1), the pwm_getPbit() function SHALL calculate the register offset using MMAP_PWM_DEV_OFFSET and read the bank PBIT Status Register (MMAP_PWM_PBIT_STATUS) via readPwmReg(). pwm.c:pwm_getPbit() Test Closed
LLR_PWM_PWM_GETPBIT_05 HLR_PWM_26200 WHEN preconditions are satisfied, the pwm_getPbit() function SHALL invoke bitwise routine READ_BIT() to extract target channel status bit from register payload. pwm.c:pwm_getPbit() Test Closed
LLR_PWM_PWM_GETPBIT_06 HLR_PWM_26200 WHEN all operational processing completes successfully, the pwm_getPbit() function SHALL return DRV_SUCCESS. pwm.c:pwm_getPbit() Test Closed

Control Coupling Diagram (CCD)

ControlCouplingStructureChart Caller pwm_getPbit() [Low-Level Device Drivers] Target readPwmReg() [Low-Level Driver Helper] Caller:s->Target:n l_t0->l_b0   pwmDevHdl (Flag) r_b0->r_t0   statusCode (DriverStatus)
Control Coupling Structure Chart

Data Coupling Diagram (DCD)

DataCouplingStructureChart Caller pwm_getPbit() [Low-Level Device Drivers] Target readPwmReg() [Low-Level Driver Helper] Caller:s->Target:n l_t0->l_b0   pwmDevHdl (Payload) r_b0->r_t0   *pbitStatus (Output Data)
Data Coupling Structure Chart

Control Flow Diagram (CFD)

cfd_pwm_getPbit start Entry: pwm_getPbit() guard_1 LLR_01: Guard Check Is the pointer `pbitStatus` is NULL (invalid)? start->guard_1 err_exit_1 LLR_01 Error Exit abort processing and return `DRV_INVALID_PARAM` guard_1->err_exit_1 YES (TRUE) guard_2 LLR_02: Guard Check Is a driver operation reports a failure status other than DRV_SUCCESS? guard_1->guard_2 err_exit_2 LLR_02 Error Exit abort processing and return `retStatus` guard_2->err_exit_2 YES (TRUE) guard_3 LLR_03: Guard Check Is `i` is equal to `0U`? guard_2->guard_3 err_exit_3 LLR_03 Error Exit execute conditional operational branch guard_3->err_exit_3 YES (TRUE) act_4 LLR_04: Action Step read the PWM PBIT Status Register (PBIT_STATUS) at physical offset `0x0068 + (MMAP_PWM_DEV_OFFSET * i)` (`MMAP_PWM_PBIT_STATUS`) using `readPwmReg()` guard_3->act_4 NO (FALSE) act_5 LLR_05: Action Step invoke bitwise routine `READ_BIT()` to extract target channel status bit from register payload act_4->act_5 success_exit LLR_06: Final Exit return `DRV_SUCCESS` act_5->success_exit
Control Flow Diagram

Data Flow Diagram (DFD)

dfd_pwm_getPbit in_store Input Data Sources & Parameters • pwmDevHdl (const PwmDevHandler) proc_1 LLR_01: Data Validation Check • Evaluate Parameter / State: pbitStatus in_store->proc_1 Validated Input Data proc_2 LLR_02: Data Validation Check • Evaluate Parameter / State: retStatus proc_1->proc_2 Validated Input Data proc_3 LLR_03: Data Validation Check • Evaluate Parameter / State: i proc_2->proc_3 Validated Input Data proc_4 LLR_04: Data Payload Transformation • Process payload via readPwmReg() proc_3->proc_4 Data Payload (readPwmReg) proc_5 LLR_05: Data Payload Transformation • Process payload via READ_BIT() proc_4->proc_5 Data Payload (READ_BIT) proc_6 LLR_06: Status Output Packaging • Format Return Payload: DriverStatus proc_5->proc_6 Final Output Data out_sink Output Data Sinks & Status Return • pbitStatus (PwmPbitStatus) proc_6->out_sink Output Data & Status Code
Data Flow Diagram
Here is the call graph for this function:
pwm_getPbit Node1 pwm_getPbit Node1->Node1 Node2 readPwmReg Node1->Node2 Node2->Node2 Node3 interDrv_Read32 Node2->Node3 Node3->Node3 Node4 interDrv_isAddressValid Node3->Node4 Node5 memoryMap_Read32 Node3->Node5 Node4->Node4 Node5->Node5
Here is the caller graph for this function:
pwm_getPbit Node1 pwm_getPbit Node1->Node1 Node2 modHsb_getPwmPbit Node1->Node2 Node2->Node2

◆ pwm_getTemp()

DriverStatus pwm_getTemp ( const PwmDevHandler pwmDevHdl,
Float32 * temp )

pwm_getTemp.

PWM get temperature value in degree Celsius (C).

Parameters
[in]pwmDevHdlThe pwm device handler.
[out]tempThe pointer of temperature value in degree Celsius (C).
Returns
DriverStatus - Driver status return code, If no error occurs during the operation of the function, it returns DRV_SUCCESS. Otherwise related error message is returned.
Return values
DRV_SUCCESS: Success.
DRV_READ_FAILED: Failed to read from the device.
DRV_INVALID_PARAM: The provided address pointer is invalid.

Low-Level Software Requirements (LLR)

Low-Level Requirement Specification: pwm_getTemp

Requirement ID Parent HLR ID Detailed Low-Level Requirement Statement (EARS Format) Software Unit Reference Verification Method Status
LLR_PWM_PWM_GETTEMP_01 HLR_PWM_30821 WHEN the pointer temp is NULL (invalid), the pwm_getTemp() function SHALL abort processing and return DRV_INVALID_PARAM. pwm.c:pwm_getTemp() Test Closed
LLR_PWM_PWM_GETTEMP_02 HLR_PWM_30821 WHEN a driver operation reports a failure status other than DRV_SUCCESS, the pwm_getTemp() function SHALL abort processing and return that driver failure status. pwm.c:pwm_getTemp() Test Closed
LLR_PWM_PWM_GETTEMP_03 HLR_PWM_30821 WHEN preconditions are satisfied, the pwm_getTemp() function SHALL read the device block members memory offset (PWM_TEMP_RAW) at physical offset 0x0060 (MMAP_PWM_TEMP_RAW) using readPwmReg(). pwm.c:pwm_getTemp() Test Closed
LLR_PWM_PWM_GETTEMP_04 HLR_PWM_30821 WHEN all operational processing completes successfully, the pwm_getTemp() function SHALL return DRV_SUCCESS. pwm.c:pwm_getTemp() Test Closed

Control Coupling Diagram (CCD)

ControlCouplingStructureChart Caller pwm_getTemp() [Low-Level Device Drivers] Target readPwmReg() [Low-Level Driver Helper] Caller:s->Target:n l_t0->l_b0   pwmDevHdl (Flag) r_b0->r_t0   statusCode (DriverStatus)
Control Coupling Structure Chart

Data Coupling Diagram (DCD)

DataCouplingStructureChart Caller pwm_getTemp() [Low-Level Device Drivers] Target readPwmReg() [Low-Level Driver Helper] Caller:s->Target:n l_t0->l_b0   pwmDevHdl (Payload) r_b0->r_t0   *temp (Output Data)
Data Coupling Structure Chart

Control Flow Diagram (CFD)

cfd_pwm_getTemp start Entry: pwm_getTemp() guard_1 LLR_01: Guard Check Is the pointer `temp` is NULL (invalid)? start->guard_1 err_exit_1 LLR_01 Error Exit abort processing and return `DRV_INVALID_PARAM` guard_1->err_exit_1 YES (TRUE) guard_2 LLR_02: Guard Check Is a driver operation reports a failure status other than DRV_SUCCESS? guard_1->guard_2 err_exit_2 LLR_02 Error Exit abort processing and return `retStatus` guard_2->err_exit_2 YES (TRUE) act_3 LLR_03: Action Step read the device block members memory offset (PWM_TEMP_RAW) at physical offset `0x0060` (`MMAP_PWM_TEMP_RAW`) using `readPwmReg()` guard_2->act_3 NO (FALSE) success_exit LLR_04: Final Exit return `DRV_SUCCESS` act_3->success_exit
Control Flow Diagram

Data Flow Diagram (DFD)

dfd_pwm_getTemp in_store Input Data Sources & Parameters • pwmDevHdl (const PwmDevHandler) proc_1 LLR_01: Data Validation Check • Evaluate Parameter / State: temp in_store->proc_1 Validated Input Data proc_2 LLR_02: Data Validation Check • Evaluate Parameter / State: retStatus proc_1->proc_2 Validated Input Data proc_3 LLR_03: Data Payload Transformation • Process payload via readPwmReg() proc_2->proc_3 Data Payload (readPwmReg) proc_4 LLR_04: Status Output Packaging • Format Return Payload: DriverStatus proc_3->proc_4 Final Output Data out_sink Output Data Sinks & Status Return • temp (Float32) proc_4->out_sink Output Data & Status Code
Data Flow Diagram
Here is the call graph for this function:
pwm_getTemp Node1 pwm_getTemp Node1->Node1 Node2 readPwmReg Node1->Node2 Node2->Node2 Node3 interDrv_Read32 Node2->Node3 Node3->Node3 Node4 interDrv_isAddressValid Node3->Node4 Node5 memoryMap_Read32 Node3->Node5 Node4->Node4 Node5->Node5
Here is the caller graph for this function:
pwm_getTemp Node1 pwm_getTemp Node1->Node1 Node2 modHsb_getPwmCbit Node1->Node2 Node2->Node2

◆ pwm_setFrequencyDutycycle()

DriverStatus pwm_setFrequencyDutycycle ( const PwmDevHandler pwmDevHdl,
const UInt16 frequency,
const UInt16 dutyCycle )

pwm_setFrequencyDutycycle.

Set the PWM frequency and duty cycle.

Parameters
[in]pwmDevHdlThe pwm device handler.
[in]frequencyThe pwm frequency in Hz.
[in]dutyCycleThe pwm duty cycle in percentage (0% - 100%).
Returns
DriverStatus - Driver status return code, If no error occurs during the operation of the function, it returns DRV_SUCCESS. Otherwise related error message is returned.
Return values
DRV_SUCCESS: Success.
DRV_WRITE_FAILED: Failed to write to the device.
DRV_READ_FAILED: Failed to read from the device.
DRV_INVALID_VALUE: The pwm duty cycle value is out of range.
DRV_VALIDATE_FAILED: The pwm frequency or duty cycle value is not set correctly in memory map.

Low-Level Software Requirements (LLR)

Low-Level Requirement Specification: pwm_setFrequencyDutycycle

Requirement ID Parent HLR ID Detailed Low-Level Requirement Statement (EARS Format) Software Unit Reference Verification Method Status
LLR_PWM_PWM_SETFREQUENCYDUTYCYCLE_01 HLR_PWM_23289 WHEN dutyCycle is greater than PWM_DUTY_CYCLE_MAX, the pwm_setFrequencyDutycycle() function SHALL abort processing and return DRV_INVALID_VALUE. pwm.c:pwm_setFrequencyDutycycle() Test Closed
LLR_PWM_PWM_SETFREQUENCYDUTYCYCLE_02 HLR_PWM_23289 WHEN frequency is equal to 0, the pwm_setFrequencyDutycycle() function SHALL abort processing and return DRV_INVALID_VALUE. pwm.c:pwm_setFrequencyDutycycle() Test Closed
LLR_PWM_PWM_SETFREQUENCYDUTYCYCLE_03 HLR_PWM_23289 WHEN a driver operation reports a failure status other than DRV_SUCCESS, the pwm_setFrequencyDutycycle() function SHALL abort processing and return that driver failure status. pwm.c:pwm_setFrequencyDutycycle() Test Closed
LLR_PWM_PWM_SETFREQUENCYDUTYCYCLE_04 HLR_PWM_23289 WHEN period register readback verification fails (readback value does not match the configured period count), the pwm_setFrequencyDutycycle() function SHALL abort processing and return DRV_VALIDATE_FAILED. pwm.c:pwm_setFrequencyDutycycle() Test Closed
LLR_PWM_PWM_SETFREQUENCYDUTYCYCLE_05 HLR_PWM_23289 WHEN on-time register readback verification fails (readback value does not match the configured active on-time count), the pwm_setFrequencyDutycycle() function SHALL abort processing and return DRV_VALIDATE_FAILED. pwm.c:pwm_setFrequencyDutycycle() Test Closed
LLR_PWM_PWM_SETFREQUENCYDUTYCYCLE_06 HLR_PWM_23289 WHEN preconditions are satisfied, the pwm_setFrequencyDutycycle() function SHALL invoke frequency macro HZ_() to compute pulse period tick count. pwm.c:pwm_setFrequencyDutycycle() Test Closed
LLR_PWM_PWM_SETFREQUENCYDUTYCYCLE_07 HLR_PWM_23289 WHEN preconditions are satisfied, the pwm_setFrequencyDutycycle() function SHALL write the device block members memory offset (PWM_PWM_PERIOD) at physical offset 0x0008 (MMAP_PWM_PWM_PERIOD) using writePwmReg(). pwm.c:pwm_setFrequencyDutycycle() Test Closed
LLR_PWM_PWM_SETFREQUENCYDUTYCYCLE_08 HLR_PWM_23289 WHEN preconditions are satisfied, the pwm_setFrequencyDutycycle() function SHALL write the device block members memory offset (PWM_PWM_ON_TIME) at physical offset 0x000C (MMAP_PWM_PWM_ON_TIME) using writePwmReg(). pwm.c:pwm_setFrequencyDutycycle() Test Closed
LLR_PWM_PWM_SETFREQUENCYDUTYCYCLE_09 HLR_PWM_23289 WHEN all operational processing completes successfully, the pwm_setFrequencyDutycycle() function SHALL return DRV_SUCCESS. pwm.c:pwm_setFrequencyDutycycle() Test Closed

Control Coupling Diagram (CCD)

ControlCouplingStructureChart Caller pwm_setFrequencyDutycycle() [Low-Level Device Drivers] Target HZ_() [Low-Level Driver Helper] Caller:s->Target:n l_t0->l_b0   pwmDevHdl (Flag) l_t1->l_b1   frequency (Flag) l_t2->l_b2   dutyCycle (Flag) r_b0->r_t0   statusCode (DriverStatus)
Control Coupling Structure Chart

Data Coupling Diagram (DCD)

DataCouplingStructureChart Caller pwm_setFrequencyDutycycle() [Low-Level Device Drivers] Target HZ_() [Low-Level Driver Helper] Caller:s->Target:n l_t0->l_b0   pwmDevHdl (Payload) l_t1->l_b1   frequency (Payload) l_t2->l_b2   dutyCycle (Payload) r_b0->r_t0   stateTelemetry (Internal State)
Data Coupling Structure Chart

Control Flow Diagram (CFD)

cfd_pwm_setFrequencyDutycycle start Entry: pwm_setFrequencyDutycycle() guard_1 LLR_01: Guard Check Is `dutyCycle` is greater than `PWM_DUTY_CYCLE_MAX`? start->guard_1 err_exit_1 LLR_01 Error Exit abort processing and return `DRV_INVALID_VALUE` guard_1->err_exit_1 YES (TRUE) guard_2 LLR_02: Guard Check Is `frequency` is equal to `0`? guard_1->guard_2 err_exit_2 LLR_02 Error Exit abort processing and return `DRV_INVALID_VALUE` guard_2->err_exit_2 YES (TRUE) guard_3 LLR_03: Guard Check Is a driver operation reports a failure status other than DRV_SUCCESS? guard_2->guard_3 err_exit_3 LLR_03 Error Exit abort processing and return `retStatus` guard_3->err_exit_3 YES (TRUE) guard_4 LLR_04: Guard Check Is `periodLsbData` is not equal to `periodLsb`? guard_3->guard_4 err_exit_4 LLR_04 Error Exit abort processing and return `DRV_VALIDATE_FAILED` guard_4->err_exit_4 YES (TRUE) guard_5 LLR_05: Guard Check Is `onTimeData` is not equal to `onTime`? guard_4->guard_5 err_exit_5 LLR_05 Error Exit abort processing and return `DRV_VALIDATE_FAILED` guard_5->err_exit_5 YES (TRUE) act_6 LLR_06: Action Step invoke frequency macro `HZ_()` to compute pulse period tick count guard_5->act_6 NO (FALSE) act_7 LLR_07: Action Step write the device block members memory offset (PWM_PWM_PERIOD) at physical offset `0x0008` (`MMAP_PWM_PWM_PERIOD`) using `writePwmReg()` act_6->act_7 act_8 LLR_08: Action Step write the device block members memory offset (PWM_PWM_ON_TIME) at physical offset `0x000C` (`MMAP_PWM_PWM_ON_TIME`) using `writePwmReg()` act_7->act_8 success_exit LLR_09: Final Exit return `DRV_SUCCESS` act_8->success_exit
Control Flow Diagram

Data Flow Diagram (DFD)

dfd_pwm_setFrequencyDutycycle in_store Input Data Sources & Parameters • pwmDevHdl (const PwmDevHandler) • frequency (const UInt16) • dutyCycle (const UInt16) proc_1 LLR_01: Data Validation Check • Evaluate Parameter / State: dutyCycle in_store->proc_1 Validated Input Data proc_2 LLR_02: Data Validation Check • Evaluate Parameter / State: frequency proc_1->proc_2 Validated Input Data proc_3 LLR_03: Data Validation Check • Evaluate Parameter / State: retStatus proc_2->proc_3 Validated Input Data proc_4 LLR_04: Data Validation Check • Evaluate Parameter / State: periodLsbData proc_3->proc_4 Validated Input Data proc_5 LLR_05: Data Validation Check • Evaluate Parameter / State: onTimeData proc_4->proc_5 Validated Input Data proc_6 LLR_06: Data Payload Transformation • Process payload via HZ_() proc_5->proc_6 Data Payload (HZ_) proc_7 LLR_07: Data Payload Transformation • Process payload via writePwmReg() proc_6->proc_7 Data Payload (writePwmReg) proc_8 LLR_08: Data Payload Transformation • Process payload via writePwmReg() proc_7->proc_8 Data Payload (writePwmReg) proc_9 LLR_09: Status Output Packaging • Format Return Payload: DriverStatus proc_8->proc_9 Final Output Data out_sink Output Data Sinks & Status Return • Status Payload (DriverStatus) proc_9->out_sink Output Data & Status Code
Data Flow Diagram
Here is the call graph for this function:
pwm_setFrequencyDutycycle Node1 pwm_setFrequencyDutycycle Node1->Node1 Node2 readPwmReg Node1->Node2 Node6 writePwmReg Node1->Node6 Node2->Node2 Node3 interDrv_Read32 Node2->Node3 Node3->Node3 Node4 interDrv_isAddressValid Node3->Node4 Node5 memoryMap_Read32 Node3->Node5 Node4->Node4 Node5->Node5 Node6->Node6 Node7 interDrv_Write32 Node6->Node7 Node7->Node4 Node7->Node7 Node8 memoryMap_Write32 Node7->Node8 Node8->Node8
Here is the caller graph for this function:
pwm_setFrequencyDutycycle Node1 pwm_setFrequencyDutycycle Node1->Node1 Node2 modPwm_setFrequencyDutycycle Node1->Node2 Node2->Node2

◆ readPwmReg()

DriverStatus readPwmReg ( const UInt32 baseAddress,
const UInt32 offset,
UInt32 * data )
static

readPwmReg - pwm PCIe read function.

To read function for PCIe PWM.

Parameters
[in]baseAddressThe base address of the module and device.
[in]offsetThe offset address from module base address.
[out]data32bit data to read from PCIe.
Returns
DriverStatus - Driver status return code, If no error occurs during the operation of the function, it returns DRV_SUCCESS. Otherwise related error message is returned.
Return values
DRV_SUCCESS: Success.
DRV_READ_FAILED: PCIe failed to read value.
DRV_INVALID_PARAM: The provided address pointer is invalid.

Low-Level Software Requirements (LLR)

Low-Level Requirement Specification: readPwmReg

Requirement ID Parent HLR ID Detailed Low-Level Requirement Statement (EARS Format) Software Unit Reference Verification Method Status
LLR_PWM_READPWMREG_01 HLR_PWM_23289 WHEN the pointer data is NULL (invalid), the readPwmReg() function SHALL abort processing and return DRV_INVALID_PARAM. pwm.c:readPwmReg() Test Closed
LLR_PWM_READPWMREG_02 HLR_PWM_23289 WHEN the pointer data is valid, the readPwmReg() function SHALL read a 32-bit register value from physical memory address (baseAddress + addrOffset) into *data using PCIe primitive interDrv_Read32(). pwm.c:readPwmReg() Test Closed
LLR_PWM_READPWMREG_03 HLR_PWM_23289 WHEN memory access via interDrv_Read32() fails (status not equal to INTF_SUCCESS), the readPwmReg() function SHALL abort processing and return DRV_READ_FAILED. pwm.c:readPwmReg() Test Closed
LLR_PWM_READPWMREG_04 HLR_PWM_23289 WHEN all operational processing completes successfully, the readPwmReg() function SHALL return DRV_SUCCESS. pwm.c:readPwmReg() Test Closed

Control Coupling Diagram (CCD)

ControlCouplingStructureChart Caller readPwmReg() [Low-Level Device Drivers] Target interDrv_Read32() [Low-Level Driver Helper] Caller:s->Target:n l_t0->l_b0   baseAddress (Flag) l_t1->l_b1   offset (Flag) r_b0->r_t0   statusCode (DriverStatus)
Control Coupling Structure Chart

Data Coupling Diagram (DCD)

DataCouplingStructureChart Caller readPwmReg() [Low-Level Device Drivers] Target interDrv_Read32() [Low-Level Driver Helper] Caller:s->Target:n l_t0->l_b0   baseAddress (Payload) l_t1->l_b1   offset (Payload) r_b0->r_t0   *data (Output Data)
Data Coupling Structure Chart

Control Flow Diagram (CFD)

cfd_readPwmReg start Entry: readPwmReg() guard_1 LLR_01: Guard Check Is the pointer `data` is NULL (invalid)? start->guard_1 err_exit_1 LLR_01 Error Exit abort processing and return `DRV_INVALID_PARAM` guard_1->err_exit_1 YES (TRUE) guard_2 LLR_02: Guard Check Is `intStatus` is not equal to `INTF_SUCCESS`? guard_1->guard_2 err_exit_2 LLR_02 Error Exit abort processing and return `DRV_READ_FAILED` guard_2->err_exit_2 YES (TRUE) act_3 LLR_03: Action Step invoke PCIe primitive `interDrv_Read32()` to read 32-bit word from physical memory address `baseAddress + addrOffset` into `*data` guard_2->act_3 NO (FALSE) success_exit LLR_04: Final Exit return `DRV_SUCCESS` act_3->success_exit
Control Flow Diagram

Data Flow Diagram (DFD)

dfd_readPwmReg in_store Input Data Sources & Parameters • baseAddress (const UInt32) • offset (const UInt32) proc_1 LLR_01: Data Validation Check • Evaluate Parameter / State: data in_store->proc_1 Validated Input Data proc_2 LLR_02: Data Validation Check • Evaluate Parameter / State: intStatus proc_1->proc_2 Validated Input Data proc_3 LLR_03: Data Payload Transformation • Process payload via interDrv_Read32() proc_2->proc_3 Data Payload (interDrv_Read32) proc_4 LLR_04: Status Output Packaging • Format Return Payload: DriverStatus proc_3->proc_4 Final Output Data out_sink Output Data Sinks & Status Return • data (UInt32) proc_4->out_sink Output Data & Status Code
Data Flow Diagram
Here is the call graph for this function:
readPwmReg Node1 readPwmReg Node1->Node1 Node2 interDrv_Read32 Node1->Node2 Node2->Node2 Node3 interDrv_isAddressValid Node2->Node3 Node4 memoryMap_Read32 Node2->Node4 Node3->Node3 Node4->Node4
Here is the caller graph for this function:
readPwmReg Node1 readPwmReg Node1->Node1 Node2 pwm_disable Node1->Node2 Node8 pwm_enable Node1->Node8 Node10 pwm_getCbit Node1->Node10 Node12 pwm_getPbit Node1->Node12 Node14 pwm_getTemp Node1->Node14 Node15 pwm_setFrequencyDutycycle Node1->Node15 Node2->Node2 Node3 modPwm_disable Node2->Node3 Node3->Node3 Node4 modPwm_initReset Node3->Node4 Node4->Node4 Node5 modConfig_init Node4->Node5 Node6 modConfig_reset Node4->Node6 Node5->Node5 Node6->Node6 Node7 modConfig_close Node6->Node7 Node7->Node7 Node8->Node8 Node9 modPwm_enable Node8->Node9 Node9->Node9 Node10->Node10 Node11 modHsb_getPwmCbit Node10->Node11 Node11->Node11 Node12->Node12 Node13 modHsb_getPwmPbit Node12->Node13 Node13->Node13 Node14->Node11 Node14->Node14 Node15->Node15 Node16 modPwm_setFrequencyDutycycle Node15->Node16 Node16->Node16

◆ writePwmReg()

DriverStatus writePwmReg ( const UInt32 baseAddress,
const UInt32 offset,
const UInt32 data )
static

writePwmReg - pwm PCIe write function.

To write function for PCIe PWM.

Parameters
[in]baseAddressThe base address of the module and device.
[in]offsetThe offset address from module base address.
[in]data32bit data to write to PCIe.
Returns
DriverStatus - Driver status return code, If no error occurs during the operation of the function, it returns DRV_SUCCESS. Otherwise related error message is returned.
Return values
DRV_SUCCESS: Success.
DRV_WRITE_FAILED: PCIe failed to write value.

Low-Level Software Requirements (LLR)

Low-Level Requirement Specification: writePwmReg

Requirement ID Parent HLR ID Detailed Low-Level Requirement Statement (EARS Format) Software Unit Reference Verification Method Status
LLR_PWM_WRITEPWMREG_01 HLR_PWM_23289 WHEN invoked, the writePwmReg() function SHALL write the 32-bit word data to physical memory address (baseAddress + addrOffset) using PCIe primitive interDrv_Write32(). pwm.c:writePwmReg() Test Closed
LLR_PWM_WRITEPWMREG_02 HLR_PWM_23289 WHEN memory access via interDrv_Write32() fails (status not equal to INTF_SUCCESS), the writePwmReg() function SHALL abort processing and return DRV_WRITE_FAILED. pwm.c:writePwmReg() Test Closed
LLR_PWM_WRITEPWMREG_03 HLR_PWM_23289 WHEN all operational processing completes successfully, the writePwmReg() function SHALL return DRV_SUCCESS. pwm.c:writePwmReg() Test Closed

Control Coupling Diagram (CCD)

ControlCouplingStructureChart Caller writePwmReg() [Low-Level Device Drivers] Target interDrv_Write32() [Low-Level Driver Helper] Caller:s->Target:n l_t0->l_b0   baseAddress (Flag) l_t1->l_b1   offset (Flag) l_t2->l_b2   data (Flag) r_b0->r_t0   statusCode (DriverStatus)
Control Coupling Structure Chart

Data Coupling Diagram (DCD)

DataCouplingStructureChart Caller writePwmReg() [Low-Level Device Drivers] Target interDrv_Write32() [Low-Level Driver Helper] Caller:s->Target:n l_t0->l_b0   baseAddress (Payload) l_t1->l_b1   offset (Payload) l_t2->l_b2   data (Payload) r_b0->r_t0   stateTelemetry (Internal State)
Data Coupling Structure Chart

Control Flow Diagram (CFD)

cfd_writePwmReg start Entry: writePwmReg() guard_1 LLR_01: Guard Check Is `intStatus` is not equal to `INTF_SUCCESS`? start->guard_1 err_exit_1 LLR_01 Error Exit abort processing and return `DRV_WRITE_FAILED` guard_1->err_exit_1 YES (TRUE) act_2 LLR_02: Action Step invoke PCIe primitive `interDrv_Write32()` to write 32-bit word `data` to physical memory address `baseAddress + addrOffset` guard_1->act_2 NO (FALSE) success_exit LLR_03: Final Exit invoke PCIe primitive `interDrv_Write32()` to write 32-bit word `data` to physical memory address `baseAddress + addrOffset` act_2->success_exit
Control Flow Diagram

Data Flow Diagram (DFD)

dfd_writePwmReg in_store Input Data Sources & Parameters • baseAddress (const UInt32) • offset (const UInt32) • data (const UInt32) proc_1 LLR_01: Data Validation Check • Evaluate Parameter / State: intStatus in_store->proc_1 Validated Input Data proc_2 LLR_02: Data Payload Transformation • Process payload via interDrv_Write32() proc_1->proc_2 Data Payload (interDrv_Write32) proc_3 LLR_03: Status Output Packaging • Format Return Payload: DriverStatus proc_2->proc_3 Final Output Data out_sink Output Data Sinks & Status Return • Status Payload (DriverStatus) proc_3->out_sink Output Data & Status Code
Data Flow Diagram
Here is the call graph for this function:
writePwmReg Node1 writePwmReg Node1->Node1 Node2 interDrv_Write32 Node1->Node2 Node2->Node2 Node3 interDrv_isAddressValid Node2->Node3 Node4 memoryMap_Write32 Node2->Node4 Node3->Node3 Node4->Node4
Here is the caller graph for this function:
writePwmReg Node1 writePwmReg Node1->Node1 Node2 pwm_disable Node1->Node2 Node8 pwm_enable Node1->Node8 Node10 pwm_setFrequencyDutycycle Node1->Node10 Node2->Node2 Node3 modPwm_disable Node2->Node3 Node3->Node3 Node4 modPwm_initReset Node3->Node4 Node4->Node4 Node5 modConfig_init Node4->Node5 Node6 modConfig_reset Node4->Node6 Node5->Node5 Node6->Node6 Node7 modConfig_close Node6->Node7 Node7->Node7 Node8->Node8 Node9 modPwm_enable Node8->Node9 Node9->Node9 Node10->Node10 Node11 modPwm_setFrequencyDutycycle Node10->Node11 Node11->Node11