Add power control
This commit is contained in:
parent
94b7ac4f8f
commit
5491961e8b
|
@ -1 +1 @@
|
|||
484
|
||||
486
|
||||
|
|
|
@ -5,9 +5,13 @@ int main(void)
|
|||
RCC->APB2ENR |= RCC_APB2ENR_IOPCEN;
|
||||
|
||||
GPIOC->CRH = (GPIOC->CRH
|
||||
& ~(0x0f << (4 * PIN_LED - 32)))
|
||||
& ~(0x0f << (4 * PIN_LED - 32))
|
||||
& ~(0x0f << (4 * PIN_SUPPLY - 32)))
|
||||
| (0x01 << (4 * PIN_LED - 32)) // Output, max. 10 MHz
|
||||
| (0x01 << (4 * PIN_SUPPLY - 32)) // Output, max. 10 MHz
|
||||
;
|
||||
|
||||
GPIOC->BSRR = (1 << PIN_SUPPLY);
|
||||
|
||||
Camera_Init();
|
||||
LTP1245_Init();
|
||||
|
@ -24,6 +28,8 @@ int main(void)
|
|||
LTP1245_FeedPaper(100);
|
||||
LTP1245_FeedPaper(10);
|
||||
|
||||
GPIOC->BRR = (1 << PIN_SUPPLY);
|
||||
|
||||
for(;;)
|
||||
{
|
||||
__WFI();
|
||||
|
|
|
@ -310,7 +310,7 @@ void TIM1_CC_IRQHandler(void)
|
|||
CurrentLine = 0;
|
||||
FrameCount++;
|
||||
|
||||
if(FrameCount == 10)
|
||||
if(FrameCount == 5)
|
||||
{
|
||||
Camera_Captured = 1;
|
||||
// Disable everything
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
// Port B
|
||||
#define PIN_THERMISTOR 0 // PB0 - Thermistor (ADC12_IN8)
|
||||
#define PIN_VBATT 1 // PB1 - Battery monitor (ADC12_IN9)
|
||||
#define PIN_SUPPLY 2 // PB2 - Voltage regulator enable
|
||||
#define PIN_PAPER 3 // PB3 - Paper detect
|
||||
#define PIN_CAMERA_PCLK 4 // PB4 - Camera pixel clock (TIM3_CH1)
|
||||
#define PIN_CAMERA_HSYNC 5 // PB5 - Camera VSYNC (TIM3_CH2)
|
||||
|
@ -36,3 +35,4 @@
|
|||
|
||||
// Port C
|
||||
#define PIN_LED 13 // PC13 - Status LED
|
||||
#define PIN_SUPPLY 14 // PC14 - Voltage regulator enable
|
||||
|
|
Loading…
Reference in a new issue