/* result: address where the result will be written returns: 0 on success -1 on fail;  */
int16_t getPressure(int32_t *result)
/* result: address where the result will be written returns: 0 on success -1 on fail;  */
int16_t getPressure(int32_t *result)
{
    uint8_t buffer[3] = { 0 };
    int16_t i = readBlock(DPS310__REG_ADR_PRS, DPS310__REG_LEN_PRS, buffer);
    if (i != DPS310__REG_LEN_PRS) {
        return DPS310__FAIL_UNKNOWN;
    }
    int32_t prs = (uint32_t)buffer[0] << 16 | (uint32_t)buffer[1] << 8 |
                  (uint32_t)buffer[2];
    if (prs & ((uint32_t)1 << 23)) {
        prs -= (uint32_t)1 << 24;
    }
    *result = calcPressure(prs);
    return DPS310__SUCCEEDED;
}