lpc_bod.h 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /**********************************************************************
  2. * $Id$ lpc_bod.h 2011-12-09
  3. *//**
  4. * @file lpc_bod.h
  5. * @brief Contain definitions & functions related to BOD.
  6. * @version 1.0
  7. * @date 09 December. 2011
  8. * @author NXP MCU SW Application Team
  9. *
  10. * Copyright(C) 2011, NXP Semiconductor
  11. * All rights reserved.
  12. *
  13. ***********************************************************************
  14. * Software that is described herein is for illustrative purposes only
  15. * which provides customers with programming information regarding the
  16. * products. This software is supplied "AS IS" without any warranties.
  17. * NXP Semiconductors assumes no responsibility or liability for the
  18. * use of the software, conveys no license or title under any patent,
  19. * copyright, or mask work right to the product. NXP Semiconductors
  20. * reserves the right to make changes in the software without
  21. * notification. NXP Semiconductors also make no representation or
  22. * warranty that such application will be suitable for the specified
  23. * use without further testing or modification.
  24. * Permission to use, copy, modify, and distribute this software and its
  25. * documentation is hereby granted, under NXP Semiconductors'
  26. * relevant copyright in the software, without fee, provided that it
  27. * is used in conjunction with NXP Semiconductors microcontrollers. This
  28. * copyright, permission, and disclaimer notice must appear in all copies of
  29. * this code.
  30. **********************************************************************/
  31. /* Peripheral group ----------------------------------------------------------- */
  32. /** @defgroup BOD BOD (Brown-Out Detector)
  33. * @ingroup LPC_CMSIS_FwLib_Drivers
  34. * @{
  35. */#ifndef __LPC_BOD_H
  36. #define __LPC_BOD_H
  37. #include "lpc_types.h"
  38. /** @defgroup BOD_Private_Macros BOD Private Macros
  39. * @{
  40. */
  41. /* --------------------- BIT DEFINITIONS -------------------------------------- */
  42. /**********************************************************************
  43. ** Power Mode Control register definitions
  44. **********************************************************************/
  45. #define BOD_PCON_BODRPM (0x01 << 2)
  46. #define BOD_PCON_BOGD (0x01 << 3)
  47. #define BOD_PCON_BORD (0x01 << 4)
  48. /**********************************************************************
  49. ** Reset Source Identification Register definitions
  50. **********************************************************************/
  51. #define BOD_RSID_POR (0x01 << 0)
  52. #define BOD_RSID_BODR (0x01 << 3)
  53. /**
  54. * @}
  55. */
  56. /** @defgroup BOD_Public_Types BOD Public Types
  57. * @{
  58. */
  59. /**
  60. * @brief The field to configurate BOD
  61. */
  62. typedef struct
  63. {
  64. uint8_t Enabled; /**< Enable BOD Circuit */
  65. uint8_t PowerReduced; /**< if ENABLE, BOD will be turned off in Power-down mode or Deep Sleep mode */
  66. /**< So, BOD can't be used to wake-up from these mode. */
  67. uint8_t ResetOnVoltageDown; /**< if ENABLE, reset the device when the VDD(REG)(3V3) voltage < the BOD reset trip level */
  68. }BOD_Config_Type;
  69. /**
  70. * @}
  71. */
  72. /* Public Functions ----------------------------------------------------------- */
  73. /** @defgroup BOD_Public_Functions BOD Public Functions
  74. * @{
  75. */
  76. void BOD_Init( BOD_Config_Type* pConfig );
  77. int32_t BOD_ResetSourceStatus(void);
  78. void BOD_ResetSourceClr(void);
  79. /**
  80. * @}
  81. */
  82. #endif /* end __LPC_BOD_H */
  83. /**
  84. * @}
  85. */
  86. /*****************************************************************************
  87. ** End Of File
  88. ******************************************************************************/