Skip to content

Commit

Permalink
Update XPowersLib & SensorLib to master
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisxhe committed Oct 5, 2024
1 parent 6b6afec commit befe015
Show file tree
Hide file tree
Showing 161 changed files with 101,809 additions and 10,391 deletions.
3 changes: 3 additions & 0 deletions libdeps/SensorLib/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.hpp linguist-language=C++


11 changes: 11 additions & 0 deletions libdeps/SensorLib/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.pio
.vscode
test
.travis.yml
test
assets
*.bk
*.test
build
*.old
sdkconfig
1 change: 0 additions & 1 deletion libdeps/SensorLib/.piopm

This file was deleted.

10 changes: 10 additions & 0 deletions libdeps/SensorLib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
set(src_dirs ./src
./src/touch
./src/platform)
set(include_dirs ./src
./src/REG
./src/touch
./src/platform)
idf_component_register(SRC_DIRS ${src_dirs}
INCLUDE_DIRS ${include_dirs}
REQUIRES esp_timer esp_driver_gpio driver)
16 changes: 16 additions & 0 deletions libdeps/SensorLib/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
menu "SensorLib Configuration"

choice SensorLib_ESP_IDF_API
prompt "SensorLib library esp-idf api version"
default SENSORLIB_ESP_IDF_NEW_API
help
Define API version

config SENSORLIB_ESP_IDF_NEW_API
bool "Use esp-idf higher version (>= 5.0) API"
config SENSORLIB_ESP_IDF_OLD_API
bool "Use esp-idf lower version ( < 5.0) API , Compatible with lower versions of esp-idf"
endchoice


endmenu
24 changes: 22 additions & 2 deletions libdeps/SensorLib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,35 @@

[![LICENSE](https://img.shields.io/github/license/lewisxhe/SensorLib)](https://github.com/lewisxhe/SensorLib/blob/master/LICENSE)
[![ISSUES](https://img.shields.io/github/issues/lewisxhe/SensorsLib)](https://github.com/lewisxhe/SensorsLib/issues)
[![FROK](https://img.shields.io/github/forks/lewisxhe/SensorsLib)](https://github.com/lewisxhe/SensorsLib/graphs/contributors)
[![FORK](https://img.shields.io/github/forks/lewisxhe/SensorsLib)](https://github.com/lewisxhe/SensorsLib/graphs/contributors)
[![STAR](https://img.shields.io/github/stars/lewisxhe/SensorsLib)](https://github.com/lewisxhe/SensorsLib/stargazers)
[![releases](https://img.shields.io/github/release/lewisxhe/SensorsLib)](https://github.com/lewisxhe/SensorLib/releases)

![PCF8563](https://img.shields.io/badge/PCB8563-GREEN)
## RTC
![PCF8563](https://img.shields.io/badge/PCF8563-GREEN)
![PCF85063](https://img.shields.io/badge/PCF85063-GREEN)
![HYM8563](https://img.shields.io/badge/HYM8563-GREEN)

## Motion Sensor

![QMI8658](https://img.shields.io/badge/QMI8658-blue)
![BMM150](https://img.shields.io/badge/BMM150-blue)
![QMC6310](https://img.shields.io/badge/QMC6310-blue)
![BMA423](https://img.shields.io/badge/BMA423-blue)
![BHI260AP](https://img.shields.io/badge/BHI260AP-blue)

## GPIO Expansion
![XL9555](https://img.shields.io/badge/XL9555-yellow)
![XL9535](https://img.shields.io/badge/XL9535-yellow)

## Haptic Driver
![DRV2605](https://img.shields.io/badge/DRV2605-teal)

## Light Sensor
![CM32181](https://img.shields.io/badge/CM32181-brown)
![LTR553](https://img.shields.io/badge/LTR553-brown)

## Touchpad
![FT5206](https://img.shields.io/badge/FT5206-red)
![FT6206](https://img.shields.io/badge/FT6206-red)
![FT6236](https://img.shields.io/badge/FT6236-red)
Expand All @@ -46,6 +59,9 @@
![CST226SE](https://img.shields.io/badge/CST226SE-red)
![CHSC5816](https://img.shields.io/badge/CHSC5816-red)
![GT911](https://img.shields.io/badge/GT911-red)
![CST9217](https://img.shields.io/badge/CST9217-red)
![CST9220](https://img.shields.io/badge/CST9220-red)
![GT9895](https://img.shields.io/badge/GT9895-red)

Support list:

Expand All @@ -71,3 +87,7 @@ Support list:
| CST226SE | Capacitive touch | ✔️ ||
| CHSC5816 | Capacitive touch | ✔️ ||
| GT911 | Capacitive touch | ✔️ ||
| CST9217 | Capacitive touch | ✔️ ||
| CST9220 | Capacitive touch | ✔️ ||
| GT9895 | Capacitive touch | ✔️ ||

6 changes: 3 additions & 3 deletions libdeps/SensorLib/examples/BHI260AP_6DoF/BHI260AP_6DoF.ino
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* @file BHI260AP_6DoF.ino
* @author Lewis He ([email protected])
* @date 2023-09-06
*
* @note Changed from Boschsensortec API https://github.com/boschsensortec/BHY2_SensorAPI
*/
#include <Wire.h>
#include <SPI.h>
Expand All @@ -48,7 +48,7 @@


SensorBHI260AP bhy;
void accel_process_callback(uint8_t sensor_id, uint8_t *data_ptr, uint32_t len)
void accel_process_callback(uint8_t sensor_id, uint8_t *data_ptr, uint32_t len, uint64_t *timestamp)
{
struct bhy2_data_xyz data;
float scaling_factor = get_sensor_default_scaling(sensor_id);
Expand All @@ -63,7 +63,7 @@ void accel_process_callback(uint8_t sensor_id, uint8_t *data_ptr, uint32_t len)
}


void gyro_process_callback(uint8_t sensor_id, uint8_t *data_ptr, uint32_t len)
void gyro_process_callback(uint8_t sensor_id, uint8_t *data_ptr, uint32_t len, uint64_t *timestamp)
{
struct bhy2_data_xyz data;
float scaling_factor = get_sensor_default_scaling(sensor_id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* @file BHI260AP_DebugInfo.ino
* @author Lewis He ([email protected])
* @date 2023-10-08
*
* @note Changed from Boschsensortec API https://github.com/boschsensortec/BHY2_SensorAPI
*/
#include <Wire.h>
#include <SPI.h>
Expand All @@ -49,7 +49,7 @@
SensorBHI260AP bhy;


void quaternion_process_callback(uint8_t sensor_id, uint8_t *data_ptr, uint32_t len)
void quaternion_process_callback(uint8_t sensor_id, uint8_t *data_ptr, uint32_t len, uint64_t *timestamp)
{
Serial.println(bhy.getSensorName(sensor_id));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* @file BHI260AP_Orientation.ino
* @author Lewis He ([email protected])
* @date 2023-10-07
*
* @note Changed from Boschsensortec API https://github.com/boschsensortec/BHY2_SensorAPI
*/
#include <Wire.h>
#include <SPI.h>
Expand All @@ -46,7 +46,7 @@
#define BHI260AP_RST 47
#endif

void orientation_process_callback(uint8_t sensor_id, uint8_t *data_ptr, uint32_t len);
void orientation_process_callback(uint8_t sensor_id, uint8_t *data_ptr, uint32_t len, uint64_t *timestamp);

SensorBHI260AP bhy;

Expand Down Expand Up @@ -106,7 +106,7 @@ void loop()
}


void orientation_process_callback(uint8_t sensor_id, uint8_t *data_ptr, uint32_t len)
void orientation_process_callback(uint8_t sensor_id, uint8_t *data_ptr, uint32_t len, uint64_t *timestamp)
{
char report[256];
uint8_t direction = *data_ptr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* @file BHI260AP_StepCounter.ino
* @author Lewis He ([email protected])
* @date 2023-10-08
*
* @note Changed from Boschsensortec API https://github.com/boschsensortec/BHY2_SensorAPI
*/
#include <Wire.h>
#include <SPI.h>
Expand All @@ -49,13 +49,13 @@
SensorBHI260AP bhy;


void step_detector_process_callback(uint8_t sensor_id, uint8_t *data_ptr, uint32_t len)
void step_detector_process_callback(uint8_t sensor_id, uint8_t *data_ptr, uint32_t len, uint64_t *timestamp)
{
Serial.print(bhy.getSensorName(sensor_id));
Serial.println(" detected.");
}

void step_counter_process_callback(uint8_t sensor_id, uint8_t *data_ptr, uint32_t len)
void step_counter_process_callback(uint8_t sensor_id, uint8_t *data_ptr, uint32_t len, uint64_t *timestamp)
{
Serial.print(bhy.getSensorName(sensor_id));
Serial.print(":");
Expand Down
Loading

0 comments on commit befe015

Please sign in to comment.