Slide 1 Slide 2 Slide 3 Slide 4 Slide 5 Slide 6 Slide 7 Slide 8 Slide 9 Product List
SYS/BIOS: Introduction to Timers and Clocks Slide 6
A clock instance can be created at configuration time or at runtime. This slide discusses how to create a clock instance during runtime. Looking at the code snippet shown, the code is using several different variables. The first two are types defined by the clock module to hold all of the various clock instance’s parameters and to store the handle of the clock instance that will be created. By calling Clock_Params_init(), the code will fill the params structure with all of the default parameter values and then update the individual parameters that need to have different values than the default. In this case, it is explicitly setting the clock instance period parameter to four and the startFlag to true. An error block variable is also being set up so that if the create failed, the user could find out more information on why it failed. Finally, Clock_create() is called, which will initialize the clock instance and return the handle to that instance. Also shown on this slide is a summary of the other API calls used to control a clock instance.
PTM Published on: 2013-12-05