diff options
Diffstat (limited to 'board/zinger/usb_pd_config.h')
-rw-r--r-- | board/zinger/usb_pd_config.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/board/zinger/usb_pd_config.h b/board/zinger/usb_pd_config.h index 0900f51a05..dac4bf2c63 100644 --- a/board/zinger/usb_pd_config.h +++ b/board/zinger/usb_pd_config.h @@ -29,7 +29,7 @@ static inline void spi_enable_clock(void) #define TIM_CCR_IDX 1 /* connect TIM3 CH1 to TIM3_CH2 input */ #define TIM_CCR_CS 2 -#define EXTI_COMP 7 +#define EXTI_COMP_MASK (1 << 7) #define IRQ_COMP STM32_IRQ_EXTI4_15 /* the RX is inverted, triggers on rising edge */ #define EXTI_XTSR STM32_EXTI_RTSR @@ -44,7 +44,7 @@ static inline void pd_set_pins_speed(void) } /* Drive the CC line from the TX block */ -static inline void pd_tx_enable(void) +static inline void pd_tx_enable(int polarity) { /* Drive TX GND on PA4 */ STM32_GPIO_BSRR(GPIO_A) = 1 << (4 + 16 /* Reset */); @@ -53,7 +53,7 @@ static inline void pd_tx_enable(void) } /* Put the TX driver in Hi-Z state */ -static inline void pd_tx_disable(void) +static inline void pd_tx_disable(int polarity) { /* Put TX GND (PA4) in Hi-Z state */ STM32_GPIO_BSRR(GPIO_A) = 1 << 4 /* Set */; @@ -61,6 +61,12 @@ static inline void pd_tx_disable(void) STM32_GPIO_MODER(GPIO_A) &= ~(0x3 << (2*6)); } +/* we know the plug polarity, do the right configuration */ +static inline void pd_select_polarity(int polarity) +{ + /* captive cable : no polarity */ +} + /* Initialize pins used for TX and put them in Hi-Z */ static inline void pd_tx_init(void) { |