mtb-pmbus 1.2.0.1772
 
Loading...
Searching...
No Matches
Status Functions

General Description

Functions

bool mtb_pmbus_ctrl_bus_is_busy (mtb_pmbus_ctrl_stc_t *inst)
 Check if the PMBus bus is busy.
 
mtb_pmbus_ctrl_status_t mtb_pmbus_ctrl_get_status (mtb_pmbus_ctrl_stc_t *inst)
 Get the status of the PMBus controller.
 
mtb_pmbus_ctrl_status_t mtb_pmbus_ctrl_wait_cmpl (mtb_pmbus_ctrl_stc_t *inst, uint32_t timeout)
 Wait for the transfer completion with a timeout.
 

Function Documentation

◆ mtb_pmbus_ctrl_bus_is_busy()

bool mtb_pmbus_ctrl_bus_is_busy ( mtb_pmbus_ctrl_stc_t * inst)

Check if the PMBus bus is busy.

This function checks the hardware status of the PMBus bus to determine if it's currently occupied by another controller or if there's ongoing communication.

Parameters
instThe pointer to the PMBus controller instance structure. Must not be NULL.
Returns
bool Bus status:
  • true: The PMBus bus is currently busy (occupied by another controller or ongoing transfer)
  • false: The PMBus bus is free and available for new transfers
Note
This is a non-blocking function that returns the current bus state immediately.

◆ mtb_pmbus_ctrl_get_status()

mtb_pmbus_ctrl_status_t mtb_pmbus_ctrl_get_status ( mtb_pmbus_ctrl_stc_t * inst)

Get the status of the PMBus controller.

This function checks the internal state and error flags of the PMBus controller to determine its current operational status. It provides information about whether the controller is ready for new operations, currently busy with a transfer, or has encountered an error.

Parameters
instThe pointer to the PMBus controller instance structure.
Returns
mtb_pmbus_ctrl_status_t The current status of the controller:
  • MTB_PMBUS_CTRL_STATUS_IS_READY: The controller is ready to accept new transfers
  • MTB_PMBUS_CTRL_STATUS_IS_BUSY: The controller is currently processing a transfer
  • MTB_PMBUS_CTRL_STATUS_BAD_PARAM: The invalid parameter (inst is NULL)
Note
This function performs a non-blocking status check of the controller internal state.

◆ mtb_pmbus_ctrl_wait_cmpl()

mtb_pmbus_ctrl_status_t mtb_pmbus_ctrl_wait_cmpl ( mtb_pmbus_ctrl_stc_t * inst,
uint32_t timeout )

Wait for the transfer completion with a timeout.

This function polls the PMBus controller status until the transfer is complete or the specified timeout expires. It checks the controller status every microsecond and returns when the controller becomes ready or when a timeout occurs.

Parameters
instThe pointer to the PMBus controller instance structure. Must not be NULL.
timeoutThe timeout value in microseconds. The function will wait up to this many microseconds for the transfer to complete. A value of 0 will perform a single status check without waiting.
Returns
mtb_pmbus_ctrl_status_t Status of the operation:
  • MTB_PMBUS_CTRL_STATUS_IS_READY: Transfer completed
  • MTB_PMBUS_CTRL_STATUS_TIMEOUT: A timeout occurred before completion
  • MTB_PMBUS_CTRL_STATUS_BAD_PARAM: Invalid parameter (inst is NULL)
Note
This function uses a blocking wait with 1 microsecond polling interval.
The function will delay for 1 microsecond between each status check.
If timeout is 0, the function performs only one status check without delay.