Go to the documentation of this file.
325 uint16_t temperature_compensation);
341 uint16_t *temperature_compensation);
@ PH_OEM_GPIO_INIT_ERR
Error while initializing GPIO PIN.
@ PH_OEM_LED_OFF
LED off state.
ph_oem_irq_option_t irq_option
behavior of the interrupt pin, disabled by default
@ PH_OEM_OK
Everything was fine.
@ PH_OEM_TAKE_READINGS
Device active state.
gpio_t interrupt_pin
interrupt pin (GPIO_UNDEF if not defined)
@ PH_OEM_INTERRUPT_GPIO_UNDEF
Interrupt pin is GPIO_UNDEF.
gpio_mode_t gpio_mode
gpio mode of the interrupt pin
int ph_oem_read_ph(const ph_oem_t *dev, uint16_t *ph_value)
Reads the PH_OEM_REG_PH_READING_BASE register to get the current pH reading.
int ph_oem_enable_interrupt(ph_oem_t *dev, ph_oem_interrupt_pin_cb_t cb, void *arg)
Enable the pH OEM interrupt pin if ph_oem_params_t::interrupt_pin is defined.
unsigned int i2c_t
Default i2c_t type definition.
int ph_oem_set_led_state(const ph_oem_t *dev, ph_oem_led_state_t state)
Set the LED state of the pH OEM sensor by writing to the PH_OEM_REG_LED register.
uint8_t addr
the slave address of the sensor on the I2C bus
ph_oem_calibration_option_t
Calibration option values.
struct ph_oem ph_oem_t
pH OEM device descriptor
@ PH_OEM_STOP_READINGS
Device hibernate state.
@ PH_OEM_TEMP_OUT_OF_RANGE
Temperature is out of range.
@ PH_OEM_IRQ_FALLING
Pin low on new reading (manually reset)
void * arg
interrupt pin callback param
@ PH_OEM_CALIBRATE_HIGH_POINT
High point calibration option.
@ PH_OEM_NOT_PH
Not an Atlas Scientific pH OEM device.
@ PH_OEM_READ_ERR
Reading to device failed.
int ph_oem_read_calibration_state(const ph_oem_t *dev, uint16_t *calibration_state)
Read the PH_OEM_REG_CALIBRATION_CONFIRM register.
@ PH_OEM_CALIBRATE_MID_POINT
Mid point calibration option.
struct ph_oem_params ph_oem_params_t
pH OEM sensor params
ph_oem_irq_option_t
Interrupt pin option values.
@ PH_OEM_WRITE_ERR
Writing to device failed.
int ph_oem_clear_calibration(const ph_oem_t *dev)
Clears all calibrations previously done.
void(* ph_oem_interrupt_pin_cb_t)(void *)
pH OEM interrupt pin callback
int ph_oem_reset_interrupt_pin(const ph_oem_t *dev)
The interrupt pin will not auto reset on option PH_OEM_IRQ_RISING and PH_OEM_IRQ_FALLING after interr...
@ PH_OEM_IRQ_BOTH
Invert state on new reading (automatically reset)
ph_oem_interrupt_pin_cb_t cb
interrupt pin callback
int ph_oem_set_compensation(const ph_oem_t *dev, uint16_t temperature_compensation)
Sets the PH_OEM_REG_TEMP_COMPENSATION_BASE register to the temperature_compensation value which the p...
int ph_oem_start_new_reading(const ph_oem_t *dev)
Starts a new reading by setting the device state to PH_OEM_TAKE_READINGS.
ph_oem_params_t params
device driver configuration
int ph_oem_init(ph_oem_t *dev, const ph_oem_params_t *params)
Initialize a pH OEM sensor.
ph_oem_device_state_t
Device state values.
Low-level GPIO peripheral driver interface definitions.
@ PH_OEM_NODEV
No device found on the bus.
gpio_mode_t
Available pin modes.
int ph_oem_set_device_state(const ph_oem_t *dev, ph_oem_device_state_t state)
Sets the device state (active/hibernate) of the pH OEM sensor by writing to the PH_OEM_REG_HIBERNATE ...
@ PH_OEM_CALIBRATE_LOW_POINT
Low point calibration option.
int ph_oem_set_i2c_address(ph_oem_t *dev, uint8_t addr)
Sets a new address to the pH OEM device by unlocking the PH_OEM_REG_UNLOCK register and writing a new...
int ph_oem_set_calibration(const ph_oem_t *dev, uint16_t calibration_value, ph_oem_calibration_option_t option)
Sets the PH_OEM_REG_CALIBRATION_BASE register to the calibration_value which the pH OEM sensor will b...
ph_oem_led_state_t
LED state values.
@ PH_OEM_LED_ON
LED on state.
@ PH_OEM_IRQ_RISING
Pin high on new reading (manually reset)
int ph_oem_read_compensation(const ph_oem_t *dev, uint16_t *temperature_compensation)
Reads the PH_OEM_REG_TEMP_CONFIRMATION_BASE register to verify the temperature compensation value tha...
i2c_t i2c
I2C device the sensor is connected to.
ph_oem_named_returns_t
Named return values.
Low-level I2C peripheral driver interface definition.