/* Enable or disable HART modulator of the AD5700 chip on the board using the attached AD4111 GPIO pins. */
static int32_t cn0414_hart_enable_modulator(struct cn0414_dev *dev, bool enable)
/* Enable or disable HART modulator of the AD5700 chip on the board using the attached AD4111 GPIO pins. */
static int32_t cn0414_hart_enable_modulator(struct cn0414_dev *dev, bool enable)
{
	ad717x_st_reg *preg;
	AD717X_ReadRegister(dev->ad4111_device, AD717X_GPIOCON_REG);
	preg = AD717X_GetReg(dev->ad4111_device, AD717X_GPIOCON_REG);
	if(enable) {
		preg->value &= ~AD4111_GPIOCON_REG_DATA0;
		preg->value |= AD4111_GPIOCON_REG_DATA1;
	} else {
		preg->value |= AD4111_GPIOCON_REG_DATA0;
		preg->value &= ~AD4111_GPIOCON_REG_DATA1;
	}
	return AD717X_WriteRegister(dev->ad4111_device, AD717X_GPIOCON_REG);
}