Software APIs
Data Structures | Typedefs | Enumerations | Functions
dif_sysrst_ctrl.h File Reference

(30d7e787c7)

System Reset Controller Device Interface Functions More...

#include "sw/device/lib/dif/autogen/dif_sysrst_ctrl_autogen.h"
#include "sysrst_ctrl_regs.h"

Go to the source code of this file.

Data Structures

struct  dif_sysrst_ctrl_key_combo_config
 Runtime configuration for the System Reset Controller key combination detection feature. More...
 
struct  dif_sysrst_ctrl_input_change_config
 Runtime configuration for the System Reset Controller input signal change detection feature. More...
 
struct  dif_sysrst_ctrl_auto_override_config
 Runtime configuration for the System Reset Controller key signal auto-override feature. More...
 
struct  dif_sysrst_ctrl_pin_config_t
 Runtime configuration for the System Reset Controller output pin override feature. More...
 
struct  dif_sysrst_ctrl_ulp_wakeup_config_t
 Runtime configuration for the System Reset Controller ultra-low-power (ULP) wakeup feature. More...
 

Typedefs

typedef enum dif_sysrst_ctrl_key_combo dif_sysrst_ctrl_key_combo_t
 A System Reset Controller key combination.
 
typedef enum dif_sysrst_ctrl_key dif_sysrst_ctrl_key_t
 System Reset Controller keys that can form a key combination.
 
typedef enum dif_sysrst_ctrl_key_combo_action dif_sysrst_ctrl_key_combo_action_t
 System Reset Controller key combination detection actions.
 
typedef struct dif_sysrst_ctrl_key_combo_config dif_sysrst_ctrl_key_combo_config_t
 Runtime configuration for the System Reset Controller key combination detection feature.
 
typedef enum dif_sysrst_ctrl_input_change dif_sysrst_ctrl_input_change_t
 System Reset Controller input signal changes that may be detected.
 
typedef enum dif_sysrst_ctrl_key_intr_src dif_sysrst_ctrl_key_intr_src_t
 System Reset Controller key interrupt sources.
 
typedef enum dif_sysrst_ctrl_combo_intr_src dif_sysrst_ctrl_combo_intr_src_t
 System Reset Controller combo interrupt sources.
 
typedef struct dif_sysrst_ctrl_input_change_config dif_sysrst_ctrl_input_change_config_t
 Runtime configuration for the System Reset Controller input signal change detection feature.
 
typedef struct dif_sysrst_ctrl_auto_override_config dif_sysrst_ctrl_auto_override_config_t
 Runtime configuration for the System Reset Controller key signal auto-override feature. More...
 
typedef enum dif_sysrst_ctrl_pin dif_sysrst_ctrl_pin_t
 System Reset Controller pins that can be inverted, read, or overridden.
 
typedef struct dif_sysrst_ctrl_pin_config_t dif_sysrst_ctrl_pin_config_t
 Runtime configuration for the System Reset Controller output pin override feature.
 
typedef struct dif_sysrst_ctrl_ulp_wakeup_config_t dif_sysrst_ctrl_ulp_wakeup_config_t
 Runtime configuration for the System Reset Controller ultra-low-power (ULP) wakeup feature. More...
 

Enumerations

enum  dif_sysrst_ctrl_key_combo {
  kDifSysrstCtrlKeyCombo0 = 1U << 0 ,
  kDifSysrstCtrlKeyCombo1 = 1U << 1 ,
  kDifSysrstCtrlKeyCombo2 = 1U << 2 ,
  kDifSysrstCtrlKeyCombo3 = 1U << 3 ,
  kDifSysrstCtrlKeyComboAll = (1U << 4) - 1
}
 A System Reset Controller key combination. More...
 
enum  dif_sysrst_ctrl_key {
  kDifSysrstCtrlKey0 = 1U << 0 ,
  kDifSysrstCtrlKey1 = 1U << 1 ,
  kDifSysrstCtrlKey2 = 1U << 2 ,
  kDifSysrstCtrlKeyPowerButton = 1U << 3 ,
  kDifSysrstCtrlKeyAcPowerPresent = 1U << 4 ,
  kDifSysrstCtrlKeyAll = (1U << 5) - 1
}
 System Reset Controller keys that can form a key combination. More...
 
enum  dif_sysrst_ctrl_key_combo_action {
  kDifSysrstCtrlKeyComboActionBatteryDisable = 1U << 0 ,
  kDifSysrstCtrlKeyComboActionInterrupt = 1U << 1 ,
  kDifSysrstCtrlKeyComboActionEcReset = 1U << 2 ,
  kDifSysrstCtrlKeyComboActionSelfReset = 1U << 3 ,
  kDifSysrstCtrlKeyComboActionAll = (1U << 4) - 1
}
 System Reset Controller key combination detection actions. More...
 
enum  dif_sysrst_ctrl_input_change {
  kDifSysrstCtrlInputPowerButtonH2L = 1U << 0 ,
  kDifSysrstCtrlInputKey0H2L = 1U << 1 ,
  kDifSysrstCtrlInputKey1H2L = 1U << 2 ,
  kDifSysrstCtrlInputKey2H2L = 1U << 3 ,
  kDifSysrstCtrlInputAcPowerPresetH2L = 1U << 4 ,
  kDifSysrstCtrlInputEcResetH2L = 1U << 5 ,
  kDifSysrstCtrlInputFlashWriteProtectH2L = 1U << 6 ,
  kDifSysrstCtrlInputPowerButtonL2H = 1U << 7 ,
  kDifSysrstCtrlInputKey0L2H = 1U << 8 ,
  kDifSysrstCtrlInputKey1L2H = 1U << 9 ,
  kDifSysrstCtrlInputKey2L2H = 1U << 10 ,
  kDifSysrstCtrlInputAcPowerPresetL2H = 1U << 11 ,
  kDifSysrstCtrlInputEcResetL2H = 1U << 12 ,
  kDifSysrstCtrlInputFlashWriteProtectL2H = 1U << 13 ,
  kDifSysrstCtrlInputAll = ((1U << 14) - 1)
}
 System Reset Controller input signal changes that may be detected. More...
 
enum  dif_sysrst_ctrl_key_intr_src {
  kDifSysrstCtrlKeyIntrStatusInputPowerButtonH2L ,
  kDifSysrstCtrlKeyIntrStatusInputKey0H2L ,
  kDifSysrstCtrlKeyIntrStatusInputKey1H2L ,
  kDifSysrstCtrlKeyIntrStatusInputKey2H2L ,
  kDifSysrstCtrlKeyIntrStatusInputAcPowerPresetH2L ,
  kDifSysrstCtrlKeyIntrStatusInputEcResetH2L ,
  kDifSysrstCtrlKeyIntrStatusInputFlashWriteProtectH2L ,
  kDifSysrstCtrlKeyIntrStatusInputPowerButtonL2H ,
  kDifSysrstCtrlKeyIntrStatusInputKey0L2H ,
  kDifSysrstCtrlKeyIntrStatusInputKey1L2H ,
  kDifSysrstCtrlKeyIntrStatusInputKey2L2H ,
  kDifSysrstCtrlKeyIntrStatusInputAcPowerPresetL2H ,
  kDifSysrstCtrlKeyIntrStatusInputEcResetL2H ,
  kDifSysrstCtrlKeyIntrStatusInputFlashWriteProtectL2H
}
 System Reset Controller key interrupt sources. More...
 
enum  dif_sysrst_ctrl_combo_intr_src {
  kDifSysrstCtrlComboIntrStatusCombo0H2L ,
  kDifSysrstCtrlComboIntrStatusCombo1H2L ,
  kDifSysrstCtrlComboIntrStatusCombo2H2L ,
  kDifSysrstCtrlComboIntrStatusCombo3H2L
}
 System Reset Controller combo interrupt sources. More...
 
enum  dif_sysrst_ctrl_pin {
  kDifSysrstCtrlPinKey0In = 1U << 0 ,
  kDifSysrstCtrlPinKey0Out = 1U << 1 ,
  kDifSysrstCtrlPinKey1In = 1U << 2 ,
  kDifSysrstCtrlPinKey1Out = 1U << 3 ,
  kDifSysrstCtrlPinKey2In = 1U << 4 ,
  kDifSysrstCtrlPinKey2Out = 1U << 5 ,
  kDifSysrstCtrlPinPowerButtonIn = 1U << 6 ,
  kDifSysrstCtrlPinPowerButtonOut = 1U << 7 ,
  kDifSysrstCtrlPinAcPowerPresentIn = 1U << 8 ,
  kDifSysrstCtrlPinBatteryDisableOut = 1U << 9 ,
  kDifSysrstCtrlPinLidOpenIn = 1U << 10 ,
  kDifSysrstCtrlPinZ3WakeupOut = 1U << 11 ,
  kDifSysrstCtrlPinEcResetInOut = 1U << 12 ,
  kDifSysrstCtrlPinFlashWriteProtectInOut = 1U << 13 ,
  kDifSysrstCtrlPinAllNonOpenDrain = (1U << 12) - 1
}
 System Reset Controller pins that can be inverted, read, or overridden. More...
 

Functions

OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_key_combo_detect_configure (const dif_sysrst_ctrl_t *sysrst_ctrl, dif_sysrst_ctrl_key_combo_t key_combo, dif_sysrst_ctrl_key_combo_config_t config)
 Configures a System Reset Controller's key combination detection feature. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_input_change_detect_configure (const dif_sysrst_ctrl_t *sysrst_ctrl, dif_sysrst_ctrl_input_change_config_t config)
 Configures a System Reset Controller's input signal change detection feature. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_output_pin_override_configure (const dif_sysrst_ctrl_t *sysrst_ctrl, dif_sysrst_ctrl_pin_t output_pin, dif_sysrst_ctrl_pin_config_t config)
 Configures a System Reset Controller's output pin override feature. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_auto_override_configure (const dif_sysrst_ctrl_t *sysrst_ctrl, dif_sysrst_ctrl_auto_override_config_t config, dif_toggle_t enabled)
 Configures a System Reset Controller's key signal auto-override feature. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_ulp_wakeup_configure (const dif_sysrst_ctrl_t *sysrst_ctrl, dif_sysrst_ctrl_ulp_wakeup_config_t config)
 Configures a System Reset Controller's ultra-low-power (ULP) wakeup feature. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_ulp_wakeup_set_enabled (const dif_sysrst_ctrl_t *sysrst_ctrl, dif_toggle_t enabled)
 Sets the enablement state of a System Reset Controller's ultra-low-power (ULP) wakeup feature. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_ulp_wakeup_get_enabled (const dif_sysrst_ctrl_t *sysrst_ctrl, dif_toggle_t *is_enabled)
 Gets the enablement state of a System Reset Controller's ultra-low-power (ULP) wakeup feature. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_pins_set_inverted (const dif_sysrst_ctrl_t *sysrst_ctrl, uint32_t pins, bool inverted)
 Sets the inversion state a System Reset Controller's input and output pins. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_pins_get_inverted (const dif_sysrst_ctrl_t *sysrst_ctrl, uint32_t *inverted_pins)
 Gets the inversion state a System Reset Controller's input and output pins. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_output_pin_override_set_allowed (const dif_sysrst_ctrl_t *sysrst_ctrl, dif_sysrst_ctrl_pin_t pin, bool allow_zero, bool allow_one)
 Sets allowable override values for a System Reset Controller's output pin. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_output_pin_override_get_allowed (const dif_sysrst_ctrl_t *sysrst_ctrl, dif_sysrst_ctrl_pin_t pin, bool *allow_zero, bool *allow_one)
 Gets allowable override values for a System Reset Controller's output pin. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_output_pin_override_set_enabled (const dif_sysrst_ctrl_t *sysrst_ctrl, dif_sysrst_ctrl_pin_t pin, dif_toggle_t enabled)
 Sets the enablement of a System Reset Controller's output pin override feature. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_output_pin_override_get_enabled (const dif_sysrst_ctrl_t *sysrst_ctrl, dif_sysrst_ctrl_pin_t pin, dif_toggle_t *is_enabled)
 Gets the enablement of a System Reset Controller's output pin override feature. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_output_pin_set_override (const dif_sysrst_ctrl_t *sysrst_ctrl, dif_sysrst_ctrl_pin_t pin, bool value)
 Sets the override value of a System Reset Controller's output pin (like writing to a GPIO pin). More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_output_pin_get_override (const dif_sysrst_ctrl_t *sysrst_ctrl, dif_sysrst_ctrl_pin_t pin, bool *value)
 Gets the override value of a System Reset Controller's output pin (like writing to a GPIO pin). More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_input_pin_read (const dif_sysrst_ctrl_t *sysrst_ctrl, dif_sysrst_ctrl_pin_t pin, bool *value)
 Reads a System Reset Controller's input pin (like a GPIO pin). More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_auto_override_set_enabled (const dif_sysrst_ctrl_t *sysrst_ctrl, dif_sysrst_ctrl_key_t key, dif_toggle_t enabled)
 Sets the enablement of a System Reset Controller's key signal auto-override feature. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_auto_override_get_enabled (const dif_sysrst_ctrl_t *sysrst_ctrl, dif_sysrst_ctrl_key_t key, dif_toggle_t *is_enabled)
 Gets the enablement of a System Reset Controller's key signal auto-override feature. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_key_combo_irq_get_causes (const dif_sysrst_ctrl_t *sysrst_ctrl, uint32_t *causes)
 Gets the cause(s) of a key combination detection IRQ. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_key_combo_irq_clear_causes (const dif_sysrst_ctrl_t *sysrst_ctrl, uint32_t causes)
 Clears the cause(s) of a key combination detection IRQ. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_input_change_irq_get_causes (const dif_sysrst_ctrl_t *sysrst_ctrl, uint32_t *causes)
 Gets the cause(s) of an input signal change detection IRQ. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_input_change_irq_clear_causes (const dif_sysrst_ctrl_t *sysrst_ctrl, uint32_t causes)
 Clears the cause(s) of an input signal change detection IRQ. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_ulp_wakeup_get_status (const dif_sysrst_ctrl_t *sysrst_ctrl, bool *wakeup_detected)
 Gets the ultra-low-power wakeup status. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_ulp_wakeup_clear_status (const dif_sysrst_ctrl_t *sysrst_ctrl)
 Clears the ultra-low-power wakeup status. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_lock (const dif_sysrst_ctrl_t *sysrst_ctrl)
 Locks System Reset Controller configurations. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_is_locked (const dif_sysrst_ctrl_t *sysrst_ctrl, bool *is_locked)
 Checks whether System Reset Controller configurations are locked. More...
 

Detailed Description

System Reset Controller Device Interface Functions

Definition in file dif_sysrst_ctrl.h.


Data Structure Documentation

◆ dif_sysrst_ctrl_key_combo_config

struct dif_sysrst_ctrl_key_combo_config

Runtime configuration for the System Reset Controller key combination detection feature.

Definition at line 110 of file dif_sysrst_ctrl.h.

Data Fields
uint32_t actions The actions to trigger after detecting the key press combination (one or more dif_sysrst_ctrl_key_combo_action_ts ORed together).
uint32_t detection_time_threshold The duration the key combination should be pressed to trigger an action.

Units: increments of 5us; [0, 2^32) represents [0, 60) seconds.

uint16_t embedded_controller_reset_duration The embedded controller's reset pulse width.

Note: only applicable if the kDifSysrstCtrlKeyComboActionEcReset action is enabled for the key combination.

Units: increments of 5us; [0, 2^16) represents [10, 200) milliseconds.

uint32_t keys The keys that comprise the key combination to detect (i.e., one or more dif_sysrst_ctrl_key_ts ORed together).
uint32_t pre_condition_detection_time_threshold The duration the pre-condition key combination should be pressed to enable triggering an action by an additional key combination press.

Units: increments of 5us; [0, 2^32) represents [0, 60) seconds.

uint32_t pre_condition_keys The keys that comprise the pre-condition key combination to detect (i.e., one or more dif_sysrst_ctrl_key_ts ORed together).

◆ dif_sysrst_ctrl_input_change_config

struct dif_sysrst_ctrl_input_change_config

Runtime configuration for the System Reset Controller input signal change detection feature.

Definition at line 322 of file dif_sysrst_ctrl.h.

Data Fields
uint16_t debounce_time_threshold The time to allow the input signal to stabilize before reevaluating its value to decide whether to trigger an interrupt.

Units: increments of 5us; [0, 2^16) represents [0, 200) milliseconds.

uint32_t input_changes A combination of input signal changes to detect (one or more dif_sysrst_ctrl_input_change_ts ORed together).

◆ dif_sysrst_ctrl_auto_override_config

struct dif_sysrst_ctrl_auto_override_config

Runtime configuration for the System Reset Controller key signal auto-override feature.

Upon detection of a Power Button high-to-low transition, the signals from generic keys 0 through 2 may be overriden with specified values.

Definition at line 344 of file dif_sysrst_ctrl.h.

Data Fields
uint16_t debounce_time_threshold The time to allow the Power Button signal to stabilize before reevaluating its value to decide whether it was pressed.

Units: increments of 5us; [0, 2^16) represents [0, 200) milliseconds.

bool key_0_override_value The value to override onto the key 0 signal.
bool key_1_override_value The value to override onto the key 1 signal.
bool key_2_override_value The value to override onto the key 2 signal.
dif_toggle_t override_key_0 Whether to override the key 0 signal.
dif_toggle_t override_key_1 Whether to override the key 1 signal.
dif_toggle_t override_key_2 Whether to override the key 2 signal.

◆ dif_sysrst_ctrl_pin_config_t

struct dif_sysrst_ctrl_pin_config_t

Runtime configuration for the System Reset Controller output pin override feature.

Definition at line 448 of file dif_sysrst_ctrl.h.

Data Fields
bool allow_one Whether to allow overriding the output pin with a value of 1.
bool allow_zero Whether to allow overriding the output pin with a value of 0.
dif_toggle_t enabled The enablement of the output pin's override feature.
bool override_value The override value to write.

Note: writing a non-allowable value will cause dif_sysrst_ctrl_output_pin_override_configure() to return kDifBadArg.

◆ dif_sysrst_ctrl_ulp_wakeup_config_t

struct dif_sysrst_ctrl_ulp_wakeup_config_t

Runtime configuration for the System Reset Controller ultra-low-power (ULP) wakeup feature.

When enabled, detection of any of the following conditions:

  1. HIGH level on the AC Power present signal, or
  2. HIGH --> LOW transition on the Power Button signal, or
  3. LOW --> HIGH transition on the Lid Open signal,

will cause the System Reset Controller to assert the Z3 Wakeup output signal and trigger an interrupt, which will also issue a wakeup request to the power manager.

Definition at line 484 of file dif_sysrst_ctrl.h.

Data Fields
uint16_t ac_power_debounce_time_threshold The time to allow the AC Power present signal to stabilize before reevaluating its value to decide whether it was activated.

Units: increments of 5us; [0, 2^16) represents [10, 200) milliseconds.

dif_toggle_t enabled The enablement of the ULP wakeup feature.
uint16_t lid_open_debounce_time_threshold The time to allow the Lid Open signal to stabilize before reevaluating its value to decide whether it was activated.

Units: increments of 5us; [0, 2^16) represents [10, 200) milliseconds.

uint16_t power_button_debounce_time_threshold The time to allow the Power Button signal to stabilize before reevaluating its value to decide whether it was pressed.

Units: increments of 5us; [0, 2^16) represents [10, 200) milliseconds.

Typedef Documentation

◆ dif_sysrst_ctrl_auto_override_config_t

Runtime configuration for the System Reset Controller key signal auto-override feature.

Upon detection of a Power Button high-to-low transition, the signals from generic keys 0 through 2 may be overriden with specified values.

◆ dif_sysrst_ctrl_ulp_wakeup_config_t

Runtime configuration for the System Reset Controller ultra-low-power (ULP) wakeup feature.

When enabled, detection of any of the following conditions:

  1. HIGH level on the AC Power present signal, or
  2. HIGH --> LOW transition on the Power Button signal, or
  3. LOW --> HIGH transition on the Lid Open signal,

will cause the System Reset Controller to assert the Z3 Wakeup output signal and trigger an interrupt, which will also issue a wakeup request to the power manager.

Enumeration Type Documentation

◆ dif_sysrst_ctrl_combo_intr_src

System Reset Controller combo interrupt sources.

Enumerator
kDifSysrstCtrlComboIntrStatusCombo0H2L 

Power button input signal high-to-low.

kDifSysrstCtrlComboIntrStatusCombo1H2L 

Key 0 input signal high-to-low.

kDifSysrstCtrlComboIntrStatusCombo2H2L 

Key 1 input signal high-to-low.

kDifSysrstCtrlComboIntrStatusCombo3H2L 

Key 2 input signal high-to-low.

Definition at line 295 of file dif_sysrst_ctrl.h.

◆ dif_sysrst_ctrl_input_change

System Reset Controller input signal changes that may be detected.

Enumerator
kDifSysrstCtrlInputPowerButtonH2L 

Power button input signal high-to-low.

kDifSysrstCtrlInputKey0H2L 

Key 0 input signal high-to-low.

kDifSysrstCtrlInputKey1H2L 

Key 1 input signal high-to-low.

kDifSysrstCtrlInputKey2H2L 

Key 2 input signal high-to-low.

kDifSysrstCtrlInputAcPowerPresetH2L 

AC power present input signal high-to-low.

kDifSysrstCtrlInputEcResetH2L 

Embedded controller reset input signal high-to-low.

kDifSysrstCtrlInputFlashWriteProtectH2L 

Flash write protect input signal high-to-low.

kDifSysrstCtrlInputPowerButtonL2H 

Power button input signal low-to-high.

kDifSysrstCtrlInputKey0L2H 

Key 0 input signal low-to-high.

kDifSysrstCtrlInputKey1L2H 

Key 1 input signal low-to-high.

kDifSysrstCtrlInputKey2L2H 

Key 2 input signal low-to-high.

kDifSysrstCtrlInputAcPowerPresetL2H 

AC power present input signal low-to-high.

kDifSysrstCtrlInputEcResetL2H 

Embedded controller reset input signal low-to-high.

kDifSysrstCtrlInputFlashWriteProtectL2H 

Flash write protect input signal low-to-high.

kDifSysrstCtrlInputAll 

All input signal transitions.

Definition at line 153 of file dif_sysrst_ctrl.h.

◆ dif_sysrst_ctrl_key

System Reset Controller keys that can form a key combination.

Enumerator
kDifSysrstCtrlKey0 

Key 0.

kDifSysrstCtrlKey1 

Key 1.

kDifSysrstCtrlKey2 

Key 2.

kDifSysrstCtrlKeyPowerButton 

Power button key.

kDifSysrstCtrlKeyAcPowerPresent 

AC power preset key.

kDifSysrstCtrlKeyAll 

All keys ORed together.

Definition at line 53 of file dif_sysrst_ctrl.h.

◆ dif_sysrst_ctrl_key_combo

A System Reset Controller key combination.

Enumerator
kDifSysrstCtrlKeyCombo0 

Key combination 0.

kDifSysrstCtrlKeyCombo1 

Key combination 1.

kDifSysrstCtrlKeyCombo2 

Key combination 2.

kDifSysrstCtrlKeyCombo3 

Key combination 3.

kDifSysrstCtrlKeyComboAll 

All key combination ORed together.

This is useful when clearing all key combination IRQ causes at once, e.g., when initializing the System Reset Controller.

Definition at line 24 of file dif_sysrst_ctrl.h.

◆ dif_sysrst_ctrl_key_combo_action

System Reset Controller key combination detection actions.

Enumerator
kDifSysrstCtrlKeyComboActionBatteryDisable 

Disable / disconnect battery.

kDifSysrstCtrlKeyComboActionInterrupt 

Issue an interrupt to the processor.

kDifSysrstCtrlKeyComboActionEcReset 

Assert the embedded controller reset for a specified duration.

kDifSysrstCtrlKeyComboActionSelfReset 

Issue a reset request to the reset manager block.

kDifSysrstCtrlKeyComboActionAll 

All actions.

Definition at line 83 of file dif_sysrst_ctrl.h.

◆ dif_sysrst_ctrl_key_intr_src

System Reset Controller key interrupt sources.

Enumerator
kDifSysrstCtrlKeyIntrStatusInputPowerButtonH2L 

Power button input signal high-to-low.

kDifSysrstCtrlKeyIntrStatusInputKey0H2L 

Key 0 input signal high-to-low.

kDifSysrstCtrlKeyIntrStatusInputKey1H2L 

Key 1 input signal high-to-low.

kDifSysrstCtrlKeyIntrStatusInputKey2H2L 

Key 2 input signal high-to-low.

kDifSysrstCtrlKeyIntrStatusInputAcPowerPresetH2L 

AC power present input signal high-to-low.

kDifSysrstCtrlKeyIntrStatusInputEcResetH2L 

Embedded controller reset input signal high-to-low.

kDifSysrstCtrlKeyIntrStatusInputFlashWriteProtectH2L 

Flash write protect input signal high-to-low.

kDifSysrstCtrlKeyIntrStatusInputPowerButtonL2H 

Power button input signal low-to-high.

kDifSysrstCtrlKeyIntrStatusInputKey0L2H 

Key 0 input signal low-to-high.

kDifSysrstCtrlKeyIntrStatusInputKey1L2H 

Key 1 input signal low-to-high.

kDifSysrstCtrlKeyIntrStatusInputKey2L2H 

Key 2 input signal low-to-high.

kDifSysrstCtrlKeyIntrStatusInputAcPowerPresetL2H 

AC power present input signal low-to-high.

kDifSysrstCtrlKeyIntrStatusInputEcResetL2H 

Embedded controller reset input signal low-to-high.

kDifSysrstCtrlKeyIntrStatusInputFlashWriteProtectL2H 

Flash write protect input signal low-to-high.

Definition at line 219 of file dif_sysrst_ctrl.h.

◆ dif_sysrst_ctrl_pin

System Reset Controller pins that can be inverted, read, or overridden.

Enumerator
kDifSysrstCtrlPinKey0In 

Key 0 input.

kDifSysrstCtrlPinKey0Out 

Key 0 output.

kDifSysrstCtrlPinKey1In 

Key 1 input.

kDifSysrstCtrlPinKey1Out 

Key 1 output.

kDifSysrstCtrlPinKey2In 

Key 2 input.

kDifSysrstCtrlPinKey2Out 

Key 2 output.

kDifSysrstCtrlPinPowerButtonIn 

Power button input.

kDifSysrstCtrlPinPowerButtonOut 

Power button output.

kDifSysrstCtrlPinAcPowerPresentIn 

AC power preset input.

kDifSysrstCtrlPinBatteryDisableOut 

Battery disable output.

kDifSysrstCtrlPinLidOpenIn 

Lid open input.

kDifSysrstCtrlPinZ3WakeupOut 

Z3 Wakeup output.

kDifSysrstCtrlPinEcResetInOut 

Embedded controller reset inout.

kDifSysrstCtrlPinFlashWriteProtectInOut 

Flash write protect inout.

kDifSysrstCtrlPinAllNonOpenDrain 

All non open drain pins.

Definition at line 381 of file dif_sysrst_ctrl.h.

Function Documentation

◆ dif_sysrst_ctrl_auto_override_configure()

OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_auto_override_configure ( const dif_sysrst_ctrl_t sysrst_ctrl,
dif_sysrst_ctrl_auto_override_config_t  config,
dif_toggle_t  enabled 
)

Configures a System Reset Controller's key signal auto-override feature.

Upon detection of a Power Button high-to-low transition, the signals from generic keys 0 through 2 may be overriden with specified values.

Parameters
sysrst_ctrlA System Reset Controller handle.
configRuntime configuration parameters.
enabledWhether to enable the feature or not.
Returns
The result of the operation.

Definition at line 615 of file dif_sysrst_ctrl.c.

◆ dif_sysrst_ctrl_auto_override_get_enabled()

OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_auto_override_get_enabled ( const dif_sysrst_ctrl_t sysrst_ctrl,
dif_sysrst_ctrl_key_t  key,
dif_toggle_t is_enabled 
)

Gets the enablement of a System Reset Controller's key signal auto-override feature.

Note, this feature is only available for keys 0, 1, and 2. Attempting to check whether the auto-override feature is enabled non-supported keys will return kDifBadArg.

Parameters
sysrst_ctrlA System Reset Controller handle.
keyThe key the override feature is enabled for.
[out]is_enabledWhether the feature is enabled or not.
Returns
The result of the operation.

Definition at line 714 of file dif_sysrst_ctrl.c.

◆ dif_sysrst_ctrl_auto_override_set_enabled()

OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_auto_override_set_enabled ( const dif_sysrst_ctrl_t sysrst_ctrl,
dif_sysrst_ctrl_key_t  key,
dif_toggle_t  enabled 
)

Sets the enablement of a System Reset Controller's key signal auto-override feature.

Note, this feature is only available for keys 0, 1, and 2. Attempting to enable the auto-override feature on non-supported keys will return kDifBadArg.

Parameters
sysrst_ctrlA System Reset Controller handle.
keyThe key to enable the override feature for.
enabledWhether to enable the feature or not.
Returns
The result of the operation.

Definition at line 686 of file dif_sysrst_ctrl.c.

◆ dif_sysrst_ctrl_input_change_detect_configure()

OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_input_change_detect_configure ( const dif_sysrst_ctrl_t sysrst_ctrl,
dif_sysrst_ctrl_input_change_config_t  config 
)

Configures a System Reset Controller's input signal change detection feature.

Parameters
sysrst_ctrlA System Reset Controller handle.
configRuntime configuration parameters.
Returns
The result of the operation.

Definition at line 105 of file dif_sysrst_ctrl.c.

◆ dif_sysrst_ctrl_input_change_irq_clear_causes()

OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_input_change_irq_clear_causes ( const dif_sysrst_ctrl_t sysrst_ctrl,
uint32_t  causes 
)

Clears the cause(s) of an input signal change detection IRQ.

Parameters
sysrst_ctrlAn sysrst_ctrl handle.
causesThe causes of the IRQ (one or more dif_sysrst_ctrl_input_change_ts ORed together).
Returns
The result of the operation.

Definition at line 770 of file dif_sysrst_ctrl.c.

◆ dif_sysrst_ctrl_input_change_irq_get_causes()

OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_input_change_irq_get_causes ( const dif_sysrst_ctrl_t sysrst_ctrl,
uint32_t *  causes 
)

Gets the cause(s) of an input signal change detection IRQ.

Parameters
sysrst_ctrlAn sysrst_ctrl handle.
[out]causesThe causes of the IRQ (one or more dif_sysrst_ctrl_input_change_ts ORed together).
Returns
The result of the operation.

Definition at line 758 of file dif_sysrst_ctrl.c.

◆ dif_sysrst_ctrl_input_pin_read()

OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_input_pin_read ( const dif_sysrst_ctrl_t sysrst_ctrl,
dif_sysrst_ctrl_pin_t  pin,
bool *  value 
)

Reads a System Reset Controller's input pin (like a GPIO pin).

Note, only input (or inout) pins may be read. Attempting to read the value of an output pin will return kDifBadArg.

Parameters
sysrst_ctrlA System Reset Controller handle.
pinThe pin to read.
[out]valueThe value set on the pin.
Returns
The result of the operation.

Definition at line 596 of file dif_sysrst_ctrl.c.

◆ dif_sysrst_ctrl_is_locked()

OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_is_locked ( const dif_sysrst_ctrl_t sysrst_ctrl,
bool *  is_locked 
)

Checks whether System Reset Controller configurations are locked.

Parameters
sysrst_ctrlA System Reset Controller handle.
[out]is_lockedOut-param for the locked state.
Returns
The result of the operation.

Definition at line 816 of file dif_sysrst_ctrl.c.

◆ dif_sysrst_ctrl_key_combo_detect_configure()

OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_key_combo_detect_configure ( const dif_sysrst_ctrl_t sysrst_ctrl,
dif_sysrst_ctrl_key_combo_t  key_combo,
dif_sysrst_ctrl_key_combo_config_t  config 
)

Configures a System Reset Controller's key combination detection feature.

Parameters
sysrst_ctrlA System Reset Controller handle.
key_comboKey combination to configure.
configRuntime configuration parameters.
Returns
The result of the operation.

Definition at line 22 of file dif_sysrst_ctrl.c.

◆ dif_sysrst_ctrl_key_combo_irq_clear_causes()

OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_key_combo_irq_clear_causes ( const dif_sysrst_ctrl_t sysrst_ctrl,
uint32_t  causes 
)

Clears the cause(s) of a key combination detection IRQ.

Parameters
sysrst_ctrlAn sysrst_ctrl handle.
causesThe causes of the IRQ (one or more dif_sysrst_ctrl_key_combo_ts ORed together).
Returns
The result of the operation.

Definition at line 746 of file dif_sysrst_ctrl.c.

◆ dif_sysrst_ctrl_key_combo_irq_get_causes()

OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_key_combo_irq_get_causes ( const dif_sysrst_ctrl_t sysrst_ctrl,
uint32_t *  causes 
)

Gets the cause(s) of a key combination detection IRQ.

Parameters
sysrst_ctrlAn sysrst_ctrl handle.
[out]causesThe causes of the IRQ (one or more dif_sysrst_ctrl_key_combo_ts ORed together).
Returns
The result of the operation.

Definition at line 734 of file dif_sysrst_ctrl.c.

◆ dif_sysrst_ctrl_lock()

OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_lock ( const dif_sysrst_ctrl_t sysrst_ctrl)

Locks System Reset Controller configurations.

This function is reentrant: calling it while locked will have no effect and return kDifOk.

Parameters
sysrst_ctrlA System Reset Controller handle.
Returns
The result of the operation.

Definition at line 806 of file dif_sysrst_ctrl.c.

◆ dif_sysrst_ctrl_output_pin_get_override()

OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_output_pin_get_override ( const dif_sysrst_ctrl_t sysrst_ctrl,
dif_sysrst_ctrl_pin_t  pin,
bool *  value 
)

Gets the override value of a System Reset Controller's output pin (like writing to a GPIO pin).

Note, only output (or inout) pins may be overriden, i.e., set to a specific value. Attempting to get the override value of an input pin will return kDifBadArg.

Additionally, this will return the configured override value of an output pin regardless if the override function is enabled or the override value is allowed.

Parameters
sysrst_ctrlA System Reset Controller handle.
pinThe output pin to override.
[out]valueThe override value set on the pin.
Returns
The result of the operation.

Definition at line 544 of file dif_sysrst_ctrl.c.

◆ dif_sysrst_ctrl_output_pin_override_configure()

OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_output_pin_override_configure ( const dif_sysrst_ctrl_t sysrst_ctrl,
dif_sysrst_ctrl_pin_t  output_pin,
dif_sysrst_ctrl_pin_config_t  config 
)

Configures a System Reset Controller's output pin override feature.

Note, only output (or inout) pins may be overriden, i.e., set to a specific value. Attempting to configure the override feature for input pins will return kDifBadArg.

Parameters
sysrst_ctrlA System Reset Controller handle.
output_pinOutput pin to configure.
configOutput pin override configuration parameters.
Returns
The result of the operation.

Definition at line 127 of file dif_sysrst_ctrl.c.

◆ dif_sysrst_ctrl_output_pin_override_get_allowed()

OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_output_pin_override_get_allowed ( const dif_sysrst_ctrl_t sysrst_ctrl,
dif_sysrst_ctrl_pin_t  pin,
bool *  allow_zero,
bool *  allow_one 
)

Gets allowable override values for a System Reset Controller's output pin.

Note, only output (or inout) pins may be overriden, i.e., set to a specific value. Attempting to get the allowable override values for input pins will return kDifBadArg.

Parameters
sysrst_ctrlA System Reset Controller handle.
pinThe allowable override values to get for an output pin.
[out]allow_zeroWhether overriding the pin's value to 0 is allowed.
[out]allow_oneWhether overriding the pin's value to 1 is allowed.
Returns
The result of the operation.

Definition at line 393 of file dif_sysrst_ctrl.c.

◆ dif_sysrst_ctrl_output_pin_override_get_enabled()

OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_output_pin_override_get_enabled ( const dif_sysrst_ctrl_t sysrst_ctrl,
dif_sysrst_ctrl_pin_t  pin,
dif_toggle_t is_enabled 
)

Gets the enablement of a System Reset Controller's output pin override feature.

Note, only output (or inout) pins may be overriden, i.e., set to a specific value. Attempting to get the enablement of the override feature for input pins will return kDifBadArg.

Parameters
sysrst_ctrlA System Reset Controller handle.
pinThe output pin whose override feature should be set.
[out]is_enabledThe enablement state the override feature is configured in.
Returns
The result of the operation.

Definition at line 470 of file dif_sysrst_ctrl.c.

◆ dif_sysrst_ctrl_output_pin_override_set_allowed()

OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_output_pin_override_set_allowed ( const dif_sysrst_ctrl_t sysrst_ctrl,
dif_sysrst_ctrl_pin_t  pin,
bool  allow_zero,
bool  allow_one 
)

Sets allowable override values for a System Reset Controller's output pin.

Note, only output (or inout) pins may be overriden, i.e., set to a specific value. Attempting to set the allowable override values for input pins will return kDifBadArg.

Parameters
sysrst_ctrlA System Reset Controller handle.
pinThe output pin whose allowable override values should be set.
allow_zeroWhether to allow overriding the pin's value to 0.
allow_oneWhether to allow overriding the pin's value to 1.
Returns
The result of the operation.

Definition at line 361 of file dif_sysrst_ctrl.c.

◆ dif_sysrst_ctrl_output_pin_override_set_enabled()

OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_output_pin_override_set_enabled ( const dif_sysrst_ctrl_t sysrst_ctrl,
dif_sysrst_ctrl_pin_t  pin,
dif_toggle_t  enabled 
)

Sets the enablement of a System Reset Controller's output pin override feature.

Note, only output (or inout) pins may be overriden, i.e., set to a specific value. Attempting to set the enablement of the override feature for input pins will return kDifBadArg.

Parameters
sysrst_ctrlA System Reset Controller handle.
pinThe output pin whose override feature should be set.
enabledThe enablement state to configure the override feature in.
Returns
The result of the operation.

Definition at line 448 of file dif_sysrst_ctrl.c.

◆ dif_sysrst_ctrl_output_pin_set_override()

OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_output_pin_set_override ( const dif_sysrst_ctrl_t sysrst_ctrl,
dif_sysrst_ctrl_pin_t  pin,
bool  value 
)

Sets the override value of a System Reset Controller's output pin (like writing to a GPIO pin).

Note, only output (or inout) pins may be overriden, i.e., set to a specific value. Attempting to set the override value of an input pin will return kDifBadArg.

Parameters
sysrst_ctrlA System Reset Controller handle.
pinThe output pin to override.
valueThe override value to set on the pin.
Returns
The result of the operation.

Definition at line 522 of file dif_sysrst_ctrl.c.

◆ dif_sysrst_ctrl_pins_get_inverted()

OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_pins_get_inverted ( const dif_sysrst_ctrl_t sysrst_ctrl,
uint32_t *  inverted_pins 
)

Gets the inversion state a System Reset Controller's input and output pins.

Parameters
sysrst_ctrlA System Reset Controller handle.
[out]inverted_pinsThe input and output pins that are inverted (i.e., one or more dif_sysrst_ctrl_pin_ts ORed together).
Returns
The result of the operation.

Definition at line 307 of file dif_sysrst_ctrl.c.

◆ dif_sysrst_ctrl_pins_set_inverted()

OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_pins_set_inverted ( const dif_sysrst_ctrl_t sysrst_ctrl,
uint32_t  pins,
bool  inverted 
)

Sets the inversion state a System Reset Controller's input and output pins.

Note, only input and output (NOT inout) pins may be inverted. Attempting to set the inversion state of inout pins will return kDifBadArg.

Parameters
sysrst_ctrlA System Reset Controller handle.
pinsThe input and output pins to set the inverted state of (i.e., one or more dif_sysrst_ctrl_pin_ts ORed together).
invertedThe inverted state to configure for the pins.
Returns
The result of the operation.

Definition at line 281 of file dif_sysrst_ctrl.c.

◆ dif_sysrst_ctrl_ulp_wakeup_clear_status()

OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_ulp_wakeup_clear_status ( const dif_sysrst_ctrl_t sysrst_ctrl)

Clears the ultra-low-power wakeup status.

Parameters
sysrst_ctrlAn sysrst_ctrl handle.
Returns
The result of the operation.

Definition at line 794 of file dif_sysrst_ctrl.c.

◆ dif_sysrst_ctrl_ulp_wakeup_configure()

OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_ulp_wakeup_configure ( const dif_sysrst_ctrl_t sysrst_ctrl,
dif_sysrst_ctrl_ulp_wakeup_config_t  config 
)

Configures a System Reset Controller's ultra-low-power (ULP) wakeup feature.

Parameters
sysrst_ctrlA System Reset Controller handle.
configRuntime configuration parameters.
Returns
The result of the operation.

Definition at line 230 of file dif_sysrst_ctrl.c.

◆ dif_sysrst_ctrl_ulp_wakeup_get_enabled()

OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_ulp_wakeup_get_enabled ( const dif_sysrst_ctrl_t sysrst_ctrl,
dif_toggle_t is_enabled 
)

Gets the enablement state of a System Reset Controller's ultra-low-power (ULP) wakeup feature.

Parameters
sysrst_ctrlA System Reset Controller handle.
[out]is_enabledThe enablement state of the ULP wakeup feature.
Returns
The result of the operation.

Definition at line 269 of file dif_sysrst_ctrl.c.

◆ dif_sysrst_ctrl_ulp_wakeup_get_status()

OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_ulp_wakeup_get_status ( const dif_sysrst_ctrl_t sysrst_ctrl,
bool *  wakeup_detected 
)

Gets the ultra-low-power wakeup status.

Parameters
sysrst_ctrlAn sysrst_ctrl handle.
[out]wakeup_detectedThe ULP wakeup detection state.
Returns
The result of the operation.

Definition at line 782 of file dif_sysrst_ctrl.c.

◆ dif_sysrst_ctrl_ulp_wakeup_set_enabled()

OT_WARN_UNUSED_RESULT dif_result_t dif_sysrst_ctrl_ulp_wakeup_set_enabled ( const dif_sysrst_ctrl_t sysrst_ctrl,
dif_toggle_t  enabled 
)

Sets the enablement state of a System Reset Controller's ultra-low-power (ULP) wakeup feature.

Parameters
sysrst_ctrlA System Reset Controller handle.
enabledThe enablement state to configure the ULP wakeup feature in.
Returns
The result of the operation.

Definition at line 257 of file dif_sysrst_ctrl.c.