mtb-pmbus 1.4.0.2051
 
Loading...
Searching...
No Matches
SMBALERT Functions

General Description

Functions

void mtb_pmbus_smbalert_config_mode (mtb_pmbus_stc_t *inst, mtb_pmbus_smbalert_mode_t mode)
 Sets the mode for SMBALERT pin.
 
void mtb_pmbus_smbalert_set_signal (mtb_pmbus_stc_t *inst)
 Set low level for SMBALERT pin.
 
void mtb_pmbus_smbalert_clear_signal (mtb_pmbus_stc_t *inst)
 Set hign level for SMBALERT pin.
 
uint8_t mtb_pmbus_smbalert_apply_mask (mtb_pmbus_stc_t *inst, uint8_t status_cmd_code, uint8_t status_bits)
 Applies the currently configured SMBALERT_MASK (0x1B) mask for the given STATUS_x command code to a set of candidate status bits.
 

Function Documentation

◆ mtb_pmbus_smbalert_config_mode()

void mtb_pmbus_smbalert_config_mode ( mtb_pmbus_stc_t * inst,
mtb_pmbus_smbalert_mode_t mode )

Sets the mode for SMBALERT pin.

Note
This function is only available when MTB_PMBUS_SUPPORT_SMBALERT is enabled at compile time options.
Parameters
instThe pointer to the PMBus instance structure
modeThe selected mode, mtb_pmbus_smbalert_mode_t

◆ mtb_pmbus_smbalert_set_signal()

void mtb_pmbus_smbalert_set_signal ( mtb_pmbus_stc_t * inst)

Set low level for SMBALERT pin.

Once the SMBALERT signal sets to 0, the Middleware starts to response on Alert Response Address.

This function does nothing if mtb_pmbus_stc_config_t::enable_smbalert is set to NULL.

Note
This function is only available when MTB_PMBUS_SUPPORT_SMBALERT is enabled at compile time options.
Parameters
instThe pointer to the PMBus instance structure

◆ mtb_pmbus_smbalert_clear_signal()

void mtb_pmbus_smbalert_clear_signal ( mtb_pmbus_stc_t * inst)

Set hign level for SMBALERT pin.

This function does nothing if mtb_pmbus_stc_config_t::enable_smbalert is set to NULL.

The middleware stops response on Alert Response Address once this function is called. If the SMBALERT mode is MTB_PMBUS_SMBALERT_MODE_AUTO, the middleware automatic clears the SMBALERT signal, otherwise clear the signal manually in mtb_pmbus_handle_events_t callback when MTB_PMBUS_ALERT_RESPONSE_ADDR_EVENT is triggered.

Note
This function is only available when MTB_PMBUS_SUPPORT_SMBALERT is enabled at compile time options.
Parameters
instThe pointer to the PMBus instance structure

◆ mtb_pmbus_smbalert_apply_mask()

uint8_t mtb_pmbus_smbalert_apply_mask ( mtb_pmbus_stc_t * inst,
uint8_t status_cmd_code,
uint8_t status_bits )

Applies the currently configured SMBALERT_MASK (0x1B) mask for the given STATUS_x command code to a set of candidate status bits.

Per the PMBus specification, the bits in a SMBALERT_MASK mask byte align with the bits of the corresponding STATUS_x register: a mask bit of 1 blocks the associated status bit from causing the SMBALERT# signal to be assigned; a mask bit of 0 allows it. The application code that detects a fault/warning condition should call this function with the relevant STATUS_x command code and the raw candidate status bits, then only call mtb_pmbus_smbalert_set_signal if the returned value is non-zero.

In addition to a register's own mask, this function also applies the cross-register cascading effect that masking STATUS_BYTE or STATUS_WORD has on the following registers, when status_cmd_code identifies one of them: STATUS_VOUT, STATUS_IOUT, STATUS_INPUT, STATUS_TEMPERATURE, STATUS_CML, STATUS_OTHER, STATUS_MFR_SPECIFIC, STATUS_FANS_1_2, and STATUS_FANS_3_4. Masking via STATUS_BYTE/STATUS_WORD only ever adds more blocked bits; it never unblocks a bit already blocked by the register's own mask.

Note
Any other manufacturer-specific/uncategorized byte status command is unaffected by this cascading behavior - only the application knows which of its status commands fall outside the named list above (this corresponds to the catch-all "none of the above"/ "unknown" bit of STATUS_BYTE/STATUS_WORD). To honor that bit for such a command, call this function a second time with STATUS_BYTE's (0x78) or STATUS_WORD's (0x79) own command code and a candidate value with only that catch-all bit set (bit 0 for both); a return value of 0 means the catch-all bit is masked and the application should suppress SMBALERT# for the uncategorized condition as well, e.g.:
if (mtb_pmbus_smbalert_apply_mask(inst, 0x78U, 0x01U) == 0U)
{
// STATUS_BYTE's "none of the above" bit is masked: suppress SMBALERT# for any
// uncategorized fault/warning not covered by the named registers above.
}
uint8_t mtb_pmbus_smbalert_apply_mask(mtb_pmbus_stc_t *inst, uint8_t status_cmd_code, uint8_t status_bits)
Applies the currently configured SMBALERT_MASK (0x1B) mask for the given STATUS_x command code to a s...
The mask is global per STATUS_x command code - it applies identically regardless of the active PAGE/PHASE, even if status_cmd_code identifies a register that itself varies by page (e.g. STATUS_VOUT, STATUS_IOUT). This is not a simplification: the SMBALERT_MASK wire protocol has no PAGE/PHASE field (only TARGET ADDRESS, SMBALERT_MASK command code, STATUS_x command code, and the mask byte), so a per-page mask has no standard representation and would be a specification deviation. Applications needing different masking per page/rail must track that distinction themselves and re-apply the appropriate mask value.
This function is only available when MTB_PMBUS_IMPL_CMD_SMBALERT_MASK is enabled at compile time options.
Parameters
instThe pointer to the PMBus instance structure
status_cmd_codeThe STATUS_x command code the candidate bits belong to
status_bitsThe raw candidate status bits about to be signalled
Returns
uint8_t The subset of status_bits that are not masked (0 means fully masked - do not assert SMBALERT# for this condition)