kopia lustrzana https://github.com/OpenRTX/OpenRTX
Added support for power gating gpio
rodzic
947d071f57
commit
af6c78542a
|
@ -46,6 +46,9 @@
|
|||
/* Battery type */
|
||||
#define BAT_LIPO_2S
|
||||
|
||||
/* Power keep switch */
|
||||
#define PWR_SW GPIOE,26
|
||||
|
||||
/* Display */
|
||||
#define LCD_BKLIGHT GPIOC,4
|
||||
#define LCD_CS GPIOC,8
|
||||
|
|
|
@ -46,6 +46,8 @@ void platform_init()
|
|||
|
||||
gpio_setMode(PTT_SW, INPUT);
|
||||
|
||||
gpio_setMode(PWR_SW, OUTPUT);
|
||||
|
||||
/*
|
||||
* Configure backlight PWM: 58.5kHz, 8 bit resolution
|
||||
*/
|
||||
|
@ -102,6 +104,9 @@ void platform_terminate()
|
|||
gpio_clearPin(GREEN_LED);
|
||||
|
||||
adc0_terminate();
|
||||
|
||||
/* Finally, remove power supply */
|
||||
gpio_clearPin(PWR_SW, OUTPUT);
|
||||
}
|
||||
|
||||
float platform_getVbat()
|
||||
|
|
|
@ -46,6 +46,9 @@
|
|||
/* Battery type */
|
||||
#define BAT_LIPO_2S
|
||||
|
||||
/* Power keep switch */
|
||||
#define PWR_SW GPIOE,26
|
||||
|
||||
/* Display */
|
||||
#define LCD_BKLIGHT GPIOC,4
|
||||
#define LCD_CS GPIOC,8
|
||||
|
|
|
@ -46,6 +46,8 @@ void platform_init()
|
|||
|
||||
gpio_setMode(PTT_SW, INPUT);
|
||||
|
||||
gpio_setMode(PWR_SW, OUTPUT);
|
||||
|
||||
/*
|
||||
* Configure backlight PWM: 58.5kHz, 8 bit resolution
|
||||
*/
|
||||
|
@ -102,6 +104,9 @@ void platform_terminate()
|
|||
gpio_clearPin(GREEN_LED);
|
||||
|
||||
adc0_terminate();
|
||||
|
||||
/* Finally, remove power supply */
|
||||
gpio_clearPin(PWR_SW, OUTPUT);
|
||||
}
|
||||
|
||||
float platform_getVbat()
|
||||
|
|
|
@ -51,6 +51,9 @@
|
|||
/* Battery type */
|
||||
#define BAT_LIPO_2S
|
||||
|
||||
/* Power keep switch */
|
||||
#define PWR_SW GPIOA,7
|
||||
|
||||
/* Display */
|
||||
#define LCD_D0 GPIOD,14
|
||||
#define LCD_D1 GPIOD,15
|
||||
|
|
|
@ -46,6 +46,8 @@ void platform_init()
|
|||
|
||||
gpio_setMode(PTT_SW, INPUT);
|
||||
|
||||
gpio_setMode(PWR_SW, OUTPUT);
|
||||
|
||||
/*
|
||||
* Initialise ADC1, for vbat, RSSI, ...
|
||||
* Configuration of corresponding GPIOs in analog input mode is done inside
|
||||
|
@ -104,6 +106,9 @@ void platform_terminate()
|
|||
nvm_terminate();
|
||||
toneGen_terminate();
|
||||
rtc_terminate();
|
||||
|
||||
/* Finally, remove power supply */
|
||||
gpio_clearPin(PWR_SW, OUTPUT);
|
||||
}
|
||||
|
||||
float platform_getVbat()
|
||||
|
|
|
@ -48,6 +48,9 @@
|
|||
/* Battery type */
|
||||
#define BAT_LIPO_2S
|
||||
|
||||
/* Power keep switch */
|
||||
#define PWR_SW GPIOA,7
|
||||
|
||||
/* Display */
|
||||
#define LCD_D0 GPIOD,14
|
||||
#define LCD_D1 GPIOD,15
|
||||
|
|
|
@ -65,6 +65,8 @@ void platform_init()
|
|||
|
||||
gpio_setMode(PTT_SW, INPUT);
|
||||
|
||||
gpio_setMode(PWR_SW, OUTPUT);
|
||||
|
||||
/*
|
||||
* Initialise ADC1, for vbat, RSSI, ...
|
||||
* Configuration of corresponding GPIOs in analog input mode is done inside
|
||||
|
@ -128,6 +130,9 @@ void platform_terminate()
|
|||
adc1_terminate();
|
||||
nvm_terminate();
|
||||
rtc_terminate();
|
||||
|
||||
/* Finally, remove power supply */
|
||||
gpio_clearPin(PWR_SW, OUTPUT);
|
||||
}
|
||||
|
||||
float platform_getVbat()
|
||||
|
|
Ładowanie…
Reference in New Issue