mtb-pmbus
Compile Time Options

General Description

Macros

#define MTB_PMBUS_LOG_LEVEL   (MTB_PMBUS_LOG_LEVEL_WARNING)
 Select the Log Level. More...
 
#define MTB_PMBUS_CUSTOM_LOG   (0U)
 Enable or disable the custom log. More...
 
#define MTB_PMBUS_SUPPORT_PMBUS   (1U)
 Enable or disable PMBus support. More...
 
#define MTB_PMBUS_SUPPORT_ZONE   (1U)
 Enable or disable Zone Write and Zone Read support. More...
 
#define MTB_PMBUS_SUPPORT_SMBALERT   (1U)
 Enable or disable SMBus Alert support. More...
 
#define MTB_PMBUS_SUPPORT_GEN_CALL_ADDR   (1U)
 Enable or disable General Call support. More...
 
#define MTB_PMBUS_SUPPORT_PEC   (1U)
 Enable or disable PEC. More...
 
#define MTB_PMBUS_PAGES_NUM   (0x10U)
 Set the maximum number of pages. More...
 
#define MTB_PMBUS_PHASES_NUM   (0x10U)
 Set the maximum number of phases. More...
 
#define MTB_PMBUS_ENABLE_CONFIG_CHECK   (1U)
 Enable the checking of configuration parameters (recommended only for debug purposes). More...
 
#define MTB_PMBUS_CONFIG_FULL_CHECK   (1U)
 Define the level of the configuration parameter checking: 0U: Minimal checking, only critical parameters (e.g., to avoid hard faults). More...
 
#define MTB_PMBUS_ENABLE_TIMEOUT   (1U)
 Enable the timeout error when the clock line is held low for 25 ms. More...
 
#define MTB_PMBUS_ZONE_MAX_NUM   (0x7FU)
 Define the range for Zone values. More...
 
#define MTB_PMBUS_ZONE_SEL_ADV   (0U)
 When enabled, the application can control the zone selection initiated by the controller using the Zone callback. More...
 
#define MTB_PMBUS_IMPL_CMD_REVISION   (1U)
 Enable or disable the automatic response on the PMBUS_REVISION (0x98) command. More...
 
#define MTB_PMBUS_IMPL_CMD_CAPABILITY   (1U)
 Enable or disable the automatic response on CAPABILITY (0x19) command. More...
 
#define MTB_PMBUS_IMPL_CMD_QUERY   (1U)
 Enable or disable automatic response on QUERY (0x1A) command. More...
 
#define MTB_PMBUS_IMPL_CMD_PAGE   (1U)
 Enable or disable automatic response on PAGE (0x00) command. More...
 
#define MTB_PMBUS_IMPL_CMD_PHASE   (1U)
 Enable or disable automatic response on PHASE (0x04) command. More...
 
#define MTB_PMBUS_IMPL_CMD_ZONE_CONFIG   (1U)
 Enable or disable automatic response on ZONE_CONFIG (0x07) command. More...
 
#define MTB_PMBUS_IMPL_CMD_ZONE_ACTIVE   (1U)
 Enable or disable automatic response on ZONE_ACTIVE (0x08) command. More...
 

Macro Definition Documentation

◆ MTB_PMBUS_LOG_LEVEL

#define MTB_PMBUS_LOG_LEVEL   (MTB_PMBUS_LOG_LEVEL_WARNING)

Select the Log Level.

Default: MTB_PMBUS_LOG_LEVEL_WARNING

◆ MTB_PMBUS_CUSTOM_LOG

#define MTB_PMBUS_CUSTOM_LOG   (0U)

Enable or disable the custom log.

Default: 0U (Disabled)

◆ MTB_PMBUS_SUPPORT_PMBUS

#define MTB_PMBUS_SUPPORT_PMBUS   (1U)

Enable or disable PMBus support.

Default: 1U (Enabled)

The APIs will be not available if this option is disabled:

Note
This option must be enabled to use Zone protocols (MTB_PMBUS_SUPPORT_ZONE), Pages (MTB_PMBUS_PAGES_NUM), Phases (MTB_PMBUS_PHASES_NUM) or any implemented commands. If this option is disabled, all these features must also be disabled (set to 0) to avoid compilation errors.

◆ MTB_PMBUS_SUPPORT_ZONE

#define MTB_PMBUS_SUPPORT_ZONE   (1U)

Enable or disable Zone Write and Zone Read support.

Default: 1U (Enabled)

The APIs will be not available if this option is disabled:

◆ MTB_PMBUS_SUPPORT_SMBALERT

#define MTB_PMBUS_SUPPORT_SMBALERT   (1U)

Enable or disable SMBus Alert support.

Default: 1U (Enabled)

The APIs will be not available if this option is disabled:

◆ MTB_PMBUS_SUPPORT_GEN_CALL_ADDR

#define MTB_PMBUS_SUPPORT_GEN_CALL_ADDR   (1U)

Enable or disable General Call support.

Default: 1U (Enabled)

The APIs will be not available if this option is disabled:

◆ MTB_PMBUS_SUPPORT_PEC

#define MTB_PMBUS_SUPPORT_PEC   (1U)

Enable or disable PEC.

Default: 1U (Enabled)

The APIs will be not available if this option is disabled:

◆ MTB_PMBUS_PAGES_NUM

#define MTB_PMBUS_PAGES_NUM   (0x10U)

Set the maximum number of pages.

The valid range is 0x0-0x20. If set to 0x0, the pages are disabled.

Default: 0x10U

The APIs will be not available if this option is disabled:

◆ MTB_PMBUS_PHASES_NUM

#define MTB_PMBUS_PHASES_NUM   (0x10U)

Set the maximum number of phases.

The valid range is 0x0-0x80. If set to 0x0, the phases are disabled.

Default: 0x10U

The APIs will be not available if this option is disabled:

◆ MTB_PMBUS_ENABLE_CONFIG_CHECK

#define MTB_PMBUS_ENABLE_CONFIG_CHECK   (1U)

Enable the checking of configuration parameters (recommended only for debug purposes).

The checking of configuration parameters is performed in the mtb_pmbus_init function. Enabling this option will increase the code size.

Default: 1U (Enabled)

◆ MTB_PMBUS_CONFIG_FULL_CHECK

#define MTB_PMBUS_CONFIG_FULL_CHECK   (1U)

Define the level of the configuration parameter checking: 0U: Minimal checking, only critical parameters (e.g., to avoid hard faults).

1U: Full checking, includes all parameter validations.

Default: 1U (Full checking)

◆ MTB_PMBUS_ENABLE_TIMEOUT

#define MTB_PMBUS_ENABLE_TIMEOUT   (1U)

Enable the timeout error when the clock line is held low for 25 ms.

The timeout is a mandatory feature of the SMBus specification, so it is recommended to disable it only during debugging.

Default: 1U (Enabled)

◆ MTB_PMBUS_ZONE_MAX_NUM

#define MTB_PMBUS_ZONE_MAX_NUM   (0x7FU)

Define the range for Zone values.

By default, the range 0x00 - 0x7FU is used for normal active zones. But the range can be extended by redefining this macro to cover the reserved for PMBus product manufacturer's values up to 0xBF.

Default: 0x7FU

◆ MTB_PMBUS_ZONE_SEL_ADV

#define MTB_PMBUS_ZONE_SEL_ADV   (0U)

When enabled, the application can control the zone selection initiated by the controller using the Zone callback.

The APIs will be not available if option is disabled:

Default: 0U (Disabled)

◆ MTB_PMBUS_IMPL_CMD_REVISION

#define MTB_PMBUS_IMPL_CMD_REVISION   (1U)

Enable or disable the automatic response on the PMBUS_REVISION (0x98) command.

Default: 1U (Enabled)

Also, enable this command in the run-time configuration: mtb_pmbus_stc_config_t::impl_cmd_mask

◆ MTB_PMBUS_IMPL_CMD_CAPABILITY

#define MTB_PMBUS_IMPL_CMD_CAPABILITY   (1U)

Enable or disable the automatic response on CAPABILITY (0x19) command.

Default: 1U (Enabled)

Also, enable this command in the run-time configuration: mtb_pmbus_stc_config_t::impl_cmd_mask

◆ MTB_PMBUS_IMPL_CMD_QUERY

#define MTB_PMBUS_IMPL_CMD_QUERY   (1U)

Enable or disable automatic response on QUERY (0x1A) command.

Default: 1U (Enabled)

Also, enable this command in the run-time configuration: mtb_pmbus_stc_config_t::impl_cmd_mask

◆ MTB_PMBUS_IMPL_CMD_PAGE

#define MTB_PMBUS_IMPL_CMD_PAGE   (1U)

Enable or disable automatic response on PAGE (0x00) command.

Default: 1U (Enabled)

Also, enable this command in the run-time configuration: mtb_pmbus_stc_config_t::impl_cmd_mask

Note
MTB_PMBUS_PAGES_NUM must be greater than 0 to use this command.

◆ MTB_PMBUS_IMPL_CMD_PHASE

#define MTB_PMBUS_IMPL_CMD_PHASE   (1U)

Enable or disable automatic response on PHASE (0x04) command.

Default: 1U (Enabled)

Also, enable this command in the run-time configuration: mtb_pmbus_stc_config_t::impl_cmd_mask

Note
MTB_PMBUS_PHASES_NUM must be greater than 0 to use this command.

◆ MTB_PMBUS_IMPL_CMD_ZONE_CONFIG

#define MTB_PMBUS_IMPL_CMD_ZONE_CONFIG   (1U)

Enable or disable automatic response on ZONE_CONFIG (0x07) command.

Default: 1U (Enabled)

Also, enable this command in the run-time configuration: mtb_pmbus_stc_config_t::impl_cmd_mask

Note
MTB_PMBUS_SUPPORT_ZONE must be enabled to use this command.

◆ MTB_PMBUS_IMPL_CMD_ZONE_ACTIVE

#define MTB_PMBUS_IMPL_CMD_ZONE_ACTIVE   (1U)

Enable or disable automatic response on ZONE_ACTIVE (0x08) command.

Default: 1U (Enabled)

Also, enable this command in the run-time configuration: mtb_pmbus_stc_config_t::impl_cmd_mask

Note
MTB_PMBUS_SUPPORT_ZONE must be enabled to use this command.