This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DSP EVM c5515 with CC250 Transceiver

Other Parts Discussed in Thread: CC2500

I'm exacute the following steps in order to read the part number from the cc250

1. send opcode 06h WREN to enable the wriy\te option

2. send opcode 02h WRITE with header byte  0xff00 ( partnumber address 0x30 and read bit 1 and burst access bit 1) to the cc250

3. send opcode 05h READ

4. reset the data register and try to read the data

as you've probably understood it doesn't work

The following is my code

Any help is more than appreciated !!!!

 

 

 

 

Int16 spi_test( )

{

 

 

spi_init( );/* Initialize the SPI interface */

spirom_reset_chipcon(CC2500_SRES);

spirom_read_from_chipcon( CC2500_PARTNUM | CC2500_READ_BURST, ( Uint32 )rx, 1 );

}

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

void

 

 

 

/* Reset Counter value */

SYS_PRCNTR = 0x04;

 

 

 

/* Reset SPI Module */

SYS_PRCNTRLR = 0x00ff;

 

 

for

(i=0;i<100;i++) {;}

 

 

 

/* Init SPI Pins: Enable SPICLK,RX,TX & CS0 */

SYS_EXBUSSEL =(0x6<<12);

 

 

 

//SPI init

SPI_SPICC2 = (0<<15);

 

// Reset SPI

SPI_SPICC1 = 0x0031;

 

// 2MHz input clock

SPI_SPIDC1 = 0x0000;

//cs1 active low

spi_init( )

{

Int16 i;

 

 

 

 

 

 

SPI_SPICC2 = (1<<15);

 

 

 

 

while((SPI_SPISR1 & 0x0001) != 0) {};

return;

}

 

 

 

 

 

 

 

 

 

 

 

 

void

 

 

 

//flen bit total number of characters in frame

i = SPI_SPIDR2;

 

// Dummy read

 

 

 

/* Spirom access cycle */

 

 

for(i = 0; i < len; i++)

{

SPI_SPIDR2 = buf[i] << 8;

 

//spidat2 hols the most significant word

SPI_SPIDR1 = 0x0000;

 

//spidat1 hols the most significant word

SPI_SPICR2 = 0x103A;

 

//set chip select 1 set clen - 8-bit words (must set to req len-1), cmd write(2) bits of spicmd2

 

 

 

while((SPI_SPISR1 & 0x0002) == 0) {};

//check fc(frame complete) bit of spistat1

}

 

 

 

/* Wait for transfer to complete */

 

 

while((SPI_SPISR1 & 0x0001) != 0) {};

//loop while busy bit is on

 

}

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

void

 

 

 

//flen bit total number of characters in frame

i = SPI_SPIDR2;

 

// Dummy read

 

 

 

/* Spirom access cycle */

 

 

for(i = 0; i < len; i++)

{

SPI_SPIDR2 = 0x0000;

 

//spidat2 hols the most significant word

SPI_SPIDR1 = 0x0000;

 

//spidat1 hols the most significant word

 

SPI_SPICR2 = 0x1039;

 

//set clen - 8-bit words (must set to req len-1), cmd read(1) bits of spicmd2

 

 

while((SPI_SPISR1 & 0x0002) == 0) {};

//check fc(frame complete) bit of spistat1

buf[i] = SPI_SPIDR2 & 0xff;

 

//read spidat2 into buf

}

 

 

 

/* Wait for transfer to complete */

 

 

while((SPI_SPISR1 & 0x0001) != 0) {};

//loop while busy bit is on

 

// EVM5515_waitusec(100);

}

void

 

 

{

 

 

/* Issue WPEN */

spirombuf[0] = spirom_CMD_WREN;

spi_write(spirombuf, 1);

 

 

 

/* issue write cmd */

spirombuf[0] = spirom_CMD_WRITE;

spirombuf[1] = ( Uint16 )( tx >> 8 );

spirombuf[2] = ( Uint16 )( tx );

 

spi_write(spirombuf, 3 );

 

 

 

/* issue write cmd */

 

 

//spirombuf[0] = spirom_CMD_WRDI;

 

 

//spi_write(spirombuf, 1);

 

}

void

 

 

 

spirombuf[0] = spirom_CMD_WREN;

spi_write(spirombuf, 1);

 

 

 

/* issue write cmd */

spirombuf[0] = spirom_CMD_WRITE;

spirombuf[1] = ( Uint16 )( tx >> 8 );

spirombuf[2] = ( Uint16 )( tx );

 

spi_write(spirombuf, 3 );

 

 

 

 

 

 

 

spirombuf[0] = spirom_CMD_READ;

 

 

spi_write(spirombuf, 1);

 

read_from_chipcon(spirombuf,1);

 

}

spirom_read_from_chipcon(Uint16 tx, Uint32 rx, Uint32 length)

{

 

spirom_reset_chipcon(Uint16 tx)
read_from_chipcon(Uint16 *buf, Uint16 len)

{

Uint16 i;

 

SPI_SPICR1 = 0x0000 | len - 1;

spi_write(Uint16 *buf, Uint16 len)

{

Uint16 i;

 

 

SPI_SPICR1 = 0x0000 | len - 1;

  • Hi Talmor,

    Your code did not come through very well. Maybe you could attach the files or the whole project.

    Are you able to probe the SPI pins. Are you seeing a clock or data?

    I wonder if the SPI clock gate is enabling clock to the SPI peripheral. Check PCGCR1 bit 1 (SPICG). That is 0x1C02 in IO memory.

    See 1.5.3.2.1 Peripheral Clock Gating Configuration Registers (PCGCR1 and PCGCR2) [1C02 - 1C03h] in the C5515 System User's Guide.

    Try to attach this code.

    Thanks,
    Mark 

  • hi Mark,

     

    my code is bases on the example code from the code composer instalation ccsv4\emulation\boards\evm5515_v1\tests\spirom.

     I'll atach the files but please note that that I rewrite the functions for my own needs .

    I do enable the SPICG bit and I do see some data coming in and out the transciver (with scope).  

    /*
     *  Copyright 2009 by Spectrum Digital Incorporated.
     *  All rights reserved. Property of Spectrum Digital Incorporated.
     */
    
    /*
     *  SPI ROM test
     *
     */
    
    #include "evm5515.h"
    #include "spirom.h"
    #include "stdio.h"
    
    static Uint8 tx[spirom_PAGESIZE];
    static Uint8 rx[spirom_PAGESIZE];
    
    // Status registers
    #define CC2500_PARTNUM          0x30        // Part number
    #define CC2500_VERSION          0x31        // Current version number
    
    // Definitions for burst/single access to registers
    #define CC2500_WRITE_BURST      0x40
    #define CC2500_READ_SINGLE      0x80
    #define CC2500_READ_BURST       0xC0
    #define CC2500_SRES             0x30        // Reset chip.
    
    /* ------------------------------------------------------------------------ *
     *                                                                          *
     *  spirom_test( )                                                            *
     *      SPI ROM test, write then verify the contents of the first 4 pages   *
     *                                                                          *
     * ------------------------------------------------------------------------ */
    Int16 spirom_test( )
    {
        Int16 i, j;
        Uint16* pdata;
    
    	/* Initialize the SPI interface */
        spi_init( );
        
        spirom_reset_chipcon(CC2500_SRES);
    
        /* Read a page */
        for(;;)
        {
        /* Clear receive buffer */
        for ( j = 0 ; j < spirom_PAGESIZE ; j++ ) rx[j] = 0;
        spirom_read_from_chipcon( CC2500_PARTNUM | CC2500_READ_BURST, ( Uint32 )rx, 1 );
        /* Clear receive buffer */
        for ( j = 0 ; j < spirom_PAGESIZE ; j++ ) rx[j] = 0;
        spirom_read_from_chipcon( CC2500_VERSION | CC2500_READ_BURST, ( Uint32 )rx, 1 );
        }
    #ifdef TALMOR
        /* Write to spirom */
        for ( i = 0 ; i < 2 ; i++ )
        {
            /* Create the test pattern */
            pdata = ( Uint16* )tx;
            for ( j = 0 ; j < spirom_PAGESIZE ; j++ )
                *pdata++ = ( Uint8 )( j + i + 8 );
    
            /* Write a page */
            spirom_write( ( Uint32 )tx, i * spirom_PAGESIZE, spirom_PAGESIZE );
        }
    
        /* Read and verify spirom */
        for ( i = 0 ; i < 2 ; i++ )
        {
        	/* Clear receive buffer */
            for ( j = 0 ; j < spirom_PAGESIZE ; j++ )
                rx[j] = 0;
                
            /* Read a page */
            spirom_read( i * spirom_PAGESIZE, ( Uint32 )rx, spirom_PAGESIZE );
    
            /* Check the pattern */
            pdata = ( Uint16* )rx;
            for ( j = 0 ; j < spirom_PAGESIZE ; j++ )
                if ( ( *pdata++ ) != ( Uint16 )( i + j + 8 ) )
                    return 1;  // Fail
        }
    #endif
        return 0;
    }
    
    
    /*
     *  Copyright 2009 by Spectrum Digital Incorporated.
     *  All rights reserved. Property of Spectrum Digital Incorporated.
     */
    
    #include "stdio.h"
    #include "evm5515.h"
    
    /* ------------------------------------------------------------------------ *
     *                                                                          *
     *  Testing Function                                                        *
     *                                                                          *
     * ------------------------------------------------------------------------ */
    void TEST_execute( Int16 ( *funchandle )( ), char *testname, Int16 testid )
    {
        Int16 status;
    
        /* Display test ID */
        printf( "%02d  Testing %s...\n", testid, testname );
    
        /* Call test function */
        status = funchandle( );
    
        /* Check for test fail */
        if ( status != 0 )
        {
            /* Print error message */
            printf( "     FAIL... error code %d... quitting\n", status );
    
            /* Software Breakpoint to Code Composer */
            SW_BREAKPOINT;
        }
        else
        {
            /* Print error message */
            printf( "    PASS\n" );
        }
    }
    
    extern Int16 spirom_test( );
    
    /* ------------------------------------------------------------------------ *
     *                                                                          *
     *  main( )                                                                 *
     *                                                                          *
     * ------------------------------------------------------------------------ */
    void main( void )
    {
        /* Initialize BSL */
        EVM5515_init( );
    
        printf("EXBUSSEL = %02x\n", SYS_EXBUSSEL);
        
        TEST_execute( spirom_test, "SPI ROM", 1 );
    
        printf( "\n***ALL Tests Passed***\n" );
        SW_BREAKPOINT;
    }
    
    /*
     *  Copyright 2007 b7 Spectrum Digital Incorporated.
     *  All rights reserved. Property of Spectrum Digital Incorporated.
     */
    
    /*
     *  SPI ROM interface
     *
     */
    
    #include "evm5515.h"
    #include "spirom.h"
    #include "stdio.h"
    
    static Uint16 spirombuf[spirom_PAGESIZE + 8];
    static Uint16 statusbuf[8];
    
    
    /* ------------------------------------------------------------------------ *
     *  spirom_init( )                                                            *
     * ------------------------------------------------------------------------ */
    void spirom_init( )
    {
    	Int16 i;
    	/* Reset Counter value */
    	SYS_PRCNTR = 0x04;
    	
    	/* Reset SPI Module */
    	SYS_PRCNTRLR = 0x00ff;
    	for(i=0;i<100;i++) {;}
    	
    	/* Init SPI Pins: Enable SPICLK,RX,TX & CS0 */
    	SYS_EXBUSSEL =(0x5<<12);
    
    	//SPI init
    	SPI_SPICC2 =   (0<<15); // Reset SPI
        SPI_SPICC1 =   0x0031;  // 2MHz input clock
        SPI_SPIDC1 =   0x0000;
     
        SPI_SPICR2 &= ~0x30F8;  // Enable CS0
        
        SPI_SPICR2 |=  0x0038;  // Set word length as 1-byte
        SPI_SPICC2 =   (1<<15); // Enable SPI
    	while((SPI_SPISR1 & 0x0001) != 0) {}; // Wait for SPI ready
    	
    //	spirom_status_set( 0xc3 );  // Clear Block Protection
    	
        return;
    }
    
    /* ------------------------------------------------------------------------ *
     *  spirom_cycle(buf, len)                                                    *
     *                                                                          *
     *  Execute a SPI spirom data transfer cycle.  Each byte in buf is shifted    *
     *  out and replaced with data coming back from the spirom.                   *
     * ------------------------------------------------------------------------ */
    
    void spirom_cycle(Uint16 *buf, Uint16 len)
    {
        Uint16 i;
    
        SPI_SPICR1 = 0x0000 | len - 1;	//flen bit total number of characters in frame
        i = SPI_SPIDR2;  // Dummy read
    
       	/* Spirom access cycle */
    	for (i = 0; i < len; i++)
    	{
    		SPI_SPIDR2 = buf[i] << 8; //spidat2 hols the most significant word
    		SPI_SPIDR1 = 0x0000;      //spidat1 hols the most significant word
       
            SPI_SPICR2 = 0x0039;  	  //set clen - 8-bit words (must set to req len-1), cmd  read(1) bits of spicmd2  
            while((SPI_SPISR1 & 0x0002) == 0) {}; //check fc(frame complete) bit of spistat1
            buf[i] = SPI_SPIDR2 & 0xff;	//read spidat2 into buf	
    	}
    	
    	/* Wait for transfer to complete */
    	while((SPI_SPISR1 & 0x0001) != 0) {}; //loop while busy bit is on 
    	
    //	EVM5515_waitusec(100);
    }
    
    /* ------------------------------------------------------------------------ *
     *  spirom_status( )                                                        *
     * ------------------------------------------------------------------------ */
    Uint16 spirom_status( )
    {
        /* Issue read status register command */
        statusbuf[0] = spirom_CMD_RDSR;
        statusbuf[1] = 0;
    
    	spirom_cycle(statusbuf, 5);
    
        return statusbuf[3];
    }
    
    /* ------------------------------------------------------------------------ *
     *  spirom_status_set( val )                                                    *
     * ------------------------------------------------------------------------ */
    Uint16 spirom_status_set( Uint8 val)
    {
        /* Issue write status register command */
        statusbuf[0] = spirom_CMD_WRSR; 
        statusbuf[1] = val;
        
    	spirom_cycle(statusbuf, 2);
    
        return statusbuf[3];
    }
    
    /* ------------------------------------------------------------------------ *
     *  spirom_read( src, dst, len )                                              *
     * ------------------------------------------------------------------------ */
    void spirom_read( Uint16 src, Uint32 dst, Uint32 length )
    {
        Int32 i;
        Uint16 *psrc, *pdst;
    
    	// Setup command
        spirombuf[0] = spirom_CMD_READ;
        spirombuf[1] = ( src >> 8 );
        spirombuf[2] = ( src >> 0 );
    
    	// Execute spirom read cycle
    	spirom_cycle(spirombuf, length + 5);
    
        // Copy returned data
        pdst = ( Uint16 * )dst;
        psrc = spirombuf + 5;
        for ( i = 0 ; i < length ; i++ )
            *pdst++ = *psrc++;
    
    }
    
    /* ------------------------------------------------------------------------ *
     *  spirom_write( src, dst, len )                                             *
     * ------------------------------------------------------------------------ */
    void spirom_write( Uint32 src, Uint16 dst, Uint32 length )
    {
        Int32 i;
        Int32 bytes_left;
        Int32 bytes_to_program;
        Uint16 *psrc;
    
        /* Establish source */
        psrc = ( Uint16 * )src;
        bytes_left = length;
    
        while ( bytes_left > 0 )
        {
            bytes_to_program = bytes_left;
    
            /* Most to program is spirom_CMD_BLOCKSIZE */
            if ( bytes_to_program > spirom_PAGESIZE )
                 bytes_to_program = spirom_PAGESIZE;
    
            /* Make sure you don't run off the end of a block */
            if ( ( dst & spirom_PAGEMASK ) != ( ( dst + bytes_to_program ) & spirom_PAGEMASK ) )
                bytes_to_program -= ( dst + bytes_to_program ) - ( ( dst + bytes_to_program ) & spirom_PAGEMASK );
    
            /* Issue WPEN */
            spirombuf[0] = spirom_CMD_WREN;
            spirom_cycle(spirombuf, 1);
    
            /* Create command block for program operation */
            spirombuf[0] = spirom_CMD_WRITE;
            spirombuf[1] = ( Uint16 )( dst >> 8 );
            spirombuf[2] = ( Uint16 )( dst );
    
            for ( i = 0 ; i < bytes_to_program ; i++ )
                spirombuf[3+i] = *psrc++;
    
            /* Execute write command */
            spirom_cycle(spirombuf, bytes_to_program + 3 );
    
            /* Wait while busy */
            while( ( spirom_status( ) & 0x01 ) );
    
            /* Get ready for next iteration */
            bytes_left -= bytes_to_program;
            dst += bytes_to_program;
        }
    }
    
    void read_from_chipcon(Uint16 *buf, Uint16 len)
    {
        Uint16 i;
    
        SPI_SPICR1 = 0x0000 | len - 1;	//flen bit total number of characters in frame
        i = SPI_SPIDR2;  // Dummy read
    
       	/* Spirom access cycle */
    	for (i = 0; i < len; i++)
    	{
    		SPI_SPIDR2 = 0x0000; //spidat2 hols the most significant word
    		SPI_SPIDR1 = 0x0000;      //spidat1 hols the most significant word
        
            SPI_SPICR2 = 0x1039;  	  //set clen - 8-bit words (must set to req len-1), cmd  read(1) bits of spicmd2      
            while((SPI_SPISR1 & 0x0002) == 0) {}; //check fc(frame complete) bit of spistat1
            buf[i] = SPI_SPIDR2 & 0xff;	//read spidat2 into buf	
    	}
    	
    	/* Wait for transfer to complete */
    	while((SPI_SPISR1 & 0x0001) != 0) {}; //loop while busy bit is on 
    	
    //	EVM5515_waitusec(100);
    }
    void spirom_reset_chipcon(Uint16 tx)
    {
    		/* Issue WPEN */	
            spirombuf[0] = spirom_CMD_WREN;
            spi_write(spirombuf, 1);
    
        	/* issue write cmd */
            spirombuf[0] = spirom_CMD_WRITE;
            spirombuf[1] = ( Uint16 )( tx >> 8 );
            spirombuf[2] = ( Uint16 )( tx );
            
            spi_write(spirombuf, 3 );
            
            /* issue write cmd */   
    	    //spirombuf[0] = spirom_CMD_WRDI;
            //spi_write(spirombuf, 1);
    	
    }
    void spirom_read_from_chipcon(Uint16 tx, Uint32 rx, Uint32 length)
    {
    	//1. send addr+command strobe
    	//2. wait for FIN
    	//3. read buyte from rcvBuf
    	//4. loop(length): transmit dummy byte
    	//5. 			   wait for FIN
    	//6. 			read buyte from rcvBuf	
    	
    	/* Issue WPEN */	
            spirombuf[0] = spirom_CMD_WREN;
            spi_write(spirombuf, 1);
    
        /* issue write cmd */
            spirombuf[0] = spirom_CMD_WRITE;
            spirombuf[1] = ( Uint16 )( tx >> 8 );
            spirombuf[2] = ( Uint16 )( tx );
    	
    	    spi_write(spirombuf, 3 );
    	
    	/* issue write cmd */   
    	
    	   // spirombuf[0] = spirom_CMD_WRDI;
           // spi_write(spirombuf, 1);
    	    
    	    
    	    spirombuf[0] = spirom_CMD_READ;
           // spirombuf[1] = ( rx >> 8 );
           // spirombuf[2] = ( rx >> 0 );
    
    	  // Execute spirom read cycle
    		spi_write(spirombuf, 1);
    		
    		read_from_chipcon(spirombuf,1);
    	
    }
    
    void spi_write(Uint16 *buf, Uint16 len)
    {
        Uint16 i;
    
    	
        SPI_SPICR1 = 0x0000 | len - 1;	//flen bit total number of characters in frame
        i = SPI_SPIDR2;  // Dummy read
    
       	/* Spirom access cycle */
    	for (i = 0; i < len; i++)
    	{
    		SPI_SPIDR2 = buf[i] << 8; //spidat2 hols the most significant word
    		SPI_SPIDR1 = 0x0000;      //spidat1 hols the most significant word
            SPI_SPICR2 = 0x103A; //set chip select 1 set clen - 8-bit words (must set to req len-1), cmd  write(2) bits of spicmd2
            
            while((SPI_SPISR1 & 0x0002) == 0) {}; //check fc(frame complete) bit of spistat1
            //buf[i] = SPI_SPIDR2 & 0xff;	//read spidat2 into buf	
    	}
    	
    	/* Wait for transfer to complete */
    	while((SPI_SPISR1 & 0x0001) != 0) {}; //loop while busy bit is on 
    
    }
    
    void spi_init( )
    {
    	Int16 i;
    	/* Reset Counter value */
    	SYS_PRCNTR = 0x04;
    	
    	/* Reset SPI Module */
    	SYS_PRCNTRLR = 0x00ff;
    	for(i=0;i<100;i++) {;}
    	
    	/* Init SPI Pins: Enable SPICLK,RX,TX & CS0 */
    	SYS_EXBUSSEL =(0x6<<12);
    
    	//SPI init
    	SPI_SPICC2 =   (0<<15); // Reset SPI
        SPI_SPICC1 =   0x0031;  // 2MHz input clock
        SPI_SPIDC1 =   0x0000; //cs1 active low
     
        //SPI_SPICR2 &= ~0x30F8;  // Enable CS0    
        //SPI_SPICR2 |= 0x1000; //Enable CS1
        
        //SPI_SPICR2 |=  0x0038;  // Set word length as 1-byte
        SPI_SPICC2 =   (1<<15); // Enable SPI
        //SPI_SPICC2 =   (0<<14); // Enable SPI
    	while((SPI_SPISR1 & 0x0001) != 0) {}; // Wait for SPI ready
    	
    //	spirom_status_set( 0xc3 );  // Clear Block Protection
    	
        return;
    }
    
    /*
     *  Copyright 2009 by Spectrum Digital Incorporated.
     *  All rights reserved. Property of Spectrum Digital Incorporated.
     */
    
    /*
     *  SPI ROM header file
     *
     */
    
    #include "evm5515.h"
    
    /* ------------------------------------------------------------------------ *
     *  SPI ROM Definitions                                                     *
     * ------------------------------------------------------------------------ */
    #define spirom_SIZE               0x8000
    #define spirom_BASE               0x0000
    #define spirom_PAGESIZE           32
    #define spirom_PAGEMASK           0xffc0
    
    /* ------------------------------------------------------------------------ *
     *  SPI ROM Commands                                                        *
     * ------------------------------------------------------------------------ */
    #define spirom_CMD_WREN           0x06 //write enable command 
    #define spirom_CMD_WRDI           0x04 //write disable command
    #define spirom_CMD_RDSR           0x05 //read status register 
    #define spirom_CMD_WRSR           0x01 //write status register 
    #define spirom_CMD_READ           0x03 // opcode read command
    #define spirom_CMD_WRITE          0x02 //opcode write comand 
    
    /* ------------------------------------------------------------------------ *
     *  SPI Controller                                                          *
     * ------------------------------------------------------------------------ */
    
    #define SPI_SPICC1         *(volatile ioport Uint16*)(0x3000) //spicdr
    #define SPI_SPICC2         *(volatile ioport Uint16*)(0x3001) //spiccr
    #define SPI_SPIDC1         *(volatile ioport Uint16*)(0x3002) //spidcr1
    #define SPI_SPIDC2         *(volatile ioport Uint16*)(0x3003) //spidcr2
    #define SPI_SPICR1         *(volatile ioport Uint16*)(0x3004) //spicmd1
    #define SPI_SPICR2         *(volatile ioport Uint16*)(0x3005) //spicmd2
    #define SPI_SPISR1         *(volatile ioport Uint16*)(0x3006) //spistat1
    #define SPI_SPISR2         *(volatile ioport Uint16*)(0x3007) //spistat2
    #define SPI_SPIDR1         *(volatile ioport Uint16*)(0x3008) //spidat1
    #define SPI_SPIDR2         *(volatile ioport Uint16*)(0x3009) //spidat2
    
    /* ------------------------------------------------------------------------ *
     *  Prototype                                                               *
     * ------------------------------------------------------------------------ */
    void spirom_init( );
    Uint16 spirom_status_set( Uint8 val);
    void spirom_read( Uint16 src, Uint32 dst, Uint32 length );
    void spirom_write( Uint32 src, Uint16 dst, Uint32 length );
    void spirom_read_from_chipcon(Uint16 rcv, Uint32 tx, Uint32 length);
    void spirom_reset_chipcon(Uint16 tx);
    void spi_init( );
    void spi_write(Uint16 *buf, Uint16 len);
    

    Thanks

    Talmor