27.10.2015 Views

Advanced Configuration and Power Interface Specification

ACPI_6.0

ACPI_6.0

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Advanced</strong> <strong>Configuration</strong> <strong>and</strong> <strong>Power</strong> <strong>Interface</strong> <strong>Specification</strong><br />

by this protocol <strong>and</strong> thus only a single element (at offset 0) can be specified in the field definition.<br />

This protocol transfers no data.<br />

The following ASL code illustrates how a device supporting the Read/Write Quick protocol should<br />

be accessed:<br />

OperationRegion(SMBD, SMBus, 0x4200, 0x100) // SMBus device at slave address 0x42<br />

Field(SMBD, BufferAcc, NoLock, Preserve)<br />

{<br />

AccessAs(BufferAcc, SMBQuick)<br />

// Use the SMBus Read/Write Quick protocol<br />

FLD0, 8 // Virtual register at comm<strong>and</strong> value 0.<br />

}<br />

/* Create the SMBus data buffer */<br />

Name(BUFF, Buffer(34){})<br />

CreateByteField(BUFF, 0x00, OB1)<br />

/* Signal device (e.g. OFF) */<br />

Store(FLD0, BUFF)<br />

If(LEqual(OB1, 0x00)) {…}<br />

/* Signal device (e.g. ON) */<br />

Store(BUFF, FLD0)<br />

// Create SMBus data buffer as BUFF<br />

// OB1 = Status (Byte)<br />

// Invoke Read Quick transaction<br />

// Successful?<br />

// Invoke Write Quick transaction<br />

In this example, a single field element (FLD0) at offset 0 is defined to represent the protocol’s read/<br />

write bit. Access to FLD0 will cause an SMBus transaction to occur to the device. Reading the field<br />

results in a Read Quick, <strong>and</strong> writing to the field results in a Write Quick. In either case data is not<br />

transferred—access to the register is simply used as a mechanism to invoke the transaction.<br />

13.3.2 Send/Receive Byte (SMBSendReceive)<br />

The SMBus Send/Receive Byte protocol (SMBSendReceive) transfers a single byte of data. Like<br />

Read/Write Quick, comm<strong>and</strong> values are not used by this protocol <strong>and</strong> thus only a single element (at<br />

offset 0) can be specified in the field definition.<br />

The following ASL code illustrates how a device supporting the Send/Receive Byte protocol should<br />

be accessed:<br />

OperationRegion(SMBD, SMBus, 0x4200, 0x100) // SMBus device at slave address 0x42<br />

Field(SMBD, BufferAcc, NoLock, Preserve)<br />

{<br />

}<br />

AccessAs(BufferAcc, SMBSendReceive) // Use the SMBus Send/Receive Byte protocol<br />

FLD0, 8 // Virtual register at comm<strong>and</strong> value 0.<br />

// Create the SMBus data buffer<br />

Name(BUFF, Buffer(34){})<br />

CreateByteField(BUFF, 0x00, STAT)<br />

CreateByteField(BUFF, 0x02, DATA)<br />

// Create SMBus data buffer as BUFF<br />

// STAT = Status (Byte)<br />

// DATA = Data (Byte)<br />

670 April, 2015 Version 6.0

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!