![]() |
Synergy Software Package User's Manual
|
The Event Link Controller (ELC) HAL module provides a high-level API for connecting various MCU peripherals for autonomous operation and uses the ELC peripheral on the Synergy MCU. There are no callbacks associated with the ELC HAL module. The project configurator in the e2 studio Integrated Solution Development Environment (ISDE) includes the ELC HAL module in every project by default. To configure the ELC HAL module, select it in the HAL/Common module in the Threads tab and click on it in the HAL/Common Stacks window.
The ELC HAL module can perform the following functions:
The following hardware features are, or are not, supported by SSP for ELC.
Legend:
| Symbol | Meaning |
|---|---|
| ✓ | Available (Tested) |
| ⌧ | Not Available (Not tested/not functional or both) |
| N/A | Not supported by MCU |
| MCU Group | Create | Break | Generate |
|---|---|---|---|
| S124 | ✓ | ✓ | ✓ |
| S128 | ✓ | ✓ | ✓ |
| S1JA | ✓ | ✓ | ✓ |
| S3A1 | ✓ | ✓ | ✓ |
| S3A3 | ✓ | ✓ | ✓ |
| S3A6 | ✓ | ✓ | ✓ |
| S3A7 | ✓ | ✓ | ✓ |
| S5D3 | ✓ | ✓ | ✓ |
| S5D5 | ✓ | ✓ | ✓ |
| S5D9 | ✓ | ✓ | ✓ |
| S7G2 | ✓ | ✓ | ✓ |
The ELC HAL module defines APIs for initializing, enabling, disabling and creating or breaking event links between modules. A complete list of the available APIs, an example API call and a short description of each can be found in the following table. A table of status return values follows the API summary table.
ELC HAL Module API Summary
| Function Name | Example API Call and Description |
|---|---|
| init | g_elc.p_api->init(g_elc.p_cfg) Initialize all links in the Event Link Controller. |
| softwareEventGenerate | g_elc.p_api->softwareEventGenerate(event_num)Generate a software event in the Event Link Controller. |
| linkSet | g_elc.p_api->linkSet(peripheral, signal)Create a single event link. |
| linkBreak | g_elc.p_api->linkBreak(peripheral)Break an event link. |
| enable | g_elc.p_api->enable()Enable the operation of the Event Link Controller. |
| disable | g_elc.p_api->disable()Disable the operation of the Event Link Controller. |
| versionGet | g_elc.p_api->versionGet(&version)Retrieve the API version with the version pointer. |
Status Return Values
| Name | Description |
|---|---|
| SSP_SUCCESS | Function successfully completed. |
| SSP_ERR_ASSERTION | p_version is NULL. |
The ELC HAL module allows the developer to create events that link various peripheral operations by using events generated by one Synergy MCU peripheral to trigger the start of operation of another Synergy MCU peripheral. The ELC HAL module APIs make it easy to create a link between two blocks (for example, from a timer to an ADC to control a periodic scan interval). By connecting various peripherals in this way, intelligent functions can be constructed that require little, if any, CPU intervention.
The following figure shows a simplified block diagram of the ELC, showing the input event sources and the peripherals that can be triggered by these events. The number of input and output triggers is specific to the S7G2 MCU. Other Synergy devices support a different number of events.
It is possible to find the mapping of ELC peripherals in the file, bsp_elc.h, in the Synergy-generated code. The available peripherals and associated events for the S7G2 MCU are shown in the below figure. Additional information on ELC operation is also available in the associated MCU user's manual.
The ELC HAL module needs no pin, clocking, or interrupt configuration. It is just a 'connect' mechanism between peripherals. However, if linking I/O Ports via the ELC, the I/O pins need to be configured as inputs or outputs.
Refer to the latest SSP Release Notes for any additional operational limitations for this module.
This section describes how to include the ELC HAL Module in an application using the SSP configurator.
To add the ELC Driver to an application, simply add it to a thread using the stacks selection sequence given in the following table. (The default name for the ELC Driver is g_elc0. This name can be changed in the associated Properties window.)
ELC HAL Module Selection Sequence
| Resource | ISDE Tab | Stacks Selection Sequence |
|---|---|---|
| g_elc ELC Driver on r_elc | Threads | New Stack> Driver> System> ELC Driver on r_elc |
When the ELC Driver on r_elc is added to the thread stack as shown in the following figure, the configurator automatically adds any needed lower‑level modules. Any modules needing additional configuration information have the box text highlighted in Red. Modules with a Gray band are individual modules that stand alone. Modules with a Blue band are shared or common; they need only be added once and can be used by multiple stacks. Modules with a Pink band can require the selection of lower-level modules; these are either optional or recommended. (This is indicated in the block with the inclusion of this text.) If the addition of lower-level modules is required, the module description include Add in the text. Clicking on any Pink banded modules brings up the New icon and displays possible choices.
The ELC HAL Module must be configured by the user for the desired operation. The available configuration settings and defaults for all the user-accessible properties are given in the properties tab within the SSP configurator and are shown in the following tables for easy reference. Only properties that can be changed without causing conflicts are available for modification. Other properties are locked and not available for changes and are identified with a lock icon for the locked property in the Properties window in the ISDE. This approach simplifies the configuration process and makes it much less error-prone than previous manual approaches to configuration. The available configuration settings and defaults for all the user-accessible properties are given in the Properties tab within the SSP Configurator and are shown in the following tables for easy reference.
Configuration Settings for the ELC HAL Module on r_elc
| ISDE Property | Value | Description |
|---|---|---|
| Parameter Checking | BSP, Enabled, Disabled Default: BSP | Enable or disable the parameter error checking. |
| Name | g_elc | Module name. |
The ELC HAL module does not require a specific clock configuration.
There are no pins associated directly with the ELC HAL Module that require configuration.
The typical steps in using the ELC HAL module in an application are:
These common steps are illustrated in a typical operational flow diagram in the following figure: