Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
LinearCharacteristics.h@43:f459f6efaf5c, 2022-05-31 (annotated)
- Committer:
- pmic
- Date:
- Tue May 31 17:51:34 2022 +0200
- Revision:
- 43:f459f6efaf5c
Introduced QMC5883L driver
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| pmic | 43:f459f6efaf5c | 1 | #ifndef LINEAR_CHARACTERISTICS_H_ |
| pmic | 43:f459f6efaf5c | 2 | #define LINEAR_CHARACTERISTICS_H_ |
| pmic | 43:f459f6efaf5c | 3 | |
| pmic | 43:f459f6efaf5c | 4 | class LinearCharacteristics |
| pmic | 43:f459f6efaf5c | 5 | { |
| pmic | 43:f459f6efaf5c | 6 | |
| pmic | 43:f459f6efaf5c | 7 | public: |
| pmic | 43:f459f6efaf5c | 8 | |
| pmic | 43:f459f6efaf5c | 9 | LinearCharacteristics(float gain, float offset); |
| pmic | 43:f459f6efaf5c | 10 | LinearCharacteristics(float x0, float x1, float y0, float y1); |
| pmic | 43:f459f6efaf5c | 11 | LinearCharacteristics(float x0, float x1, float y0, float y1, float yMin, float yMax); |
| pmic | 43:f459f6efaf5c | 12 | |
| pmic | 43:f459f6efaf5c | 13 | LinearCharacteristics() {}; |
| pmic | 43:f459f6efaf5c | 14 | |
| pmic | 43:f459f6efaf5c | 15 | virtual ~LinearCharacteristics(); |
| pmic | 43:f459f6efaf5c | 16 | |
| pmic | 43:f459f6efaf5c | 17 | float operator()(float x) |
| pmic | 43:f459f6efaf5c | 18 | { |
| pmic | 43:f459f6efaf5c | 19 | return evaluate(x); |
| pmic | 43:f459f6efaf5c | 20 | } |
| pmic | 43:f459f6efaf5c | 21 | |
| pmic | 43:f459f6efaf5c | 22 | float evaluate(float x); |
| pmic | 43:f459f6efaf5c | 23 | |
| pmic | 43:f459f6efaf5c | 24 | void setup(float gain, float offset); |
| pmic | 43:f459f6efaf5c | 25 | void setup(float x0, float x1, float y0, float y1); |
| pmic | 43:f459f6efaf5c | 26 | void setup(float x0, float x1, float y0, float y1, float yMin, float yMax); |
| pmic | 43:f459f6efaf5c | 27 | |
| pmic | 43:f459f6efaf5c | 28 | void correctExistingOffset(float); |
| pmic | 43:f459f6efaf5c | 29 | |
| pmic | 43:f459f6efaf5c | 30 | private: |
| pmic | 43:f459f6efaf5c | 31 | |
| pmic | 43:f459f6efaf5c | 32 | float gain; |
| pmic | 43:f459f6efaf5c | 33 | float offset; |
| pmic | 43:f459f6efaf5c | 34 | float yMin; |
| pmic | 43:f459f6efaf5c | 35 | float yMax; |
| pmic | 43:f459f6efaf5c | 36 | |
| pmic | 43:f459f6efaf5c | 37 | }; |
| pmic | 43:f459f6efaf5c | 38 | |
| pmic | 43:f459f6efaf5c | 39 | #endif |