firmware: initial power management
This commit is contained in:
parent
8f67e742f7
commit
72b9444861
20
src/power.c
20
src/power.c
@ -4,7 +4,23 @@
|
|||||||
#include "bits.h"
|
#include "bits.h"
|
||||||
#include "power.h"
|
#include "power.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
required units:
|
||||||
|
* SSP0 (FPGA interface) [enabled via spi_init]
|
||||||
|
* UART3 (debug console) [enabled via uart_init]
|
||||||
|
* TIM3 (FPGA clock)
|
||||||
|
* RTC
|
||||||
|
* GPIO
|
||||||
|
* GPDMA [enabled via spi_init]
|
||||||
|
* USB [enabled via usb_init]
|
||||||
|
* PWM1
|
||||||
|
*/
|
||||||
void power_init() {
|
void power_init() {
|
||||||
LPC_SC->PCONP |= (BV(PCTIM3) | BV(PCUART3));
|
LPC_SC->PCONP = BV(PCSSP0)
|
||||||
|
| BV(PCTIM3)
|
||||||
|
| BV(PCRTC)
|
||||||
|
| BV(PCGPIO)
|
||||||
|
| BV(PCPWM1)
|
||||||
|
// | BV(PCUSB)
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|||||||
31
src/power.h
31
src/power.h
@ -5,9 +5,38 @@
|
|||||||
|
|
||||||
#include "bits.h"
|
#include "bits.h"
|
||||||
|
|
||||||
#define PCUART3 (25)
|
|
||||||
#define PCUART0 (3)
|
#define PCUART0 (3)
|
||||||
|
#define PCUART1 (4)
|
||||||
|
#define PCUART2 (24)
|
||||||
|
#define PCUART3 (25)
|
||||||
|
|
||||||
|
#define PCTIM0 (1)
|
||||||
|
#define PCTIM1 (2)
|
||||||
|
#define PCTIM2 (22)
|
||||||
#define PCTIM3 (23)
|
#define PCTIM3 (23)
|
||||||
|
#define PCRTC (9)
|
||||||
|
#define PCRIT (16)
|
||||||
|
|
||||||
|
#define PCCAN1 (13)
|
||||||
|
#define PCCAN2 (14)
|
||||||
|
|
||||||
|
#define PCPWM1 (6)
|
||||||
|
#define PCMCPWM (17)
|
||||||
|
|
||||||
|
#define PCSSP0 (21)
|
||||||
|
#define PCSSP1 (10)
|
||||||
|
#define PCSPI (8)
|
||||||
|
|
||||||
|
#define PCI2C0 (7)
|
||||||
|
#define PCI2C1 (19)
|
||||||
|
#define PCI2C2 (26)
|
||||||
|
|
||||||
|
#define PCI2S (27)
|
||||||
|
#define PCGPDMA (29)
|
||||||
|
#define PCENET (30)
|
||||||
|
#define PCUSB (31)
|
||||||
|
#define PCQEI (18)
|
||||||
|
#define PCGPIO (15)
|
||||||
|
|
||||||
void power_init(void);
|
void power_init(void);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user