/*
 * ltc1448.c
 *
 * Created: 17/08/2018 22:24:57
 *  Author: Ledo
 */ 

#include "globales.h"
#include "asf.h"


void ltc1448_dac_update(uint16_t chA,uint16_t chB)
{
	// Activate the CS pin
	pio_set_pin_low(LTC1448_CS_PIN);
	delay_us(20);
	
	soft_spi_transfer(chA>>4);
	soft_spi_transfer(((chA&0x0F)<<4) | ((chB&0xF00)>>8));
	soft_spi_transfer(chB&0xFF);

	// Deactivate the CS pin
	pio_set_pin_high(LTC1448_CS_PIN);
	

}
