Having trouble with Control Reg

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
DaHu_285096
Level 5
Level 5
10 likes received 250 replies posted 100 replies posted
        I have set up a control reg for selecting CS on a couple of SPI devices but when I attempt to compile the code, I get error that reference not found. I have attached my project. Thanks for your help   
0 Likes
2 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

This code looks like you have an attempt to define a structure

   

and a f() mistypped, ie. seperate deliniation between structure

   

and f()....?

   

 

   

struct Timetype GetTime(void)
{
    struct Timetype t;
    unsigned char tbuf[8];
    unsigned char i;

  SPI_SELECT_Write(RTC_SEL);
  writeSPI( RTCREAD + regSECOND); // write command
  for (i = 0; i<7; i++)
  {
    tbuf = writeSPI(0);  
  }
  SPI_SELECT_Write(RTC_SEL);
  t.Second = tbuf[0] & 0x7f;
  t.Minute = tbuf[1] & 0x7f;
  t.Hour = tbuf[2] & 0x3f;
  t.Day = tbuf[3] & 0x3f;
  t.Month = tbuf[5] & 0x1f;
  t.Year = tbuf[6];
  return t;
}

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Thread was answered here secure.cypress.com/

   

 

   

Bob

0 Likes