#ifndef _LED_DEFINITION_H_
#define _LED_DEFINITION_H_

#ifndef SYS_LED
#define SYS_LED 0x2A
#endif
#ifndef WAN_LED
#define WAN_LED 0x2b
#endif
#ifndef LAN1_LED
#define LAN1_LED 0x2a
#endif
#ifndef LAN2_LED
#define LAN2_LED 0x29
#endif
#ifndef LAN3_LED
#define LAN3_LED 0x28
#endif
#ifndef LAN4_LED
#define LAN4_LED 0x27
#endif
#ifndef EXT1_LED
#define EXT1_LED 0xff
#endif
#ifndef EXT2_LED
#define EXT2_LED 0xff
#endif

#if ((defined(EXT3_LED) && EXT3_LED != 0xff) \
 || (defined(EXT4_LED) && EXT4_LED != 0xff) \
 || (defined(EXT5_LED) && EXT5_LED != 0xff) \
 || (defined(EXT6_LED) && EXT6_LED != 0xff) \
 || (defined(EXT7_LED) && EXT7_LED != 0xff) \
 || (defined(EXT8_LED) && EXT8_LED != 0xff) \
 || (defined(EXT9_LED) && EXT9_LED != 0xff) \
 || (defined(EXT10_LED) && EXT10_LED != 0xff))
#define EXT_LED_GPIO
#ifndef EXT3_LED
#define EXT3_LED 0xff
#endif
#ifndef EXT4_LED
#define EXT4_LED 0xff
#endif
#ifndef EXT5_LED
#define EXT5_LED 0xff
#endif
#ifndef EXT6_LED
#define EXT6_LED 0xff
#endif
#ifndef EXT7_LED
#define EXT7_LED 0xff
#endif
#ifndef EXT8_LED
#define EXT8_LED 0xff
#endif
#ifndef EXT9_LED
#define EXT9_LED 0xff
#endif
#ifndef EXT10_LED
#define EXT10_LED 0xff
#endif
#endif

#ifndef SYS_LED_INV       
#define SYS_LED_POLARITY 0
#else
#define SYS_LED_POLARITY 1
#endif

#ifndef WAN_LED_INV
#define WAN_LED_POLARITY 0
#else         
#define WAN_LED_POLARITY 1
#endif

#ifndef LAN1_LED_INV
#define LAN1_LED_POLARITY 0
#else          
#define LAN1_LED_POLARITY 1
#endif
               
#ifndef LAN2_LED_INV
#define LAN2_LED_POLARITY 0
#else          
#define LAN2_LED_POLARITY 1
#endif
               
#ifndef LAN3_LED_INV
#define LAN3_LED_POLARITY 0
#else          
#define LAN3_LED_POLARITY 1
#endif
               
#ifndef LAN4_LED_INV
#define LAN4_LED_POLARITY 0
#else          
#define LAN4_LED_POLARITY 1
#endif
               
#ifndef EXT1_LED_INV       
#define EXT1_LED_POLARITY 0
#else          
#define EXT1_LED_POLARITY 1
#endif
               
#ifndef EXT2_LED_INV
#define EXT2_LED_POLARITY 0
#else          
#define EXT2_LED_POLARITY 1
#endif
               
#ifndef EXT3_LED_INV
#define EXT3_LED_POLARITY 0
#else          
#define EXT3_LED_POLARITY 1
#endif
               
#ifndef EXT4_LED_INV
#define EXT4_LED_POLARITY 0
#else          
#define EXT4_LED_POLARITY 1
#endif
               
#ifndef EXT5_LED_INV
#define EXT5_LED_POLARITY 0
#else          
#define EXT5_LED_POLARITY 1
#endif
               
#ifndef EXT6_LED_INV
#define EXT6_LED_POLARITY 0
#else          
#define EXT6_LED_POLARITY 1
#endif
               
#ifndef EXT7_LED_INV
#define EXT7_LED_POLARITY 0
#else          
#define EXT7_LED_POLARITY 1
#endif
               
#ifndef EXT8_LED_INV
#define EXT8_LED_POLARITY 0
#else          
#define EXT8_LED_POLARITY 1
#endif
               
#ifndef EXT9_LED_INV
#define EXT9_LED_POLARITY 0
#else          
#define EXT9_LED_POLARITY 1
#endif
               
#ifndef EXT10_LED_INV
#define EXT10_LED_POLARITY 0
#else            
#define EXT10_LED_POLARITY 1
#endif

#define GPIO_POLARITY ( (SYS_LED_POLARITY<<0) | (WAN_LED_POLARITY<<1) | (LAN1_LED_POLARITY<<2) | (LAN2_LED_POLARITY<<3) \
						| (LAN3_LED_POLARITY<<4) | (LAN4_LED_POLARITY<<5) | (EXT1_LED_POLARITY<<6) | (EXT2_LED_POLARITY<<7) \
						| (EXT3_LED_POLARITY<<8) | (EXT4_LED_POLARITY<<9) | (EXT5_LED_POLARITY<<10) | (EXT6_LED_POLARITY<<11) \
						| (EXT7_LED_POLARITY<<12) | (EXT8_LED_POLARITY<<13) | (EXT9_LED_POLARITY<<14) | (EXT10_LED_POLARITY<<15) )

#endif //#ifndef _LED_DEFINITION_H_