Indicators.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*****************************************************************
  2. *****************************************************************
  3. *** **
  4. *** (C)Copyright 2005-2006, American Megatrends Inc. **
  5. *** **
  6. *** All Rights Reserved. **
  7. *** **
  8. *** 6145-F, Northbelt Parkway, Norcross, **
  9. *** **
  10. *** Georgia - 30071, USA. Phone-(770)-246-8600. **
  11. *** **
  12. *****************************************************************
  13. *****************************************************************
  14. ******************************************************************
  15. *
  16. * Indicators.h
  17. * Beep & LED functionalities.
  18. *
  19. * Author: Govind Kothandapani <govindk@ami.com>
  20. ******************************************************************/
  21. #ifndef INDICATORS_H
  22. #define INDICATORS_H
  23. #include "Types.h"
  24. #define MAX_LED_NUM 32
  25. #define LED_TASK_INTERVAL_MS 125
  26. #define LED_PATTERN_OFF 0x0000 /* steady off */
  27. #define LED_PATTERN_ON 0xffff /* steady on */
  28. #define LED_PATTERN_STANDBY_BLINK 0x8000 /* 100ms on 2900ms off */
  29. #define LED_PATTERN_SLOW_BLINK 0xf0f0 /* 1HZ */
  30. #define LED_PATTERN_FAST_BLINK 0x5555 /* 4HZ */
  31. #define LED_PATTERN_1_HZ 0xf0f0 /* 1HZ */
  32. #define LED_PATTERN_2_HZ 0xcccc /* 2HZ */
  33. #pragma pack(1)
  34. typedef struct
  35. {
  36. INT8U Enable;
  37. INT8U LEDNum;
  38. INT16U Pattern;
  39. INT16U NumSec;
  40. INT8U CurBit;
  41. INT32U Count;
  42. } PACKED IndicatorInfo_T;
  43. #pragma pack()
  44. /**
  45. * @brief Start a particular LED to glow by a certain Pattern for N sec.
  46. * @param LEDNum - LED number to glow.
  47. * @param Pattern - Pattern for glowing.
  48. * @param NumSec - No of seconds to glow.
  49. **/
  50. extern INT8U GlowLED (INT8U LEDNum, INT16U Pattern, INT16U NumSec, int BMCInst);
  51. /**
  52. * @brief Return Enable flag for particular LED
  53. * @param LEDNum - LED number to lookup.
  54. **/
  55. extern BOOL GetLEDEnabled (INT8U LEDNum, int BMCInst);
  56. /**
  57. * @brief Return blink pattern for particular LED
  58. * @param LEDNum - LED number to lookup.
  59. **/
  60. extern INT16U GetLEDPattern (INT8U LEDNum, int BMCInst);
  61. /**
  62. * @brief Generates Beeps in a specified pattern for N sec.
  63. * @param Pattern - Pattern for Beep.
  64. * @param NumSec - No of seconds to Beep.
  65. **/
  66. extern INT8U GenerateBeep (INT16U Pattern, INT16U NumSec, int BMCInst);
  67. /**
  68. * @brief Monitors LED & Beep in a specified pattern for N sec.
  69. **/
  70. extern void MoniterIndicators (int BMCInst);
  71. #endif /* INDICATORS_H */