• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Embedded Software » BIOS » BIOS forum » Passing parameters to a Clock function in SYS/BIOS
Share
BIOS
  • Forum
  • Announcements
Options
  • Subscribe via RSS

Passing parameters to a Clock function in SYS/BIOS

Passing parameters to a Clock function in SYS/BIOS

This question is answered
Andrey56137
Posted by Andrey56137
on Nov 08 2010 21:22 PM
Intellectual330 points

I am trying to build a program that uses SYS/BIOS (aka BIOS 6) with CCS 4.2.  The BIOS "Clock" module can be set up to run a function either periodically or only once ("one-shot"). In my case, I need to run it only once. Setting up and initializing the clock is not a problem:

 

Clock_Handle clk;

Clock_Params clkParams;

Clock_Params_init(&clkParams);

clkParams.period = 0;

clkParams.startFlag = FALSE;

clk = Clock_create(myFunc, 1, &clkParams, NULL);

Clock_start(clk);

 

In Clock_create, I am setting up the clock to execute "myFunc". What I don't know how to do is pass parameters into myFunc. From BIOS documentation, the only way I saw is to define the optional clock argument:

clkParams.arg = (UArg)0x1234;   /* set up a flag for the clock */

However, that's just a single 32-bit value. What I need is to pass arbitrary parameters, which might include different primitive types, pointers, and structures, into myFunc. Suppose myFunc is defined as:

void myFunc(int* x, size_t x_len);

Is there a way to do it? It seems that not being able to pass parameters to functions, either periodic or one-shot, would be a significant restriction. I am sure it can be done, I just lack knowledge on SYS/BIOS.

 

Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • David Martin-Sacristan
    Posted by David Martin-Sacristan
    on Mar 30 2012 10:40 AM
    Prodigy100 points

    I have this same question. Can anyone solve it?

    Thank you.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Alan DeMars
    Posted by Alan DeMars
    on Mar 30 2012 12:00 PM
    Verified Answer
    Verified by David Friedland
    Genius14105 points

    Define a structure that contains all the info you want to pass to the Clock function.

    Create one of those structures and initialize it accordingly.

    Pass a pointer to that structure as the clkParams.arg parameter.

    In your Clock function, cast the arg as a ptr to your structure, then de-reference the struct ptr to access the info.

    Alan

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • David Martin-Sacristan
    Posted by David Martin-Sacristan
    on Apr 03 2012 12:00 PM
    Prodigy100 points

    Thank you Alan!

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use