|
|
@@ -3,16 +3,22 @@ |
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#define FAKE_BITS
|
|
|
|
#define DAC_TYPE 2
|
|
|
|
|
|
|
|
#ifdef FAKE_BITS
|
|
|
|
/* fake compressed range with random lookup bits */
|
|
|
|
#if DAC_TYPE == 0
|
|
|
|
/* AD5542, normal 16-bit range */
|
|
|
|
#define DAC_BITS 16
|
|
|
|
#define __dac_actual(x) (x)
|
|
|
|
#elif DAC_TYPE == 1
|
|
|
|
/* AD5542, fake 10-bit range using random lower bits */
|
|
|
|
#define DAC_BITS 10
|
|
|
|
#define __dac_actual(x) (dac_lookup[(x)&1023])
|
|
|
|
#elif DAC_TYPE == 2
|
|
|
|
/* MAX504, true 10-bit DAC */
|
|
|
|
#define DAC_BITS 10
|
|
|
|
#define __dac_actual(x) ((x) << 2)
|
|
|
|
#else
|
|
|
|
/* normal range */
|
|
|
|
#define DAC_BITS 16
|
|
|
|
#define __dac_actual(x) (x)
|
|
|
|
#error Unknown DAC type
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define DAC_LOW 0
|
|
|
|