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
Makefile-user.mk
documentation/
# 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-------------------------------------------------------------------------------
void cDAC101C085::CheckDev()
uint8_t cDAC101C085::CheckDev()
{
// Vars
byte error = 0;
@ -39,7 +39,7 @@ void cDAC101C085::CheckDev()
#endif
Wire.beginTransmission(m_address);
error = Wire.endTransmission();
I2CError(error); // Pass to error parser
return I2CError(error); // Pass to error parser
}
//-------------------------------------changeSettings-------------------------------------------------------------------------

30
software/app/dac101c085.h

@ -24,20 +24,43 @@ namespace rijnfel {
namespace dac {
//-------------------------------------Enums----------------------------------------------------------------------------------
/** Represents the operational mode of the DAC.
*/
enum eOpMode {NORMAL, PULL_DOWN_2K5, PULL_DOWN_100K, HIGH_IMPEDANCE};
//-------------------------------------cDAC101085-----------------------------------------------------------------------------
/** Small simple driver for the TI DAC101C085.
*/
class cDAC101C085
{
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
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);
/** @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);
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 WriteSettings(uint16_t settings);
uint8_t I2CError(uint8_t error);
@ -45,4 +68,5 @@ private:
}
}
#endif /* APP_DAC101C085_H_ */

22
software/app/excitation_light.h

@ -4,7 +4,7 @@
// Author: Maximilian Stiefel
// 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----------------------------------------------------------------------------------
//-------------------------------------cExcitationLight-----------------------------------------------------------------------
/** Class to use the excitation light in an advanced way with the help of a DAC.
*/
class cExcitationLight
{
public:
/** Construct object, allocate space for DAC.
*/
cExcitationLight(); // Constructor
/** Destruct object, free space for DAC.
*/
~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);
/** 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();
/** Use 2K5 pull-down resistor to turn LED completely off.
* @retval uint8_t Returns 1 on success, 0 when failing.
*/
uint8_t DeactivateLED();
private:
dac::cDAC101C085 *m_DAC;

1
software/app/web_interface.cpp

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

2
software/files/config.html

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