You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
77 lines
1.4 KiB
77 lines
1.4 KiB
/**
|
|
******************************************************************************
|
|
* @copyright Copyright (C), 2016-2022, ConvenientPower. Co., Ltd.
|
|
* @file bc.h
|
|
* @version 1.0
|
|
* @author qing.cheng
|
|
* @date 2022-11-09
|
|
* @brief Header file of BC_H module.
|
|
******************************************************************************
|
|
*/
|
|
#ifndef _BC_H_
|
|
#define _BC_H_
|
|
|
|
|
|
#include "core_comm.h"
|
|
#include "stdbool.h"
|
|
#include "drv_dpdn.h"
|
|
#include "comp_config.h"
|
|
#define DELAY_1P15S 1150
|
|
|
|
|
|
#define bc_entry_staus 0
|
|
#define bc_exit_staus 1
|
|
|
|
typedef struct bc_timer_s
|
|
{
|
|
uint8_t en;
|
|
uint16_t word;
|
|
} bc_timer_s;
|
|
|
|
|
|
typedef union bc_process_flag_u
|
|
{
|
|
uint8_t word;
|
|
struct
|
|
{
|
|
uint8_t outtimerflag: 1;
|
|
uint8_t dcp_role: 1;
|
|
uint8_t resived: 6;
|
|
} bit;
|
|
} bc_process_flag_u;
|
|
|
|
|
|
typedef struct bc_param_s
|
|
{
|
|
bc_timer_s bc_timer;
|
|
bc_process_flag_u process_flag;
|
|
|
|
} bc_param_s;
|
|
|
|
/*
|
|
* @brief usb_bc_init
|
|
* @param port
|
|
* @param bc_param
|
|
* @note
|
|
* @retval
|
|
*/
|
|
void usb_bc_init(uint8_t port, bc_param_s *bc_param);
|
|
/*
|
|
* @brief bc_timer_func
|
|
* @param port
|
|
* @param bc_param
|
|
* @note
|
|
* @retval
|
|
*/
|
|
void bc_timer_func(uint8_t port, bc_param_s *bc_param);
|
|
|
|
/*
|
|
* @brief bc_dcp_recognition £¨BC1.2 dpÀ¸ßʶ±ð¼ì²â£©
|
|
* @param port
|
|
* @param bc_param
|
|
* @note
|
|
* @retval
|
|
*/
|
|
void bc_dcp_recognition(uint8_t port, bc_param_s *bc_param);
|
|
|
|
#endif
|
|
|