You are here

Having trouble with Control Reg | Cypress Semiconductor

Having trouble with Control Reg

Summary: 2 Replies, Latest post by Bob Marlowe on 07 Aug 2014 07:21 AM PDT
Verified Answers: 0
Last post
Log in to post new comments.
user_343349849's picture
314 posts

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

user_14586677's picture
7646 posts

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;

  writeSPI( RTCREAD + regSECOND); // write command
  for (i = 0; i<7; i++)
    tbuf[i] = writeSPI(0);  
  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;

user_1377889's picture
9281 posts

Thread was answered here



Log in to post new comments.