ethernut5_pwrman.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * (C) Copyright 2011
  3. * egnite GmbH <info@egnite.de>
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. /*
  24. * Ethernut 5 power management support
  25. *
  26. * For additional information visit the project home page at
  27. * http://www.ethernut.de/
  28. */
  29. /* I2C address of the PMC */
  30. #define PWRMAN_I2C_ADDR 0x22
  31. /* PMC registers */
  32. #define PWRMAN_REG_VERS 0 /* Version register */
  33. #define PWRMAN_REG_STA 1 /* Feature status register */
  34. #define PWRMAN_REG_ENA 2 /* Feature enable register */
  35. #define PWRMAN_REG_DIS 3 /* Feature disable register */
  36. #define PWRMAN_REG_TEMP 4 /* Board temperature */
  37. #define PWRMAN_REG_VAUX 6 /* Auxiliary input voltage */
  38. #define PWRMAN_REG_LEDCTL 8 /* LED blinking timer. */
  39. /* Feature flags used in status, enable and disable registers */
  40. #define PWRMAN_BOARD 0x01 /* 1.8V and 3.3V supply */
  41. #define PWRMAN_VBIN 0x02 /* VBUS input at device connector */
  42. #define PWRMAN_VBOUT 0x04 /* VBUS output at host connector */
  43. #define PWRMAN_MMC 0x08 /* Memory card supply */
  44. #define PWRMAN_RS232 0x10 /* RS-232 driver shutdown */
  45. #define PWRMAN_ETHCLK 0x20 /* Ethernet clock enable */
  46. #define PWRMAN_ETHRST 0x40 /* Ethernet PHY reset */
  47. #define PWRMAN_WAKEUP 0x80 /* RTC wake-up */
  48. /* Features, which are not essential to keep u-boot alive */
  49. #define PWRMAN_DISPENSIBLE (PWRMAN_VBOUT | PWRMAN_MMC | PWRMAN_ETHCLK)
  50. /* Enable Ethernut 5 power management. */
  51. extern void ethernut5_power_init(void);
  52. /* Reset Ethernet PHY. */
  53. extern void ethernut5_phy_reset(void);
  54. extern void ethernut5_print_version(void);
  55. #ifdef CONFIG_CMD_BSP
  56. extern void ethernut5_print_power(void);
  57. extern void ethernut5_print_celsius(void);
  58. extern void ethernut5_print_voltage(void);
  59. #endif