diff options
Diffstat (limited to 'firmware/target/arm/ascodec-target.h')
-rw-r--r-- | firmware/target/arm/ascodec-target.h | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/firmware/target/arm/ascodec-target.h b/firmware/target/arm/ascodec-target.h index c87d869ebb..68d9905a6b 100644 --- a/firmware/target/arm/ascodec-target.h +++ b/firmware/target/arm/ascodec-target.h | |||
@@ -59,14 +59,19 @@ static inline void ascodec_unlock(void) | |||
59 | i2c_unlock(); | 59 | i2c_unlock(); |
60 | } | 60 | } |
61 | 61 | ||
62 | static inline void ascodec_enable_endofch_irq(void) | 62 | static inline bool ascodec_chg_status(void) |
63 | { | 63 | { |
64 | ascodec_write(AS3514_IRQ_ENRD0, IRQ_ENDOFCH); | 64 | return ascodec_read(AS3514_IRQ_ENRD0) & CHG_STATUS; |
65 | } | ||
66 | |||
67 | static inline bool ascodec_endofch(void) | ||
68 | { | ||
69 | return ascodec_read(AS3514_IRQ_ENRD0) & CHG_ENDOFCH; | ||
65 | } | 70 | } |
66 | 71 | ||
67 | static inline void ascodec_disable_endofch_irq(void) | 72 | static inline void ascodec_monitor_endofch(void) |
68 | { | 73 | { |
69 | ascodec_write(AS3514_IRQ_ENRD0, 0); | 74 | ascodec_write(AS3514_IRQ_ENRD0, IRQ_ENDOFCH); |
70 | } | 75 | } |
71 | 76 | ||
72 | static inline void ascodec_wait_adc_finished(void) | 77 | static inline void ascodec_wait_adc_finished(void) |
@@ -81,6 +86,16 @@ static inline void ascodec_wait_adc_finished(void) | |||
81 | */ | 86 | */ |
82 | } | 87 | } |
83 | 88 | ||
89 | static inline void ascodec_write_charger(int value) | ||
90 | { | ||
91 | ascodec_write(AS3514_CHARGER, value); | ||
92 | } | ||
93 | |||
94 | static inline int ascodec_read_charger(void) | ||
95 | { | ||
96 | return ascodec_read(AS3514_CHARGER); | ||
97 | } | ||
98 | |||
84 | extern void ascodec_suppressor_on(bool on); | 99 | extern void ascodec_suppressor_on(bool on); |
85 | 100 | ||
86 | #endif /* CPU_PP */ | 101 | #endif /* CPU_PP */ |