sam3: Add enable_pclock() helper function

Add a helper function to enable peripheral clocks.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2018-12-28 19:00:29 -05:00
parent b4baabe408
commit 4683036f98
10 changed files with 32 additions and 22 deletions

View File

@@ -31,7 +31,7 @@ serial_init(void)
gpio_peripheral(tx_pin, 'A', 0);
// Reset uart
PMC->PMC_PCER0 = 1 << Pmc_id;
enable_pclock(Pmc_id);
Port->UART_PTCR = UART_PTCR_RXTDIS | UART_PTCR_TXTDIS;
Port->UART_CR = (UART_CR_RSTRX | UART_CR_RSTTX
| UART_CR_RXDIS | UART_CR_TXDIS);