/* Make a HART transmission. The HART output channels must be routed to the boards output headers by enabling the output demultiplexer and disabling the input demultiplexer. */
int32_t cn0414_hart_transmit(struct cn0414_dev *dev, uint8_t *arg)
/* Make a HART transmission. The HART output channels must be routed to the boards output headers by enabling the output demultiplexer and disabling the input demultiplexer. */
int32_t cn0414_hart_transmit(struct cn0414_dev *dev, uint8_t *arg)
{
	int32_t ret;
	uint32_t size;
	ret = cn0414_hart_enable_modulator(dev, true);
	if(ret != CN0414_SUCCESS)
		return ret;
	size = strlen((char *)arg);
	NVIC_DisableIRQ(TMR0_INT);
	NVIC_DisableIRQ(HART_CD_INT);
	ret = ad5700_transmit(dev->ad5700_device, arg, size);
	if(ret != CN0414_SUCCESS)
		usr_uart_write_string(dev->uart_descriptor,
				      (uint8_t*)"Transmission failed!\n");
	NVIC_EnableIRQ(TMR0_INT);
	NVIC_EnableIRQ(HART_CD_INT);
	return cn0414_hart_enable_modulator(dev, false);
}