Altera_Forum
Honored Contributor
8 years agoQuestion for SPI
Hello! Please tell me how to check the status of the pin MISO.
unsigned long int Get7794_Data(alt_u8 channel) { unsigned long int data; alt_u8 cfg_reg; cfg_reg = (channel-1)&0xFF; spi_select_slave(0x21000,0); spi_send(0x21000,0x10); spi_send(0x21000,0x00); spi_send(0x21000,cfg_reg); //---------------- // ????????? DOUT/RDY - the line goes low when a new data-word is available in the output register //---------------- spi_send(0x21000,0x58); data = (unsigned)(spi_send(0x21000,0x58)) << 16; data |= (unsigned)(spi_send(0x21000,0x58)) << 8; data |= (unsigned)(spi_send(0x21000,0x00)); spi_deselect_slave(0x21000,0); return data; }