CN0397 (Smart Visible Light Detection)
Dependencies: AD7798
CN0397 Class Reference
The CN0397 shield class. More...
#include <CN0397.h>
Public Member Functions | |
CN0397 (PinName cs) | |
The CN0397 class constructor. | |
void | init (void) |
Initialization method of the class. | |
void | display_data (void) |
Displays data on the serial interface. | |
void | data_to_voltage (uint16_t adcValue, float *voltage) |
Converts ADC counts to voltage. | |
void | calc_light_intensity (uint8_t channel, uint16_t adcValue, float *intensity) |
Computes light intensity of the channel. | |
void | calc_light_concentration (uint8_t channel, float intensity, float *conc) |
Computes light concentration from light intensity. | |
void | set_app_data (void) |
Reads the ADC channels and computes intensity and concentration. | |
void | calibration (uint8_t channel) |
Calibrates the channel. | |
Data Fields | |
AD7798 | ad7798 |
Instance of the AD7798. |
Detailed Description
The CN0397 shield class.
Definition at line 99 of file CN0397.h.
Constructor & Destructor Documentation
CN0397 | ( | PinName | cs ) |
The CN0397 class constructor.
Definition at line 71 of file CN0397.cpp.
Member Function Documentation
void calc_light_concentration | ( | uint8_t | channel, |
float | intensity, | ||
float * | conc | ||
) |
Computes light concentration from light intensity.
- Parameters:
-
channel - channel to be converted intensity - light intensity conc - computed light concentration
Definition at line 199 of file CN0397.cpp.
void calc_light_intensity | ( | uint8_t | channel, |
uint16_t | adcValue, | ||
float * | intensity | ||
) |
Computes light intensity of the channel.
- Parameters:
-
channel - channel to be converted adcValue - ADC counts intensity - computed light intensity
Definition at line 192 of file CN0397.cpp.
void calibration | ( | uint8_t | channel ) |
Calibrates the channel.
- Parameters:
-
channel - channel to be calibrated
Definition at line 236 of file CN0397.cpp.
void data_to_voltage | ( | uint16_t | adcValue, |
float * | voltage | ||
) |
Converts ADC counts to voltage.
- Parameters:
-
adcValue - ADC counts voltage - computed voltage
Definition at line 147 of file CN0397.cpp.
void display_data | ( | void | ) |
Displays data on the serial interface.
Definition at line 74 of file CN0397.cpp.
void init | ( | void | ) |
Initialization method of the class.
Initializes the AD7798 and initiates calibration if needed
Definition at line 154 of file CN0397.cpp.
void set_app_data | ( | void | ) |
Reads the ADC channels and computes intensity and concentration.
Definition at line 206 of file CN0397.cpp.
Field Documentation
Generated on Mon Jul 18 2022 00:52:12 by 1.7.2