Browse Source

Documented my code. Added a doxygen file.

software_develop
Maximilian Stiefel 7 years ago
parent
commit
1053aea16c
  1. 1
      software/.gitignore
  2. 2494
      software/Doxyfile
  3. 4
      software/app/dac101c085.cpp
  4. 30
      software/app/dac101c085.h
  5. 22
      software/app/excitation_light.h
  6. 1
      software/app/web_interface.cpp
  7. 2
      software/files/config.html

1
software/.gitignore

@ -37,5 +37,6 @@ out/
# Individual Setting # Individual Setting
Makefile-user.mk Makefile-user.mk
documentation/
# End of https://www.gitignore.io/api/c++ # End of https://www.gitignore.io/api/c++

2494
software/Doxyfile

File diff suppressed because it is too large

4
software/app/dac101c085.cpp

@ -27,7 +27,7 @@ cDAC101C085::~cDAC101C085()
{} {}
//-------------------------------------checkDev------------------------------------------------------------------------------- //-------------------------------------checkDev-------------------------------------------------------------------------------
void cDAC101C085::CheckDev() uint8_t cDAC101C085::CheckDev()
{ {
// Vars // Vars
byte error = 0; byte error = 0;
@ -39,7 +39,7 @@ void cDAC101C085::CheckDev()
#endif #endif
Wire.beginTransmission(m_address); Wire.beginTransmission(m_address);
error = Wire.endTransmission(); error = Wire.endTransmission();
I2CError(error); // Pass to error parser return I2CError(error); // Pass to error parser
} }
//-------------------------------------changeSettings------------------------------------------------------------------------- //-------------------------------------changeSettings-------------------------------------------------------------------------

30
software/app/dac101c085.h

@ -24,20 +24,43 @@ namespace rijnfel {
namespace dac { namespace dac {
//-------------------------------------Enums---------------------------------------------------------------------------------- //-------------------------------------Enums----------------------------------------------------------------------------------
/** Represents the operational mode of the DAC.
*/
enum eOpMode {NORMAL, PULL_DOWN_2K5, PULL_DOWN_100K, HIGH_IMPEDANCE}; enum eOpMode {NORMAL, PULL_DOWN_2K5, PULL_DOWN_100K, HIGH_IMPEDANCE};
//-------------------------------------cDAC101085----------------------------------------------------------------------------- //-------------------------------------cDAC101085-----------------------------------------------------------------------------
/** Small simple driver for the TI DAC101C085.
*/
class cDAC101C085 class cDAC101C085
{ {
public: public:
cDAC101C085(uint8_t number, uint8_t i_address); // Constructor /** @brief Instantiate DAC, assign a number and an address.
* @param i_dac_number Number of the DAC.
* @param i_address I2C address of this DAC.
*/
cDAC101C085(uint8_t i_dac_number, uint8_t i_address); // Constructor
/** @brief Free DAC, is currently doing nothing.
*/
~cDAC101C085(); // Destructor ~cDAC101C085(); // Destructor
void CheckDev(); // Check if device is available and alive
/** @brief Check if the device is answering on the bus.
* @retval uint8_t Returns 1 on success, 0 when failing.
*/
uint8_t CheckDev(); // Check if device is available and alive
/** @brief Read out 16 bit register of the DAC.
* @retval uint16_t 16 bit read from the DAC.
*/
uint16_t ReadSettings(void); uint16_t ReadSettings(void);
/** @brief Write new setting to DAC register.
* @retval uint8_t Returns 1 on success, 0 when failing.
*/
uint8_t ChangeSettings(enum eOpMode mode, uint16_t val); uint8_t ChangeSettings(enum eOpMode mode, uint16_t val);
private: private:
uint8_t m_number; // Which of the dacs is it? uint8_t m_dac_number; // Which of the dacs is it?
uint8_t m_address; uint8_t m_address;
uint8_t WriteSettings(uint16_t settings); uint8_t WriteSettings(uint16_t settings);
uint8_t I2CError(uint8_t error); uint8_t I2CError(uint8_t error);
@ -45,4 +68,5 @@ private:
} }
} }
#endif /* APP_DAC101C085_H_ */ #endif /* APP_DAC101C085_H_ */

22
software/app/excitation_light.h

@ -4,7 +4,7 @@
// Author: Maximilian Stiefel // Author: Maximilian Stiefel
// Date: 09.08.2017 // Date: 09.08.2017
// //
// Description: // Description: Class to use the excitation light in an advanced way with the help of a DAC.
// //
//---------------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------------
@ -25,13 +25,33 @@ namespace light {
//-------------------------------------Enums---------------------------------------------------------------------------------- //-------------------------------------Enums----------------------------------------------------------------------------------
//-------------------------------------cExcitationLight----------------------------------------------------------------------- //-------------------------------------cExcitationLight-----------------------------------------------------------------------
/** Class to use the excitation light in an advanced way with the help of a DAC.
*/
class cExcitationLight class cExcitationLight
{ {
public: public:
/** Construct object, allocate space for DAC.
*/
cExcitationLight(); // Constructor cExcitationLight(); // Constructor
/** Destruct object, free space for DAC.
*/
~cExcitationLight(); // Destructor ~cExcitationLight(); // Destructor
/** Set the desired current through excitation light.
* @param microamp Current in uA.
* @retval uint8_t Returns 1 on success, 0 when failing.
*/
uint8_t SetCurrent(uint16_t microamp); uint8_t SetCurrent(uint16_t microamp);
/** Function to be hooked up to a timer to generate rectangular signal.
* @retval uint8_t Returns 1 on success, 0 when failing.
*/
uint8_t RectangleUpdate(); uint8_t RectangleUpdate();
/** Use 2K5 pull-down resistor to turn LED completely off.
* @retval uint8_t Returns 1 on success, 0 when failing.
*/
uint8_t DeactivateLED(); uint8_t DeactivateLED();
private: private:
dac::cDAC101C085 *m_DAC; dac::cDAC101C085 *m_DAC;

1
software/app/web_interface.cpp

@ -138,6 +138,7 @@ void cWebInterface::OnConfiguration(HttpRequest &request, HttpResponse &response
// Update config // Update config
if (request.getBody() == NULL) if (request.getBody() == NULL)
{ {
Serial.println(request.getPostParameter("StaSSID"));
debugf("NULL bodyBuf"); debugf("NULL bodyBuf");
return; return;
} }

2
software/files/config.html

@ -66,4 +66,4 @@
</div> <!-- /container --> </div> <!-- /container -->
</body> </body>
</html> </html>
Loading…
Cancel
Save