mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-08-06 10:27:34 +00:00
Fixed broken imports after dir structure rework & added stm32 i2c
This commit is contained in:
@@ -11,22 +11,25 @@ namespace sta
|
||||
*
|
||||
* @ingroup sta_core_i2c
|
||||
*/
|
||||
class I2cDevice : public Device
|
||||
class I2CDevice : public Device
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @param intf %I2C hardware interface
|
||||
* @param csPin The peripheral's address.
|
||||
*/
|
||||
I2cDevice(I2c * intf, int addr);
|
||||
I2CDevice(I2C * intf, int address, bool master=false, bool blocking=true);
|
||||
|
||||
protected:
|
||||
void select() override;
|
||||
|
||||
void deselect() override;
|
||||
|
||||
|
||||
private:
|
||||
int addr_; /**< device address */
|
||||
I2C * intf_;
|
||||
int address_; /**< device address */
|
||||
int master_;
|
||||
int blocking_;
|
||||
};
|
||||
|
||||
} // namespace sta
|
||||
@@ -34,4 +37,4 @@ namespace sta
|
||||
|
||||
|
||||
|
||||
#endif // STA_CORE_I2C_DEVICE_HPP
|
||||
#endif // STA_CORE_I2C_DEVICE_HPP
|
||||
|
@@ -16,18 +16,24 @@ namespace sta
|
||||
*
|
||||
* @ingroup sta_core_i2c
|
||||
*/
|
||||
class I2c : public Interface
|
||||
class I2C : public Interface
|
||||
{
|
||||
public:
|
||||
I2c(Mutex * mutex=nullptr);
|
||||
I2C(Mutex * mutex=nullptr);
|
||||
|
||||
/**
|
||||
* @brief Address selection for the I2C bus.
|
||||
*
|
||||
* @param address The address to select.
|
||||
* @brief Specify the mode of communication via the bus.
|
||||
*
|
||||
* @param master
|
||||
* @param blocking
|
||||
*/
|
||||
virtual void selectAddress(uint16_t address) = 0;
|
||||
void setSettings(uint16_t address, bool master, bool blocking);
|
||||
|
||||
protected:
|
||||
uint16_t address_;
|
||||
bool master_;
|
||||
bool blocking_;
|
||||
};
|
||||
} // namespace sta
|
||||
|
||||
#endif // STA_CORE_I2C_I2C_HPP
|
||||
#endif // STA_CORE_I2C_I2C_HPP
|
||||
|
@@ -83,4 +83,4 @@ namespace sta
|
||||
} // namespace sta
|
||||
|
||||
|
||||
#endif // STA_CORE_BUS_SERIAL_INTERFACE_HPP
|
||||
#endif // STA_CORE_BUS_SERIAL_INTERFACE_HPP
|
||||
|
Reference in New Issue
Block a user