Software Platform Wrapper

Frozen Content

Use of the Software Platform to develop your Embedded software is a breeze in Altium Designer, with the Software Platform Wrapper. When you compile your Embedded project, a new header file and C file are automatically generated by the Software Platform Builder, completely encapsulating your platform. These files make it very easy to use the Software Platform, with all required handles being defined for you, all header files you need to access being included, and the optional ability to automatically initialize the complete platform!

Accessing and Using Generated Files

Upon compilation of an Embedded project, the files generated by (and from) the Software Platform – swplatform.c and swplatform.h – can be found in the Generated»C Source Documents and Generated»Header Documents sub-folders respectively, in the Projects panel.

Example of Header and C files generated as a 'wrapper' around the active project's Software Platform upon compilation of that project.

The swplatform.c file is generated only when the option to Generate Initialization Code is enabled, as part of the Software Platform Configuration service. This option is enabled by default for all new Software Platform documents.

To use the generated files, you must ensure to add a #include statement into your top-level code source file (typically main.c), to 'bring in' the generated swplatform.h file:

#include "swplatform.h"

All other required header files needed to access the devices in the stack are brought in (made available) as a result of adding (pointing to) this file.

Generating and Using Initialization Code

As part of the Software Platform Configuration service, there are three options relating to the creation and use of initialization code.

Use available configuration options to generate and use code by which to open and initialize all device stacks in the platform - all delivered as part of an encompassing wrapper
around your Software Platform.
  • Generate Initialization Code – enable this option to create initialization code, by which to open all device stacks and to provide handles for subsequent use of the API. This option is enabled by default for all new Software Platform documents. If this option is disabled, the two options below will become unavailable, and no swplatform.c file will be generated.
  • Top Level Only – enable this option to explicitly open top-level stack items only (all other items will be opened implicitly). If disabled, all stack items will be explicitly opened and handles provided. This option is enabled by default for all new Software Platform documents.
  • Call Initialization Code – enable this option to automatically call generated initialization code before main().

With the Generate Initialization Code option enabled, initialization code will be added to both swplatform.h and swplatform.c
(created as a result of enabling the option) generated files.
You are reporting an issue with the following selected text and/or image within the active document: