Commit 9f81b442 authored by Armando Visconti's avatar Armando Visconti
Browse files

sensor/stmemsc: Align stmemsc i/f to v2.9.1



Align stmemsc HAL i/f to v2.9.1

Signed-off-by: default avatarArmando Visconti <armando.visconti@st.com>
parent 05fd4533
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ set(stmems_pids
  i3g4250d
  iis2dh
  iis2dlpc
  iis2dulpx
  iis2iclx
  iis2mdc
  iis328dq
@@ -75,7 +76,9 @@ set(stmems_pids
  lsm6dsv16b
  lsm6dsv16bx
  lsm6dsv16x
  lsm6dsv320x
  lsm6dsv32x
  lsm6dsv80x
  lsm6dsv
  lsm9ds1
  st1vafe3bx
+22 −19
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ Origin:
   https://www.st.com/en/embedded-software/c-driver-mems.html

Status:
   version v2.8
   version v2.9.1

Purpose:
   ST Microelectronics standard C platform-independent drivers for MEMS
@@ -62,21 +62,22 @@ Description:
     - asm330lhhxg1_STdC    v2.0.1
     - h3lis100dl_STdC      v2.0.1
     - h3lis331dl_STdC      v2.0.1
     - hts221_STdC          v2.0.1
     - hts221_STdC          v2.1.0
     - i3g4250d_STdC        v2.0.1
     - iis2dh_STdC          v2.0.1
     - iis2dlpc_STdC        v2.0.1
     - iis2dulpx_STdC       v1.0.2
     - iis2iclx_STdC        v2.0.1
     - iis2mdc_STdC         v2.0.2
     - iis2mdc_STdC         v2.0.3
     - iis328dq_STdC        v2.0.1
     - iis3dhhc_STdC        v2.0.1
     - iis3dwb_STdC         v2.0.1
     - ilps22qs_STdC        v3.1.1
     - ilps28qsw_STdC       v2.2.0
     - ism303dac_STdC       v2.0.1
     - ism330bx_STdC        v3.0.1
     - ism330dhcx_STdC      v2.1.0
     - ism330dlc_STdC       v2.0.1
     - ism330bx_STdC        v3.0.2
     - ism330dhcx_STdC      v2.1.1
     - ism330dlc_STdC       v2.0.2
     - ism330is_STdC        v3.0.1
     - l3gd20h_STdC         v2.0.1
     - lis25ba_STdC         v2.0.1
@@ -85,20 +86,20 @@ Description:
     - lis2ds12_STdC        v2.0.1
     - lis2dtw12_STdC       v2.0.1
     - lis2du12_STdC        v2.0.1
     - lis2dux12_STdC       v2.3.0
     - lis2duxs12_STdC      v2.3.0
     - lis2dux12_STdC       v2.4.1
     - lis2duxs12_STdC      v2.4.1
     - lis2dw12_STdC        v2.0.1
     - lis2hh12_STdC        v2.0.1
     - lis2mdl_STdC         v2.0.1
     - lis331dlh_STdC       v2.0.1
     - lis3de_STdC          v2.0.1
     - lis3dh_STdC          v2.0.1
     - lis3dhh_STdC         v2.0.1
     - lis3dhh_STdC         v2.0.2
     - lis3mdl_STdC         v2.0.1
     - lps22ch_STdC         v2.0.1
     - lps22df_STdC         v2.2.0
     - lps22hb_STdC         v2.0.1
     - lps22hh_STdC         v3.0.1
     - lps22hb_STdC         v2.0.2
     - lps22hh_STdC         v3.0.2
     - lps25hb_STdC         v2.0.1
     - lps27hhtw_STdC       v2.0.1
     - lps27hhw_STdC        v2.0.1
@@ -112,20 +113,22 @@ Description:
     - lsm6dso16is_STdC     v3.0.1
     - lsm6dso32_STdC       v2.1.0
     - lsm6dso32x_STdC      v2.1.0
     - lsm6dso_STdC         v3.1.0
     - lsm6dso_STdC         v3.1.1
     - lsm6dsox_STdC        v3.1.0
     - lsm6dsr_STdC         v2.1.0
     - lsm6dsrx_STdC        v2.1.0
     - lsm6dsv16b_STdC      v3.0.0
     - lsm6dsv16bx_STdC     v5.0.1
     - lsm6dsv16b_STdC      v3.0.1
     - lsm6dsv16bx_STdC     v5.0.2
     - lsm6dsv16x_STdC      v4.3.0
     - lsm6dsv320x_STdC     v1.1.0
     - lsm6dsv32x_STdC      v2.3.0
     - lsm6dsv80x_STdC      v1.1.0
     - lsm6dsv_STdC         v3.3.0
     - lsm9ds1_STdC         v2.0.1
     - st1vafe3bx_STdC      v2.0.0
     - st1vafe6ax_STdC      v2.0.1
     - st1vafe3bx_STdC      v2.1.1
     - st1vafe6ax_STdC      v2.0.2
     - sths34pf80_STdC      v3.0.1
     - stts22h_STdC         v2.1.0
     - stts22h_STdC         v2.1.1
     - stts751_STdC         v2.0.1

Dependencies:
@@ -133,10 +136,10 @@ Dependencies:

URL:
   https://www.st.com/en/embedded-software/c-driver-mems.html
   https://github.com/STMicroelectronics/STMems_Standard_C_drivers/tree/v2.8
   https://github.com/STMicroelectronics/STMems_Standard_C_drivers/tree/v2.9.1

commit:
   1609395 (tag v2.8)
   0c1759e4 (tag v2.9.1)

Maintained-by:
   ST Microelectronics
+21 −15
Original line number Diff line number Diff line
@@ -50,7 +50,10 @@ int32_t __weak hts221_read_reg(const stmdev_ctx_t *ctx, uint8_t reg, uint8_t *da
{
  int32_t ret;

  if (ctx == NULL) return -1;
  if (ctx == NULL)
  {
    return -1;
  }

  ret = ctx->read_reg(ctx->handle, reg, data, len);

@@ -68,12 +71,15 @@ int32_t __weak hts221_read_reg(const stmdev_ctx_t *ctx, uint8_t reg, uint8_t *da
  *
  */
int32_t __weak hts221_write_reg(const stmdev_ctx_t *ctx, uint8_t reg,
                                uint8_t *data,
                                const uint8_t *data,
                                uint16_t len)
{
  int32_t ret;

  if (ctx == NULL) return -1;
  if (ctx == NULL)
  {
    return -1;
  }

  ret = ctx->write_reg(ctx->handle, reg, data, len);

@@ -857,7 +863,7 @@ int32_t hts221_hum_rh_point_0_get(const stmdev_ctx_t *ctx, float_t *val)
  int32_t ret;

  ret = hts221_read_reg(ctx, HTS221_H0_RH_X2, &coeff, 1);
  *val = coeff / 2.0f;
  *val = (float_t)coeff / 2.0f;

  return ret;
}
@@ -876,7 +882,7 @@ int32_t hts221_hum_rh_point_1_get(const stmdev_ctx_t *ctx, float_t *val)
  int32_t ret;

  ret = hts221_read_reg(ctx, HTS221_H1_RH_X2, &coeff, 1);
  *val = coeff / 2.0f;
  *val = (float_t)coeff / 2.0f;

  return ret;
}
@@ -902,7 +908,7 @@ int32_t hts221_temp_deg_point_0_get(const stmdev_ctx_t *ctx, float_t *val)
  {
    ret = hts221_read_reg(ctx, HTS221_T1_T0_MSB, (uint8_t *) &reg, 1);
    coeff_h = reg.t0_msb;
    *val = ((coeff_h * 256) + coeff_l) / 8.0f;
    *val = (((float_t)coeff_h * 256.0f) + (float_t)coeff_l) / 8.0f;
  }

  return ret;
@@ -929,7 +935,7 @@ int32_t hts221_temp_deg_point_1_get(const stmdev_ctx_t *ctx, float_t *val)
  {
    ret = hts221_read_reg(ctx, HTS221_T1_T0_MSB, (uint8_t *) &reg, 1);
    coeff_h = reg.t1_msb;
    *val = ((coeff_h * 256) + coeff_l) / 8.0f;
    *val = (((float_t)coeff_h * 256.0f) + (float_t)coeff_l) / 8.0f;
  }

  return ret;
@@ -950,8 +956,8 @@ int32_t hts221_hum_adc_point_0_get(const stmdev_ctx_t *ctx, float_t *val)
  int32_t ret;

  ret = hts221_read_reg(ctx, HTS221_H0_T0_OUT_L, coeff_p, 2);
  coeff = (coeff_p[1] * 256) + coeff_p[0];
  *val = coeff * 1.0f;
  coeff = ((int16_t)coeff_p[1] * 256) + (int16_t)coeff_p[0];
  *val = (float_t)coeff * 1.0f;

  return ret;
}
@@ -971,8 +977,8 @@ int32_t hts221_hum_adc_point_1_get(const stmdev_ctx_t *ctx, float_t *val)
  int32_t ret;

  ret = hts221_read_reg(ctx, HTS221_H1_T0_OUT_L, coeff_p, 2);
  coeff = (coeff_p[1] * 256) + coeff_p[0];
  *val = coeff * 1.0f;
  coeff = ((int16_t)coeff_p[1] * 256) + (int16_t)coeff_p[0];
  *val = (float_t)coeff * 1.0f;

  return ret;
}
@@ -992,8 +998,8 @@ int32_t hts221_temp_adc_point_0_get(const stmdev_ctx_t *ctx, float_t *val)
  int32_t ret;

  ret = hts221_read_reg(ctx, HTS221_T0_OUT_L, coeff_p, 2);
  coeff = (coeff_p[1] * 256) + coeff_p[0];
  *val = coeff * 1.0f;
  coeff = ((int16_t)coeff_p[1] * 256) + (int16_t)coeff_p[0];
  *val = (float_t)coeff * 1.0f;

  return ret;
}
@@ -1013,8 +1019,8 @@ int32_t hts221_temp_adc_point_1_get(const stmdev_ctx_t *ctx, float_t *val)
  int32_t ret;

  ret = hts221_read_reg(ctx, HTS221_T1_OUT_L, coeff_p, 2);
  coeff = (coeff_p[1] * 256) + coeff_p[0];
  *val = coeff * 1.0f;
  coeff = ((int16_t)coeff_p[1] * 256) + (int16_t)coeff_p[0];
  *val = (float_t)coeff * 1.0f;

  return ret;
}
+1 −52
Original line number Diff line number Diff line
@@ -131,33 +131,6 @@ typedef struct

#endif /* MEMS_SHARED_TYPES */

#ifndef MEMS_UCF_SHARED_TYPES
#define MEMS_UCF_SHARED_TYPES

/** @defgroup    Generic address-data structure definition
  * @brief       This structure is useful to load a predefined configuration
  *              of a sensor.
  *              You can create a sensor configuration by your own or using
  *              Unico / Unicleo tools available on STMicroelectronics
  *              web site.
  *
  * @{
  *
  */

typedef struct
{
  uint8_t address;
  uint8_t data;
} ucf_line_t;

/**
  * @}
  *
  */

#endif /* MEMS_UCF_SHARED_TYPES */

/**
  * @}
  *
@@ -289,30 +262,6 @@ typedef struct
#define HTS221_T1_OUT_L            0x3EU
#define HTS221_T1_OUT_H            0x3FU

/**
  * @defgroup HTS221_Register_Union
  * @brief    This union group all the registers having a bit-field
  *           description.
  *           This union is useful but it's not needed by the driver.
  *
  *           REMOVING this union you are compliant with:
  *           MISRA-C 2012 [Rule 19.2] -> " Union are not allowed "
  *
  * @{
  *
  */
typedef union
{
  hts221_av_conf_t        av_conf;
  hts221_ctrl_reg1_t      ctrl_reg1;
  hts221_ctrl_reg2_t      ctrl_reg2;
  hts221_ctrl_reg3_t      ctrl_reg3;
  hts221_status_reg_t     status_reg;
  hts221_t1_t0_msb_t      t1_t0_msb;
  bitwise_t               bitwise;
  uint8_t                 byte;
} hts221_reg_t;

/**
  * @}
  *
@@ -334,7 +283,7 @@ int32_t hts221_read_reg(const stmdev_ctx_t *ctx, uint8_t reg,
                        uint8_t *data,
                        uint16_t len);
int32_t hts221_write_reg(const stmdev_ctx_t *ctx, uint8_t reg,
                         uint8_t *data,
                         const uint8_t *data,
                         uint16_t len);

typedef enum
+4194 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading