📄 ident.h
字号:
/*********************************************************************
* Function: void IdentitySetDeviceType(UINT deviceType)
* void IdentitySetDeviceTypeL(USINT deviceType_L)
* void IdentitySetDeviceTypeH(USINT deviceType_H)
*
* PreCondition:
*
* Input: deviceType
*
* Output: none
*
* Side Effects:
*
* Overview: Writes the Identity class variable, device type.
*
* Note: None
********************************************************************/
#define mIdentitySetDeviceType(device_type) (uIdentity.deviceType.W.word = device_type)
#define mIdentitySetDeviceTypeL(device_type_L) (uIdentity.deviceType.bytes.L = device_type_L)
#define mIdentitySetDeviceTypeH(device_type_H) (uIdentity.deviceType.bytes.H = device_type_H)
/*********************************************************************
* Function: void IdentitySetProductCode(UINT productCode)
* void IdentitySetProductCodeL(USINT productCode_L)
* void IdentitySetProductCodeH(USINT productCode_H)
*
* PreCondition:
*
* Input: productCode
*
* Output: none
*
* Side Effects:
*
* Overview: Writes the Identity class variable, product code.
*
* Note: None
********************************************************************/
#define mIdentitySetProductCode(product_code) (uIdentity.productCode.W.word = product_code)
#define mIdentitySetProductCodeL(product_code_L) (uIdentity.productCode.bytes.L = product_code_L)
#define mIdentitySetProductCodeH(product_code_H) (uIdentity.productCode.bytes.H = product_code_H)
/*********************************************************************
* Function: void IdentitySetMajorRevision(UINT majorRev)
* void mIdentitySetMinorRevision(USINT minorRev)
*
* PreCondition:
*
* Input: revision
*
* Output: none
*
* Side Effects:
*
* Overview: Writes the Identity class variable, revision.
*
* Note: None
********************************************************************/
#define mIdentitySetMajorRevision(major_rev) (uIdentity.revision.major = major_rev)
#define mIdentitySetMinorRevision(minor_rev) (uIdentity.revision.minor = minor_rev)
/*********************************************************************
* Function: void IdentitySetSerial(UDINT serial)
* void IdentitySetSerialL(USINT serial_L)
* void IdentitySetSerialH(USINT serial_H)
* void IdentitySetSerialUL(USINT serial_UH)
* void IdentitySetSerialUH(USINT serial_UH)
*
* PreCondition:
*
* Input: serial
*
* Output: none
*
* Side Effects:
*
* Overview: Writes the Identity class variable, serial number.
*
* Note: None
********************************************************************/
#define mIdentitySetSerial(serial_num) (uIdentity.serial.W = serial_num)
#define mIdentitySetSerialL(serial_num_L) (uIdentity.serial.bytes.L = serial_num_L)
#define mIdentitySetSerialH(serial_num_H) (uIdentity.serial.bytes.H = serial_num_H)
#define mIdentitySetSerialUL(serial_num_UL) (uIdentity.serial.bytes.UL = serial_num_UL)
#define mIdentitySetSerialUH(serial_num_UH) (uIdentity.serial.bytes.UH = serial_num_UH)
/*********************************************************************
* Function: void IdentitySetStatus(WORD status)
* void IdentitySetStatusL(USINT status_L)
* void IdentitySetStatusH(USINT status_H)
*
* PreCondition:
*
* Input: status
*
* Output: none
*
* Side Effects:
*
* Overview: Writes the Identity class variable, status.
*
* Note: None
********************************************************************/
#define mIdentitySetStatus(status_bits) (uIdentity.status.W = status_bits)
#define mIdentitySetStatusL(status_bits_L) (uIdentity.status.bits.lbyte.L = status_bits_L)
#define mIdentitySetStatusH(status_bits_H) (uIdentity.status.bits.lbyte.H = status_bits_H)
/*********************************************************************
* Function: void IdentitySetName(unsigned char *pName)
*
* PreCondition:
*
* Input: *pName
*
* Output: none
*
* Side Effects:
*
* Overview: Writes the Identity class variable pointer to the
* device name.
*
* Note: None
********************************************************************/
#define mIdentitySetNameP(p_name) (uIdentity.name.p = p_name)
#define mIdentitySetNameLen(name_len) (uIdentity.name.len = name_len)
/*********************************************************************
* Function: UINT IdentityGetVendorID(void)
* USINT IdentityGetVendorIDL(void)
* USINT IdentityGetVendorIDH(void)
*
* PreCondition:
*
* Input: none
*
* Output: VendorID
*
* Side Effects:
*
* Overview: Reads the vendor ID.
*
* Note: None
********************************************************************/
#define mIdentityGetVendorID() (uIdentity.vendorID.W)
#define mIdentityGetVendorIDL() (uIdentity.vendorID.bytes.L)
#define mIdentityGetVendorIDH() (uIdentity.vendorID.bytes.H)
/*********************************************************************
* Function: UINT IdentityGetDeviceType(void)
* USINT IdentityGetDeviceTypeL(void)
* USINT IdentityGetDeviceTypeH(void)
*
* PreCondition:
*
* Input: none
*
* Output: Device Type
*
* Side Effects:
*
* Overview: Reads the Device Type.
*
* Note: None
********************************************************************/
#define mIdentityGetDeviceType() (uIdentity.deviceType.W)
#define mIdentityGetDeviceTypeL() (uIdentity.deviceType.bytes.L)
#define mIdentityGetDeviceTypeH() (uIdentity.deviceType.bytes.H)
/*********************************************************************
* Function: UINT IdentityGetProductCode(void)
* USINT IdentityGetProductCodeL(void)
* USINT IdentityGetProductCodeH(void)
*
* PreCondition:
*
* Input: none
*
* Output: Product Code
*
* Side Effects:
*
* Overview: Reads the Product Code.
*
* Note: None
********************************************************************/
#define mIdentityGetProductCode() (uIdentity.productCode.W)
#define mIdentityGetProductCodeL() (uIdentity.productCode.bytes.L)
#define mIdentityGetProductCodeH() (uIdentity.productCode.bytes.H)
/*********************************************************************
* Function: USINT IdentityGetMajorRevision(void)
* USINT IdentityGetMinorRevision(void)
*
* PreCondition:
*
* Input: none
*
* Output: Revision
*
* Side Effects:
*
* Overview: Reads the revision.
*
* Note: None
********************************************************************/
#define mIdentityGetMajorRevision() (uIdentity.revision.major)
#define mIdentityGetMinorRevision() (uIdentity.revision.minor)
/*********************************************************************
* Function: UDINT IdentityGetSerial(void)
* USINT IdentityGetSerialL(void)
* USINT IdentityGetSerialH(void)
* USINT IdentityGetSerialUL(void)
* USINT IdentityGetSerialUH(void)
*
* PreCondition:
*
* Input: none
*
* Output: Serial number
*
* Side Effects:
*
* Overview: Reads the serial number.
*
* Note: None
********************************************************************/
#define mIdentityGetSerial() (uIdentity.serial.W)
#define mIdentityGetSerialL() (uIdentity.serial.bytes.L)
#define mIdentityGetSerialH() (uIdentity.serial.bytes.H)
#define mIdentityGetSerialUL() (uIdentity.serial.bytes.UL)
#define mIdentityGetSerialUH() (uIdentity.serial.bytes.UH)
/*********************************************************************
* Function: WORD IdentityGetStatus(void)
* USINT IdentityGetStatusL(void)
* USINT IdentityGetStatusH(void)
*
* PreCondition:
*
* Input: none
*
* Output: Status
*
* Side Effects:
*
* Overview: Reads the status.
*
* Note: None
********************************************************************/
#define mIdentityGetStatus() (uIdentity.status.W)
#define mIdentityGetStatusL() (uIdentity.status.bits.lbyte.L)
#define mIdentityGetStatusH() (uIdentity.status.bits.lbyte.H)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -