This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

help with basics

what does this code mean in the context of a function?

(*(volatile unsigned long *)(spi_base[dev] + SSP_CR0)) = buf;

1.buf is already defined as :
unsigned int buf ;

2. spi_base seems to be a global variable:
const unsigned long spi_base[MAX_SPI] = {SSP0_BASE_ADDR,SSP1_BASE_ADDR};

3. and SSP_CR0 is defined as :

#define SSP_CR0 0x00

0