title: How to get silabs Si1141 out of suspended mode
body: <p>Trying to read the PS1 values. But as im running the following code it keeps saying on "chip_stat" that its suspended.</p>
  
  <pre><code>main (void){
  
      init(); // Configuration initialization
      si1141_init(); // Si1141 sensor initialization
  
      __delay_ms(30); // Delay to ensure Si1141 is completely booted, must be atleast 25ms
  
      si1141_WriteToRegister(REG_IRQ_STATUS, 0xFF); // Clear interrupt source
  
      signed int status;
  
      while(1){
  
          WriteToI2C(0x5A&lt;&lt;1); // Slave address
          PutByteI2C(0x30); // chip_stat
          ReadFromI2C(0x5A&lt;&lt;1); // Slave address
          if((status = GetByteI2C(0x30)) == Sw_I2C_ERROR) // chip_stat
          {
              return Sw_I2C_ERROR;
          }
          Stop_I2C();
          status++;;
      }
  }
  </code></pre>
  
  <p>The code im using to read the PS1 values is the following. Im reading the value 16705. Which keeps being the same on all measurements.</p>
  
  <p>The value should go up and down from 0 - 32767, as it measures more or less movement.</p>
  
  <pre><code>signed int si1141_ReadFromRegister(unsigned char reg){
      signed int data;
  
      WriteToI2C(0x5A&lt;&lt;1); // Slave address
      ReadFromI2C(0x5A&lt;&lt;1); // Slave address
      if((data = GetByteI2C(Sw_I2C_LAST)) == Sw_I2C_ERROR)
      {
          return Sw_I2C_ERROR;
      }
      Stop_I2C();
      return data;
  }
  
  main (void){
  
      init(); // Configuration initialization
      si1141_init(); // Si1141 sensor initialization
  
      __delay_ms(30); // Delay to ensure Si1141 is completely booted, must be atleast 25ms
  
      si1141_WriteToRegister(REG_IRQ_STATUS, 0xFF); // Clear interrupt source
  
      signed int PS1;
  
      while(1){        
  
      PS1 = si1141_ReadFromRegister(REG_PS1_DATA0) + (256 * si1141_ReadFromRegister(REG_PS1_DATA1)); // Proximity CH1
  
      }
  }
  </code></pre>
  
  <p>I linked the files for the i2c communication.</p>
  
  <p><a href="https://www.dropbox.com/s/q41vw444gjvj0qa/swi2c.c?dl=0" rel="nofollow">https://www.dropbox.com/s/q41vw444gjvj0qa/swi2c.c?dl=0</a>
  <a href="https://www.dropbox.com/s/1mshyz88o15hz8c/swi2c.h?dl=0" rel="nofollow">https://www.dropbox.com/s/1mshyz88o15hz8c/swi2c.h?dl=0</a></p>