My question is just outputting the incoming signal . I don't know how to read the "1" and "0" from the port 1C and then store to x and printf 1 bit by 1 bit.I have physically connected the pins and have checked that no problem in incoming signal. The signal is SPI and 24 bit.
Code: Select all
# include <xs1.h>
#include <stdio.h>
#include <platform.h>
on stdcore[1]: in buffered port:1 in8P = XS1_PORT_1C ;
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_2 ;
int x ;
int main ( void ) {
par
{
on stdcore[1]:
{
configure_clock_src (clk , INCLK );
configure_in_port (CS , clk );
set_port_inv(CS);
configure_in_port_strobed_slave (in8P , CS , clk );
start_clock (clk );
in8P:> x :
}
}
}