|
ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
|
TI FDC2114/2214 capacitance-to-digital field-sensing codec (PROTOCORE_ENABLE_FDC2214). More...
#include "protocore_config.h"Go to the source code of this file.
TI FDC2114/2214 capacitance-to-digital field-sensing codec (PROTOCORE_ENABLE_FDC2214).
The FDC2x14 measures the resonant frequency of an external LC tank; a capacitance shift (a finger near the electrode, a liquid rising past it, a material change) moves that frequency, so watching the 28-bit conversion result gives proximity / level / material sensing without contact. Each channel's result is two 16-bit registers - a DATA MSB register whose top 4 bits are error flags and low 12 bits are the data MSB, and a DATA LSB register - which combine into the 28-bit reading. f_sensor = data / 2^28 * f_ref.
This codec is pure and host-tested: ::protocore_fdc2214_data combines the register pair, ::protocore_fdc2214_error pulls the flags, ::protocore_fdc2214_sensor_freq_hz scales to frequency, and ::protocore_fdc2214_build_config emits a single-channel continuous-conversion bring-up as (reg, msb, lsb) triples. On an ESP32 the binding replays that config and reads the channel over I2C (Wire); only that touches hardware. Bridge the readings northbound like any sensor.
Definition in file fdc2214.h.