do (byte swapping). Used them to make 32 bit pci transfers to
16 bit analog outputs practical.
* "read()" to calculate the number of bytes available.
*/
chcr |= CHCR_SET_LC_IE;
-
+ if(num_memory_bits == 32 && num_device_bits == 16)
+ {
+ /* Doing a combined 32 and 16 bit byteswap gets the 16 bit samples into the fifo in the right order.
+ Tested doing 32 bit memory to 16 bit device transfers to the analog out of a pxi-6281 */
+ chcr |= CHCR_BYTE_SWAP16 | CHCR_BYTE_SWAP32;
+ }
if(mite_chan->dir == COMEDI_INPUT){
chcr |= CHCR_DEV_TO_MEM;
}
#define PCI_VENDOR_ID_NATINST 0x1093
-//#define DEBUG_MITE
+// #define DEBUG_MITE
#define PCIMIO_COMPAT
#ifdef DEBUG_MITE
CHCR_FIFO_ON = 0,
CHCR_BURSTEN = (1<<14),
CHCR_NO_BURSTEN = 0,
- CHCR_CHEND1 = (1<<5),
- CHCR_CHEND0 = (1<<4),
+ CHCR_BYTE_SWAP16 = (1 << 6),
+ CHCR_BYTE_SWAP32 = (1 << 4),
CHCR_DIR = (1<<3),
CHCR_DEV_TO_MEM = CHCR_DIR,
CHCR_MEM_TO_DEV = 0,