Code example: Where did WDT_Start(void) come from?

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

cross mob
Anonymous
Not applicable

I'm looking through the example code for BLE_Proximity01 and in main.c noticed the code to start the watchdog timer (WDT). I opened the WDT's datasheet and didn't see any reference about a Start() function. So, I searched the generated source for "CySysWdtUnlock" using GREP and found that it is defined in CyLFClk.c. Where did that come from? So, I looked at the Clocks resources and found a number of references to "LFCLK". I assume that setting them there added the code to the generated source: CyLFClk.h and CyLFClk.c, but am not sure. Then I search CyLFClk.h and find a large number of WDT functions in the WDT API section. Why wouldn't they be listed in the WDT datasheet?

   

My question is, if I was going to create this from scratch, I wouldn't have a clue as to how I would do this. Is there anything that explains what is going on here? The PDF with the example code doesn't explain much about the nuts and bolts and the BLE datasheet says:

   

"Note The LFCLK is used in the BLE Component only during Deep Sleep Mode and hence the ILO inaccuracy does not affect the BLE communication."

   

Or, are we supposed to just use the code as supplied and not worry about being able to write this from scratch after we gain a much better understanding?

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

There is a "System Reference Guide" which you find from Creator's help menu. This explains some of the functions.

   

Additionally right clicking on the Start() function (rather: any function call) brings up a menu that will lead you to the declaration or definition of that function.

   

 

   

Bob

View solution in original post

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

There is a "System Reference Guide" which you find from Creator's help menu. This explains some of the functions.

   

Additionally right clicking on the Start() function (rather: any function call) brings up a menu that will lead you to the declaration or definition of that function.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Thanks Bob, that right-click thing is faster than GREP. But at a higher conceptual level, what would lead me to understand that a WDT_Start() function is needed when the Global Signal Reference datasheet doesn't mention that it's needed? And what would lead me to understand that the WDT_Start() function needs any of the function that it calls?

   

The PSoC Creator System Reference Guide (SRG) provides information about watchdog timers but doesn't tie them to the Global Signal component. So maybe a cross reference to the appropriate watchdog timer sections in the SRG can be added to the Global Signal Reference. Also, I don't see anything that explains what is needed to use the other interrupts properly, so maybe cross references can be added for the others, Combined CTBm, System Performance Controller Interface, etc.

   

Maybe I'm just extra dense.

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

"Maybe I'm just extra dense."   Probably ;-))

   

 

   

Bob

0 Likes