-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
T6713 CO2 Sensor Driver #355
base: master
Are you sure you want to change the base?
Conversation
I approve this pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sensor functions and returns adequate values with this code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See feedback. Only have one location of the function headers. In the source file. Member variables don't need doxygen comments
CISLibrary/drivers/T6713/T6713.h
Outdated
* DEFAULT_T6713_SLAVE_ADDRESS | ||
*/ | ||
T6713(I2C & i2c, uint8_t addr = DEFAULT_T6713_SLAVE_ADDRESS) : | ||
i2c(i2c), addr(addr) {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the constructor defined here and not the source?
CISLibrary/drivers/T6713/T6713.h
Outdated
* @brief The slave address of the sensor to which the I2C should read/write | ||
* | ||
*/ | ||
uint8_t addr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the address configurable? If so, make it an enum class of the allowable values, if not make it a static const member.
CISLibrary/drivers/T6713/T6713.h
Outdated
// T6713 CO2 Sensor I2C default slave address | ||
const uint8_t DEFAULT_T6713_SLAVE_ADDRESS = 0x15 << 1; | ||
// Same command found in the T67XX CO2 Sensor Module documentation, see pg. 29 | ||
static const char READ_CO2_COMMAND[5] = {0x04, 0x13, 0x8B, 0x00, 0x01}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have these as part of the class instead of the default namespace
CISLibrary/drivers/T6713/T6713.h
Outdated
* @return mbed_error_status_t MBED_SUCCESS if the reading was successful, | ||
* otherwise the error status of the reading | ||
*/ | ||
mbed_error_status_t readPPM(int & outValue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use uint32_t for unsigned 32b integers. Aka specify the number of bits
@WattsUp I'm not sure what you mean when you say
Does this mean the function headers (in this case, just |
This branch contains just the files for the T6713 class, which acts as a driver for reading PPM values from the T6713 CO2 sensor.
Everything that needs to be documented in the code should have already been documented using the Doxygen format, which means documentation may be automatically generated using the Doxygen software.
I have also tested to make sure the class works properly with the sensor using Bradley's setup as seen in Payload's channel on Slack.