Code: Select all
#include <xs1.h>
#include <stdio.h>
#include <platform.h>
on stdcore[1]: in buffered port:32 in32P = XS1_PORT_1D ;
on stdcore[1]: in port INCLK = XS1_PORT_1A ;
on stdcore[1]: in port CS = XS1_PORT_1B ;
on stdcore[1]: clock clk = XS1_CLKBLK_1 ;
int main ( void ) {
par
{
on stdcore[1]:
{ configure_clock_src (clk , INCLK );
set_port_inv(CS);
configure_in_port_strobed_slave (in32P , CS , clk );
start_clock (clk );
int z ;
while(1)
{ printf("wait\n");
in32P:32 :> z ;
printf("z is in hex = %x, 1\n",z);
}
}
}
///////////////////////////////// result from my 9.9.2
wait
z is in hex = 7bb57df7, 1
wait
z is in hex = ffffffff, 1
wait
/////////////////////////////////