I'm working on the xCORE-200 Multichannel Audio Platform, which has a 4*4 LED-array on it. The LED array is driven by eight signals each controlling one of 4 rows and 4 columns. Rows are controlled by a 4-bit port XS1_PORT_4C, and columns are controlled by a 4-bit port XS1_PORT_4D.According to the XMOS progamming guide, I declared 2 out ports as global variables like this:
Code: Select all
on tile[0]: out port led_row = XS1_PORT_4C;
on tile[0]: out port led_col = XS1_PORT_4D;
Code: Select all
case i2s.receive(size_t index, int32_t sample):
samples[index] = sample;
if(sample == 0){
led_row <: 0x0E;
led_col <: 0x0E;
} // want to active the led of row0 ,col0
// xscope_int(0, sample);
break;
case i2s.send(size_t index) -> int32_t sample:
sample = samples[index];
// xscope_int(1, sample);
if(sample != 0){
led_row <: 0x07;
led_col <: 0x07; // want to active the led of row3 ,col3
}
break;
Thank you very much!
cjf