20260324
This commit is contained in:
23
IAPV1.1/Driver/pwr_ctrl/pwr_ctrl.c
Normal file
23
IAPV1.1/Driver/pwr_ctrl/pwr_ctrl.c
Normal file
@ -0,0 +1,23 @@
|
||||
#include "pwr_ctrl.h" //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>ͷ<EFBFBD>ļ<EFBFBD>
|
||||
#include "delay.h" //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>ͷ<EFBFBD>ļ<EFBFBD>
|
||||
#include "pbdata.h"
|
||||
/*-------------------------------------------------*/
|
||||
|
||||
|
||||
/*------------------------------------------------*/
|
||||
void PWR_CTRL_Init(void)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
|
||||
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE); //ʹ<><CAB9>PB<50>˿<EFBFBD>ʱ<EFBFBD><CAB1>
|
||||
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; //<2F><><EFBFBD><EFBFBD>
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP; //<2F><><EFBFBD><EFBFBD>
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_400KHz; //IO<49><4F><EFBFBD>ٶ<EFBFBD>Ϊ400KHz
|
||||
GPIO_Init(GPIOA, &GPIO_InitStructure);
|
||||
PWR_CTRLTFWF_L;//<2F>ر<EFBFBD>WIFI<46><49>TF<54><46><EFBFBD><EFBFBD>Դ
|
||||
PWR_CTRL3V3_L;
|
||||
}
|
||||
|
||||
|
||||
34
IAPV1.1/Driver/pwr_ctrl/pwr_ctrl.h
Normal file
34
IAPV1.1/Driver/pwr_ctrl/pwr_ctrl.h
Normal file
@ -0,0 +1,34 @@
|
||||
#ifndef _PWR_CTRL_H
|
||||
#define _PWR_CTRL_H
|
||||
|
||||
#include "stm32l1xx.h" //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>ͷ<EFBFBD>ļ<EFBFBD>
|
||||
|
||||
#define PWR_CTRLADC_H GPIO_SetBits(GPIOB, GPIO_Pin_0) //<2F><><EFBFBD>ƿ<EFBFBD><C6BF><EFBFBD><EFBFBD><EFBFBD>ADC<44>IJ<EFBFBD><C4B2><EFBFBD><EFBFBD><EFBFBD>Դʹ<D4B4><CAB9>
|
||||
#define PWR_CTRLADC_L GPIO_ResetBits(GPIOB, GPIO_Pin_0)
|
||||
|
||||
#define PWR_CTRLL76C_H GPIO_SetBits(GPIOB,GPIO_Pin_12) //L76C<36><43><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
#define PWR_CTRLL76C_L GPIO_ResetBits(GPIOB,GPIO_Pin_12)
|
||||
|
||||
#define PWR_CTRL3V3_H GPIO_SetBits(GPIOA,GPIO_Pin_4)//<2F><>Ƭ<EFBFBD><C6AC><EFBFBD><EFBFBD>Χ3V3<56><33>Դ<EFBFBD>ܿ<EFBFBD><DCBF><EFBFBD>
|
||||
#define PWR_CTRL3V3_L GPIO_ResetBits(GPIOA,GPIO_Pin_4)
|
||||
|
||||
#define PWR_CTRL5V_H GPIO_SetBits(GPIOC,GPIO_Pin_0) //5V<35><56>Դ<EFBFBD><D4B4>9V<39><56>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD>
|
||||
#define PWR_CTRL5V_L GPIO_ResetBits(GPIOC,GPIO_Pin_0)
|
||||
|
||||
#define PWR_CTRLBC25_H GPIO_SetBits(GPIOB,GPIO_Pin_1) //BC25<32><35>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD>
|
||||
#define PWR_CTRLBC25_L GPIO_ResetBits(GPIOB,GPIO_Pin_1)
|
||||
|
||||
#define PWR_CTRLTFWF_H GPIO_SetBits(GPIOA,GPIO_Pin_12) //TF<54><46><EFBFBD><EFBFBD>WIFI<46><49>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD>
|
||||
#define PWR_CTRLTFWF_L GPIO_ResetBits(GPIOA,GPIO_Pin_12)
|
||||
|
||||
#define PWR_CTRL485_H GPIO_SetBits(GPIOC,GPIO_Pin_11) //485<38><35>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD>
|
||||
#define PWR_CTRL485_L GPIO_ResetBits(GPIOA,GPIO_Pin_11)
|
||||
|
||||
#define Enable_SdiRX GPIO_SetBits(GPIOB,GPIO_Pin_5);
|
||||
#define Enable_SdiTX GPIO_ResetBits(GPIOB,GPIO_Pin_5);
|
||||
|
||||
#define RS485_TX_EN GPIO_ResetBits(GPIOA,GPIO_Pin_8);
|
||||
#define RS485_RX_EN GPIO_SetBits(GPIOA,GPIO_Pin_8);
|
||||
void PWR_CTRL_Init(void);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user