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