User manual
 

Embedded Components

Embedded components encapsulate the initialization and functionality of embedded systems basic elements, such as MCU core, on-chip peripherals (for details on categories of components delivered with Processor Expert see chapter Component categories), FPGAs, standalone peripherals, virtual devices, and pure software algorithms.
These facilities are interfaced to the user through properties, methods and events. It is very similar to objects in the Object Oriented Programming (OOP) concept.

Easy Initialization

A user can initialize components by setting their initialization properties in the Component Inspector. Processor Expert generates the initialization code for the peripherals according to the properties of the appropriate components. User can decide whether the component will be initialized automatically at startup or manually by calling the component's Init method.

Easy On-chip Peripherals Management

Processor Expert knows exactly the relation between the allocated peripherals and the selected components. When the user selects a peripheral in the component properties, Processor Expert proposes all the possible candidates but signals which peripherals are allocated already (with the icon of the component allocating the peripheral). PE also signalizes peripherals that are not compatible with the current component settings (with a red exclamation mark). In the case of an unrealizable allocation, an error is generated.

Unlike common libraries, Embedded Components are implemented for all possible peripherals, with optimal code. The most important advantages of the generated modules for driving peripherals are that you can:

  • Select any peripheral that supports component function and change it whenever you want during design time.
  • Be sure that the component setting conforms to peripheral parameters.
  • Choose the initialization state of the component.
  • Choose which methods you want to use in your code and which event you want to handle.
  • Use several components of the same type with optimal code for each component.

The concept of the peripheral allocation generally does not enable sharing of peripherals because it would make the application design too complicated. The only way to share resources is through the components and their methods and events. For example, it is possible to use the RTIshared component for sharing periodic interrupt from timers.

Methods

Methods are interfacing component functionality to user's code. All enabled methods are generated into appropriate component modules during the code generation process. All Methods of each component inserted into the project are visible as a subtree of the components in the Project panel.
You can use in your code all enabled methods. The easiest way to call any method from your code is to drag and drop the method from project panel to the editor. The complexity and number of methods depend on the component's level of abstraction.

Events

Some components allow handling the hardware or software events related to the component. The user can specify the name on function invoked in the case of event occurrence. They are usually invoked from the internal interrupt service routines generated by Processor Expert. If the enabled event handling routine is not already present in the event module then the header and implementation files are updated and an "empty" function (without any code) is inserted. The user can write event handling code into this procedure and this code will not be changed during the next code generation.
All Methods and Events of each component inserted into the project are visible as a subtree of components in the Project panel.

Interrupt Subroutines

Some components, especially the Low-level components and the Peripheral Initialization components () allow to assign an interrupt service routine (ISR) name to a specific interrupt vector setup.
The name of the Interrupt service is generated directly to the interrupt vector table and the user has to do all necessary control registers handling within the user code.
ISRs items are listed in the subtree of a component in the Project panel.


Figure 1 - Example Of a Component With Two ISRs

Highly Configurable and Extensible Library

Embedded Components can be created and edited manually or with the help of Component Wizard. CPU Components are a special category of components.