Hallo, I have developed an opb spi 16 bit peripheral with regiter support to interface it to bus.
Here c code:
unsigned int (*control_reg) = (unsigned int(*))XPAR_OPB_SPI_16_BIT_0_BASEADDR + OPB_SPI_16_BIT_SLAVE_REG2_OFFSET;
int main (void) {
(*control_reg) = 10;
xil_printf("%X %X\n", &(*control_reg), XPAR_OPB_SPI_16_BIT_0_BASEADDR + OPB_SPI_16_BIT_SLAVE_REG2_OFFSET);
Using "unsigned int" the two address to be printed don't match. If I use "unsigned char" they match, but in this way I truncate some datas because they are 16 bit registers.
What could I do?
Many Thanks Marco