mirror of
https://github.com/No-Chicken/Power-Pico.git
synced 2026-04-03 13:02:36 +08:00
加入API
This commit is contained in:
@@ -171,7 +171,7 @@ bool fusb302_timer(void)
|
|||||||
|
|
||||||
bool is_power_ready(void) { return app_pd.status_power == STATUS_POWER_TYP; }
|
bool is_power_ready(void) { return app_pd.status_power == STATUS_POWER_TYP; }
|
||||||
bool is_PPS_ready(void) { return app_pd.status_power == STATUS_POWER_PPS; }
|
bool is_PPS_ready(void) { return app_pd.status_power == STATUS_POWER_PPS; }
|
||||||
|
void send_power_request(void) { app_pd.send_request = 1; }
|
||||||
|
|
||||||
uint8_t fusb302_dev_init(void) {
|
uint8_t fusb302_dev_init(void) {
|
||||||
fusb302_dev.i2c_address = 0x22<<1; // FUSB302 I2C address
|
fusb302_dev.i2c_address = 0x22<<1; // FUSB302 I2C address
|
||||||
|
|||||||
@@ -38,10 +38,15 @@ enum {
|
|||||||
};
|
};
|
||||||
typedef uint8_t status_power_t;
|
typedef uint8_t status_power_t;
|
||||||
|
|
||||||
|
enum {
|
||||||
|
PD_SYS_STATE_INIT = 0,
|
||||||
|
PD_SYS_STATE_READY,
|
||||||
|
PD_SYS_STATE_ERROR
|
||||||
|
};
|
||||||
|
typedef uint8_t PD_user_state_t;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
uint8_t state;
|
|
||||||
//uint8_t pd_ic_initial;
|
|
||||||
PD_protocol_t protocol;
|
PD_protocol_t protocol;
|
||||||
|
|
||||||
// Power ready power
|
// Power ready power
|
||||||
@@ -77,6 +82,9 @@ extern App_PD_t app_pd;
|
|||||||
|
|
||||||
uint8_t fusb302_dev_init(void);
|
uint8_t fusb302_dev_init(void);
|
||||||
void handle_FUSB302_event(FUSB302_event_t events);
|
void handle_FUSB302_event(FUSB302_event_t events);
|
||||||
|
bool is_power_ready(void);
|
||||||
|
bool is_PPS_ready(void);
|
||||||
|
void send_power_request(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user