typedef struct
{
union
{
__IO uint16_t CTRL1;
struct
{
UINT16 cc1_connect_flg :1;
UINT16 cc3_connect_flg :1;
UINT16 pre_cc1_connect_flg :1;
UINT16 pre_cc3_connect_flg :1;
UINT16 init_cc1_sink_flg:1;
UINT16 init_cc3_sink_flg:1;
UINT16 init_cc3_source_flg:1;
UINT16 pre_init_cc1_sink_flg:1;
UINT16 pre_init_cc3_sink_flg:1;
UINT16 pre_init_cc3_source_flg:1;
UINT16 cc1_detect_flg:1;
UINT16 cc3_detect_flg:1;
UINT16 cc1_get_power_ADC_ok_flg:1;
UINT16 get_key_start_flg:1;
UINT16 get_key_ok_flg:1;
};
};
union
{
__IO uint16_t CTRL2;
struct
{
UINT16 cc3_pd_run_mode :4;
UINT16 cc1_pd_run_flg :1;
UINT16 get_sop1_flg :1;
UINT16 cc1_get_source_cap_flg :1;
UINT16 cc1_get_rdy_flg :1;
UINT16 cc3_get_request_flg :1;
UINT16 reverse:7;
};
};
uint8_t adapter_src_cap_len;
}G_PD_CTRL;
联合体中的两个结构体成员,公用同一段内存,使用时需注意。