Synergy Software Package User's Manual
ELC Driver

ELC HAL Module Introduction

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.

ELC HAL Module Features

The ELC HAL module can perform the following functions:

  • Creates an event link between two blocks.
  • Breaks that event link between two blocks.
  • Generates one of two software events that interrupt the CPU.
ELC_BD.png
ELC HAL Module Block Diagram

ELC Hardware support details

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

ELC HAL Module APIs Overview

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.
Note
For more complete descriptions of operation and definitions for the function data structures, typedefs, defines, API data, API structures, and function variables, review the SSP User's Manual API References for the associated module.

Status Return Values

Name Description
SSP_SUCCESS Function successfully completed.
SSP_ERR_ASSERTION p_version is NULL.
Note
Lower-level drivers may return common error codes. Refer to the SSP User's Manual API References for the associated module for a definition of all relevant status return values.

ELC HAL Module Operational Overview

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.

ELC_TE.png
ELC HAL Module Trigger 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.

ELC_PM.png
ELC HAL Peripheral Map

ELC HAL Module Important Operational Notes and Limitations

ELC HAL Module Operational Notes

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.

ELC HAL Module Limitations

Refer to the latest SSP Release Notes for any additional operational limitations for this module.

Including the ELC HAL Module in an Application

This section describes how to include the ELC HAL Module in an application using the SSP configurator.

Note
This section assumes you are familiar with creating a project, adding threads, adding a stack to a thread and configuring a block within the stack. If you are unfamiliar with any of these items, refer to the first few chapters of the SSP User's Manual to learn how to manage each of these important steps in creating SSP-based applications.

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.

ELC_MS.png
ELC HAL Module Stack

Configuring the ELC HAL Module

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.

Note
You may want to open your ISDE, create the module and explore the property settings in parallel with looking over the following configuration table settings. This will help orient you and can be a useful 'hands-on' approach to learning the ins and outs of developing with SSP.

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.
Note
The example settings and defaults are for a project using the Synergy S7G2 MCU Group. Other MCUs may have different default values and available configuration settings.

ELC HAL Module Clock Configuration

The ELC HAL module does not require a specific clock configuration.

ELC HAL Module Pin Configuration

There are no pins associated directly with the ELC HAL Module that require configuration.

Using the ELC HAL Module in an Application

The typical steps in using the ELC HAL module in an application are:

  1. Initialize the ELC using the elc_api_t::init and enable APIs (automatically done by ISDE).
  2. Link a peripheral with an event using elc_api_t::linkSet API.
  3. Enable the linkage with the elc_api_t::enable API.

These common steps are illustrated in a typical operational flow diagram in the following figure:

ELC_TA.png
Flow Diagram of a Typical ELC HAL Module Application