|
HFCC-01 Low-Level Software (LLSW) Rel_6802_HFCC-01-RP-CSAR-CB
|
#include "discreteIn.h"#include "utilHelper.h"#include "interDrv.h"#include "interStatus.h"#include "mmapDiscreteIn.h"#include "memoryOper.h"Functions | |
| static DriverStatus | readDiscreteInReg (const UInt32 baseAddress, const UInt32 offset, UInt32 *data) |
| readDiscreteInReg. | |
| DriverStatus | discreteIn_getPbit (const DInDevHandler dInDevHdl, DInPbitStatus *pbitStatus, const UInt8 devNum) |
| discreteIn_getPbit. | |
| DriverStatus | discreteIn_getCbit (const DInDevHandler dInDevHdl, DInCbitStatus *cbitStatus, const UInt8 devNum) |
| discreteIn_getCbit. | |
| DriverStatus | discreteIn_getTemp (const DInDevHandler dInDevHdl, Float32 *temp) |
| discreteIn_getTemp. | |
| DriverStatus | discreteIn_getChSense (const DInDevHandler dInDevHdl, DInDevState *pDevState) |
| discreteIn_getChSense. | |
Discrete Input device driver file
| DriverStatus discreteIn_getCbit | ( | const DInDevHandler | dInDevHdl, |
| DInCbitStatus * | cbitStatus, | ||
| const UInt8 | devNum ) |
discreteIn_getCbit.
discreteIn get CBIT status.
| [in] | dInDevHdl | The discrete input device handler. |
| [out] | cbitStatus | The pointer of CBIT status value. |
| [in] | devNum | The discrete input device number. |
| DRV_SUCCESS | : Success. |
| DRV_READ_FAILED | : Failed to read from the device or module. |
| DRV_INVALID_PARAM | : The provided address pointer is invalid. |
| Requirement ID | Parent HLR ID | Detailed Low-Level Requirement Statement (EARS Format) | Software Unit Reference | Verification Method | Status |
|---|---|---|---|---|---|
| LLR_DISCRETEIN_DISCRETEIN_GETCBIT_01 | HLR_DIN_23588 | WHEN the pointer cbitStatus is NULL (invalid), the discreteIn_getCbit() function SHALL abort processing and return DRV_INVALID_PARAM. | discreteIn.c:discreteIn_getCbit() | Test | Closed |
| LLR_DISCRETEIN_DISCRETEIN_GETCBIT_02 | HLR_DIN_23588 | WHEN devNum is equal to 0 or 1, the discreteIn_getCbit() function SHALL map the hardware access to device instance 0. | discreteIn.c:discreteIn_getCbit() | Test | Closed |
| LLR_DISCRETEIN_DISCRETEIN_GETCBIT_03 | HLR_DIN_23588 | WHEN devNum is equal to 2, the discreteIn_getCbit() function SHALL map the hardware access to device instance 1. | discreteIn.c:discreteIn_getCbit() | Test | Closed |
| LLR_DISCRETEIN_DISCRETEIN_GETCBIT_04 | HLR_DIN_23588 | WHEN the device instance is resolved, the discreteIn_getCbit() function SHALL read the CBIT status register MMAP_DIN_CBIT_STATUS using readDiscreteInReg(). | discreteIn.c:discreteIn_getCbit() | Test | Closed |
| LLR_DISCRETEIN_DISCRETEIN_GETCBIT_05 | HLR_DIN_23588 | WHEN the CBIT status register is read successfully, the discreteIn_getCbit() function SHALL unpack hardware status bits for power good, over/under temperature, and channel parity into struct cbitStatus. | discreteIn.c:discreteIn_getCbit() | Test | Closed |
| LLR_DISCRETEIN_DISCRETEIN_GETCBIT_06 | HLR_DIN_23588 | WHEN all operational processing completes successfully, the discreteIn_getCbit() function SHALL return DRV_SUCCESS. | discreteIn.c:discreteIn_getCbit() | Test | Closed |
| DriverStatus discreteIn_getChSense | ( | const DInDevHandler | dInDevHdl, |
| DInDevState * | pDevState ) |
discreteIn_getChSense.
discreteIn get channel sense logic value.
| [in] | dInDevHdl | The discrete input device handler. |
| [out] | pDevState | The state of the channel. |
| DRV_SUCCESS | : Success. |
| DRV_READ_FAILED | : Failed to read from the device or module. |
| DRV_INVALID_PARAM | : The provided address pointer is invalid. |
| Requirement ID | Parent HLR ID | Detailed Low-Level Requirement Statement (EARS Format) | Software Unit Reference | Verification Method | Status |
|---|---|---|---|---|---|
| LLR_DISCRETEIN_DISCRETEIN_GETCHSENSE_01 | HLR_DIN_23258 | WHEN the pointer pDevState is NULL (invalid), the discreteIn_getChSense() function SHALL abort processing and return DRV_INVALID_PARAM. | discreteIn.c:discreteIn_getChSense() | Test | Closed |
| LLR_DISCRETEIN_DISCRETEIN_GETCHSENSE_02 | HLR_DIN_23258 | WHEN a driver operation reports a failure status other than DRV_SUCCESS, the discreteIn_getChSense() function SHALL abort processing and return that driver failure status. | discreteIn.c:discreteIn_getChSense() | Test | Closed |
| LLR_DISCRETEIN_DISCRETEIN_GETCHSENSE_03 | HLR_DIN_23258 | WHEN preconditions are satisfied, the discreteIn_getChSense() function SHALL read the Discrete Input Channel Sense Register (READ_INPUT) at physical offset 0x0078 (MMAP_DIN_READ_INPUT) using readDiscreteInReg(). | discreteIn.c:discreteIn_getChSense() | Test | Closed |
| LLR_DISCRETEIN_DISCRETEIN_GETCHSENSE_04 | HLR_DIN_23258 | WHEN preconditions are satisfied, the discreteIn_getChSense() function SHALL invoke bitwise routine READ_BIT() to extract target channel status bit from register payload. | discreteIn.c:discreteIn_getChSense() | Test | Closed |
| LLR_DISCRETEIN_DISCRETEIN_GETCHSENSE_05 | HLR_DIN_23258 | WHEN all operational processing completes successfully, the discreteIn_getChSense() function SHALL return DRV_SUCCESS. | discreteIn.c:discreteIn_getChSense() | Test | Closed |
| DriverStatus discreteIn_getPbit | ( | const DInDevHandler | dInDevHdl, |
| DInPbitStatus * | pbitStatus, | ||
| const UInt8 | devNum ) |
discreteIn_getPbit.
discreteIn get PBIT status.
| [in] | dInDevHdl | The discrete input device handler. |
| [in] | devNum | The discrete input device number. |
| [out] | pbitStatus | The pointer of PBIT status value. |
| DRV_SUCCESS | : Success. |
| DRV_READ_FAILED | : Failed to read from the device or module. |
| DRV_INVALID_PARAM | : The provided address pointer is invalid. |
| Requirement ID | Parent HLR ID | Detailed Low-Level Requirement Statement (EARS Format) | Software Unit Reference | Verification Method | Status |
|---|---|---|---|---|---|
| LLR_DISCRETEIN_DISCRETEIN_GETPBIT_01 | HLR_DIN_319 | WHEN the pointer pbitStatus is NULL (invalid), the discreteIn_getPbit() function SHALL abort processing and return DRV_INVALID_PARAM. | discreteIn.c:discreteIn_getPbit() | Test | Closed |
| LLR_DISCRETEIN_DISCRETEIN_GETPBIT_02 | HLR_DIN_319 | WHEN devNum is equal to 0 or 1, the discreteIn_getPbit() function SHALL map the hardware access to device instance 0. | discreteIn.c:discreteIn_getPbit() | Test | Closed |
| LLR_DISCRETEIN_DISCRETEIN_GETPBIT_03 | HLR_DIN_319 | WHEN devNum is equal to 2, the discreteIn_getPbit() function SHALL map the hardware access to device instance 1. | discreteIn.c:discreteIn_getPbit() | Test | Closed |
| LLR_DISCRETEIN_DISCRETEIN_GETPBIT_04 | HLR_DIN_319 | WHEN the device instance is resolved, the discreteIn_getPbit() function SHALL read the PBIT status register MMAP_DIN_PBIT_STATUS using readDiscreteInReg(). | discreteIn.c:discreteIn_getPbit() | Test | Closed |
| LLR_DISCRETEIN_DISCRETEIN_GETPBIT_05 | HLR_DIN_319 | WHEN the PBIT status register is read successfully, the discreteIn_getPbit() function SHALL unpack hardware status bits for power good, over/under temperature, and logic verification into struct pbitStatus. | discreteIn.c:discreteIn_getPbit() | Test | Closed |
| LLR_DISCRETEIN_DISCRETEIN_GETPBIT_06 | HLR_DIN_319 | WHEN all operational processing completes successfully, the discreteIn_getPbit() function SHALL return DRV_SUCCESS. | discreteIn.c:discreteIn_getPbit() | Test | Closed |
| DriverStatus discreteIn_getTemp | ( | const DInDevHandler | dInDevHdl, |
| Float32 * | temp ) |
discreteIn_getTemp.
discreteIn get temperature value in degree Celsius (C).
| [in] | dInDevHdl | The discrete input device handler. |
| [out] | temp | The pointer of temperature value in degree Celsius (C). |
| DRV_SUCCESS | : Success. |
| DRV_READ_FAILED | : Failed to read from the device or module. |
| DRV_INVALID_PARAM | : The provided address pointer is invalid. |
| Requirement ID | Parent HLR ID | Detailed Low-Level Requirement Statement (EARS Format) | Software Unit Reference | Verification Method | Status |
|---|---|---|---|---|---|
| LLR_DISCRETEIN_DISCRETEIN_GETTEMP_01 | HLR_DIN_30815 | WHEN the pointer temp is NULL (invalid), the discreteIn_getTemp() function SHALL abort processing and return DRV_INVALID_PARAM. | discreteIn.c:discreteIn_getTemp() | Test | Closed |
| LLR_DISCRETEIN_DISCRETEIN_GETTEMP_02 | HLR_DIN_30815 | WHEN a driver operation reports a failure status other than DRV_SUCCESS, the discreteIn_getTemp() function SHALL abort processing and return that driver failure status. | discreteIn.c:discreteIn_getTemp() | Test | Closed |
| LLR_DISCRETEIN_DISCRETEIN_GETTEMP_03 | HLR_DIN_30815 | WHEN preconditions are satisfied, the discreteIn_getTemp() function SHALL read the Raw Temperature Sensor Register (TEMP_RAW) at physical offset 0x0068 (MMAP_DIN_TEMP_RAW) using readDiscreteInReg(). | discreteIn.c:discreteIn_getTemp() | Test | Closed |
| LLR_DISCRETEIN_DISCRETEIN_GETTEMP_04 | HLR_DIN_30815 | WHEN all operational processing completes successfully, the discreteIn_getTemp() function SHALL return DRV_SUCCESS. | discreteIn.c:discreteIn_getTemp() | Test | Closed |
|
static |
readDiscreteInReg.
To read function for PCIe Discrete Input.
| [in] | baseAddress | The base address of the module and device. |
| [in] | offset | The offset address from module base address. |
| [out] | data | 32bit data to read from PCIe. |
| DRV_SUCCESS | : Success. |
| DRV_READ_FAILED | : PCIe failed to read value. |
| DRV_INVALID_PARAM | : The provided address pointer is invalid. |
| Requirement ID | Parent HLR ID | Detailed Low-Level Requirement Statement (EARS Format) | Software Unit Reference | Verification Method | Status |
|---|---|---|---|---|---|
| LLR_DISCRETEIN_READDISCRETEINREG_01 | HLR_DIN_23588 | WHEN the pointer data is NULL (invalid), the readDiscreteInReg() function SHALL abort processing and return DRV_INVALID_PARAM. | discreteIn.c:readDiscreteInReg() | Test | Closed |
| LLR_DISCRETEIN_READDISCRETEINREG_02 | HLR_DIN_23588 | WHEN the pointer data is valid, the readDiscreteInReg() function SHALL read a 32-bit register value from physical memory address (baseAddress + addrOffset) into *data using PCIe primitive interDrv_Read32(). | discreteIn.c:readDiscreteInReg() | Test | Closed |
| LLR_DISCRETEIN_READDISCRETEINREG_03 | HLR_DIN_23588 | WHEN memory access via interDrv_Read32() fails (status not equal to INTF_SUCCESS), the readDiscreteInReg() function SHALL abort processing and return DRV_READ_FAILED. | discreteIn.c:readDiscreteInReg() | Test | Closed |
| LLR_DISCRETEIN_READDISCRETEINREG_04 | HLR_DIN_23588 | WHEN all operational processing completes successfully, the readDiscreteInReg() function SHALL return DRV_SUCCESS. | discreteIn.c:readDiscreteInReg() | Test | Closed |