mtb-pmbus
Enumerated Types

General Description

Enumerations

enum  mtb_pmbus_status_t {
  MTB_PMBUS_STATUS_SUCCESS = MTB_PMBUS_HAL_STATUS_SUCCESS ,
  MTB_PMBUS_STATUS_INVALID_CMD_CODE = MTB_PMBUS_HAL_STATUS_INVALID_CMD_CODE ,
  MTB_PMBUS_STATUS_INVALID_PAGE = MTB_PMBUS_HAL_STATUS_INVALID_PAGE ,
  MTB_PMBUS_STATUS_INVALID_PHASE = MTB_PMBUS_HAL_STATUS_INVALID_PHASE ,
  MTB_PMBUS_STATUS_BAD_PARAM = MTB_PMBUS_HAL_STATUS_BAD_PARAM ,
  MTB_PMBUS_STATUS_TOO_MANY_BYTES = MTB_PMBUS_HAL_STATUS_TOO_MANY_BYTES ,
  MTB_PMBUS_STATUS_CMD_IS_ACTIVE = MTB_PMBUS_HAL_STATUS_CMD_IS_ACTIVE ,
  MTB_PMBUS_STATUS_IS_BUSY = MTB_PMBUS_HAL_STATUS_IS_BUSY
}
 Used to return the statuses of most PMBus APIs. More...
 
enum  mtb_pmbus_smbalert_mode_t {
  MTB_PMBUS_SMBALERT_MODE_MANUAL = 0U ,
  MTB_PMBUS_SMBALERT_MODE_AUTO = 1U
}
 The modes for SMBALERT pin. More...
 
enum  mtb_pmbus_events_t {
  MTB_PMBUS_QUICK_CMD_RD_EVENT = 0U ,
  MTB_PMBUS_QUICK_CMD_WR_EVENT = 1U ,
  MTB_PMBUS_RECEIVE_BYTE_EVENT = 2U ,
  MTB_PMBUS_RECEIVE_BYTE_CMPLT_EVENT = 3U ,
  MTB_PMBUS_ALERT_RESPONSE_ADDR_EVENT = 4U
}
 General events for PMBus Middleware. More...
 
enum  mtb_pmbus_cmd_events_t {
  MTB_PMBUS_CMD_MATCH = 0U ,
  MTB_PMBUS_CMD_WRITE_BYTE = 1U ,
  MTB_PMBUS_CMD_WRITE_DONE = 2U ,
  MTB_PMBUS_CMD_READ_REQ = 3U ,
  MTB_PMBUS_CMD_READ_DONE = 4U ,
  MTB_PMBUS_CMD_DONE = 5U ,
  MTB_PMBUS_CMD_ARB_LOST = 6U
}
 Command specific events. More...
 
enum  mtb_pmbus_zone_events_t {
  MTB_PMBUS_ZONE_READ_STATUS_CMPLT = 0U ,
  MTB_PMBUS_ZONE_READ_STATUS_BYTE_REQ = 1U ,
  MTB_PMBUS_ZONE_READ_STATUS_WORD_REQ = 2U ,
  MTB_PMBUS_ZONE_CONFIG_RD = 3U ,
  MTB_PMBUS_ZONE_CONFIG_WR = 4U ,
  MTB_PMBUS_ZONE_ACTIVE_RD = 5U ,
  MTB_PMBUS_ZONE_ACTIVE_WR = 6U
}
 Zone events. More...
 
enum  mtb_pmbus_hw_resources_ctrl_action_t {
  MTB_PMBUS_HW_RESOURCES_ENABLE = 0U ,
  MTB_PMBUS_HW_RESOURCES_DISABLE = 1U
}
 I2C HW actions. More...
 
enum  mtb_pmbus_revision_t { MTB_PMBUS_REVISION_1_4 = 0U }
 Revision of the PMBus specification. More...
 
enum  mtb_pmbus_speed_t {
  MTB_PMBUS_SPEED_100 = 0U ,
  MTB_PMBUS_SPEED_400 = 1U ,
  MTB_PMBUS_SPEED_1000 = 2U
}
 The Bus Speed. More...
 

Enumeration Type Documentation

◆ mtb_pmbus_status_t

Used to return the statuses of most PMBus APIs.

Enumerator
MTB_PMBUS_STATUS_SUCCESS 

Correct status.

No error.

MTB_PMBUS_STATUS_INVALID_CMD_CODE 

The provided command code is incorrect.

MTB_PMBUS_STATUS_INVALID_PAGE 

The provided page is incorrect.

MTB_PMBUS_STATUS_INVALID_PHASE 

The provided phase is incorrect.

MTB_PMBUS_STATUS_BAD_PARAM 

One or more of input parameters are invalid.

MTB_PMBUS_STATUS_TOO_MANY_BYTES 

The requested size is bigger than command size.

MTB_PMBUS_STATUS_CMD_IS_ACTIVE 

The requested action is aborted for the command as this command takes part in communication.

MTB_PMBUS_STATUS_IS_BUSY 

The requested action is aborted as the PMBus instance takes part in communication.

◆ mtb_pmbus_smbalert_mode_t

The modes for SMBALERT pin.

Note
This enum is only available when MTB_PMBUS_SUPPORT_SMBALERT is enabled at compile time options.
Enumerator
MTB_PMBUS_SMBALERT_MODE_MANUAL 

The user must manually clear SMBALERT signal.

Typically, in the Alert Response Address callback function.

MTB_PMBUS_SMBALERT_MODE_AUTO 

The middleware automatically clears SMBALERT signal after receiving Alert Response Address.

◆ mtb_pmbus_events_t

General events for PMBus Middleware.

Enumerator
MTB_PMBUS_QUICK_CMD_RD_EVENT 

Quick command event with Read bit.

MTB_PMBUS_QUICK_CMD_WR_EVENT 

Quick command event with Write bit.

MTB_PMBUS_RECEIVE_BYTE_EVENT 

Receive byte is requested by the controller.

Use this event to update data byte before sending. This event is triggered in two cases: when the controller requests the Receive byte or when the controller sends Quick command with Read bit. Use MTB_PMBUS_RECEIVE_BYTE_CMPLT_EVENT to determine if the controller requests Receive byte or Quick command is executed.

MTB_PMBUS_RECEIVE_BYTE_CMPLT_EVENT 

Receive byte protocol is executed.

MTB_PMBUS_ALERT_RESPONSE_ADDR_EVENT 

The target successfully sent its own address to Host.

This event occurs only when SMBALERT signal is pulled down by this Target Device. If SMBALERT mode is manual ( MTB_PMBUS_SMBALERT_MODE_MANUAL), use this event to stop pulling down of SMBALERT signal.

◆ mtb_pmbus_cmd_events_t

Command specific events.

Enumerator
MTB_PMBUS_CMD_MATCH 

Command match event.

Inside this event, the application can protect or disable the command. In this case, the middleware sends NACK after receiving the command code.

MTB_PMBUS_CMD_WRITE_BYTE 

The controller sends a data byte.

Using this event, the application may decide whether ACK or NACK will be sent after receiving the byte.

MTB_PMBUS_CMD_WRITE_DONE 

Write is completed.

The application can read the received data inside the callback by mtb_pmbus_cmd_read_data_isr or mtb_pmbus_cmd_read_data_ext_isr. For complex protocols, like Group Protocol, it is recommended to apply the received value only when the MTB_PMBUS_CMD_DONE event occurs on the bus.

MTB_PMBUS_CMD_READ_REQ 

Read data is requested.

The application can update the data before sending it to the controller inside this callback by mtb_pmbus_cmd_update_data_isr or mtb_pmbus_cmd_update_data_ext_isr

MTB_PMBUS_CMD_READ_DONE 

Read is completed.

This event does not mean that transfer is completed. When complex protocols are initiated on the bus, like Zone Read, the completion of read request does not mean that the controller completes the transfer, so it is recommended to consider the data receiving event on the controller side only when MTB_PMBUS_CMD_DONE is occurred.

MTB_PMBUS_CMD_DONE 

The transfer for command is completed, STOP event occurs on the Bus.

The application can perform any actions over a command including enabling or disabling all commands. Before this event, the middleware clears the active transfer status.

MTB_PMBUS_CMD_ARB_LOST 

The command arbitration is lost.

This event occurs when the target loses arbitration during a command transfer.

◆ mtb_pmbus_zone_events_t

Zone events.

Note
This enum is only available when MTB_PMBUS_SUPPORT_ZONE is enabled at compile time options.
Enumerator
MTB_PMBUS_ZONE_READ_STATUS_CMPLT 

Zone Read protocol is completed.

MTB_PMBUS_ZONE_READ_STATUS_BYTE_REQ 

The Status byte is requested.

MTB_PMBUS_ZONE_READ_STATUS_WORD_REQ 

The Word byte is requested.

MTB_PMBUS_ZONE_CONFIG_RD 

The controller assigns the new read zone for the whole instance or specific page.

The requested zone value can be accepted or rejected by setting the return value for the callback: 0U - NACK is sent after receiving the requested value, 1U - ACK is sent after receiving the requested value.

Note
This enum value is only available when MTB_PMBUS_ZONE_SEL_ADV is enabled at compile time options.
MTB_PMBUS_ZONE_CONFIG_WR 

The controller assigns a new write zone for the whole instance or specific page.

The requested zone value can be accepted or rejected by setting the return value for callback: 0U - NACK is sent after receiving the the requested value, 1U - ACK is sent after receiving the requested value.

Note
This enum value is only available when MTB_PMBUS_ZONE_SEL_ADV is enabled at compile time options.
MTB_PMBUS_ZONE_ACTIVE_RD 

The controller selects the new active read zone.

The requested zone value can be accepted or rejected by setting the return value for callback: 0U - the NACK is sent after receiving the requested value, 1U - the ACK is sent after receiving the requested value.

Note
This enum value is only available when MTB_PMBUS_ZONE_SEL_ADV is enabled at compile time options.
MTB_PMBUS_ZONE_ACTIVE_WR 

The controller selects the new active write zone.

The requested zone value can be accepted or rejected by setting the return value for callback: 0U - NACK is sent after receiving the requested value, 1U - ACK is sent after receiving the requested value.

Note
This enum value is only available when MTB_PMBUS_ZONE_SEL_ADV is enabled at compile time options.

◆ mtb_pmbus_hw_resources_ctrl_action_t

I2C HW actions.

Enumerator
MTB_PMBUS_HW_RESOURCES_ENABLE 

Enable the I2C HW.

MTB_PMBUS_HW_RESOURCES_DISABLE 

Disable the I2C HW.

◆ mtb_pmbus_revision_t

Revision of the PMBus specification.

Note
This enum is only available when MTB_PMBUS_IMPL_CMD_REVISION is enabled at compile time options.
Enumerator
MTB_PMBUS_REVISION_1_4 

PMBus revision 1.4.

◆ mtb_pmbus_speed_t

The Bus Speed.

Note
This enum is only available when MTB_PMBUS_IMPL_CMD_CAPABILITY is enabled at compile time options.
Enumerator
MTB_PMBUS_SPEED_100 

The maximum supported bus speed is 100 kHz.

MTB_PMBUS_SPEED_400 

The maximum supported bus speed is 400 kHz.

MTB_PMBUS_SPEED_1000 

The maximum supported bus speed is 1 MHz.