HFCC-01 Low-Level Software (LLSW) Rel_6802_HFCC-01-RP-CSAR-CB
Loading...
Searching...
No Matches
analogIn.c File Reference
#include "analogIn.h"
#include "utilHelper.h"
#include "interDrv.h"
#include "interStatus.h"
#include "mmapAnalogIn.h"
Include dependency graph for analogIn.c:
analogIn.c Node1 analogIn.c Node2 analogIn.h Node1->Node2 Node5 utilHelper.h Node1->Node5 Node7 interDrv.h Node1->Node7 Node8 interStatus.h Node1->Node8 Node9 mmapAnalogIn.h Node1->Node9 Node3 commonDataTypes.h Node2->Node3 Node4 driverStatus.h Node2->Node4 Node6 INTEGRITY.h Node5->Node6 Node7->Node3 Node7->Node8

Macros

#define AIN_VOLTAGE_LSB   (0.003F)
#define AIN_CH_ENABLE_STATE   (1U)

Functions

static DriverStatus readAnInReg (const UInt32 baseAddress, const UInt32 offset, UInt32 *data)
 readAnInReg - analogIn PCIe read function.
static DriverStatus writeAnInReg (const UInt32 baseAddress, const UInt32 offset, const UInt32 data)
 writeAnInReg - analogIn PCIe write function.
DriverStatus analogIn_getPbit (const AnalogInDevHandler analogInDevHdl, AnalogInPbitStatus *pbitStatus)
 analogIn_getPbit.
DriverStatus analogIn_getCbit (const AnalogInDevHandler analogInDevHdl, AnalogInCbitStatus *cbitStatus)
 analogIn_getCbit.
DriverStatus analogIn_getTemp (const AnalogInDevHandler analogInDevHdl, Float32 *temp5v, Float32 *temp10v)
 analogIn_getTemp.
DriverStatus analogIn_enableDisableCh (const AnalogInDevHandler analogInDevHdl, const UInt8 chNum, const Bool flag)
 analogIn_enableDisableCh.
DriverStatus analogIn_getInputRange (const AnalogInDevHandler analogInDevHdl, const UInt8 bank, UInt32 *range)
 analogIn_getInputRange.
DriverStatus analogIn_getAdcReading (const AnalogInDevHandler analogInDevHdl, const UInt8 chNum, Float32 *adcValue)
 analogIn_getAdcReading.
DriverStatus analogIn_getChannelStatus (const AnalogInDevHandler analogInDevHdl, const UInt8 chNum, Bool *status)
 analogIn_getChannelStatus.

Detailed Description

Macro Definition Documentation

◆ AIN_CH_ENABLE_STATE

#define AIN_CH_ENABLE_STATE   (1U)

◆ AIN_VOLTAGE_LSB

#define AIN_VOLTAGE_LSB   (0.003F)

Function Documentation

◆ analogIn_enableDisableCh()

DriverStatus analogIn_enableDisableCh ( const AnalogInDevHandler analogInDevHdl,
const UInt8 chNum,
const Bool flag )

analogIn_enableDisableCh.

Parameters
[in]analogInDevHdlThe device handler.
[in]chNumThe device channel number.
[out]flagThe flag to enable or disable 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 or module.
DRV_READ_FAILED: Failed to read from the device or module.

Low-Level Software Requirements (LLR)

Low-Level Requirement Specification: analogIn_enableDisableCh

Requirement ID Parent HLR ID Detailed Low-Level Requirement Statement (EARS Format) Software Unit Reference Verification Method Status
LLR_ANALOGIN_ANALOGIN_ENABLEDISABLECH_01 HLR_AIN_30827 WHEN invoked, the analogIn_enableDisableCh() function SHALL read the current ADC channel enable status from register MMAP_ADC_CH_STATE using readAnInReg(). analogIn.c:analogIn_enableDisableCh() Test Closed
LLR_ANALOGIN_ANALOGIN_ENABLEDISABLECH_02 HLR_AIN_30827 WHEN the register read operation fails (status not equal to DRV_SUCCESS), the analogIn_enableDisableCh() function SHALL abort processing and return that failure status. analogIn.c:analogIn_enableDisableCh() Test Closed
LLR_ANALOGIN_ANALOGIN_ENABLEDISABLECH_03 HLR_AIN_30827 WHEN flag is TRUE, the analogIn_enableDisableCh() function SHALL enable channel chNum by setting bit chNum in the ADC channel state register value. analogIn.c:analogIn_enableDisableCh() Test Closed
LLR_ANALOGIN_ANALOGIN_ENABLEDISABLECH_04 HLR_AIN_30827 WHEN flag is FALSE, the analogIn_enableDisableCh() function SHALL disable channel chNum by clearing bit chNum in the ADC channel state register value. analogIn.c:analogIn_enableDisableCh() Test Closed
LLR_ANALOGIN_ANALOGIN_ENABLEDISABLECH_05 HLR_AIN_30827 WHEN the ADC channel enable bitmask is updated, the analogIn_enableDisableCh() function SHALL write the new mask to register MMAP_ADC_CH_ENABLE using writeAnInReg(). analogIn.c:analogIn_enableDisableCh() Test Closed
LLR_ANALOGIN_ANALOGIN_ENABLEDISABLECH_06 HLR_AIN_30827 WHEN all operational processing completes successfully, the analogIn_enableDisableCh() function SHALL return DRV_SUCCESS. analogIn.c:analogIn_enableDisableCh() Test Closed

Control Coupling Diagram (CCD)

ControlCouplingStructureChart Caller analogIn_enableDisableCh() [Low-Level Device Drivers] Target readAnInReg() [Low-Level Driver Helper] Caller:s->Target:n l_t0->l_b0   analogInDevHdl (Flag) l_t1->l_b1   chNum (Flag) l_t2->l_b2   flag (Flag) r_b0->r_t0   statusCode (DriverStatus)
Control Coupling Structure Chart

Data Coupling Diagram (DCD)

DataCouplingStructureChart Caller analogIn_enableDisableCh() [Low-Level Device Drivers] Target readAnInReg() [Low-Level Driver Helper] Caller:s->Target:n l_t0->l_b0   analogInDevHdl (Payload) l_t1->l_b1   chNum (Payload) l_t2->l_b2   flag (Payload) r_b0->r_t0   stateTelemetry (Internal State)
Data Coupling Structure Chart

Control Flow Diagram (CFD)

cfd_analogIn_enableDisableCh start Entry: analogIn_enableDisableCh() guard_1 LLR_01: Guard Check Is a driver operation reports a failure status other than DRV_SUCCESS? start->guard_1 err_exit_1 LLR_01 Error Exit abort processing and return `retStatus` guard_1->err_exit_1 YES (TRUE) guard_2 LLR_02: Guard Check Is `flag` is equal to `TRUE`? guard_1->guard_2 err_exit_2 LLR_02 Error Exit execute conditional operational branch guard_2->err_exit_2 YES (TRUE) act_3 LLR_03: Action Step read the memory map offset list (ADC_CH_STATE) at physical offset `0x0100` (`MMAP_ADC_CH_STATE`) using `readAnInReg()` guard_2->act_3 NO (FALSE) act_4 LLR_04: Action Step write the memory map offset list (ADC_CH_ENABLE) at physical offset `0x000C` (`MMAP_ADC_CH_ENABLE`) using `writeAnInReg()` act_3->act_4 success_exit LLR_05: Final Exit return `DRV_SUCCESS` act_4->success_exit
Control Flow Diagram

Data Flow Diagram (DFD)

dfd_analogIn_enableDisableCh in_store Input Data Sources & Parameters • analogInDevHdl (const AnalogInDevHandler) • chNum (const UInt8) • flag (const Bool) proc_1 LLR_01: Data Validation Check • Evaluate Parameter / State: retStatus in_store->proc_1 Validated Input Data proc_2 LLR_02: Data Validation Check • Evaluate Parameter / State: flag proc_1->proc_2 Validated Input Data proc_3 LLR_03: Data Payload Transformation • Process payload via readAnInReg() proc_2->proc_3 Data Payload (readAnInReg) proc_4 LLR_04: Data Payload Transformation • Process payload via writeAnInReg() proc_3->proc_4 Data Payload (writeAnInReg) proc_5 LLR_05: Status Output Packaging • Format Return Payload: DriverStatus proc_4->proc_5 Final Output Data out_sink Output Data Sinks & Status Return • Status Payload (DriverStatus) proc_5->out_sink Output Data & Status Code
Data Flow Diagram
Here is the call graph for this function:
analogIn_enableDisableCh Node1 analogIn_enableDisableCh Node1->Node1 Node2 readAnInReg Node1->Node2 Node6 writeAnInReg 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:
analogIn_enableDisableCh Node1 analogIn_enableDisableCh Node1->Node1 Node2 modAnalogIn_disableRead Node1->Node2 Node7 modAnalogIn_enableRead Node1->Node7 Node2->Node2 Node3 modAnalogIn_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 Node7->Node7

◆ analogIn_getAdcReading()

DriverStatus analogIn_getAdcReading ( const AnalogInDevHandler analogInDevHdl,
const UInt8 chNum,
Float32 * adcValue )

analogIn_getAdcReading.

Parameters
[in]analogInDevHdlThe analog input device handler.
[in]chNumThe device channel number.
[out]adcValueThe adc reading 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 or module.
DRV_INVALID_PARAM: The provided address pointer is invalid.

Low-Level Software Requirements (LLR)

Low-Level Requirement Specification: analogIn_getAdcReading

Requirement ID Parent HLR ID Detailed Low-Level Requirement Statement (EARS Format) Software Unit Reference Verification Method Status
LLR_ANALOGIN_ANALOGIN_GETADCREADING_01 HLR_AIN_21627 WHEN the pointer adcValue is NULL (invalid), the analogIn_getAdcReading() function SHALL abort processing and return DRV_INVALID_PARAM. analogIn.c:analogIn_getAdcReading() Test Closed
LLR_ANALOGIN_ANALOGIN_GETADCREADING_02 HLR_AIN_21627 WHEN a driver operation reports a failure status other than DRV_SUCCESS, the analogIn_getAdcReading() function SHALL abort processing and return that driver failure status. analogIn.c:analogIn_getAdcReading() Test Closed
LLR_ANALOGIN_ANALOGIN_GETADCREADING_03 HLR_AIN_21627 WHEN preconditions are satisfied, the analogIn_getAdcReading() function SHALL read the memory map offset list (ADC_RD_BASE_ADDR) at physical offset (0x0200 + (chNum * MMAP_ADC_CH_OFFSET_GAP)) (MMAP_ADC_RD_BASE_ADDR) using readAnInReg(). analogIn.c:analogIn_getAdcReading() Test Closed
LLR_ANALOGIN_ANALOGIN_GETADCREADING_04 HLR_AIN_21627 WHEN all operational processing completes successfully, the analogIn_getAdcReading() function SHALL return DRV_SUCCESS. analogIn.c:analogIn_getAdcReading() Test Closed

Control Coupling Diagram (CCD)

ControlCouplingStructureChart Caller analogIn_getAdcReading() [Low-Level Device Drivers] Target readAnInReg() [Low-Level Driver Helper] Caller:s->Target:n l_t0->l_b0   analogInDevHdl (Flag) l_t1->l_b1   chNum (Flag) r_b0->r_t0   statusCode (DriverStatus)
Control Coupling Structure Chart

Data Coupling Diagram (DCD)

DataCouplingStructureChart Caller analogIn_getAdcReading() [Low-Level Device Drivers] Target readAnInReg() [Low-Level Driver Helper] Caller:s->Target:n l_t0->l_b0   analogInDevHdl (Payload) l_t1->l_b1   chNum (Payload) r_b0->r_t0   *adcValue (Output Data)
Data Coupling Structure Chart

Control Flow Diagram (CFD)

cfd_analogIn_getAdcReading start Entry: analogIn_getAdcReading() guard_1 LLR_01: Guard Check Is the pointer `adcValue` 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 memory map offset list (ADC_RD_BASE_ADDR) at physical offset `(0x0200 + (chNum * MMAP_ADC_CH_OFFSET_GAP))` (`MMAP_ADC_RD_BASE_ADDR`) using `readAnInReg()` 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_analogIn_getAdcReading in_store Input Data Sources & Parameters • analogInDevHdl (const AnalogInDevHandler) • chNum (const UInt8) proc_1 LLR_01: Data Validation Check • Evaluate Parameter / State: adcValue 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 readAnInReg() proc_2->proc_3 Data Payload (readAnInReg) 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 • adcValue (Float32) proc_4->out_sink Output Data & Status Code
Data Flow Diagram
Here is the call graph for this function:
analogIn_getAdcReading Node1 analogIn_getAdcReading Node1->Node1 Node2 readAnInReg 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:
analogIn_getAdcReading Node1 analogIn_getAdcReading Node1->Node1 Node2 modAnalogIn_read Node1->Node2 Node2->Node2

◆ analogIn_getCbit()

DriverStatus analogIn_getCbit ( const AnalogInDevHandler analogInDevHdl,
AnalogInCbitStatus * cbitStatus )

analogIn_getCbit.

analogIn get CBIT status.

Parameters
[in]analogInDevHdlThe analog input 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 or module.
DRV_INVALID_PARAM: The provided address pointer is invalid.

Low-Level Software Requirements (LLR)

Low-Level Requirement Specification: analogIn_getCbit

Requirement ID Parent HLR ID Detailed Low-Level Requirement Statement (EARS Format) Software Unit Reference Verification Method Status
LLR_ANALOGIN_ANALOGIN_GETCBIT_01 HLR_AIN_23596 WHEN the pointer cbitStatus is NULL (invalid), the analogIn_getCbit() function SHALL abort processing and return DRV_INVALID_PARAM. analogIn.c:analogIn_getCbit() Test Closed
LLR_ANALOGIN_ANALOGIN_GETCBIT_02 HLR_AIN_23596 WHEN a driver operation reports a failure status other than DRV_SUCCESS, the analogIn_getCbit() function SHALL abort processing and return that driver failure status. analogIn.c:analogIn_getCbit() Test Closed
LLR_ANALOGIN_ANALOGIN_GETCBIT_03 HLR_AIN_23596 WHEN preconditions are satisfied, the analogIn_getCbit() function SHALL read the memory map offset list (ADC_CBIT_GEN_STATUS) at physical offset 0x0110 (MMAP_ADC_CBIT_GEN_STATUS) using readAnInReg(). analogIn.c:analogIn_getCbit() Test Closed
LLR_ANALOGIN_ANALOGIN_GETCBIT_04 HLR_AIN_23596 WHEN preconditions are satisfied, the analogIn_getCbit() function SHALL invoke bitwise routine READ_BIT() to extract target channel status bit from register payload. analogIn.c:analogIn_getCbit() Test Closed
LLR_ANALOGIN_ANALOGIN_GETCBIT_05 HLR_AIN_23596 WHEN all operational processing completes successfully, the analogIn_getCbit() function SHALL return DRV_SUCCESS. analogIn.c:analogIn_getCbit() Test Closed

Control Coupling Diagram (CCD)

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

Data Coupling Diagram (DCD)

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

Control Flow Diagram (CFD)

cfd_analogIn_getCbit start Entry: analogIn_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) act_3 LLR_03: Action Step read the memory map offset list (ADC_CBIT_GEN_STATUS) at physical offset `0x0110` (`MMAP_ADC_CBIT_GEN_STATUS`) using `readAnInReg()` guard_2->act_3 NO (FALSE) act_4 LLR_04: Action Step invoke bitwise routine `READ_BIT()` to extract target channel status bit from register payload act_3->act_4 success_exit LLR_05: Final Exit return `DRV_SUCCESS` act_4->success_exit
Control Flow Diagram

Data Flow Diagram (DFD)

dfd_analogIn_getCbit in_store Input Data Sources & Parameters • analogInDevHdl (const AnalogInDevHandler) 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 Payload Transformation • Process payload via readAnInReg() proc_2->proc_3 Data Payload (readAnInReg) proc_4 LLR_04: Data Payload Transformation • Process payload via READ_BIT() proc_3->proc_4 Data Payload (READ_BIT) proc_5 LLR_05: Status Output Packaging • Format Return Payload: DriverStatus proc_4->proc_5 Final Output Data out_sink Output Data Sinks & Status Return • cbitStatus (AnalogInCbitStatus) proc_5->out_sink Output Data & Status Code
Data Flow Diagram
Here is the call graph for this function:
analogIn_getCbit Node1 analogIn_getCbit Node1->Node1 Node2 readAnInReg 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:
analogIn_getCbit Node1 analogIn_getCbit Node1->Node1 Node2 modHsb_getAnalogInCbit Node1->Node2 Node2->Node2

◆ analogIn_getChannelStatus()

DriverStatus analogIn_getChannelStatus ( const AnalogInDevHandler analogInDevHdl,
const UInt8 chNum,
Bool * status )

analogIn_getChannelStatus.

Parameters
[in]analogInDevHdlThe analog input device handler.
[in]chNumThe device channel number.
[out]statusThe status of the 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_READ_FAILED: Failed to read from the device or module.
DRV_INVALID_PARAM: The provided address pointer is invalid.

Low-Level Software Requirements (LLR)

Low-Level Requirement Specification: analogIn_getChannelStatus

Requirement ID Parent HLR ID Detailed Low-Level Requirement Statement (EARS Format) Software Unit Reference Verification Method Status
LLR_ANALOGIN_ANALOGIN_GETCHANNELSTATUS_01 HLR_AIN_30827 WHEN the pointer status is NULL (invalid), the analogIn_getChannelStatus() function SHALL abort processing and return DRV_INVALID_PARAM. analogIn.c:analogIn_getChannelStatus() Test Closed
LLR_ANALOGIN_ANALOGIN_GETCHANNELSTATUS_02 HLR_AIN_30827 WHEN the pointer status is valid, the analogIn_getChannelStatus() function SHALL read the ADC channel state register MMAP_ADC_CH_STATE using readAnInReg(). analogIn.c:analogIn_getChannelStatus() Test Closed
LLR_ANALOGIN_ANALOGIN_GETCHANNELSTATUS_03 HLR_AIN_30827 WHEN the register read operation fails (status not equal to DRV_SUCCESS), the analogIn_getChannelStatus() function SHALL abort processing and return that failure status. analogIn.c:analogIn_getChannelStatus() Test Closed
LLR_ANALOGIN_ANALOGIN_GETCHANNELSTATUS_04 HLR_AIN_30827 WHEN bit chNum in register MMAP_ADC_CH_STATE is equal to AIN_CH_ENABLE_STATE, the analogIn_getChannelStatus() function SHALL set *status to TRUE (enabled). analogIn.c:analogIn_getChannelStatus() Test Closed
LLR_ANALOGIN_ANALOGIN_GETCHANNELSTATUS_05 HLR_AIN_30827 WHEN bit chNum in register MMAP_ADC_CH_STATE is not equal to AIN_CH_ENABLE_STATE, the analogIn_getChannelStatus() function SHALL set *status to FALSE (disabled). analogIn.c:analogIn_getChannelStatus() Test Closed
LLR_ANALOGIN_ANALOGIN_GETCHANNELSTATUS_06 HLR_AIN_30827 WHEN all operational processing completes successfully, the analogIn_getChannelStatus() function SHALL return DRV_SUCCESS. analogIn.c:analogIn_getChannelStatus() Test Closed

Control Coupling Diagram (CCD)

ControlCouplingStructureChart Caller analogIn_getChannelStatus() [Low-Level Device Drivers] Target readAnInReg() [Low-Level Driver Helper] Caller:s->Target:n l_t0->l_b0   analogInDevHdl (Flag) l_t1->l_b1   chNum (Flag) r_b0->r_t0   statusCode (DriverStatus)
Control Coupling Structure Chart

Data Coupling Diagram (DCD)

DataCouplingStructureChart Caller analogIn_getChannelStatus() [Low-Level Device Drivers] Target readAnInReg() [Low-Level Driver Helper] Caller:s->Target:n l_t0->l_b0   analogInDevHdl (Payload) l_t1->l_b1   chNum (Payload) r_b0->r_t0   *status (Output Data)
Data Coupling Structure Chart

Control Flow Diagram (CFD)

cfd_analogIn_getChannelStatus start Entry: analogIn_getChannelStatus() guard_1 LLR_01: Guard Check Is the pointer `status` 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 `AIN_CH_ENABLE_STATE` is equal to `READ_BIT`(regValue, chNum)? 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 memory map offset list (ADC_CH_STATE) at physical offset `0x0100` (`MMAP_ADC_CH_STATE`) using `readAnInReg()` guard_3->act_4 NO (FALSE) success_exit LLR_05: Final Exit return `DRV_SUCCESS` act_4->success_exit
Control Flow Diagram

Data Flow Diagram (DFD)

dfd_analogIn_getChannelStatus in_store Input Data Sources & Parameters • analogInDevHdl (const AnalogInDevHandler) • chNum (const UInt8) proc_1 LLR_01: Data Validation Check • Evaluate Parameter / State: status 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: AIN_CH_ENABLE_STATE proc_2->proc_3 Validated Input Data proc_4 LLR_04: Data Payload Transformation • Process payload via readAnInReg() proc_3->proc_4 Data Payload (readAnInReg) proc_5 LLR_05: Status Output Packaging • Format Return Payload: DriverStatus proc_4->proc_5 Final Output Data out_sink Output Data Sinks & Status Return • status (Bool) proc_5->out_sink Output Data & Status Code
Data Flow Diagram
Here is the call graph for this function:
analogIn_getChannelStatus Node1 analogIn_getChannelStatus Node1->Node1 Node2 readAnInReg 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:
analogIn_getChannelStatus Node1 analogIn_getChannelStatus Node1->Node1 Node2 modAnalogIn_disableRead Node1->Node2 Node7 modAnalogIn_enableRead Node1->Node7 Node8 modAnalogIn_read Node1->Node8 Node2->Node2 Node3 modAnalogIn_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 Node7->Node7 Node8->Node8

◆ analogIn_getInputRange()

DriverStatus analogIn_getInputRange ( const AnalogInDevHandler analogInDevHdl,
const UInt8 bank,
UInt32 * range )

analogIn_getInputRange.

Parameters
[in]analogInDevHdlThe analog input device handler.
[in]bankThe device bank.
[out]rangeThe range data 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 or module.
DRV_INVALID_PARAM: The provided address pointer is invalid.

Low-Level Software Requirements (LLR)

Low-Level Requirement Specification: analogIn_getInputRange

Requirement ID Parent HLR ID Detailed Low-Level Requirement Statement (EARS Format) Software Unit Reference Verification Method Status
LLR_ANALOGIN_ANALOGIN_GETINPUTRANGE_01 HLR_AIN_21627 WHEN the pointer range is NULL (invalid), the analogIn_getInputRange() function SHALL abort processing and return DRV_INVALID_PARAM. analogIn.c:analogIn_getInputRange() Test Closed
LLR_ANALOGIN_ANALOGIN_GETINPUTRANGE_02 HLR_AIN_21627 WHEN a driver operation reports a failure status other than DRV_SUCCESS, the analogIn_getInputRange() function SHALL abort processing and return that driver failure status. analogIn.c:analogIn_getInputRange() Test Closed
LLR_ANALOGIN_ANALOGIN_GETINPUTRANGE_03 HLR_AIN_21627 WHEN preconditions are satisfied, the analogIn_getInputRange() function SHALL read the memory map offset list (ADC_IN_RG_BANK_BASE) at physical offset (0x0000 + (bank * MMAP_ADC_CH_OFFSET_GAP)) (MMAP_ADC_IN_RG_BANK_BASE) using readAnInReg(). analogIn.c:analogIn_getInputRange() Test Closed
LLR_ANALOGIN_ANALOGIN_GETINPUTRANGE_04 HLR_AIN_21627 WHEN all operational processing completes successfully, the analogIn_getInputRange() function SHALL return DRV_SUCCESS. analogIn.c:analogIn_getInputRange() Test Closed

Control Coupling Diagram (CCD)

ControlCouplingStructureChart Caller analogIn_getInputRange() [Low-Level Device Drivers] Target readAnInReg() [Low-Level Driver Helper] Caller:s->Target:n l_t0->l_b0   analogInDevHdl (Flag) l_t1->l_b1   bank (Flag) r_b0->r_t0   statusCode (DriverStatus)
Control Coupling Structure Chart

Data Coupling Diagram (DCD)

DataCouplingStructureChart Caller analogIn_getInputRange() [Low-Level Device Drivers] Target readAnInReg() [Low-Level Driver Helper] Caller:s->Target:n l_t0->l_b0   analogInDevHdl (Payload) l_t1->l_b1   bank (Payload) r_b0->r_t0   *range (Output Data)
Data Coupling Structure Chart

Control Flow Diagram (CFD)

cfd_analogIn_getInputRange start Entry: analogIn_getInputRange() guard_1 LLR_01: Guard Check Is the pointer `range` 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 memory map offset list (ADC_IN_RG_BANK_BASE) at physical offset `(0x0000 + (bank * MMAP_ADC_CH_OFFSET_GAP))` (`MMAP_ADC_IN_RG_BANK_BASE`) using `readAnInReg()` 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_analogIn_getInputRange in_store Input Data Sources & Parameters • analogInDevHdl (const AnalogInDevHandler) • bank (const UInt8) proc_1 LLR_01: Data Validation Check • Evaluate Parameter / State: range 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 readAnInReg() proc_2->proc_3 Data Payload (readAnInReg) 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 • range (UInt32) proc_4->out_sink Output Data & Status Code
Data Flow Diagram
Here is the call graph for this function:
analogIn_getInputRange Node1 analogIn_getInputRange Node1->Node1 Node2 readAnInReg 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:
analogIn_getInputRange Node1 analogIn_getInputRange Node1->Node1 Node2 modAnalogIn_initReset Node1->Node2 Node2->Node2 Node3 modConfig_init Node2->Node3 Node4 modConfig_reset Node2->Node4 Node3->Node3 Node4->Node4 Node5 modConfig_close Node4->Node5 Node5->Node5

◆ analogIn_getPbit()

DriverStatus analogIn_getPbit ( const AnalogInDevHandler analogInDevHdl,
AnalogInPbitStatus * pbitStatus )

analogIn_getPbit.

analogIn get PBIT status.

Parameters
[in]analogInDevHdlThe analog input 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 or module.
DRV_INVALID_PARAM: The provided address pointer is invalid.

Low-Level Software Requirements (LLR)

Low-Level Requirement Specification: analogIn_getPbit

Requirement ID Parent HLR ID Detailed Low-Level Requirement Statement (EARS Format) Software Unit Reference Verification Method Status
LLR_ANALOGIN_ANALOGIN_GETPBIT_01 HLR_AIN_322 WHEN the pointer pbitStatus is NULL (invalid), the analogIn_getPbit() function SHALL abort processing and return DRV_INVALID_PARAM. analogIn.c:analogIn_getPbit() Test Closed
LLR_ANALOGIN_ANALOGIN_GETPBIT_02 HLR_AIN_322 WHEN a driver operation reports a failure status other than DRV_SUCCESS, the analogIn_getPbit() function SHALL abort processing and return that driver failure status. analogIn.c:analogIn_getPbit() Test Closed
LLR_ANALOGIN_ANALOGIN_GETPBIT_03 HLR_AIN_322 WHEN preconditions are satisfied, the analogIn_getPbit() function SHALL read the memory map offset list (ADC_PBIT_GEN_STATUS) at physical offset 0x0104 (MMAP_ADC_PBIT_GEN_STATUS) using readAnInReg(). analogIn.c:analogIn_getPbit() Test Closed
LLR_ANALOGIN_ANALOGIN_GETPBIT_04 HLR_AIN_322 WHEN preconditions are satisfied, the analogIn_getPbit() function SHALL invoke bitwise routine READ_BIT() to extract target channel status bit from register payload. analogIn.c:analogIn_getPbit() Test Closed
LLR_ANALOGIN_ANALOGIN_GETPBIT_05 HLR_AIN_322 WHEN all operational processing completes successfully, the analogIn_getPbit() function SHALL return DRV_SUCCESS. analogIn.c:analogIn_getPbit() Test Closed

Control Coupling Diagram (CCD)

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

Data Coupling Diagram (DCD)

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

Control Flow Diagram (CFD)

cfd_analogIn_getPbit start Entry: analogIn_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) act_3 LLR_03: Action Step read the memory map offset list (ADC_PBIT_GEN_STATUS) at physical offset `0x0104` (`MMAP_ADC_PBIT_GEN_STATUS`) using `readAnInReg()` guard_2->act_3 NO (FALSE) act_4 LLR_04: Action Step invoke bitwise routine `READ_BIT()` to extract target channel status bit from register payload act_3->act_4 success_exit LLR_05: Final Exit return `DRV_SUCCESS` act_4->success_exit
Control Flow Diagram

Data Flow Diagram (DFD)

dfd_analogIn_getPbit in_store Input Data Sources & Parameters • analogInDevHdl (const AnalogInDevHandler) 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 Payload Transformation • Process payload via readAnInReg() proc_2->proc_3 Data Payload (readAnInReg) proc_4 LLR_04: Data Payload Transformation • Process payload via READ_BIT() proc_3->proc_4 Data Payload (READ_BIT) proc_5 LLR_05: Status Output Packaging • Format Return Payload: DriverStatus proc_4->proc_5 Final Output Data out_sink Output Data Sinks & Status Return • pbitStatus (AnalogInPbitStatus) proc_5->out_sink Output Data & Status Code
Data Flow Diagram
Here is the call graph for this function:
analogIn_getPbit Node1 analogIn_getPbit Node1->Node1 Node2 readAnInReg 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:
analogIn_getPbit Node1 analogIn_getPbit Node1->Node1 Node2 modHsb_getAnalogInPbit Node1->Node2 Node2->Node2

◆ analogIn_getTemp()

DriverStatus analogIn_getTemp ( const AnalogInDevHandler analogInDevHdl,
Float32 * temp5v,
Float32 * temp10v )

analogIn_getTemp.

analogIn get temperature value in degree celsius (C).

Parameters
[in]analogInDevHdlThe analog input device handler.
[out]temp5vThe pointer of 5v bank temperature value in degree celsius (C).
[out]temp10vThe pointer of 10v bank 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 or module.
DRV_INVALID_PARAM: The provided address pointer is invalid.

Low-Level Software Requirements (LLR)

Low-Level Requirement Specification: analogIn_getTemp

Requirement ID Parent HLR ID Detailed Low-Level Requirement Statement (EARS Format) Software Unit Reference Verification Method Status
LLR_ANALOGIN_ANALOGIN_GETTEMP_01 HLR_AIN_31357 WHEN the pointer temp5v is NULL (invalid) or the pointer temp10v is NULL (invalid), the analogIn_getTemp() function SHALL abort processing and return DRV_INVALID_PARAM. analogIn.c:analogIn_getTemp() Test Closed
LLR_ANALOGIN_ANALOGIN_GETTEMP_02 HLR_AIN_31357 WHEN a driver operation reports a failure status other than DRV_SUCCESS, the analogIn_getTemp() function SHALL abort processing and return that driver failure status. analogIn.c:analogIn_getTemp() Test Closed
LLR_ANALOGIN_ANALOGIN_GETTEMP_03 HLR_AIN_31357 WHEN preconditions are satisfied, the analogIn_getTemp() function SHALL read the memory map offset list (ADC_TEMP_5V) at physical offset 0x011C (MMAP_ADC_TEMP_5V) using readAnInReg(). analogIn.c:analogIn_getTemp() Test Closed
LLR_ANALOGIN_ANALOGIN_GETTEMP_04 HLR_AIN_31357 WHEN preconditions are satisfied, the analogIn_getTemp() function SHALL invoke routine 005() to execute target subsystem hardware operation. analogIn.c:analogIn_getTemp() Test Closed
LLR_ANALOGIN_ANALOGIN_GETTEMP_05 HLR_AIN_31357 WHEN all operational processing completes successfully, the analogIn_getTemp() function SHALL return DRV_SUCCESS. analogIn.c:analogIn_getTemp() Test Closed

Control Coupling Diagram (CCD)

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

Data Coupling Diagram (DCD)

DataCouplingStructureChart Caller analogIn_getTemp() [Low-Level Device Drivers] Target readAnInReg() [Low-Level Driver Helper] Caller:s->Target:n l_t0->l_b0   analogInDevHdl (Payload) r_b0->r_t0   *temp5v (Output Data) r_b1->r_t1   *temp10v (Output Data)
Data Coupling Structure Chart

Control Flow Diagram (CFD)

cfd_analogIn_getTemp start Entry: analogIn_getTemp() guard_1 LLR_01: Guard Check Is the pointer `temp5v` is NULL (invalid) or the pointer `temp10v` 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 memory map offset list (ADC_TEMP_5V) at physical offset `0x011C` (`MMAP_ADC_TEMP_5V`) using `readAnInReg()` guard_2->act_3 NO (FALSE) act_4 LLR_04: Action Step invoke routine `005()` to execute target subsystem hardware operation act_3->act_4 success_exit LLR_05: Final Exit return `DRV_SUCCESS` act_4->success_exit
Control Flow Diagram

Data Flow Diagram (DFD)

dfd_analogIn_getTemp in_store Input Data Sources & Parameters • analogInDevHdl (const AnalogInDevHandler) proc_1 LLR_01: Data Validation Check • Evaluate Parameter / State: temp5v 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 readAnInReg() proc_2->proc_3 Data Payload (readAnInReg) proc_4 LLR_04: Data Payload Transformation • Process payload via 005() proc_3->proc_4 Data Payload (005) proc_5 LLR_05: Status Output Packaging • Format Return Payload: DriverStatus proc_4->proc_5 Final Output Data out_sink Output Data Sinks & Status Return • temp5v (Float32) • temp10v (Float32) proc_5->out_sink Output Data & Status Code
Data Flow Diagram
Here is the call graph for this function:
analogIn_getTemp Node1 analogIn_getTemp Node1->Node1 Node2 readAnInReg 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:
analogIn_getTemp Node1 analogIn_getTemp Node1->Node1 Node2 modHsb_getAnalogInCbit Node1->Node2 Node2->Node2

◆ readAnInReg()

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

readAnInReg - analogIn PCIe read function.

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: readAnInReg

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

Control Coupling Diagram (CCD)

ControlCouplingStructureChart Caller readAnInReg() [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 readAnInReg() [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_readAnInReg start Entry: readAnInReg() 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_readAnInReg 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:
readAnInReg Node1 readAnInReg 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:
readAnInReg Node1 readAnInReg Node1->Node1 Node2 analogIn_enableDisableCh Node1->Node2 Node9 analogIn_getAdcReading Node1->Node9 Node11 analogIn_getCbit Node1->Node11 Node13 analogIn_getChannelStatus Node1->Node13 Node14 analogIn_getInputRange Node1->Node14 Node15 analogIn_getPbit Node1->Node15 Node17 analogIn_getTemp Node1->Node17 Node2->Node2 Node3 modAnalogIn_disableRead Node2->Node3 Node8 modAnalogIn_enableRead Node2->Node8 Node3->Node3 Node4 modAnalogIn_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->Node9 Node10 modAnalogIn_read Node9->Node10 Node10->Node10 Node11->Node11 Node12 modHsb_getAnalogInCbit Node11->Node12 Node12->Node12 Node13->Node3 Node13->Node8 Node13->Node10 Node13->Node13 Node14->Node4 Node14->Node14 Node15->Node15 Node16 modHsb_getAnalogInPbit Node15->Node16 Node16->Node16 Node17->Node12 Node17->Node17

◆ writeAnInReg()

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

writeAnInReg - analogIn PCIe write function.

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: writeAnInReg

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

Control Coupling Diagram (CCD)

ControlCouplingStructureChart Caller writeAnInReg() [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 writeAnInReg() [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_writeAnInReg start Entry: writeAnInReg() 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_writeAnInReg 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:
writeAnInReg Node1 writeAnInReg 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:
writeAnInReg Node1 writeAnInReg Node1->Node1 Node2 analogIn_enableDisableCh Node1->Node2 Node2->Node2 Node3 modAnalogIn_disableRead Node2->Node3 Node8 modAnalogIn_enableRead Node2->Node8 Node3->Node3 Node4 modAnalogIn_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