aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/e300/rev_c/power.h
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2014-10-07 11:32:14 +0200
committerMartin Braun <martin.braun@ettus.com>2014-10-07 12:09:33 +0200
commit1b149f561370687ad65e3aa644a402f00dbd16ea (patch)
treeab86042840fa1369d64bca56c5f3a64d1a4f1f72 /firmware/e300/rev_c/power.h
parentfd3e84941de463fa1a7ebab0a69515b4bf2614cd (diff)
downloaduhd-1b149f561370687ad65e3aa644a402f00dbd16ea.tar.gz
uhd-1b149f561370687ad65e3aa644a402f00dbd16ea.tar.bz2
uhd-1b149f561370687ad65e3aa644a402f00dbd16ea.zip
Initial commit E300 support.
Diffstat (limited to 'firmware/e300/rev_c/power.h')
-rw-r--r--firmware/e300/rev_c/power.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/firmware/e300/rev_c/power.h b/firmware/e300/rev_c/power.h
new file mode 100644
index 000000000..453633414
--- /dev/null
+++ b/firmware/e300/rev_c/power.h
@@ -0,0 +1,58 @@
+#ifndef POWER_H
+#define POWER_H
+
+#include <stdbool.h>
+#include <stdint.h>
+
+void tps54478_init(bool enable);
+void tps54478_set_power(bool on); // Zynq core power (1.0V for FPGA)
+bool tps54478_is_power_good(void);
+
+void charge_set_led(bool on); // Here for error blink codes
+void charge_notify(bool charging);
+
+void power_signal_interrupt(void);
+
+void fpga_reset(bool delay);
+
+typedef enum power_subsystems {
+ PS_UNKNOWN,
+ PS_FPGA,
+ PS_VDRAM,
+ PS_PERIPHERALS_1_8,
+ PS_PERIPHERALS_3_3,
+ PS_TX,
+ PS_MAX
+} power_subsystem_t;
+
+enum Regulators
+{
+ REG_UNKNOWN,
+ REG_TPS54478,
+ REG_LTC3675
+};
+
+bool power_enable(power_subsystem_t subsys, bool on);
+
+void battery_init(void);
+uint16_t battery_get_voltage(void); // mV
+
+bool power_init(void);
+bool power_on(void);
+uint8_t power_off(void);
+
+//bool power_is_subsys_on(int8_t index);
+bool power_is_subsys_on(power_subsystem_t index);
+//int8_t power_get_regulator_index(uint8_t device, uint8_t address);
+//bool ltc3675_reg_helper(uint8_t address);
+
+void usbhub_reset(void);
+
+#ifndef I2C_REWORK
+#include "io.h"
+
+extern io_pin_t PWR_SDA;
+extern io_pin_t PWR_SCL;
+#endif // I2C_REWORK
+
+#endif // POWER_H