AD7190. Ниже кусок хедера. Без приведения типа keil51 константы
резал по младшим 16 битам...
/* Mode Register Bit Designations (AD7190_REG_MODE) */
#define AD7190_MODE_SEL(x) ((((DWORD)(x)) & 0x7) << 21) // Operation Mode Select.
#define AD7190_MODE_DAT_STA (((DWORD)(1)) << 20) // Status Register transmission.
#define AD7190_MODE_CLKSRC(x) ((((DWORD)(x)) & 0x3) << 18) // Clock Source Select.
#define AD7190_MODE_SINC3 (((DWORD)(1)) << 15) // SINC3 Filter Select.
#define AD7190_MODE_ENPAR (((DWORD)(1)) << 13) // Parity Enable.
#define AD7190_MODE_SCYCLE (((DWORD)(1)) << 11) // Single cycle conversion.
#define AD7190_MODE_REJ60 (((DWORD)(1)) << 10) // 50/60Hz notch filter.
#define AD7190_MODE_RATE(x) (((DWORD)(x)) & 0x3FF) // Filter Update Rate Select.
/* Mode Register: AD7190_MODE_SEL(x) options */
#define AD7190_MODE_CONT 0 // Continuous Conversion Mode.
#define AD7190_MODE_SINGLE 1 // Single Conversion Mode.
#define AD7190_MODE_IDLE 2 // Idle Mode.
#define AD7190_MODE_PWRDN 3 // Power-Down Mode.
#define AD7190_MODE_CAL_INT_ZERO 4 // Internal Zero-Scale Calibration.
#define AD7190_MODE_CAL_INT_FULL 5 // Internal Full-Scale Calibration.
#define AD7190_MODE_CAL_SYS_ZERO 6 // System Zero-Scale Calibration.
#define AD7190_MODE_CAL_SYS_FULL 7 // System Full-Scale Calibration.
/* Mode Register: AD7190_MODE_CLKSRC(x) options */
#define AD7190_CLK_EXT_MCLK1_2 0 // External crystal. The external crystal is connected from MCLK1 to MCLK2.
#define AD7190_CLK_EXT_MCLK2 1 // External Clock applied to MCLK2
#define AD7190_CLK_INT 2 // Internal 4.92 MHz clock. Pin MCLK2 is tristated.
#define AD7190_CLK_INT_CO 3 // Internal 4.92 MHz clock. The internal clock is available on MCLK2.
/* Configuration Register Bit Designations (AD7190_REG_CONF) */
#define AD7190_CONF_CHOP (((DWORD)(1)) << 23) // CHOP enable.
#define AD7190_CONF_REFSEL (((DWORD)(1)) << 20) // REFIN1/REFIN2 Reference Select.
#define AD7190_CONF_CHAN(x) ((((DWORD)(x)) & 0xFF) << 8) // Channel select.
#define AD7190_CONF_BURN (((DWORD)(1)) << 7) // Burnout current enable.
#define AD7190_CONF_REFDET (((DWORD)(1)) << 6) // Reference detect enable.
#define AD7190_CONF_BUF (((DWORD)(1)) << 4) // Buffered Mode Enable.
#define AD7190_CONF_UNIPOLAR (((DWORD)(1)) << 3) // Unipolar/Bipolar Enable.
#define AD7190_CONF_GAIN(x) ((x) & 0x7) // Gain Select.
блин, почему при оформлении как код, вставляются дополнительные переносы?