Skip to content

Commit

Permalink
Merge pull request #375 from pborcin/feat/qma6100p
Browse files Browse the repository at this point in the history
add qma6100p accelerometer
  • Loading branch information
tore-espressif authored Oct 3, 2024
2 parents 01fe06a + 1ded9ab commit 0a83a89
Show file tree
Hide file tree
Showing 17 changed files with 1,209 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/ci/update_readme_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
# 'AUDIO_SPEAKER' : r'',
# 'AUDIO_MIC' : r'',
'SDCARD': r'(^idf$)', # SD card driver is native to ESP-IDF
'IMU': r'(icm42670$|mpu6050$)',
'IMU': r'(icm42670$|mpu6050$|qma6100p$)',
'LED': r'(led_indicator$|^idf$)', # Provided by led_indicator or idf
'BAT': r'(^idf$)', # Battery (ADC driver) is native to ESP-IDF
'CAMERA': r'(esp32-camera$)', # esp32-camera component
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upload_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
with:
directories: >
bsp/esp32_azure_iot_kit;bsp/esp32_s2_kaluga_kit;bsp/esp_wrover_kit;bsp/esp-box;bsp/esp32_s3_usb_otg;bsp/esp32_s3_eye;bsp/esp32_s3_lcd_ev_board;bsp/esp32_s3_korvo_2;bsp/esp-box-lite;bsp/esp32_lyrat;bsp/esp32_c3_lcdkit;bsp/esp-box-3;bsp/esp_bsp_generic;bsp/esp32_s3_korvo_1;bsp/esp32_p4_function_ev_board;bsp/m5stack_core_s3;bsp/m5dial;bsp/m5stack_core_2;bsp/esp_bsp_devkit;
components/bh1750;components/ds18b20;components/es8311;components/es7210;components/fbm320;components/hts221;components/mag3110;components/mpu6050;components/esp_lvgl_port;components/icm42670;
components/bh1750;components/ds18b20;components/es8311;components/es7210;components/fbm320;components/hts221;components/mag3110;components/mpu6050;components/esp_lvgl_port;components/icm42670;components/qma6100p;
components/lcd_touch/esp_lcd_touch;components/lcd_touch/esp_lcd_touch_ft5x06;components/lcd_touch/esp_lcd_touch_gt911;components/lcd_touch/esp_lcd_touch_tt21100;components/lcd_touch/esp_lcd_touch_gt1151;components/lcd_touch/esp_lcd_touch_cst816s;
components/lcd/esp_lcd_gc9a01;components/lcd/esp_lcd_ili9341;components/lcd/esp_lcd_ra8875;components/lcd_touch/esp_lcd_touch_stmpe610;components/lcd/esp_lcd_sh1107;components/lcd/esp_lcd_st7796;components/lcd/esp_lcd_gc9503;components/lcd/esp_lcd_ssd1681;components/lcd/esp_lcd_ili9881c;
components/io_expander/esp_io_expander;components/io_expander/esp_io_expander_tca9554;components/io_expander/esp_io_expander_tca95xx_16bit;components/io_expander/esp_io_expander_ht8574;
Expand Down
2 changes: 1 addition & 1 deletion bsp/esp32_s3_eye/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ The ESP32-S3-EYE board consists of two parts: the main board (ESP32-S3-EYE-MB) t
|AUDIO_SPEAKER| :x: | | |
| AUDIO_MIC |:heavy_check_mark:| | |
| SDCARD |:heavy_check_mark:| idf | >=4.4.5 |
| IMU | :x: | | |
| IMU |:heavy_check_mark:| [qma6100p](https://components.espressif.com/components/qma6100p) | 1.* |
| CAMERA |:heavy_check_mark:| [espressif/esp32-camera](https://components.espressif.com/components/espressif/esp32-camera) | ^2.0.2 |
<!-- Autogenerated end: Dependencies -->
5 changes: 5 additions & 0 deletions bsp/esp32_s3_eye/idf_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@ dependencies:
esp_codec_dev:
version: "^1,<1.2"
public: true

qma6100p:
version: "1.*"
override_path: "../../components/qma6100p"
public: true
2 changes: 1 addition & 1 deletion bsp/esp32_s3_eye/include/bsp/esp32_s3_eye.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#define BSP_CAPS_AUDIO_SPEAKER 0
#define BSP_CAPS_AUDIO_MIC 1
#define BSP_CAPS_SDCARD 1
#define BSP_CAPS_IMU 0 // There is an IMU, but not supported in this BSP
#define BSP_CAPS_IMU 1
#define BSP_CAPS_CAMERA 1

/**************************************************************************************************
Expand Down
8 changes: 8 additions & 0 deletions components/qma6100p/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
idf_component_register(
SRCS "qma6100p.c"
INCLUDE_DIRS "include"
REQUIRES "driver"
)

include(package_manager)
cu_pkg_define_version(${CMAKE_CURRENT_LIST_DIR})
34 changes: 34 additions & 0 deletions components/qma6100p/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# QMA6100P Driver Component

[![Component Registry](https://components.espressif.com/components/espressif/qma6100p/badge.svg)](https://components.espressif.com/components/espressif/qma6100p)

C driver for QST QMA6100P 3-axis accelerometer based on I2C communication.

## Features

- Get 3-axis accelerometer data, either raw or as floating point values.
- Configure accelerometer sensitivity.
- Support for QMA6100P interrupt generation when data ready (occurs each time a write to all sensor data registers has been completed).

## Important Notes

- Keep in mind that QMA6100P I2C address depends on the level of its AD0 pin (1) (0x12 when low, 0x13 when high).
- In order to receive QMA6100P interrupts, its INT pins (5, 6) must be connected to a GPIO on the ESP32.

## Limitations

- Only I2C communication is supported.
- If QMA6100P interrupts are used, it is recommended to not read data using I2C directly from the ISR.

## Get Started

This driver, along with many other components from this repository, can be used as a package from [Espressif's IDF Component Registry](https://components.espressif.com). To include this driver in your project, run the following idf.py from the project's root directory:

```
idf.py add-dependency "espressif/qma6100p"
```

Another option is to manually create a `idf_component.yml` file. You can find more about using .yml files for components from [Espressif's documentation](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-component-manager.html).

## See Also
* [QMA6100P datasheet](https://www.qstcorp.com/upload/pdf/202203/13-52-20%20QMA6100P%20Preliminary%20Datasheet%20Rev.%20A1_SPImode03.pdf)
6 changes: 6 additions & 0 deletions components/qma6100p/idf_component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: "1.0.0"
description: I2C driver for QMA6100P accelerometer
url: https://github.com/espressif/esp-bsp/tree/master/components/qma6100p
dependencies:
idf : ">=4.0"
cmake_utilities: "0.*"
Loading

0 comments on commit 0a83a89

Please sign in to comment.