diff --git a/libraries/MySensors/drivers/AVR/DigitalIO/PinIO.h b/libraries/MySensors/drivers/AVR/DigitalIO/PinIO.h index d91aae3..c861d13 100644 --- a/libraries/MySensors/drivers/AVR/DigitalIO/PinIO.h +++ b/libraries/MySensors/drivers/AVR/DigitalIO/PinIO.h @@ -41,8 +41,24 @@ class PinIO { public: /** Create a PinIO object with no assigned pin. */ PinIO() : bit_(0), mask_(0XFF) {} + /** Constructor + * @param[in] pin Pin assigned to this object. + */ explicit PinIO(uint8_t pin); + /** Initialize pin bit mask and port address. + * @param[in] pin Arduino board pin number. + * @return true for success or false if invalid pin number. + */ bool begin(uint8_t pin); + /** Configure the pin + * + * @param[in] mode Configure as output mode if true else input mode. + * @param[in] data For output mode set pin high if true else low. + * For input mode enable 20K pullup if true else Hi-Z. + * + * This function may be used with interrupts enabled or disabled. + * The previous interrupt state will be restored. + */ void config(bool mode, bool data); //---------------------------------------------------------------------------- /** @return Pin's level */ diff --git a/libraries/MySensors/drivers/AVR/DigitalIO/SoftI2cMaster.h b/libraries/MySensors/drivers/AVR/DigitalIO/SoftI2cMaster.h index 309232a..dd4bbf0 100644 --- a/libraries/MySensors/drivers/AVR/DigitalIO/SoftI2cMaster.h +++ b/libraries/MySensors/drivers/AVR/DigitalIO/SoftI2cMaster.h @@ -91,9 +91,45 @@ class I2cMasterBase { */ virtual void stop() = 0; +/** + * Start an I2C transfer with possible continuation. + * + * @param[in] addressRW I2C slave address plus R/W bit. + * The I2C slave address is in the high seven bits + * and is ORed with on of the following: + * - I2C_READ for a read transfer. + * - I2C_WRITE for a write transfer. + * . + * @param[in,out] buf Source or destination for transfer. + * @param[in] nbyte Number of bytes to transfer (may be zero). + * @param[in] option Option for ending the transfer, one of: + * - I2C_STOP end the transfer with an I2C stop + * condition. + * - I2C_REP_START end the transfer with an I2C + * repeated start condition. + * - I2C_CONTINUE allow additional transferContinue() + * calls. + * . + * @return true for success else false. + */ bool transfer(uint8_t addressRW, void *buf, size_t nbyte, uint8_t option = I2C_STOP); +/** + * Continue an I2C transfer. + * + * @param[in,out] buf Source or destination for transfer. + * @param[in] nbyte Number of bytes to transfer (may be zero). + * @param[in] option Option for ending the transfer, one of: + * - I2C_STOP end the transfer with an I2C stop + * condition. + * - I2C_REP_START end the transfer with an I2C + * repeated start condition. + * - I2C_CONTINUE allow additional transferContinue() + * calls. + * . + * @return true for success else false. + */ bool transferContinue(void *buf, size_t nbyte, uint8_t option = I2C_STOP); /** Write a byte * @@ -115,7 +151,21 @@ class I2cMasterBase { class SoftI2cMaster : public I2cMasterBase { public: SoftI2cMaster() {} + /** + * Constructor, initialize SCL/SDA pins and set the bus high. + * + * @param[in] sdaPin The software SDA pin number. + * + * @param[in] sclPin The software SCL pin number. + */ SoftI2cMaster(uint8_t sclPin, uint8_t sdaPin); + /** + * Initialize SCL/SDA pins and set the bus high. + * + * @param[in] sdaPin The software SDA pin number. + * + * @param[in] sclPin The software SCL pin number. + */ void begin(uint8_t sclPin, uint8_t sdaPin); uint8_t read(uint8_t last); void start(); diff --git a/libraries/MySensors/drivers/AVR/DigitalIO/attic/ADS7818.h b/libraries/MySensors/drivers/AVR/DigitalIO/attic/ADS7818.h index c416acc..eb64fb5 100644 --- a/libraries/MySensors/drivers/AVR/DigitalIO/attic/ADS7818.h +++ b/libraries/MySensors/drivers/AVR/DigitalIO/attic/ADS7818.h @@ -8,8 +8,11 @@ #define STATIC_ALWAYS_INLINE static inline __attribute__((always_inline)) //------------------------------------------------------------------------------ template +/** ADS7818 class */ class ADS7818 { public: + //---------------------------------------------------------------------------- + /** Set pin modes and initial levels. */ void begin() { fastPinMode(ClkPin, 1); fastDigitalWrite(ClkPin, 0); @@ -18,6 +21,9 @@ class ADS7818 { fastPinMode(DataPin, 0); } //---------------------------------------------------------------------------- + /** Read ADS7818 12-bit ADC + * \return 16-bit value read. + */ inline __attribute__((always_inline)) uint16_t read() { uint16_t v = 0; diff --git a/libraries/MySensors/drivers/AVR/DigitalIO/attic/MCP320X.h b/libraries/MySensors/drivers/AVR/DigitalIO/attic/MCP320X.h index e4d1b81..741bbee 100644 --- a/libraries/MySensors/drivers/AVR/DigitalIO/attic/MCP320X.h +++ b/libraries/MySensors/drivers/AVR/DigitalIO/attic/MCP320X.h @@ -3,6 +3,7 @@ #include //============================================================================== template +/** MCP3201 class */ class MCP3201 { public: //---------------------------------------------------------------------------- @@ -81,6 +82,7 @@ class MCP3201 { //============================================================================== template +/** MCP3202 class */ class MCP3202 { public: //---------------------------------------------------------------------------- @@ -165,6 +167,7 @@ class MCP3202 { //============================================================================== template +/** MCP3204 class */ class MCP3204 { public: //---------------------------------------------------------------------------- diff --git a/libraries/MySensors/drivers/AVR/DigitalIO/attic/MCP355X.h b/libraries/MySensors/drivers/AVR/DigitalIO/attic/MCP355X.h index 0cde640..daa2911 100644 --- a/libraries/MySensors/drivers/AVR/DigitalIO/attic/MCP355X.h +++ b/libraries/MySensors/drivers/AVR/DigitalIO/attic/MCP355X.h @@ -8,6 +8,7 @@ const int32_t MCP355X_ERR = 0X80000000; const uint8_t MCP355X_TO_MS = 100; //============================================================================== template +/** MCP355X class */ class MCP355X { public: //----------------------------------------------------------------------------