這篇是 Smart Battery Selector Specification Revision 1.1  的第5章的對照翻譯

原始文件可以去SBS的論壇下載,網址:http://www.sbs-forum.org/specs/

 

這篇講SB selector 的介面的,也就是指令的部分

指令只有3個,跟data spec.還有charger spec. 比起來,算是輕鬆寫意了

 

最後面順便貼一下附錄A的指令表

方便參照,短短的

這文件就只有一個附錄

 

 

==================

 

 

翻譯是先用google翻譯過一遍

再人工調整成我看得懂的版本

但有的句子很難翻

如果有看起來很怪或語意怪怪的句子

請以英文原文為主!!

 

 

翻譯附註:

SMBus Host => SMBus 主機(通常就是指Keyboard Controller)

Master:主設備(避免跟host混淆)

Slave:從設備

 

 

 

 

 

=====

 

 

 

 

5. Smart Battery Selector Interface

 

The following functions are used by the Smart Battery to communicate with a SMBus Host, Smart Battery,Smart Battery Charger and other devices connected via the SMBus.

 

下面的函數被智能電池使用,以和SMBus Host、智能電池充電器、和其他經由SMBus連接的裝置進行溝通。

 

 

The functions are described as follows:

 

FunctionName() 0xnn (command code)

 

Description:

A brief description of the function. 函數的簡短描述

 

Purpose:

The purpose of the function, and an example where appropriate.

此函數的目的,以及適當的例子

 

SMBus Protocol: Read or Write Word.

 

Input, Output or Input/Output: A description of the data supplied to or returned by the function. 描述提供給此函數的資料,或函數的回傳資料

 

 

The following commands describe the interface the system software expects when communicating with a Smart Battery Selector. It is acceptable for the system BIOS, or some other device in the system, to intercept and emulate some or all of the selector commands, provided that the selector interface defined below is maintained to the system software.

 

以下命令描述了當與智能電池選擇器進行溝通時,系統軟體期望的界面。 系統BIOS或系統中的某些其他設備可以攔截intercept模擬emulate某些或所有選擇器命令,只要下面定義的選擇器介面被維護maintained到系統軟體即可。

 

 

 

 

 

5.1. SelectorState (0x01)

 

Description:

 

This required function either returns the current state of the selector or allows the state to be altered under programmatic control. The information is broken into four nibbles that report:

 

這個必需的函數要嘛返回選擇器的當前狀態,要嘛允許在程序控制下改變狀態。 該資訊分為四個半字節(nibble),分別報告:

 

Which battery is communicating with the SMBus Host

Which power source is powering the system

Which battery is connected to the smart charger

Which battery(s) are present.

 

哪個電池正在與SMBus主機通信
哪個電源為系統供電
哪種電池連接到智能充電器
存在哪些電池。

 

The selector will have a mechanism to notify the system when there is a change in its state, doing so when:

 

選擇器將具有一種機制,用於在狀態發生變化時通知系統,該機制在以下情況下發出:

 

A battery is added or removed

AC power is connected or disconnected

The selector autonomously switches to another battery (for example, the previous one ran low)

 

添加或移除電池
連接或斷開交流電源
選擇器自動切換到另一個電池(例如,前一個電量不足)

 

 

This function provides simultaneous access to four nibble-wide registers of the following types: one for status, two for status and control, and one purely for control. To ensure that a host writing to a specific register nibble does not inadvertently alter the contents of another register nibble, the host must mask register nibbles it doesn’t want to modify by writing all 1’s (0xF). For example, to set the SMB_X nibble to select the first battery but not change any other values, the host would write 0x1FFF to this function.

 

該函數可同時存取以下類型的四個半字節寬的暫存器:一個用於狀態,兩個用於狀態和控制,以及一個純粹用於控制。 為確保主機寫入特定的 暫存器半字節 不會無意間更改到另一個暫存器半字節 的內容,主機必須通過寫入全10xF)來屏蔽不想修改的暫存器半字節。

例如,要將SMB_X半字節設置為選擇第一個電池而不更改任何其他值,主機將向該函數寫入0x1FFF

 

PS: inadvertently:不慎地;不小心地、不經意地

 

Purpose:

 

Used by the system host to determine the current state of the selector and attached batteries.

It also may be used to determine the state of the battery system after the selector notifies the system of a change.

 

由系統主機用來確定選擇器所連電池當前狀態。 在選擇器將更改通知系統後,它還可用於確定電池系統的狀態。

 

SMBus Protocol: Read or Write Word

 

Input/Output: word -- bit flags in nibbles mapped as follows: 半字節中的位元旗標映射如下

 

圖片

 

 

 

SMB_X nibble

 

The read/write SMB_X nibble is used by the SMBus Host either to select which battery to communicate with or to determine which battery it is communicating with. Normally, this nibble selects the same battery as the POWER_BY_X nibble. At most, one bit may be set in this register. When writing a value to the POWER_BY_X nibble, the SMB_X nibble MUST have the same bit set.

 

SMBus主機使用 讀/SMB_X半字節 來選擇要與之通信的電池,或者用以確定正在與之通信的電池。 通常,該半字節選擇與 POWER_BY_X半字節 相同的電池。 最多可以在該暫存器中設置一個位元。 在將值寫入POWER_BY_X半字節 時,SMB_X半字節 務必設置相同的位元。

 

For example, an application that displays the remaining capacity of all batteries would use this nibble to select each battery in turn and get its capacity. The bits are defined as follows:

 

例如,一個顯示所有電池剩餘電量的應用程序將使用此半字節,依次選擇每個電池,並獲取其容量。 這些位元定義如下:

 

0x8000 SMB_D Host SMBus is connected to Battery D

0x4000 SMB_C Host SMBus is connected to Battery C

0x2000 SMB_B Host SMBus is connected to Battery B

0x1000 SMB_A Host SMBus is connected to Battery A

0x0000 Host SMBus is not connected to a Battery or to an undetermined battery 主機SMBus未連接到電池或未確定的電池

 

 

Note: At most one bit may be set in this nibble.

 

注意:此半字節中最多可以設置一位元。

 

 

POWER_BY_X nibble

 

The read/write POWER_BY_X nibble is used by the SMBus Host either to select which battery will power the system or to determine which battery is powering the system.

It is important to note that any change in the SMB_X nibble is persistent and must be checked to determine that the system is actually communicating with the battery that is supplying power.

When selecting which battery will power the system by either a user intervention or autonomously, both the POWER_BY_X nibble and the SMB_X nibble MUST have the same bit set.

 

In addition, these bits will be inverted whenever the selector detects the charger is charging a battery, if this feature is supported by the selector as indicated by the CHARGING_INDICATOR bit flag in SelectorInfo().

 

SMBus主機使用 讀/POWER_BY_X半字節 來選擇要為系統供電的電池,或確定正在為系統供電的電池。 重要的是要注意,SMB_X半字節 中的任何更改都是持久性的,必須進行檢查以確定系統實際上正在與正在供電的電池進行通信。 當通過用戶干預或自主干預,選擇為系統供電的電池時,POWER_BY_X半字節 和SMB_X半字節 必須設置為相同的位元。

 

此外,如果選擇器支持此功能(如SelectorInfo()中的CHARGING_INDICATOR位元旗標所指示),只要選擇器檢測到充電器正在為電池充電,這些位元都將反轉inverted)。

 

The bits are defined as follows: 這些位元定義如下

 

0x0800 POWER_BY_D Set system to communicate with and be powered by Battery D

0x0400 POWER_BY_C Set system to communicate with and be powered by Battery C

0x0200 POWER_BY_B Set system to communicate with and be powered by Battery B

0x0100 POWER_BY_A Set system to communicate with and be powered by Battery A

0x0000 POWER_BY_AC Set system to be powered by AC power

 

 

Note: If the Selector supports reporting the Charger’s status through this nibble, other valid values are 0x7, 0xB, 0xD, 0xE, and 0xF in addition to 0x0, 0x1, 0x2, 0x4, and 0x8 -- all other bit combinations are not allowed.

 

注意:如果選擇器支持通過此半字節報告充電器的狀態,則除0x00x10x20x40x8以外,其他有效值為0x70xB0xD0xE0xF(即0111, 1011, 1101, 1110, 1111

----- 不允許所有其他的位元組合 。

 

When writing to this nibble, the host should write positive logic without concern for whether or not the value should be inverted due to the presence of charging. For example, to set the power_by connection to battery A, even if the charger is charging, the host should write 0x1 to this nibble (and not 0xE).

 

寫入該半字節時,主機應寫入正邏輯(positive logic),而不必擔心是否由於存在充電而將值取反(inverted)。 例如,要設置與電池Apower_by連接,即使充電器正在充電,主機也應向該半字節寫入0x1(而不是0xE)。 0xE=1110b

 

 

 

CHARGE_X nibble

 

The read/write CHARGE_X nibble is used by the SMBus Host either to select which, if any, battery will be connected to the charger or to determine which, if any, battery is already connected to the charger.

In addition, these bits will be inverted whenever AC is present (for example, 0x1 - no AC -> 0xE -AC present). Whether or not AC is present, up to only one bit may be set (i.e., written) to indicate which, if any, battery to charge.

 

SMBus主機使用 讀/CHARGE_X半字節 來選擇將哪個電池(如果有的話)連接到充電器,或者確定哪一個電池(如果有的話)已經連接到充電器。

此外,只要存在AC(例如0x1-不存在AC-> 0xE -AC),這些位元將被反轉。 無論是否存在交流電,最多只能設置(即寫入)一位元來指示要為哪個電池充電(如果有的話)。
 

The bits are defined as follows: 這些位元定義如下

 

0x0080 CHARGE_D Set to charge Battery D

0x0040 CHARGE_C Set to charge Battery C

0x0020 CHARGE_B Set to charge Battery B

0x0010 CHARGE_A Set to charge Battery A

0x0000 No Battery or undetermined Battery connected to charger

充電器未連接電池或連接到不明的電池

 

 

Note: This nibble will be inverted if AC power is present; therefore, valid values are 0x0, 0x1, 0x2, 0x4, 0x8, 0xF, 0xE, 0xD, 0xB, and 0x7 -- all other bit combinations are not allowed.

When writing to this nibble, the host should write positive logic without concern for whether or not the value should be inverted due to the presence of AC power. For example, to set the charger connection to battery 2, even if AC is present, the host should write 0x2 to this nibble (and not 0xD).

 

注意:如果有交流電源,此半字節將被反轉; 因此,有效值為0x00x10x20x40x80xF0xE0xD0xB0x7 ---- 不允許所有其他的位元組合。
寫入此半字節時,主機應寫入正邏輯,而不必擔心由於存在交流電源而導致該值是否應反轉。 例如,要將充電器連接到電池2,即使存在交流電,主機也應在該半字節中寫入0x2(而不是0xD)。

 

 

 

PRESENT_X nibble

 

The read only PRESENT_X nibble is used by the SMBus Host to determine how many and which batteries are present.

 

SMBus主機使用唯讀的PRESENT_X半字節來確定有多少電池。

 

The bits are defined as follows: 這些位元定義如下

 

0x0008 PRESENT_D Battery D is present

0x0004 PRESENT_C Battery C is present

0x0002 PRESENT_B Battery B is present

0x0001 PRESENT_A Battery A is present

 

Note: Each bit in the PRESENT_X nibble will be set independently to indicate the presence of a battery.

 

注意:PRESENT_X半字節中的每個位元將獨立設置,以指示電池的存在。

 

 

 

 

 

 

 

5.2. SelectorPresets (0x02)

 

Description:

 

This optional function allows a system to select the next battery it wants to power the system in the event that the current battery is removed or falls below its cutoff voltage. It also allows the system to select which batteries are OK to use.

 

此可選功能允許系統在當前電池被卸下或低於其截止電壓的情況下,選擇要為其供電的下一個電池。 它還允許系統選擇可以使用(OK to use)的電池。

 

Purpose:

 

Used by the system host to preset expected system behaviors. In a notebook computer where AC is present, the power management system might want to have the battery with the least charge be the next one selected.

 

由系統主機用來預先設置預期的系統行為。 在存在交流電(AC)的筆記本電腦中,電源管理系統可能希望選擇電量最少的電池作為下一個電池。

 

In that same computer, when AC is not present, the power management system might designate the most fully-charged battery as the next one to use. The OK_TO_USE control allows “bad” batteries to be marked as un-useable. For example, a battery with a protection device in the open-circuit state may be present in the system. In this case, the power management system knows that attempts to extract power from this battery will fail and might cause the system’s power integrity to be compromised.


在同一台電腦上,如果不使用交流電,則電源管理系統可能會指定充滿電的電池作為下一個要使用的電池。 OK_TO_USE控件 允許將“壞”電池標記為不可用。 例如,系統中可能出現 帶有保護裝置的電池 處於開路狀態。 在這種情況下,電源管理系統知道從該電池中提取電源的嘗試將失敗,並可能導致系統的電源完整性受到損害(compromised)。

 

 

SMBus Protocol: Read or Write Word

 

Input/Output: word -- bit flags in nibbles mapped as follows: 半字節中的位元旗標映射如下

 

圖片

 

 

 

USE_NEXT_X nibble

 

The read/write USE_NEXT_X nibble is used by the SMBus Host either to select which battery it wishes to use next or report which battery it will use next. If no bits are written, the selector will use AND report its default. If the selected battery is not present, the selector will use its default.

 

SMBus主機使用 讀/USE_NEXT_X半字節 來選擇下一個要使用的電池,或報告下一個要使用的電池。 如果未寫入任何位元,則選擇器將使用並且報告其默認值。 如果被選擇的電池不存在,則選擇器將使用其默認值。

 

The bits are defined as follows: 這些位元定義如下

 

0x0800 USE_NEXT_D Set to discharge Battery D next

0x0400 USE_NEXT_C Set to discharge Battery C next

0x0200 USE_NEXT_B Set to discharge Battery B next

0x0100 USE_NEXT_A Set to discharge Battery A next

 

Note: Zero or one bits of the USE_NEXT_X nibble may be set. If no bit is set or the selected battery is not present, the selector will default to its own (manufacturer specific) “next battery” algorithm.

 

注意:可以將USE_NEXT_X半字節 的零個或一個位元設置為1。 如果未設置任何位元或被選擇的電池不存在,則選擇器將默認使用其自己的(製造商特定的)“下一個電池”算法。

 

 

OK_TO_USE_X nibble

 

The read/write OK_TO_USE_X nibble is used by the SMBus Host either to select usable batteries or to report which batteries are usable. If a battery is marked NOT OK to use, the selector will NOT allow the battery to be connected to either the system’s power or charger’s power buses.

This nibble may also be used to signal that there is NO battery available by marking all the batteries as not OK to use.

 

SMBus主機使用 讀/OK_TO_USE_X半字節 來選擇可用電池,或報告哪些電池可用。

如果電池標記為“不能使用”NOT OK to use,則選擇器將不允許將電池連接至系統的電源充電器的電源匯流排。 通過將所有電池標記為“不能使用”,此半字節也可用於表示沒有可用電池。

 

The bits are defined as follows: 這些位元定義如下

 

0x0008 OK_TO_USE_D Allow the use of Battery D

0x0004 OK_TO_USE_C Allow the use of Battery C

0x0002 OK_TO_USE_B Allow the use of Battery B

0x0001 OK_TO_USE_A Allow the use of Battery A

 

Note: Each bit in the OK_TO_USE_X nibble may be set independently to indicate that the battery is available for use. The OK_TO_USE_X bit will always be zero when the battery is not present. The OK_TO_USE_X bit will automatically be set whenever the battery is inserted.

 

注意:可以單獨設置OK_TO_USE_X半字節中的每個位元,以指示哪一個電池是可以使用的。 如果沒有電池,則OK_TO_USE_X位元將始終為零。 只要插入電池,OK_TO_USE_X位元將自動設置。

 

 

 

 

 

 

5.3. SelectorInfo (0x04)

 

Description:

 

The SMBus system host uses this command to determine the capabilities of the selector.

 

SMBus系統主機使用此命令來確定選擇器的功能。

 

Purpose:

 

Allows the system host to determine the number of batteries the selector supports as well as the specification revision implemented by the selector.

 

允許系統主機確定選擇器支持的電池數量以及選擇器實現規格修訂

 

SMBus Protocol: Read Word

 

Input/Output: word -- bit flags in nibbles mapped as follows: 半字節中的位元旗標映射如下

 

圖片

 

 

Note: It is acceptable for a selector component to expect the system BIOS to intercept and emulate this command rather than implementing it in the actual device itself.

 

注意:選擇器組件可以期望系統BIOS截取並模擬此命令,而不是在實際設備本身中實現它,這是可以接受的。

 

 

 

 

 

BATTERIES_SUPPORTED nibble

 

The BATTERIES_SUPPORTED nibble is used by the SMBus Host to determine how many and which batteries the selector can support. This specification is written to allow support for up to four batteries, but due to size or cost constraints a given selector may support less than this number. The bits in this nibble are individually hard-coded by the selector to indicate which battery positions the selector supports.

 

SMBus主機使用BATTERIES_SUPPORTED半字節 來確定選擇器可以支持多少電池,以及哪些電池選擇器能夠支持。 此規範的編寫是支持到最多四個電池,但是由於尺寸或成本限制,特定的選擇器可能支持的電池數量少於該數量。 該半字節中的位元由選擇器分別進行硬編碼hard-coded,以指示選擇器有支持哪些電池位置

 

The bits are defined as follows: 這些位元定義如下

 

0x0008 PRESENT_D Battery D is supported by the selector

0x0004 PRESENT_C Battery C is supported by the selector

0x0002 PRESENT_B Battery B is supported by the selector

0x0001 PRESENT_A Battery A is supported by the selector

 

Note: Each bit in the BATTERIES_SUPPORTED nibble will be set independently to indicate the battery positions supported by the selector.

 

注意:BATTERIES_SUPPORTED半字節中的每個位元將獨立設置,以指示選擇器支持的電池位置。

 

 

 

SELECTOR_REVISION nibble

 

The SELECTOR_REVISION is an encoded value used to indicate which version of the Smart Battery Selector specification the selector supports. For Revision 1.0 of the Smart Battery Selector specification, the value will be 1.

 

SELECTOR_REVISION是一個編碼值,用於指示選擇器支持哪個版本的智能電池選擇器規範。 對於智能電池選擇器規範的修訂版1.0,該值為1

 

 

CHARGING_INDICATOR bit flag

 

The CHARGING_INDICATOR is a bit flag that indicates whether or not the selector reports the charger’s status (e.g. the charger is charging a battery or not) in the POWER_BY nibble of SelectorState(). Support of this feature may require a connection between the charger and the selector component. The default is that this feature is supported.

 

CHARGING_INDICATOR是一個位元旗標,指示選擇器是否在SelectorState()的POWER_BY半字節中報告充電器的狀態(例如,充電器是否正在為電池充電)。 要支持此功能,可能需要在充電器和選擇器組件之間建立連接。 默認值為支持此功能。

 

 

 

 

=============
 

 

 

7. Appendix A The command set in tabular form

 

 


In the following table, the function name, its access (r,w), data type and command. For a Smart Battery Selector to be recognized as compliant, it must support all the required functions described by this specification.

 

在下表中,函數名稱,其訪問權限(r,w)數據類型 命令 為了使智能電池選擇器符合標準,它必須支持本規範描述的所有必需功能。

 

 

 

 

圖片

 

 

Notes:


All unused function codes are reserved (0x1d - 0x1f, 0x24 ... 0xff) and may not be used. 

The upper two bits of all command codes are specifically reserved for future use to optionally address multiple battery selectors.

 

所有未使用的功能代碼(0x1d-0x1f,0x24 ... 0xff)都被保留,並且可能不被使用。

所有命令代碼的高兩位都被專門保留,以供將來使用,做為分配地址給多個電池選擇器的可能選項。

 

 

 

 

 

 

 

 

arrow
arrow
    創作者介紹
    創作者 迷途工程師 的頭像
    迷途工程師

    迷途工程師的網路雜記

    迷途工程師 發表在 痞客邦 留言(0) 人氣()