Added I2C address scan

This commit is contained in:
dario
2024-07-01 11:06:45 +02:00
parent 82f64aca61
commit 82baae62ad
3 changed files with 20 additions and 0 deletions

View File

@@ -35,6 +35,11 @@ namespace sta
*/
void setSettings(uint16_t address, bool master, bool blocking);
/**
* @brief Prints all available addresses via the debug printable.
*
*/
virtual void scanAddresses() = 0;
protected:
/// @brief The peripheral's address to communicate with.
uint16_t address_;

View File

@@ -27,6 +27,7 @@ namespace sta
void receive(uint8_t * buffer, size_t size) override;
void fill(uint8_t value, size_t count) override;
void scanAddresses() override;
private:
I2C_HandleTypeDef * handle_;
const uint32_t timeout_ = 1000;