Remove USB pull-up code
This commit is contained in:
parent
3ca6ea3e9e
commit
fc91c5a032
3 changed files with 4 additions and 12 deletions
|
|
@ -1 +1 @@
|
|||
434
|
||||
436
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
#define PIN_UART_RX 10 // PA10 - USART1_RX
|
||||
#define PIN_USB_DM 11 // PA11 - USB_DM
|
||||
#define PIN_USB_DP 12 // PA12 - USB_DP
|
||||
#define PIN_USB_PULLUP 15 // PA15 - 1.5 kΩ to D+
|
||||
|
||||
// Port B
|
||||
#define PIN_LED 0 // PB0 - Status LED
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
#include "ownership.h"
|
||||
MODULE_OWNS_PERIPHERAL(USB);
|
||||
MODULE_OWNS_PIN(GPIOA, PIN_USB_PULLUP);
|
||||
MODULE_OWNS_PIN(GPIOA, PIN_USB_DM);
|
||||
MODULE_OWNS_PIN(GPIOA, PIN_USB_DP);
|
||||
|
||||
|
|
@ -15,19 +14,13 @@ volatile unsigned int USB_Address = 0;
|
|||
|
||||
void USB_Init(void)
|
||||
{
|
||||
// Free PA15 (pullup for D+) for use as GPIO
|
||||
AFIO->MAPR = AFIO_MAPR_SWJ_CFG_JTAGDISABLE;
|
||||
|
||||
// Initialise USB GPIOs to AF mode, set pullup high
|
||||
// Initialise USB GPIOs to AF mode
|
||||
// Note: This will reset the test point pin to an input without pullup
|
||||
GPIOA->ODR = 1 << PIN_USB_PULLUP;
|
||||
GPIOA->CRH = (0x44444444
|
||||
& ~(0x0f << (PIN_USB_DM * 4 - 32))
|
||||
& ~(0x0f << (PIN_USB_DP * 4 - 32))
|
||||
& ~(0x0f << (PIN_USB_PULLUP * 4 - 32)))
|
||||
& ~(0x0f << (PIN_USB_DP * 4 - 32)))
|
||||
| (0x0b << (PIN_USB_DM * 4 - 32)) // AF mode, 50 MHz
|
||||
| (0x0b << (PIN_USB_DP * 4 - 32)) // AF mode, 50 MHz
|
||||
| (0x01 << (PIN_USB_PULLUP * 4 - 32)) // Push-pull output, 10 MHz
|
||||
;
|
||||
|
||||
Util_Delay(100000);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue