at91_shdwc.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * File : at91_shdwc.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006, RT-Thread Develop Team
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. *
  20. * Change Logs:
  21. * Date Author Notes
  22. * 2011-01-13 weety first version
  23. */
  24. #ifndef AT91_SHDWC_H
  25. #define AT91_SHDWC_H
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. #define AT91_SHDW_CR (AT91_SHDWC + 0x00) /* Shut Down Control Register */
  30. #define AT91_SHDW_SHDW (1 << 0) /* Shut Down command */
  31. #define AT91_SHDW_KEY (0xa5 << 24) /* KEY Password */
  32. #define AT91_SHDW_MR (AT91_SHDWC + 0x04) /* Shut Down Mode Register */
  33. #define AT91_SHDW_WKMODE0 (3 << 0) /* Wake-up 0 Mode Selection */
  34. #define AT91_SHDW_WKMODE0_NONE 0
  35. #define AT91_SHDW_WKMODE0_HIGH 1
  36. #define AT91_SHDW_WKMODE0_LOW 2
  37. #define AT91_SHDW_WKMODE0_ANYLEVEL 3
  38. #define AT91_SHDW_CPTWK0 (0xf << 4) /* Counter On Wake Up 0 */
  39. #define AT91_SHDW_CPTWK0_(x) ((x) << 4)
  40. #define AT91_SHDW_RTTWKEN (1 << 16) /* Real Time Timer Wake-up Enable */
  41. #define AT91_SHDW_SR (AT91_SHDWC + 0x08) /* Shut Down Status Register */
  42. #define AT91_SHDW_WAKEUP0 (1 << 0) /* Wake-up 0 Status */
  43. #define AT91_SHDW_RTTWK (1 << 16) /* Real-time Timer Wake-up */
  44. #define AT91_SHDW_RTCWK (1 << 17) /* Real-time Clock Wake-up [SAM9RL] */
  45. #ifdef __cplusplus
  46. }
  47. #endif
  48. #endif