Revision 21076167 source/alld_at42qt1050.c
source/alld_at42qt1050.c | ||
---|---|---|
64 | 64 |
* |
65 | 65 |
* @return Indicator whether the function call was successful or a timeout occurred. |
66 | 66 |
*/ |
67 |
inline apalExitStatus_t |
|
68 |
at42qt1050_lld_read_reg(const AT42QT1050Driver* at42qt1050d, const at42qt1050_lld_register_t reg, uint8_t* const data, const apalTime_t timeout) |
|
67 |
apalExitStatus_t at42qt1050_lld_read_reg(const AT42QT1050Driver* at42qt1050d, const at42qt1050_lld_register_t reg, uint8_t* const data, const apalTime_t timeout) |
|
69 | 68 |
{ |
70 | 69 |
apalDbgAssert(at42qt1050d != NULL && at42qt1050d->i2cd != NULL); |
71 | 70 |
apalDbgAssert(data != NULL); |
... | ... | |
84 | 83 |
* |
85 | 84 |
* @return Indicator whether the function call was successful or a timeout occurred. |
86 | 85 |
*/ |
87 |
inline apalExitStatus_t |
|
88 |
at42qt1050_lld_write_reg(const AT42QT1050Driver* at42qt1050d, const at42qt1050_lld_register_t reg, const uint8_t data, const apalTime_t timeout) |
|
86 |
apalExitStatus_t at42qt1050_lld_write_reg(const AT42QT1050Driver* at42qt1050d, const at42qt1050_lld_register_t reg, const uint8_t data, const apalTime_t timeout) |
|
89 | 87 |
{ |
90 | 88 |
apalDbgAssert(at42qt1050d != NULL && at42qt1050d->i2cd != NULL); |
91 | 89 |
|
... | ... | |
103 | 101 |
* |
104 | 102 |
* @return Indicator whether the function call was successful or a timeout occurred. |
105 | 103 |
*/ |
106 |
inline apalExitStatus_t |
|
107 |
at42qt1050_lld_read_keyssignal(const AT42QT1050Driver* at42qt1050d, const uint8_t key, uint16_t* signal, const apalTime_t timeout) |
|
104 |
apalExitStatus_t at42qt1050_lld_read_keyssignal(const AT42QT1050Driver* at42qt1050d, const uint8_t key, uint16_t* signal, const apalTime_t timeout) |
|
108 | 105 |
{ |
109 | 106 |
apalDbgAssert(at42qt1050d != NULL && at42qt1050d->i2cd != NULL); |
110 | 107 |
apalDbgAssert(key < AT42QT1050_LLD_NUM_KEYS); |
... | ... | |
127 | 124 |
* |
128 | 125 |
* @return Indicator whether the function call was successful or a timeout occurred. |
129 | 126 |
*/ |
130 |
inline apalExitStatus_t |
|
131 |
at42qt1050_lld_read_referencedata(const AT42QT1050Driver* at42qt1050d, const uint8_t key, uint16_t* refdata, const apalTime_t timeout) |
|
127 |
apalExitStatus_t at42qt1050_lld_read_referencedata(const AT42QT1050Driver* at42qt1050d, const uint8_t key, uint16_t* refdata, const apalTime_t timeout) |
|
132 | 128 |
{ |
133 | 129 |
apalDbgAssert(at42qt1050d != NULL && at42qt1050d->i2cd != NULL); |
134 | 130 |
apalDbgAssert(key < AT42QT1050_LLD_NUM_KEYS); |
... | ... | |
149 | 145 |
* |
150 | 146 |
* @return Resulting sample count. |
151 | 147 |
*/ |
152 |
inline uint16_t |
|
153 |
at42qt1050_lld_pulse2samples(const uint8_t pulse) |
|
148 |
uint16_t at42qt1050_lld_pulse2samples(const uint8_t pulse) |
|
154 | 149 |
{ |
155 | 150 |
apalDbgAssert(pulse <= 0x0Fu); |
156 | 151 |
|
... | ... | |
165 | 160 |
* |
166 | 161 |
* @return The (theoretical) value to set to the pulse register. |
167 | 162 |
*/ |
168 |
inline float |
|
169 |
at42qt1050_lld_samples2pulse(const uint16_t samples) |
|
163 |
float at42qt1050_lld_samples2pulse(const uint16_t samples) |
|
170 | 164 |
{ |
171 | 165 |
return log2f(samples); |
172 | 166 |
} |
... | ... | |
179 | 173 |
* |
180 | 174 |
* @return Resulting scaling factor. |
181 | 175 |
*/ |
182 |
inline uint16_t |
|
183 |
at42qt1050_lld_scale2scaling(const uint8_t scale) |
|
176 |
uint16_t at42qt1050_lld_scale2scaling(const uint8_t scale) |
|
184 | 177 |
{ |
185 | 178 |
apalDbgAssert(scale <= 0x0Fu); |
186 | 179 |
|
... | ... | |
195 | 188 |
* |
196 | 189 |
* @return The (theoretcial) value to set to the scale register. |
197 | 190 |
*/ |
198 |
inline float |
|
199 |
at42qt1050_lld_scaling2scale(const uint16_t factor) |
|
191 |
float at42qt1050_lld_scaling2scale(const uint16_t factor) |
|
200 | 192 |
{ |
201 | 193 |
return log2f(factor); |
202 | 194 |
} |
Also available in: Unified diff