Incorrect configuration of FIFO and the use of GPIO interrupts
While converting the code from Analog Devices CN409 to Arduino, some of the Register's configuration haven't been modified, hence there may be some issues with the behavior of the code.
void ADPD1080::SetFIFO(void){
ADPD1080::SetOperationMode(PROGRAM);
// Slot A enable and 32 bit extend sample data to fifo
Adafruit_BusIO_Register slot_en_reg =
Adafruit_BusIO_Register(i2c_dev, ADPD1080_SLOT_EN, 2, MSBFIRST);
slot_en_reg.write(0x3131, 2); // Slot A Enable, slot A FIFO mode=4 channels of 16-bit data for time slot A
// Slot B Enable, slot B FIFO mode=4 channels of 16-bit data for time slot B
// set FIFO threshold to 8 words data
Adafruit_BusIO_Register fifo_thresh_reg =
Adafruit_BusIO_Register(i2c_dev, ADPD1080_FIFO_THRESH, 2, MSBFIRST);
fifo_thresh_reg.write(0x1F00,2);
// Set FIFO interrupt.
Adafruit_BusIO_Register int_mask_reg =
Adafruit_BusIO_Register(i2c_dev, ADPD1080_INT_MASK, 2, MSBFIRST);
int_mask_reg.write(0x0FF,2);
Adafruit_BusIO_Register gpio_drv_reg =
Adafruit_BusIO_Register(i2c_dev, ADPD1080_GPIO_DRV, 2, MSBFIRST);
gpio_drv_reg.write(0x05,2);
ADPD1080::SetOperationMode(NORMAL_OPERATION);
}
Edited by Vincent Raimbault