Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@ endif()

# STMEMSC - Hardware Abstraction Layer for ST sensor
add_subdirectory_ifdef(CONFIG_HAS_STMEMSC sensor/stmemsc)

# Add sensor common include files
zephyr_include_directories(sensor/inc)
131 changes: 131 additions & 0 deletions sensor/inc/mems_conf_shared_types.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
/**
******************************************************************************
* @attention
*
* Copyright (c) 2025 STMicroelectronics.
* All rights reserved.
*
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
#include <stdint.h>

/*
* This file contain the MEMS Configuration Shared Types v2.0 that are used inside
* the various algo configuration files.
*/

#ifndef MEMS_CONF_SHARED_TYPES
#define MEMS_CONF_SHARED_TYPES

#define MEMS_CONF_ARRAY_LEN(x) (sizeof(x) / sizeof(x[0]))

/*
* MEMS_CONF_SHARED_TYPES format supports the following operations:
* - MEMS_CONF_OP_TYPE_TYPE_READ: read the register at the location specified
* by the "address" field ("data" field is ignored)
* - MEMS_CONF_OP_TYPE_TYPE_WRITE: write the value specified by the "data"
* field at the location specified by the "address" field
* - MEMS_CONF_OP_TYPE_TYPE_DELAY: wait the number of milliseconds specified by
* the "data" field ("address" field is ignored)
* - MEMS_CONF_OP_TYPE_TYPE_POLL_SET: poll the register at the location
* specified by the "address" field until all the bits identified by the mask
* specified by the "data" field are set to 1
* - MEMS_CONF_OP_TYPE_TYPE_POLL_RESET: poll the register at the location
* specified by the "address" field until all the bits identified by the mask
* specified by the "data" field are reset to 0
*/

struct mems_conf_name_list {
const char *const *list;
uint16_t len;
};

enum {
MEMS_CONF_OP_TYPE_READ = 1,
MEMS_CONF_OP_TYPE_WRITE = 2,
MEMS_CONF_OP_TYPE_DELAY = 3,
MEMS_CONF_OP_TYPE_POLL_SET = 4,
MEMS_CONF_OP_TYPE_POLL_RESET = 5
};

struct mems_conf_op {
uint8_t type;
uint8_t address;
uint8_t data;
};

struct mems_conf_op_list {
const struct mems_conf_op *list;
uint32_t len;
};

#endif /* MEMS_CONF_SHARED_TYPES */

#ifndef MEMS_CONF_METADATA_SHARED_TYPES
#define MEMS_CONF_METADATA_SHARED_TYPES

struct mems_conf_application {
char *name;
char *version;
};

struct mems_conf_result {
uint8_t code;
char *label;
};

enum {
MEMS_CONF_OUTPUT_CORE_HW = 1,
MEMS_CONF_OUTPUT_CORE_EMB = 2,
MEMS_CONF_OUTPUT_CORE_FSM = 3,
MEMS_CONF_OUTPUT_CORE_MLC = 4,
MEMS_CONF_OUTPUT_CORE_ISPU = 5
};

enum {
MEMS_CONF_OUTPUT_TYPE_UINT8_T = 1,
MEMS_CONF_OUTPUT_TYPE_INT8_T = 2,
MEMS_CONF_OUTPUT_TYPE_CHAR = 3,
MEMS_CONF_OUTPUT_TYPE_UINT16_T = 4,
MEMS_CONF_OUTPUT_TYPE_INT16_T = 5,
MEMS_CONF_OUTPUT_TYPE_UINT32_T = 6,
MEMS_CONF_OUTPUT_TYPE_INT32_T = 7,
MEMS_CONF_OUTPUT_TYPE_UINT64_T = 8,
MEMS_CONF_OUTPUT_TYPE_INT64_T = 9,
MEMS_CONF_OUTPUT_TYPE_HALF = 10,
MEMS_CONF_OUTPUT_TYPE_FLOAT = 11,
MEMS_CONF_OUTPUT_TYPE_DOUBLE = 12
};

struct mems_conf_output {
char *name;
uint8_t core;
uint8_t type;
uint16_t len;
uint8_t reg_addr;
char *reg_name;
uint8_t num_results;
const struct mems_conf_result *results;
};

struct mems_conf_output_list {
const struct mems_conf_output *list;
uint16_t len;
};

struct mems_conf_mlc_identifier {
uint8_t fifo_tag;
uint16_t id;
char *label;
};

struct mems_conf_mlc_identifier_list {
const struct mems_conf_mlc_identifier *list;
uint16_t len;
};

#endif /* MEMS_CONF_METADATA_SHARED_TYPES */
1 change: 1 addition & 0 deletions sensor/stmemsc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ set(stmems_pids
ism330dhcx
ism330dlc
ism330is
ism6hg256x
l3gd20h
lis25ba
lis2de12
Expand Down
169 changes: 85 additions & 84 deletions sensor/stmemsc/README
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Origin:
https://www.st.com/en/embedded-software/c-driver-mems.html

Status:
version v2.9.1
version v2.11

Purpose:
ST Microelectronics standard C platform-independent drivers for MEMS
Expand Down Expand Up @@ -49,97 +49,98 @@ Description:

Driver versions in this package:

- a3g4250d_STdC v2.0.1
- ais25ba_STdC v2.0.1
- ais2dw12_STdC v2.0.1
- ais2ih_STdC v2.0.1
- ais328dq_STdC v2.0.1
- ais3624dq_STdC v2.0.1
- asm330lhb_STdC v2.1.0
- asm330lhbg1_STdC v1.1.0
- asm330lhh_STdC v3.2.0
- asm330lhhx_STdC v2.1.0
- asm330lhhxg1_STdC v2.0.1
- h3lis100dl_STdC v2.0.1
- h3lis331dl_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.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.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
- lis2de12_STdC v2.0.1
- lis2dh12_STdC v2.0.1
- lis2ds12_STdC v2.0.1
- lis2dtw12_STdC v2.0.1
- lis2du12_STdC v2.0.1
- 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.2
- lis3mdl_STdC v2.0.1
- lps22ch_STdC v2.0.1
- lps22df_STdC v2.2.0
- 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
- lps28dfw_STdC v2.2.0
- lps33k_STdC v2.0.1
- lsm303agr_STdC v2.0.1
- lsm303ah_STdC v2.0.1
- lsm6ds3tr-c_STdC v2.0.1
- lsm6dsl_STdC v2.0.1
- lsm6dsm_STdC v2.0.1
- lsm6dso16is_STdC v3.0.1
- lsm6dso32_STdC v2.1.0
- lsm6dso32x_STdC v2.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.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.1.1
- st1vafe6ax_STdC v2.0.2
- sths34pf80_STdC v3.0.1
- stts22h_STdC v2.1.1
- stts751_STdC v2.0.1
- a3g4250d_STdC v2.2.0
- ais25ba_STdC v2.2.0
- ais2dw12_STdC v2.2.0
- ais2ih_STdC v2.2.0
- ais328dq_STdC v2.2.0
- ais3624dq_STdC v2.2.0
- asm330lhb_STdC v2.3.0
- asm330lhbg1_STdC v1.3.0
- asm330lhh_STdC v3.4.0
- asm330lhhx_STdC v2.3.0
- asm330lhhxg1_STdC v2.2.1
- h3lis100dl_STdC v2.2.0
- h3lis331dl_STdC v2.2.0
- hts221_STdC v2.3.0
- i3g4250d_STdC v2.2.0
- iis2dh_STdC v2.2.0
- iis2dlpc_STdC v2.2.0
- iis2dulpx_STdC v2.0.0
- iis2iclx_STdC v2.2.0
- iis2mdc_STdC v2.2.0
- iis328dq_STdC v2.2.0
- iis3dhhc_STdC v2.2.0
- iis3dwb_STdC v2.2.0
- ilps22qs_STdC v4.0.0
- ilps28qsw_STdC v3.0.0
- ism303dac_STdC v2.2.0
- ism330bx_STdC v3.2.0
- ism330dhcx_STdC v2.4.0
- ism330dlc_STdC v2.2.0
- ism330is_STdC v3.2.0
- ism6hg256x_STdC v2.0.0
- l3gd20h_STdC v2.2.0
- lis25ba_STdC v2.2.0
- lis2de12_STdC v2.2.0
- lis2dh12_STdC v2.2.0
- lis2ds12_STdC v2.2.0
- lis2dtw12_STdC v2.2.0
- lis2du12_STdC v2.2.0
- lis2dux12_STdC v3.0.0
- lis2duxs12_STdC v3.0.0
- lis2dw12_STdC v2.2.0
- lis2hh12_STdC v2.2.0
- lis2mdl_STdC v2.2.0
- lis331dlh_STdC v2.2.0
- lis3de_STdC v2.2.0
- lis3dh_STdC v2.2.0
- lis3dhh_STdC v2.2.0
- lis3mdl_STdC v2.2.0
- lps22ch_STdC v2.2.0
- lps22df_STdC v2.4.0
- lps22hb_STdC v2.2.0
- lps22hh_STdC v3.2.0
- lps25hb_STdC v2.2.0
- lps27hhtw_STdC v2.2.0
- lps27hhw_STdC v2.2.0
- lps28dfw_STdC v3.0.0
- lps33k_STdC v2.2.0
- lsm303agr_STdC v2.2.0
- lsm303ah_STdC v2.2.0
- lsm6ds3tr-c_STdC v2.2.0
- lsm6dsl_STdC v2.2.0
- lsm6dsm_STdC v2.2.0
- lsm6dso16is_STdC v3.2.0
- lsm6dso32_STdC v2.3.0
- lsm6dso32x_STdC v2.3.0
- lsm6dso_STdC v3.2.1
- lsm6dsox_STdC v3.3.0
- lsm6dsr_STdC v2.3.0
- lsm6dsrx_STdC v2.3.0
- lsm6dsv16b_STdC v3.2.0
- lsm6dsv16bx_STdC v5.2.0
- lsm6dsv16x_STdC v5.0.0
- lsm6dsv320x_STdC v3.0.0
- lsm6dsv32x_STdC v3.0.0
- lsm6dsv80x_STdC v3.0.0
- lsm6dsv_STdC v4.0.0
- lsm9ds1_STdC v2.2.0
- st1vafe3bx_STdC v2.3.0
- st1vafe6ax_STdC v2.2.0
- sths34pf80_STdC v3.2.0
- stts22h_STdC v2.3.0
- stts751_STdC v2.2.0

Dependencies:
None.

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

commit:
0c1759e4 (tag v2.9.1)
7ae811c3 (tag v2.11)

Maintained-by:
ST Microelectronics
Expand Down
Loading