Dheeraj M Pai
/
XXX_INTEGRATE_WITH_KIRUBHA_CODE
ADF7023
Diff: main.cpp
- Revision:
- 3:dd63376a1030
- Parent:
- 2:24459bb3d5cf
--- a/main.cpp Sat Jun 27 03:53:25 2015 +0000 +++ b/main.cpp Thu Jul 09 06:53:55 2015 +0000 @@ -36,7 +36,8 @@ void send_data() { - +// cout<<"Times="<<times<<ENDL; + times++; // static int current_byte = 0; static int current_bit = 7; @@ -47,7 +48,7 @@ current_bit = 7; j++; bitcount=1; - cout<<"SENDING"<<ENDL; +// cout<<"SENDING"<<ENDL; if(j>=sizeof(data_TX)) { j=0; @@ -59,80 +60,8 @@ } -void write_con(con_type ram, uint8_t address, uint8_t *data, int length){ - - int *response = new int[length]; - - - - CS = 0; - -// ignore recevived data - adf.write( ram ); - -// write start address - int r = adf.write( address ); - -// write data - for(int i = 0 ; i < length ; ++i){ - response[i] = adf.write( data[i] ); - } - - CS = 1; - - cout << r << ENDL; - for(int i = 0 ; i < length ; ++i){ - cout << response[i] << " "; - } - cout << ENDL; - -} - -void write_discon(discon_type ram, uint8_t *address, uint8_t *data, int length){ - - int *response1 = new int[length]; - int *response2 = new int[length]; - - CS = 0; - -// ignore recevived data - adf.write( ram ); - - for(int i = 0 ; i < length ; ++i){ - -// address[7:0] next 8 bits - response1[i] = adf.write( address[i] ); - -// data next 8 bits - response2[i] = adf.write( data[i] ); - - } - - CS = 1; - - for(int i = 0 ; i < length ; ++i){ - cout << response1[i] << "\t" << response2[i] << ENDL; - } - -} - -int read_discon(discon_type_RD ram, uint8_t address){ - - CS = 0; - -// ignore the reply - adf.write( ram ); - - int stat1 = adf.write( address ); - int stat2 = adf.write( SPI_NOP ); - int reply = adf.write( SPI_NOP ); - - CS = 1; - - return reply; -} void write_bbram_sequence(void){ @@ -316,8 +245,8 @@ int l=0; while(l<=1000){ - cout << "in while" << ENDL; - cout<<bitcount<<ENDL; + cout << "transmitting" << ENDL; +// cout<<bitcount<<ENDL; bitcount++; if(clk == 0){