ethernut5_pwrman.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * (C) Copyright 2011
  3. * egnite GmbH <info@egnite.de>
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. /*
  8. * Ethernut 5 power management support
  9. *
  10. * For additional information visit the project home page at
  11. * http://www.ethernut.de/
  12. */
  13. /* I2C address of the PMC */
  14. #define PWRMAN_I2C_ADDR 0x22
  15. /* PMC registers */
  16. #define PWRMAN_REG_VERS 0 /* Version register */
  17. #define PWRMAN_REG_STA 1 /* Feature status register */
  18. #define PWRMAN_REG_ENA 2 /* Feature enable register */
  19. #define PWRMAN_REG_DIS 3 /* Feature disable register */
  20. #define PWRMAN_REG_TEMP 4 /* Board temperature */
  21. #define PWRMAN_REG_VAUX 6 /* Auxiliary input voltage */
  22. #define PWRMAN_REG_LEDCTL 8 /* LED blinking timer. */
  23. /* Feature flags used in status, enable and disable registers */
  24. #define PWRMAN_BOARD 0x01 /* 1.8V and 3.3V supply */
  25. #define PWRMAN_VBIN 0x02 /* VBUS input at device connector */
  26. #define PWRMAN_VBOUT 0x04 /* VBUS output at host connector */
  27. #define PWRMAN_MMC 0x08 /* Memory card supply */
  28. #define PWRMAN_RS232 0x10 /* RS-232 driver shutdown */
  29. #define PWRMAN_ETHCLK 0x20 /* Ethernet clock enable */
  30. #define PWRMAN_ETHRST 0x40 /* Ethernet PHY reset */
  31. #define PWRMAN_WAKEUP 0x80 /* RTC wake-up */
  32. /* Features, which are not essential to keep u-boot alive */
  33. #define PWRMAN_DISPENSIBLE (PWRMAN_VBOUT | PWRMAN_MMC | PWRMAN_ETHCLK)
  34. /* Enable Ethernut 5 power management. */
  35. extern void ethernut5_power_init(void);
  36. /* Reset Ethernet PHY. */
  37. extern void ethernut5_phy_reset(void);
  38. extern void ethernut5_print_version(void);
  39. #ifdef CONFIG_CMD_BSP
  40. extern void ethernut5_print_power(void);
  41. extern void ethernut5_print_celsius(void);
  42. extern void ethernut5_print_voltage(void);
  43. #endif