Library for MAX5387 dual channel digi pot
Revision 4:89d2f70616ee, committed 2016-05-12
- Comitter:
- j3
- Date:
- Thu May 12 22:53:08 2016 +0000
- Parent:
- 3:25deebfe51ba
- Commit message:
- updated documentation
Changed in this revision
max5387.cpp | Show annotated file Show diff for this revision Revisions of this file |
max5387.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 25deebfe51ba -r 89d2f70616ee max5387.cpp --- a/max5387.cpp Fri Jul 24 01:54:01 2015 +0000 +++ b/max5387.cpp Thu May 12 22:53:08 2016 +0000 @@ -1,16 +1,5 @@ /******************************************************************//** * @file max5387.cpp -* -* @author Justin Jordan -* -* @version 0.0 -* -* Started: 18JUL15 -* -* Updated: -* -* @brief Source file for Max5387 class -*********************************************************************** * Copyright (C) 2015 Maxim Integrated Products, Inc., All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a
diff -r 25deebfe51ba -r 89d2f70616ee max5387.h --- a/max5387.h Fri Jul 24 01:54:01 2015 +0000 +++ b/max5387.h Thu May 12 22:53:08 2016 +0000 @@ -1,16 +1,5 @@ /******************************************************************//** * @file max5387.h -* -* @author Justin Jordan -* -* @version 0.0 -* -* Started: 18JUL15 -* -* Updated: -* -* @brief Header file for Max5387 class -*********************************************************************** * Copyright (C) 2015 Maxim Integrated Products, Inc., All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -49,10 +38,42 @@ #include "mbed.h" +/** +* @brief Dual, 256-Tap, Volatile, Low-Voltage Linear Taper Digital +* Potentiometer +* +* @details The MAX5387 dual, 256-tap, volatile, low-voltage linear +* taper digital potentiometer offers three end-to-end resistance values +* of 10kΩ, 50kΩ, and 100kΩ. Operating from a single +2.6V to +5.5V power +* supply, the device provides a low 35ppm/°C end-to-end temperature +* coefficient. The device features an I2C interface. +* +* @code +* #include "mbed.h" +* #include "max5387.h" +* +* int main (void) +* { +* Max5387 digiPot(D14, D15, Max5387::MAX5387_I2C_ADRS0); +* uint8_t data; +* +* //set data... +* +* digiPot.write_ch_A(data); +* +* //... rest of application +* } +* @endcode +*/ class Max5387 { public: + /** + * @brief Valid 7-bit I2C addresses + * @details The 8 valid I2C addresses set via A0, A1, and A2 pins + * of the MAX5387 + */ typedef enum { MAX5387_I2C_ADRS0 = 0x28, @@ -76,7 +97,8 @@ * @param[in] i2c_adrs - 7-bit slave address of MAX5387 * * On Exit: - * @return none + * + * @return None **************************************************************/ Max5387(I2C *i2c_bus, max5387_i2c_adrs_t i2c_adrs); @@ -93,7 +115,8 @@ * @param[in] i2c_adrs - 7-bit slave address of MAX5387 * * On Exit: - * @return none + * + * @return None **************************************************************/ Max5387(PinName sda, PinName scl, max5387_i2c_adrs_t i2c_adrs); @@ -106,7 +129,8 @@ * On Entry: * * On Exit: - * @return none + * + * @return None **************************************************************/ ~Max5387(); @@ -120,7 +144,8 @@ * @param[in] val - wiper position of channel A * * On Exit: - * @return 0 on success, non-0 on failure + * + * @return 0 on success, non-0 on failure **************************************************************/ int16_t write_ch_A(uint8_t val); @@ -134,7 +159,8 @@ * @param[in] val - wiper position of channel B * * On Exit: - * @return 0 on success, non-0 on failure + * + * @return 0 on success, non-0 on failure **************************************************************/ int16_t write_ch_B(uint8_t val); @@ -148,7 +174,8 @@ * @param[in] val - wiper position of channel A&B * * On Exit: - * @return 0 on success, non-0 on failure + * + * @return 0 on success, non-0 on failure **************************************************************/ int16_t write_ch_AB(uint8_t val);