LTC2704 초기화 코드
void LTC2704_Init(void)
{
LTC2704_CS_INIT();
LTC2704_CS0_HI();
LTC2704_CS1_HI();
LTC2704_SPI_INIT();
LTC2704_CS0_LO();
LTC2704_SPI_Send(0x2F); //range
LTC2704_SPI_Send(0x00);
LTC2704_SPI_Send(0x01); //+10V
LTC2704_CS0_HI();
}
LTC2704 Data 출력 코드
void LTC2704_DataSet0(unsigned char Ch, unsigned short Data)
{
unsigned char chanel[4] = {0, 2, 4, 6};
LTC2704_CS0_LO();
LTC2704_SPI_Send(0x30+chanel[Ch]);
LTC2704_SPI_Send(Data>>8);
LTC2704_SPI_Send(Data);
LTC2704_CS0_HI();
}
void LTC2704_DataOut0(unsigned char Ch)
{
unsigned char chanel[4] = {0, 2, 4, 6};
LTC2704_CS0_LO();
LTC2704_SPI_Send(0x40+chanel[Ch]);
LTC2704_SPI_Send(0x00);
LTC2704_SPI_Send(0x00);
LTC2704_CS0_HI();
}