board/lgvr/usb_pd_config.h
/* Drive the CC line from the TX block */
Drive the CC line from the TX block
Drive the CC line from the TX block
static inline void pd_tx_enable(int port, int polarity)
{
	if (polarity) {
		gpio_set_level(GPIO_LED_R_L, 0);
		gpio_set_level(GPIO_LED_G_L, 1);
		gpio_set_level(GPIO_LED_B_L, 1);
	}
		gpio_set_alternate_function(GPIO_A, 0x0040, 0);
		gpio_set_alternate_function(GPIO_B, 0x0010, 0);
		STM32_GPIO_MODER(GPIO_A) = (STM32_GPIO_MODER(GPIO_A)
				& ~(3 << (2*1))) 
				|  (1 << (2*1)); 
		gpio_set_level(GPIO_CC1_PD, 0);
}
static inline void pd_tx_enable ( int port , int polarity ) { if ( polarity ) { gpio_set_level ( GPIO_LED_R_L , 0 ) ; gpio_set_level ( GPIO_LED_G_L , 1 ) ; gpio_set_level ( GPIO_LED_B_L , 1 ) ; } gpio_set_alternate_function ( GPIO_A , 0x0040 , 0 ) ; gpio_set_alternate_function ( GPIO_B , 0x0010 , 0 ) ; STM32_GPIO_MODER ( GPIO_A ) = ( STM32_GPIO_MODER ( GPIO_A ) & ~ ( 3 << ( 2 * 1 ) ) ) | ( 1 << ( 2 * 1 ) ) ; gpio_set_level ( GPIO_CC1_PD , 0 ) ; }
Drive the CC line from the TX block
Drive the CC line from the TX block
// from lucid board /* put SPI function on TX pin */ /* USB_C0_CC2_TX_DATA: PA6 is SPI1 MISO */ /* USB_C0_CC1_TX_DATA: PB4 is SPI1 MISO */ /* MCU ADC PA1 pin output low */ /* PA1 disable ADC */ /* Set as GPO */