Изменения на новые настройки пинов и устройств
This commit is contained in:
parent
5ce1eb2440
commit
cd69a1a277
|
|
@ -7,56 +7,38 @@
|
||||||
void Pwm_Init(
|
void Pwm_Init(
|
||||||
tPowerManagement *env,
|
tPowerManagement *env,
|
||||||
tPower *Power,
|
tPower *Power,
|
||||||
tSIM800FPower *SIM800FPower,
|
tSIM7682EPower *SIM7682EPower,
|
||||||
tPRO04Power *PRO04Power
|
tSIM68Power *SIM68Power
|
||||||
) {
|
) {
|
||||||
env->Power = Power;
|
env->Power = Power;
|
||||||
env->SIM800FPower = SIM800FPower;
|
env->SIM7682EPower = SIM7682EPower;
|
||||||
env->PRO04Power = PRO04Power;
|
env->SIM68Power = SIM68Power;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Pwm_Power(tPowerManagement *env) {
|
void Pwm_Power(tPowerManagement *env) {
|
||||||
// GpioPinSet(&env->Power->discretOut1_pd3, true);
|
|
||||||
GpioPinSet(&env->Power->discretOut1_pd0, true);
|
|
||||||
|
|
||||||
GpioPinSet(&env->Power->gonec_boot, false);
|
|
||||||
|
|
||||||
GpioPinSet(&env->Power->gonec_reset, true);
|
|
||||||
|
|
||||||
|
|
||||||
GpioPinSet(&env->Power->tx_pwr_5, true);
|
|
||||||
GpioPinSet(&env->Power->tx_pwr_en, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Pwm_PRO04Startup(tPowerManagement *env) {
|
void Pwm_SIM68Startup(tPowerManagement *env) {
|
||||||
GpioPinSet(&env->PRO04Power->reset, false);
|
GpioPinSet(&env->SIM68Power->reset, true);
|
||||||
GpioPinSet(&env->PRO04Power->onOff, false);
|
GpioPinSet(&env->SIM68Power->pwr_en, false);
|
||||||
GpioPinSet(&env->PRO04Power->pwr_en, false);
|
|
||||||
|
|
||||||
SystemDelayMs(50);
|
|
||||||
GpioPinSet(&env->PRO04Power->onOff, true);
|
|
||||||
SystemDelayMs(50);
|
|
||||||
GpioPinSet(&env->PRO04Power->reset, true);
|
|
||||||
SystemDelayMs(50);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Pwm_SIM800FStartup(tPowerManagement *env) {
|
void Pwm_SIM7682EStartup(tPowerManagement *env) {
|
||||||
|
|
||||||
// Sleep
|
|
||||||
GpioPinSet(&env->SIM800FPower->dtr_sleep, false);
|
|
||||||
// Reset
|
// Reset
|
||||||
GpioPinSet(&env->SIM800FPower->reset, true);
|
GpioPinSet(&env->SIM7682EPower->reset, true);
|
||||||
// Рабочее состояние
|
// Рабочее состояние
|
||||||
GpioPinSet(&env->SIM800FPower->pwrkey, false);
|
GpioPinSet(&env->SIM7682EPower->pwrkey, false);
|
||||||
// Подача питания
|
// Подача питания
|
||||||
GpioPinSet(&env->SIM800FPower->pwr_en, true);
|
GpioPinSet(&env->SIM7682EPower->pwr_en, true);
|
||||||
|
|
||||||
SystemDelayMs(50);
|
SystemDelayMs(50);
|
||||||
// Включение
|
// Включение
|
||||||
GpioPinSet(&env->SIM800FPower->pwrkey, true);
|
GpioPinSet(&env->SIM7682EPower->pwrkey, true);
|
||||||
SystemDelayMs(1000);
|
SystemDelayMs(1000);
|
||||||
// Возврат в рабочее состояние
|
// Возврат в рабочее состояние
|
||||||
GpioPinSet(&env->SIM800FPower->pwrkey, false);
|
GpioPinSet(&env->SIM7682EPower->pwrkey, false);
|
||||||
SystemDelayMs(50);
|
SystemDelayMs(50);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,57 +8,38 @@
|
||||||
#include "SerialPorts.h"
|
#include "SerialPorts.h"
|
||||||
#include "stdint.h"
|
#include "stdint.h"
|
||||||
#include "GpioPin.h"
|
#include "GpioPin.h"
|
||||||
#include "SpiPorts.h"
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
tGpioPin pwrkey;
|
tGpioPin pwrkey;
|
||||||
tGpioPin reset;
|
tGpioPin reset;
|
||||||
tGpioPin pwr_en;
|
tGpioPin pwr_en;
|
||||||
tGpioPin dtr_sleep;
|
tGpioPin pwr_mon;
|
||||||
} tSIM800FPower;
|
} tSIM7682EPower;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
tGpioPin onOff;
|
|
||||||
tGpioPin reset;
|
tGpioPin reset;
|
||||||
tGpioPin pwr_en;
|
tGpioPin pwr_en;
|
||||||
} tPRO04Power;
|
tGpioPin ppc_mcu;
|
||||||
|
} tSIM68Power;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
tGpioPin gpio1;
|
|
||||||
tGpioPin gpio4;
|
|
||||||
|
|
||||||
tGpioPin gonec_pwr_amp;
|
|
||||||
// tGpioPin gonec_is_prm;
|
|
||||||
tGpioPin gonec_boot;
|
|
||||||
|
|
||||||
tGpioPin gonec_reset;
|
|
||||||
tGpioPin tx_pwr_en;
|
|
||||||
tGpioPin tx_pwr_5;
|
|
||||||
tGpioPin tx_pwr_good;
|
|
||||||
|
|
||||||
tGpioPin discretOut1_pd3;
|
|
||||||
tGpioPin discretOut1_pd0;
|
|
||||||
|
|
||||||
tGpioPin discretIn1_pg3;
|
|
||||||
tGpioPin discretIn1_pg2;
|
|
||||||
|
|
||||||
} tPower;
|
} tPower;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
tSIM800FPower *SIM800FPower;
|
tSIM7682EPower *SIM7682EPower;
|
||||||
tPRO04Power *PRO04Power;
|
tSIM68Power *SIM68Power;
|
||||||
tPower *Power;
|
tPower *Power;
|
||||||
} tPowerManagement;
|
} tPowerManagement;
|
||||||
|
|
||||||
void Pwm_Init(
|
void Pwm_Init(
|
||||||
tPowerManagement *env,
|
tPowerManagement *env,
|
||||||
tPower *Power,
|
tPower *Power,
|
||||||
tSIM800FPower *SIM800FPower,
|
tSIM7682EPower *SIM7682EPower,
|
||||||
tPRO04Power *PRO04Power
|
tSIM68Power *SIM68Power
|
||||||
);
|
);
|
||||||
|
|
||||||
void Pwm_Power(tPowerManagement *env);
|
void Pwm_Power(tPowerManagement *env);
|
||||||
void Pwm_SIM800FStartup(tPowerManagement *env);
|
void Pwm_SIM7682EStartup(tPowerManagement *env);
|
||||||
void Pwm_PRO04Startup(tPowerManagement *env);
|
void Pwm_SIM68Startup(tPowerManagement *env);
|
||||||
|
|
||||||
#endif //POWERMANAGEMENT_H
|
#endif //POWERMANAGEMENT_H
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue