Inter-Integrated Circuit (I²C) Low-Power Instance#
The Inter-Integrated Circuit (I²C) Ultra-Low-Power (ULP) peripheral (I²C2) is designed for energy-efficient applications that require minimal current consumption.
Managed by the power manager, this peripheral belongs to the ULP subsystem and remains accessible only in Power State 2 (PS2) through platform-level power management.
The power manager coordinates:
Power state transitions
Peripheral enablement
RAM retention
Wakeup source control
This coordination allows the ULP I²C peripheral to operate during deep-sleep states, enabling extended battery life and continuous sensor communication.
Pin Selection: ULP GPIO vs HP GPIO#
Selecting the correct GPIO pins is critical for reliable I²C communication in low-power modes.
Using incompatible GPIO types can lead to communication loss or unnecessary power draw.
ULP GPIO#
Use ULP GPIO pins for I²C communication during low-power operation.
Only ULP GPIO pins associated with the ULP I²C remain retained and functional in PS2.
ULP GPIOs are optimized for minimal leakage and remain active in deep-sleep states.
High-Power (HP) GPIO#
If HP GPIO pins are used, reconfigure them to ULP-compatible settings before entering PS2.
After wakeup, restore their previous configuration.
HP GPIOs are unavailable in deep-sleep states; using them may result in communication loss or higher power consumption.
Achieving Low-Power Operation (PS2 and PS1)#
To maximize energy savings, configure the ULP I²C peripheral to operate in PS2.
This section explains how to prepare the system, manage memory, and configure wakeup sources for reliable low-power operation.
Steps to Use ULP I²C in PS2#
Configure the Power Manager in Simplicity Studio to switch the device to PS2.
Enable the ULP I²C component in the project configuration.
Use the
sl_si91x_power_manager_add_ps_requirement()API to request entry into PS2.Power down unused peripherals and configure RAM retention, if needed.
Use ULP memory for DMA buffers, if applicable.
Configure wakeup sources (such as GPIOs, timers, or wireless modules) using Power Manager APIs so the device can wake from deep sleep.
// Deinitialize I2C before entering low-power mode
sl_i2c_driver_deinit(I2C_INSTANCE_USED); // Disables peripheral
// Add PS2 requirement to enter low-power mode
sl_si91x_power_manager_add_ps_requirement(SL_SI91X_POWER_MANAGER_PS2);
// ... MCU sleeps ...Reconfiguring Peripherals Across Sleep Wakeups#
When the SiWx917 device wakes from PS2, you must reinitialize and reconfigure the ULP I²C and GPIO peripherals to restore normal operation.
This step ensures reliable communication with connected sensors or devices and prevents data loss after low-power transitions.
Reconfiguration Sequence#
Follow this sequence to restore functionality after wakeup:
Reinitialize the I²C peripheral using
sl_i2c_driver_init().Reinitialize ULP GPIOs for I²C communication and wakeup sources.
UseDEBUGINIT()if you need debug output.Restore configuration settings lost during sleep, such as FIFO thresholds or callback registrations.
Resume normal I²C transfers or periodic sensor polling.
sl_i2c_driver_init(I2C_INSTANCE_USED, &sl_i2c_config); // Reinitialize I2C
DEBUGINIT(); // Reinitialize GPIOs for debug output
sl_i2c_driver_configure_fifo_threshold(I2C_INSTANCE_USED, I2C_TX_FIFO_THRESHOLD, I2C_RX_FIFO_THRESHOLD);
// Restore configuration and resume operationThis reconfiguration sequence ensures consistent and reliable communication after each sleep–wake cycle.
Tip: If wake latency is critical, store configuration data in retained RAM so you can restore settings quickly without performing full reinitialization.
Practical Example Flow#
This example demonstrates how to initialize, transition, and resume ULP I²C communication across power states on the SiWx917.
It illustrates a complete workflow from high-power operation (PS4) to low-power mode (PS2) state.
Step 1: Start in PS4 (High Power)#
Initialize the I²C peripheral and perform standard send and receive operations.
sl_i2c_config = sl_i2c_i2c2_config;
sl_i2c_driver_init(I2C_INSTANCE_USED, &sl_i2c_config);
sl_i2c_driver_configure_fifo_threshold(I2C_INSTANCE_USED, I2C_TX_FIFO_THRESHOLD, I2C_RX_FIFO_THRESHOLD);
// ... Send/receive data as neededTip: Use PS4 mode during initialization and testing to verify functionality before transitioning to low-power states.
Step 2: Switch to PS2 (Low Power)#
Power down unused peripherals, configure RAM retention, and reconfigure the I²C peripheral for ULP operation. Use ULP memory for DMA buffers if required.
sl_i2c_driver_deinit(I2C_INSTANCE_USED); // Disables peripheral and clears FIFOs
sl_si91x_power_manager_add_ps_requirement(SL_SI91X_POWER_MANAGER_PS2); // Enter PS2
// ... MCU goes to PS2 state ...Note: In PS2, only ULP peripherals remain active.
Step 3: Reconfigure in PS2#
After the power state transitioned to PS2, reinitialize the I²C and GPIO peripherals, restore configuration settings, and continue normal operation.
sl_i2c_driver_init(I2C_INSTANCE_USED, &sl_i2c_config); // Reinitialize I2C
DEBUGINIT(); // Reinitialize GPIOs for debug output
sl_i2c_driver_configure_fifo_threshold(I2C_INSTANCE_USED, I2C_TX_FIFO_THRESHOLD, I2C_RX_FIFO_THRESHOLD);
// ... Send/receive data as neededThis process ensures reliable operation across power transitions and allows continuous sensor communication while maintaining low energy consumption.
References#
For additional examples and implementation details, refer to:
WiSeConnect software development kit (SDK) I2C peripheral examples
sl_si91x_ulp_i2c_driver_leader