Add power control

This commit is contained in:
fruchti 2018-08-24 01:25:05 +02:00
parent 94b7ac4f8f
commit 5491961e8b
4 changed files with 10 additions and 4 deletions

View file

@ -1 +1 @@
484 486

View file

@ -5,10 +5,14 @@ int main(void)
RCC->APB2ENR |= RCC_APB2ENR_IOPCEN; RCC->APB2ENR |= RCC_APB2ENR_IOPCEN;
GPIOC->CRH = (GPIOC->CRH 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_LED - 32)) // Output, max. 10 MHz
| (0x01 << (4 * PIN_SUPPLY - 32)) // Output, max. 10 MHz
; ;
GPIOC->BSRR = (1 << PIN_SUPPLY);
Camera_Init(); Camera_Init();
LTP1245_Init(); LTP1245_Init();
@ -24,6 +28,8 @@ int main(void)
LTP1245_FeedPaper(100); LTP1245_FeedPaper(100);
LTP1245_FeedPaper(10); LTP1245_FeedPaper(10);
GPIOC->BRR = (1 << PIN_SUPPLY);
for(;;) for(;;)
{ {
__WFI(); __WFI();

View file

@ -310,7 +310,7 @@ void TIM1_CC_IRQHandler(void)
CurrentLine = 0; CurrentLine = 0;
FrameCount++; FrameCount++;
if(FrameCount == 10) if(FrameCount == 5)
{ {
Camera_Captured = 1; Camera_Captured = 1;
// Disable everything // Disable everything

View file

@ -19,7 +19,6 @@
// Port B // Port B
#define PIN_THERMISTOR 0 // PB0 - Thermistor (ADC12_IN8) #define PIN_THERMISTOR 0 // PB0 - Thermistor (ADC12_IN8)
#define PIN_VBATT 1 // PB1 - Battery monitor (ADC12_IN9) #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_PAPER 3 // PB3 - Paper detect
#define PIN_CAMERA_PCLK 4 // PB4 - Camera pixel clock (TIM3_CH1) #define PIN_CAMERA_PCLK 4 // PB4 - Camera pixel clock (TIM3_CH1)
#define PIN_CAMERA_HSYNC 5 // PB5 - Camera VSYNC (TIM3_CH2) #define PIN_CAMERA_HSYNC 5 // PB5 - Camera VSYNC (TIM3_CH2)
@ -36,3 +35,4 @@
// Port C // Port C
#define PIN_LED 13 // PC13 - Status LED #define PIN_LED 13 // PC13 - Status LED
#define PIN_SUPPLY 14 // PC14 - Voltage regulator enable