Skip to content

Conversation

@Byte-Entropy
Copy link

Introduce a complete C++ driver for the NAU7802 sensor, including an I2C wrapper for STM32 HAL functions. Normalize file naming conventions and update the driver to improve initialization logic. Clean up the repository by removing redundant files and updating the README to reflect changes.

This commit adds the initial, complete C++ driver for the NAU7802 sensor,
placing it in the PeripheralDriversSubmodule.

- Includes a reusable I2C_Wrapper to abstract STM32 HAL functions.
- Implements core logic: init, reset, setGain, and readSensor.
- Adds register definitions, example usage files, and a README.
Renamed Files: Changed I2C_Wrapper source and header files to i2c_wrapper (lowercase) for consistent naming conventions.

Driver Update: Updated NAU7802 constructor to accept the I2C wrapper pointer and HAL_Delay function directly.

Main Test Update: Modified main_read_test.cpp to implement the new initialization logic, set default gain to 1x, and added placeholders for future calibration.

Cleanup: Removed the redundant ExampleUsage.cpp and the binary datasheet file (.pdf).

Registers: Minor updates to register definitions in NAU7802_regs.hpp.
-- Example command --
case 0: //
SOAR_PRINT("NAU7802Task: Received command 0.\n");
break;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, we can have commands to stop reading adn start reading or only record to flash and dont log/print

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants