+ //\r
+ // Set the appropriate Host Control Register and auxiliary Control Register.\r
+ //\r
+ AuxiliaryControl = 0;\r
+ if (SMBUS_LIB_PEC (SmBusAddress)) {\r
+ AuxiliaryControl |= SMBUS_B_AAC;\r
+ HostControl |= SMBUS_B_PEC_EN;\r
+ }\r
+ //\r
+ // Set Host Commond Register.\r
+ //\r
+ InternalSmBusIoWrite8 (SMBUS_R_HST_CMD, (UINT8) SMBUS_LIB_COMMAND (SmBusAddress));\r
+ //\r
+ // Write value to Host Data 0 and Host Data 1 Registers.\r
+ //\r
+ InternalSmBusIoWrite8 (SMBUS_R_HST_D0, (UINT8) Value);\r
+ InternalSmBusIoWrite8 (SMBUS_R_HST_D1, (UINT8) (Value >> 8));\r
+ //\r
+ // Set Auxiliary Control Regiester.\r
+ //\r
+ InternalSmBusIoWrite8 (SMBUS_R_AUX_CTL, AuxiliaryControl);\r
+ //\r
+ // Set SMBUS slave address for the device to send/receive from.\r
+ //\r
+ InternalSmBusIoWrite8 (SMBUS_R_XMIT_SLVA, (UINT8) SmBusAddress);\r
+ //\r
+ // Start the SMBUS transaction and wait for the end.\r
+ //\r
+ ReturnStatus = InternalSmBusStart (HostControl);\r
+ //\r
+ // Read value from Host Data 0 and Host Data 1 Registers.\r
+ //\r
+ Value = InternalSmBusIoRead8 (SMBUS_R_HST_D1) << 8;\r
+ Value |= InternalSmBusIoRead8 (SMBUS_R_HST_D0);\r
+ //\r
+ // Clear Host Status Register and Auxiliary Status Register.\r
+ //\r
+ InternalSmBusIoWrite8 (SMBUS_R_HST_STS, SMBUS_B_HSTS_ALL);\r
+ InternalSmBusIoWrite8 (SMBUS_R_AUX_STS, SMBUS_B_CRCE);\r