/******************************************************************************    
 * FILE PURPOSE:     - LED config Header                                       
 ******************************************************************************    
 * FILE NAME:     led_config.h                                                        
 *                                                                                 
 * DESCRIPTION:  Header file for LED configuration parameters
 *               and data structures                                                 
 *                                                                                 
 * REVISION HISTORY:                                                               
 * 11 Oct 03 - PSP TII                                                             
 *                                                                                 
 * (C) Copyright 2002, Texas Instruments, Inc                                      
 *******************************************************************************/  
                                                                                   

#ifndef __LED_CONFIG__
#define __LED_CONFIG__

/* LED config parameters */
#define  MAX_GPIO_PIN_NUM           64
#define  MAX_GPIOS_PER_STATE         5
#define  MAX_MODULE_ENTRIES         25
#define  MAX_MODULE_INSTANCES        4
#define  MAX_STATE_ENTRIES          25
#define  MAX_LED_ENTRIES            25


/* LED modes */
#define LED_OFF                    0
#define LED_ON                     1
#define LED_ONESHOT_OFF            2
#define LED_ONESHOT_ON             3
#define LED_FLASH                  4
#define LED_BLINK_CODE0            5    /*--- param1: on time, param2: blink nr , (param2 > 100 blink off) ---*/
#define LED_BLINK_CODE1            6 
#define LED_BLINK_CODE2            7 

#define NUM_LED_MODES              8



/* Data structure for LED configuration */
typedef struct led_config {
    char name[80];
    unsigned int instance;
    unsigned int state;
    unsigned int gpio[MAX_GPIOS_PER_STATE];
    unsigned int mode[MAX_GPIOS_PER_STATE];
    unsigned int gpio_num;
    unsigned int param1;
    unsigned int param2;
    unsigned int event_id;
    char event_name[80];
} LED_CONFIG_T;

/*------------------------------------------------------------------------------------------*\
\*------------------------------------------------------------------------------------------*/
#if defined(CONFIG_LED_REMAP)
#define CONFIG_LED_STATE_MEMORY     20
#define CONFIG_LED_REMAP_STATES     10

/*------------------------------------------------------------------------------------------*\
 * DEBUG FLAGS
 *  0x01  push pop states
 *  0x02  register remap led
 *  0x04  remap check (all)
 *  0x08  remap check (match)
 *  0x10  led register
\*------------------------------------------------------------------------------------------*/
#define CONFIG_LED_STATE_MEMORY_DEBUG 0

/*------------------------------------------------------------------------------------------*\
\*------------------------------------------------------------------------------------------*/
struct _remap_led_table {
    unsigned int in_use;        /* true fuer aktivieren, false fuer deaktivieren */
    void *from_module;          /* handle welches durch register_module erhalten wurde */
    void *to_module;            /* handle welches durch register_module erhalten wurde */
    unsigned int remapped_only; /* true wenn original LED nicht mehr angesteuert werden soll */
    unsigned int from_state[CONFIG_LED_REMAP_STATES];
    unsigned int to_state[CONFIG_LED_REMAP_STATES];
};
#endif /*--- #if defined(CONFIG_LED_REMAP) ---*/


#endif /* __LED_CONFIG__ */
