Digital Humidity Sensor
Diff: SHT3X.cpp
- Revision:
- 3:42e11b9135b5
- Parent:
- 2:870701ee67c4
diff -r 870701ee67c4 -r 42e11b9135b5 SHT3X.cpp --- a/SHT3X.cpp Thu Mar 25 20:24:25 2021 +0000 +++ b/SHT3X.cpp Mon Apr 26 11:22:46 2021 +0000 @@ -55,8 +55,8 @@ uint32_t aux; /* Write the register */ - cmd[0] = (uint8_t)( mode >> 8U ); - cmd[1] = (uint8_t)( mode & 0xFF ); + cmd[0] = ( mode >> 8U ); + cmd[1] = ( mode & 0xFF ); aux = _i2c.write ( _SHT3X_Addr, &cmd[0], sizeof( cmd )/sizeof( cmd[0] ), false ); @@ -152,8 +152,8 @@ uint32_t aux; /* Write the register */ - cmd[0] = (uint8_t)( SHT3X_PERIODIC_MESUREMENT_WITH_ART >> 8U ); - cmd[1] = (uint8_t)( SHT3X_PERIODIC_MESUREMENT_WITH_ART & 0xFF ); + cmd[0] = ( SHT3X_PERIODIC_MESUREMENT_WITH_ART >> 8U ); + cmd[1] = ( SHT3X_PERIODIC_MESUREMENT_WITH_ART & 0xFF ); aux = _i2c.write ( _SHT3X_Addr, &cmd[0], sizeof( cmd )/sizeof( cmd[0] ), false ); @@ -192,8 +192,8 @@ uint32_t aux; /* Write the register */ - cmd[0] = (uint8_t)( SHT3X_BREAK >> 8U ); - cmd[1] = (uint8_t)( SHT3X_BREAK & 0xFF ); + cmd[0] = ( SHT3X_BREAK >> 8U ); + cmd[1] = ( SHT3X_BREAK & 0xFF ); aux = _i2c.write ( _SHT3X_Addr, &cmd[0], sizeof( cmd )/sizeof( cmd[0] ), false ); @@ -232,8 +232,8 @@ uint32_t aux; /* Write the register */ - cmd[0] = (uint8_t)( SHT3X_SOFT_RESET >> 8U ); - cmd[1] = (uint8_t)( SHT3X_SOFT_RESET & 0xFF ); + cmd[0] = ( SHT3X_SOFT_RESET >> 8U ); + cmd[1] = ( SHT3X_SOFT_RESET & 0xFF ); aux = _i2c.write ( _SHT3X_Addr, &cmd[0], sizeof( cmd )/sizeof( cmd[0] ), false ); @@ -272,8 +272,8 @@ uint32_t aux; /* Write the register */ - cmd = SHT3X_GENERAL_CALL_RESET_SECOND_BYTE; - aux = _i2c.write ( SHT3X_GENERAL_CALL_RESET_ADDRESS_BYTE, &cmd, 1U, false ); + cmd = SHT3X_GENERAL_CALL_RESET_SECOND_BYTE; + aux = _i2c.write ( SHT3X_GENERAL_CALL_RESET_ADDRESS_BYTE, &cmd, 1U, false ); @@ -312,8 +312,8 @@ uint32_t aux; /* Write the register */ - cmd[0] = (uint8_t)( heater >> 8U ); - cmd[1] = (uint8_t)( heater & 0xFF ); + cmd[0] = ( heater >> 8U ); + cmd[1] = ( heater & 0xFF ); aux = _i2c.write ( _SHT3X_Addr, &cmd[0], sizeof( cmd )/sizeof( cmd[0] ), false ); @@ -352,8 +352,8 @@ uint32_t aux = SHT3X_SUCCESS; /* Write the register */ - cmd[0] = (uint8_t)( SHT3X_STATUS_REGISTER >> 8U ); - cmd[1] = (uint8_t)( SHT3X_STATUS_REGISTER & 0xFF ); + cmd[0] = ( SHT3X_STATUS_REGISTER >> 8U ); + cmd[1] = ( SHT3X_STATUS_REGISTER & 0xFF ); aux |= _i2c.write ( _SHT3X_Addr, &cmd[0], 2U, true ); /* Read the register */ @@ -403,8 +403,8 @@ uint32_t aux; /* Write the register */ - cmd[0] = (uint8_t)( SHT3X_CLEAR_STATUS_REGISTER >> 8U ); - cmd[1] = (uint8_t)( SHT3X_CLEAR_STATUS_REGISTER & 0xFF ); + cmd[0] = ( SHT3X_CLEAR_STATUS_REGISTER >> 8U ); + cmd[1] = ( SHT3X_CLEAR_STATUS_REGISTER & 0xFF ); aux = _i2c.write ( _SHT3X_Addr, &cmd[0], sizeof( cmd )/sizeof( cmd[0] ), false ); @@ -444,8 +444,8 @@ uint32_t aux; /* Write the register */ - cmd[0] = (uint8_t)( mo >> 8U ); - cmd[1] = (uint8_t)( mo & 0xFF ); + cmd[0] = ( mo >> 8U ); + cmd[1] = ( mo & 0xFF ); aux = _i2c.write ( _SHT3X_Addr, &cmd[0], sizeof( cmd )/sizeof( cmd[0] ), false ); @@ -485,8 +485,8 @@ uint32_t aux; /* Write the register */ - cmd[0] = (uint8_t)( SHT3X_FETCH_DATA >> 8U ); - cmd[1] = (uint8_t)( SHT3X_FETCH_DATA & 0xFF ); + cmd[0] = ( SHT3X_FETCH_DATA >> 8U ); + cmd[1] = ( SHT3X_FETCH_DATA & 0xFF ); aux = _i2c.write ( _SHT3X_Addr, &cmd[0], sizeof( cmd )/sizeof( cmd[0] ), true ); /* Read the register */