/* NOTE! You cannot set background to 1 without setting temperature and pressure You cannot set both temperature and pressure when background mode is disabled  */
int16_t setOpMode(uint8_t opMode)
/* NOTE! You cannot set background to 1 without setting temperature and pressure You cannot set both temperature and pressure when background mode is disabled  */
int16_t setOpMode(uint8_t opMode)
{
    opMode &= DPS310__REG_MASK_OPMODE >> DPS310__REG_SHIFT_OPMODE;
    if (opMode == INVAL_OP_CMD_BOTH || opMode == INVAL_OP_CONT_NONE) {
        return DPS310__FAIL_UNKNOWN;
    }
    if (writeByte(DPS310__REG_ADR_OPMODE, opMode)) {
        return DPS310__FAIL_UNKNOWN;
    }
    dps310_ctx.m_opMode = (Mode)opMode;
    return DPS310__SUCCEEDED;
}