TOG Safety Example
==================

Introduction
------------

This example demonstrates the usage of the TOG module. The example shows how to listen for TOG error events using the ESM, and also forcing an error in order to demonstrate application notification of a timeout event.

The example demonstrates:

    * Setting a timeout for TOG instance
    * Error injection for an TOG instance
    * Error event detection for a timeout event

Use Cases
---------

    +----------+--------------------------------------------------+-----------+
    | Use Case | Description                                      | ESM       |
    +==========+==================================================+===========+
    | UC-1     | The TOG is programmed with a timeout that is     | MCU_ESM0  |
    |          | small enough to trigger a timeout event on any   |           |
    |          | access.                                          |           |
    |          | Error event is triggered and application is      |           |
    |          | notified of the event.                           |           |
    +----------+--------------------------------------------------+-----------+


Example Details
---------------

The example should be loaded to the hardware using the Secondary Boot Loader (SBL) from the SDK.

+---------------------+------------------------------------------------+------------------------------------------+
| Example Name        | Location                                       | Build Command                            |
+=====================+================================================+==========================================+
| tog_app             | [sdl_install_dir]/examples/tog/                | make tog_app PROFILE=release             |
+---------------------+------------------------------------------------+------------------------------------------+

Expected Output
---------------

.. code:: bash

    TOG Sample Example 
    
     Demo for minimum value timeout 
    
    ECC_Test_init: Init MCU ESM complete 
    
    SDL_TOG_setIntrEnable complete 
    
    SDL_TOG_init.timeout complete 
    
    SDL_TOG_start complete 
     
      TOG_eventHandler  
    
      ESM Call back function called : instType 0x2, intType 0x1, grpChannel 0x2, index 0xd, intSrc 0x4d 
      Take action 
    
    SDL_TOG_stop complete 
    tog_main.c:182:tog_example_app:PASS
    
    -----------------------
    1 Tests 0 Failures 0 Ignored



Reference
---------

`TOG User Guide <../modules/tog.html>`_
