diff --git a/src_main/core/piinit.h b/src_main/core/piinit.h index 5cd0ee2b..efaffc88 100644 --- a/src_main/core/piinit.h +++ b/src_main/core/piinit.h @@ -40,9 +40,9 @@ public: class PIInit { + friend class __PIInit_Initializer__; friend class PIFile; public: - PIInit(); ~PIInit(); //! \brief Build options which PIP library was built @@ -61,6 +61,7 @@ public: static bool isBuildOptionEnabled(BuildOption o); static PIStringList buildOptions(); private: + explicit PIInit(); void setFileCharset(const char *charset); bool fileExists(const PIString & p); PRIVATE_DECLARATION diff --git a/src_main/io/pispi.h b/src_main/io/pispi.h index 005f1833..62349c87 100644 --- a/src_main/io/pispi.h +++ b/src_main/io/pispi.h @@ -8,9 +8,16 @@ class PIP_EXPORT PISPI: public PIIODevice { PIIODEVICE(PISPI) public: - explicit PISPI(const PIString & path = PIString(), uint speed_hz = 100000, PIIODevice::DeviceMode mode = PIIODevice::ReadWrite); + explicit PISPI(const PIString & path = PIString(), uint speed_hz = 1000000, PIIODevice::DeviceMode mode = PIIODevice::ReadWrite); ~PISPI() {} + //! \brief Parameters of PISPI + enum Parameters { + ClockInverse /*! SPI clk polarity control check and generate */ = 0x1, + ParityOdd /*! Parity is odd instead of even */ = 0x2, + TwoStopBits /*! Two stop bits instead of one */ = 0x4 + }; + void setSpeed(uint speed_hz); uint speed() const {return spi_speed;}