OPALIB Quick Start


OwnTech Power API Library Quick start is intended at providing a quick start for using OwnTech Power Converter.

It allows to automatically execute a user-defined function on a periodic basis.

This library makes use of the Timer 6.

Working with OPALIB Quick start

Enable the library

To enable the library, just uncomment the quick_start library in src/owntech.ini.

Then, include the library header in main.cpp:

Memo: the standalone Quick Start library configuration is as follows:


Executing a user function periodically

To periodically run a function, provide a pointer to a void(void) user-defined function as first parameter of the init function. The second parameter is the period (in µs) that has to be used for the task.

void opalib_quick_start_init(void (*periodic_task)(), uint32_t task_period_us);

Then, calling the function opalib_quick_start_launch_task() will start your periodic task.

As an example, the following code will call the function user_defined_task() every 50 µs:

Specify the hardware version

This is used for development purpose, the end-user should not have to worry about this.

Some versions of the hardware have specificities that alter the software behavior. The hardware version can be specified using the function opalib_quick_start_set_hardware_version(). This function call should be done before anything else in the main().

Library structure

  • $(PROJECTDIR)/src/
    • opalib_quick_start.c Main source file
    • opalib_quick_start.h List of public functions implemented in library