[sam3] add basic pmc support

some peripheral ID definitions already added in periph.h were removed
This commit is contained in:
Felix Held
2015-04-09 17:08:25 +02:00
committed by Karl Palsson
parent 6d69cbf98f
commit 8a24685d0c
11 changed files with 1174 additions and 128 deletions

View File

@@ -44,20 +44,29 @@ void pmc_plla_config(uint8_t mul, uint8_t div)
void pmc_peripheral_clock_enable(uint8_t pid)
{
#if defined(PMC_PCER1)
if (pid < 32) {
PMC_PCER0 = 1 << pid;
} else {
PMC_PCER1 = 1 << (pid & 31);
}
#else
//SAM3N and SAM3U only have one Peripheral Clock Enable Register
PMC_PCER = 1 << pid;
#endif
}
void pmc_peripheral_clock_disable(uint8_t pid)
{
#if defined(PMC_PCER1)
if (pid < 32) {
PMC_PCDR0 = 1 << pid;
} else {
PMC_PCDR1 = 1 << (pid & 31);
}
#else
PMC_PCDR = 1 << pid;
#endif
}
void pmc_mck_set_source(enum mck_src src)