HFCC-01 Low-Level Software (LLSW) Rel_6802_HFCC-01-RP-CSAR-CB
Loading...
Searching...
No Matches
modDiscreteIn.h File Reference
#include "commonDataTypes.h"
#include "modStatus.h"
#include "modConfig.h"
Include dependency graph for modDiscreteIn.h:
modDiscreteIn.h Node1 modDiscreteIn.h Node2 commonDataTypes.h Node1->Node2 Node3 modStatus.h Node1->Node3 Node4 modConfig.h Node1->Node4 Node4->Node3 Node5 INTEGRITY.h Node4->Node5 Node6 modInfo.h Node4->Node6 Node6->Node2 Node6->Node3
This graph shows which files directly or indirectly include this file:
modDiscreteIn.h Node1 modDiscreteIn.h Node2 deviceLibModule.h Node1->Node2 Node3 modDiscreteIn.c Node1->Node3

Go to the source code of this file.

Enumerations

enum  DInLogic {
  DI_DEFAULT = (0U) , DI_OG_GND = (1U) , DI_OG_OPEN = (2U) , DI_SO_SPLY = (3U) ,
  DI_SO_OPEN = (4U) , DI_SG_SPLY = (5U) , DI_SG_GND = (6U)
}
 This is enum definition for the state logic of discrete input. More...

Functions

ModStatus modDiscreteIn_read (const DInChannelNum channelNum, DInLogic *pDiscreteValue)
 modDiscreteIn_read.

Detailed Description

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

Discrete Input Module

Enumeration Type Documentation

◆ DInLogic

enum DInLogic

This is enum definition for the state logic of discrete input.

Enumerator
DI_DEFAULT 

Default state for Discrete Input.

DI_OG_GND 

Ground condition in GROUND/OPEN.

DI_OG_OPEN 

Open condition in GROUND/OPEN.

DI_SO_SPLY 

Supply condition in SUPPLY/OPEN.

DI_SO_OPEN 

Open condition in SUPPLY/OPEN.

DI_SG_SPLY 

Supply condition in SUPPLY/GROUND.

DI_SG_GND 

Ground condition in SUPPLY/GROUND.

Function Documentation

◆ modDiscreteIn_read()

ModStatus modDiscreteIn_read ( const DInChannelNum channelNum,
DInLogic * pDiscreteValue )

modDiscreteIn_read.

Read discrete input value from the specified channel.

Parameters
[in]channelNumDiscrete input channel to access.
[out]pDiscreteValueDiscrete input read value.
Returns
ModStatus - Module status return code, If no error occurs during the operation of the function, it returns MD_SUCCESS. Otherwise related error message is returned.
Return values
MD_SUCCESS: Success.
MD_INVALID_PARAM: The provided address pointer is invalid.
MD_INVALID_INIT: The module has not been initialized.
MD_INVALID_CHANNEL: The channel number is invalid.
MD_INVALID_VALUE: Channel type is not valid.
MD_READ_ERR: The module is failed to read.

Low-Level Software Requirements (LLR)

Low-Level Requirement Specification: modDiscreteIn_read

Requirement ID Parent HLR ID Detailed Low-Level Requirement Statement (EARS Format) Software Unit Reference Verification Method Status
LLR_DISCRETEIN_MODDISCRETEIN_READ_01 HLR_DIN_23258 WHEN channel validation fails (validateChannel() returns FALSE), the modDiscreteIn_read() function SHALL abort processing and return MD_INVALID_CHANNEL. modDiscreteIn.c:modDiscreteIn_read() Test Closed
LLR_DISCRETEIN_MODDISCRETEIN_READ_02 HLR_DIN_23258 WHEN the pointer pDiscreteValue is NULL (invalid), the modDiscreteIn_read() function SHALL abort processing and return MD_INVALID_PARAM. modDiscreteIn.c:modDiscreteIn_read() Test Closed
LLR_DISCRETEIN_MODDISCRETEIN_READ_03 HLR_DIN_23258 WHEN the target card module state is not INIT, the modDiscreteIn_read() function SHALL abort processing and return MD_INVALID_INIT. modDiscreteIn.c:modDiscreteIn_read() Test Closed
LLR_DISCRETEIN_MODDISCRETEIN_READ_04 HLR_DIN_23258 WHEN preconditions are satisfied, the modDiscreteIn_read() function SHALL read the hardware channel states into devState using discreteIn_getChSense(). modDiscreteIn.c:modDiscreteIn_read() Test Closed
LLR_DISCRETEIN_MODDISCRETEIN_READ_05 HLR_DIN_23258 WHEN the channel bank is BANK0, the modDiscreteIn_read() function SHALL sample the discrete state from devState.chState at index chanNum + DIN_BANK_OFFSET_0. modDiscreteIn.c:modDiscreteIn_read() Test Closed
LLR_DISCRETEIN_MODDISCRETEIN_READ_06 HLR_DIN_23258 WHEN the channel bank is BANK1, the modDiscreteIn_read() function SHALL sample the discrete state from devState.chState at index chanNum + DIN_BANK_OFFSET_1. modDiscreteIn.c:modDiscreteIn_read() Test Closed
LLR_DISCRETEIN_MODDISCRETEIN_READ_07 HLR_DIN_23258 WHEN the channel bank is BANK2, the modDiscreteIn_read() function SHALL sample the discrete state from devState.chState at index chanNum + DIN_BANK_OFFSET_2. modDiscreteIn.c:modDiscreteIn_read() Test Closed
LLR_DISCRETEIN_MODDISCRETEIN_READ_08 HLR_DIN_23258 WHEN the channel bank is BANK3, the modDiscreteIn_read() function SHALL sample the discrete state from devState.chState at index chanNum + DIN_BANK_OFFSET_3. modDiscreteIn.c:modDiscreteIn_read() Test Closed
LLR_DISCRETEIN_MODDISCRETEIN_READ_09 HLR_DIN_23258 WHEN the channel type is Ground/Open (DIN_GND_OPEN) and the sampled state is TRUE, the modDiscreteIn_read() function SHALL set *pDiscreteValue to DI_OG_GND. modDiscreteIn.c:modDiscreteIn_read() Test Closed
LLR_DISCRETEIN_MODDISCRETEIN_READ_10 HLR_DIN_23258 WHEN the channel type is Ground/Open (DIN_GND_OPEN) and the sampled state is FALSE, the modDiscreteIn_read() function SHALL set *pDiscreteValue to DI_OG_OPEN. modDiscreteIn.c:modDiscreteIn_read() Test Closed
LLR_DISCRETEIN_MODDISCRETEIN_READ_11 HLR_DIN_23258 WHEN the channel type is Supply/Open (DIN_SUPPLY_OPEN) and the sampled state is TRUE, the modDiscreteIn_read() function SHALL set *pDiscreteValue to DI_SO_OPEN. modDiscreteIn.c:modDiscreteIn_read() Test Closed
LLR_DISCRETEIN_MODDISCRETEIN_READ_12 HLR_DIN_23258 WHEN the channel type is Supply/Open (DIN_SUPPLY_OPEN) and the sampled state is FALSE, the modDiscreteIn_read() function SHALL set *pDiscreteValue to DI_SO_SPLY. modDiscreteIn.c:modDiscreteIn_read() Test Closed
LLR_DISCRETEIN_MODDISCRETEIN_READ_13 HLR_DIN_23258 WHEN all operational processing completes successfully, the modDiscreteIn_read() function SHALL return MD_SUCCESS. modDiscreteIn.c:modDiscreteIn_read() Test Closed

Control Coupling Diagram (CCD)

ControlCouplingStructureChart Caller modDiscreteIn_read() [Device Library Modules] Target discreteIn_getChSense() [Subordinate Routine] Caller:s->Target:n l_t0->l_b0   channelNum (Flag) r_b0->r_t0   statusCode (ModStatus)
Control Coupling Structure Chart

Data Coupling Diagram (DCD)

DataCouplingStructureChart Caller modDiscreteIn_read() [Device Library Modules] Target discreteIn_getChSense() [Subordinate Routine] Caller:s->Target:n l_t0->l_b0   channelNum (Payload) r_b0->r_t0   *pDiscreteValue (Output Data)
Data Coupling Structure Chart

Control Flow Diagram (CFD)

cfd_modDiscreteIn_read start Entry: modDiscreteIn_read() guard_1 LLR_01: Guard Check Is the channel validation check returns FALSE (invalid channel)? start->guard_1 err_exit_1 LLR_01 Error Exit abort processing and return `MD_INVALID_CHANNEL` guard_1->err_exit_1 YES (TRUE) guard_2 LLR_02: Guard Check Is the pointer `pDiscreteValue` is NULL (invalid)? guard_1->guard_2 err_exit_2 LLR_02 Error Exit abort processing and return `MD_INVALID_PARAM` guard_2->err_exit_2 YES (TRUE) guard_3 LLR_03: Guard Check Is the module initialization state is not initialized (INIT)? guard_2->guard_3 err_exit_3 LLR_03 Error Exit abort processing and return `MD_INVALID_INIT` guard_3->err_exit_3 YES (TRUE) guard_4 LLR_04: Guard Check Is `drvStatus` is not equal to `DRV_SUCCESS`? guard_3->guard_4 err_exit_4 LLR_04 Error Exit abort processing and return `errCheck(drvStatus)` guard_4->err_exit_4 YES (TRUE) guard_5 LLR_05: Guard Check Is the bank identifier is equal to `BANK0`? guard_4->guard_5 err_exit_5 LLR_05 Error Exit execute conditional operational branch guard_5->err_exit_5 YES (TRUE) guard_6 LLR_06: Guard Check Is the bank identifier is equal to `BANK1`? guard_5->guard_6 err_exit_6 LLR_06 Error Exit execute conditional operational branch guard_6->err_exit_6 YES (TRUE) guard_7 LLR_07: Guard Check Is the bank identifier is equal to `BANK2`? guard_6->guard_7 err_exit_7 LLR_07 Error Exit execute conditional operational branch guard_7->err_exit_7 YES (TRUE) guard_8 LLR_08: Guard Check Is `chanType` is equal to `DIN_GND_OPEN`? guard_7->guard_8 err_exit_8 LLR_08 Error Exit execute conditional operational branch guard_8->err_exit_8 YES (TRUE) guard_9 LLR_09: Guard Check Is `chanType` is equal to `DIN_SUPPLY_OPEN`? guard_8->guard_9 err_exit_9 LLR_09 Error Exit execute conditional operational branch guard_9->err_exit_9 YES (TRUE) guard_10 LLR_10: Guard Check Is `state` is equal to `TRUE`? guard_9->guard_10 err_exit_10 LLR_10 Error Exit execute conditional operational branch guard_10->err_exit_10 YES (TRUE) act_11 LLR_11: Action Step invoke routine `discreteIn_getChSense()` to execute target subsystem hardware operation guard_10->act_11 NO (FALSE) act_12 LLR_12: Action Step evaluate the driver return status using `errCheck()` act_11->act_12 success_exit LLR_13: Final Exit return `MD_SUCCESS` act_12->success_exit
Control Flow Diagram

Data Flow Diagram (DFD)

dfd_modDiscreteIn_read in_store Input Data Sources & Parameters • channelNum (const DInChannelNum) proc_1 LLR_01: Data Validation Check • Evaluate Parameter / State: validateChannel in_store->proc_1 Validated Input Data proc_2 LLR_02: Data Validation Check • Evaluate Parameter / State: pDiscreteValue proc_1->proc_2 Validated Input Data proc_3 LLR_03: Data Validation Check • Evaluate Parameter / State: discreteInModHdl proc_2->proc_3 Validated Input Data proc_4 LLR_04: Data Validation Check • Evaluate Parameter / State: drvStatus proc_3->proc_4 Validated Input Data proc_5 LLR_05: Data Validation Check • Evaluate Parameter / State: bank proc_4->proc_5 Validated Input Data proc_6 LLR_06: Data Validation Check • Evaluate Parameter / State: bank proc_5->proc_6 Validated Input Data proc_7 LLR_07: Data Validation Check • Evaluate Parameter / State: bank proc_6->proc_7 Validated Input Data proc_8 LLR_08: Data Validation Check • Evaluate Parameter / State: chanType proc_7->proc_8 Validated Input Data proc_9 LLR_09: Data Validation Check • Evaluate Parameter / State: chanType proc_8->proc_9 Validated Input Data proc_10 LLR_10: Data Validation Check • Evaluate Parameter / State: state proc_9->proc_10 Validated Input Data proc_11 LLR_11: Data Payload Transformation • Process payload via discreteIn_getChSense() proc_10->proc_11 Data Payload (discreteIn_getChSense) proc_12 LLR_12: Data Payload Transformation • Process payload via errCheck() proc_11->proc_12 Data Payload (errCheck) proc_13 LLR_13: Status Output Packaging • Format Return Payload: ModStatus proc_12->proc_13 Final Output Data out_sink Output Data Sinks & Status Return • pDiscreteValue (DInLogic) proc_13->out_sink Output Data & Status Code
Data Flow Diagram
Here is the call graph for this function:
modDiscreteIn_read Node1 modDiscreteIn_read Node1->Node1 Node2 discreteIn_getChSense Node1->Node2 Node7 errCheck Node1->Node7 Node8 validateChannel Node1->Node8 Node2->Node2 Node3 readDiscreteInReg Node2->Node3 Node3->Node3 Node4 interDrv_Read32 Node3->Node4 Node4->Node4 Node5 interDrv_isAddressValid Node4->Node5 Node6 memoryMap_Read32 Node4->Node6 Node5->Node5 Node6->Node6 Node7->Node7 Node8->Node8
Here is the caller graph for this function:
modDiscreteIn_read Node1 modDiscreteIn_read Node1->Node1