ethernut5_pwrman.h 1.6 KB

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