Altera_Forum
Honored Contributor
11 years agoHow to select which SPI slave to read/write thru alt_avalon_spi_command()?
I have a design using Altera IP SPI (3 wire serial). In this design, the SPI master connects with 3 slaves.
The driver provided by Altera is: nt alt_avalon_spi_command(alt_u32 base, alt_u32 slave, alt_u32 write_length, const alt_u8 * write_data, alt_u32 read_length, alt_u8 * read_data, alt_u32 flags); Based on the document, the 2nd argument "alt_u32 slave" is used to "Asserts the slave select output for the specified slave". Does this mean, if I want to write/read slave 0, I should set slave = 0x00, if I want to r/w slave 1, slave = 0x01, or if I want to r/w slave 2, slave = 0x02. Is my understanding correct? Thanks.