APIs for interacting with an NTC thermistor e.g the NCP18XH103F03RB resistor on the CY8CPROTO-062-4343W board or the CY8CKIT-028-EPD shield Note: This lib uses floating point calculations during temperature calculation so it is recommended to enable floating point support.
mtb_thermistor_ntc_wiring: Defines the way the NTC thermistor is wired up: Vin-NTC-R-GND or Vin-R-NTC-GND.
The thermistor is connected to Ground with the resister between it and Vin.
The thermistor is connected to Vin with the resister between it and ground.
mtb_thermistor_ntc_gpio_init(mtb_thermistor_ntc_gpio_t *obj, cyhal_adc_t *adc, cyhal_gpio_t gnd, cyhal_gpio_t vdd, cyhal_gpio_t out, mtb_thermistor_ntc_gpio_cfg_t *cfg, mtb_thermistor_ntc_wiring wiring)¶
Initialize the ADC Channel and Pins to communicate with the thermistor.
obj – [inout] Pointer to a thermistor object containing the set of pins and adc channel that are associated with the thermistor. Note: The caller must allocate the memory for this object but the init function will initialize its contents.
obj – [out] Pointer to a Thermistor object. The caller must allocate the memory for this object but the init function will initialize its contents.
adc – [in] Pointer to an already initialized adc object
gnd – [in] Ground reference pin
vdd – [in] VDD reference pin
out – [in] Voltage output pin
cfg – [in] Pointer to the cfg object containing the thermistor constants
wiring – [in] How the circuit is wired up
CY_RSLT_SUCCESS if properly initialized, else an error indicating what went wrong.
Gets the temperature reading, in degrees C, from the thermistor.
obj – [in] Pointer to a thermistor object containing the set of pins and adc channel that are associated with the thermistor.
The temperature reading, in degrees C, from the hardware.
- #include <>
Configuration structure containing ntc thermistor constants.
- #include <>
Structure defining the pins and adc channel used to interact with the ntc thermistor.