功能测试可以
This commit is contained in:
parent
79fe76276c
commit
5c0ba6ef42
|
@ -67,7 +67,7 @@
|
|||
</option>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.std.2020844713" name="Language standard" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.std" useByScannerDiscovery="true" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.std.gnu99" valueType="enumerated"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.defs.177116515" name="Defined symbols (-D)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.defs" useByScannerDiscovery="true" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="DEBUG=0"/>
|
||||
<listOptionValue builtIn="false" value="DEBUG=1"/>
|
||||
<listOptionValue builtIn="false" value="CLK_OSC32K=0"/>
|
||||
</option>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.include.files.288896968" name="Include files (-include)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.include.files" useByScannerDiscovery="true" valueType="includeFiles"/>
|
||||
|
@ -100,7 +100,7 @@
|
|||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.flags.1577723329" name="Linker flags (-Xlinker [option])" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.flags" useByScannerDiscovery="false" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="--print-memory-usage"/>
|
||||
</option>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.printfloat.1191876922" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.printfloat" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.printfloat.1191876922" name="Use wchprintfloat(-lprintfloat)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.linker.printfloat" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||
<inputType id="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.linker.input.1859223768" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.tool.c.linker.input">
|
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-794068338182449592" id="ilg.gnumcueclipse.managedbuild.cross.riscv.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT RISC-V Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-749514335968608025" id="ilg.gnumcueclipse.managedbuild.cross.riscv.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT RISC-V Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
</provider>
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
{
|
||||
"files.associations": {
|
||||
"bsp_adc.h": "c"
|
||||
"bsp_adc.h": "c",
|
||||
"bsp_beep.h": "c",
|
||||
"bsp_key.h": "c",
|
||||
"bsp_beep_led_emv.h": "c"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,9 +17,12 @@
|
|||
#include "gattprofile.h"
|
||||
#include "peripheral.h"
|
||||
|
||||
|
||||
#include "bsp_adc.h"
|
||||
|
||||
#include "bsp_key.h"
|
||||
|
||||
#include "bsp_beep_led_emv.h"
|
||||
|
||||
/*********************************************************************
|
||||
* GLOBAL TYPEDEFS
|
||||
*/
|
||||
|
@ -42,64 +45,67 @@ __attribute__((noinline)) void Main_Circulation()
|
|||
while (1)
|
||||
{
|
||||
TMOS_SystemProcess();
|
||||
if (GPIOB_ReadPortPin(GPIO_Pin_14) == 0)
|
||||
if (GPIOB_ReadPortPin(GPIO_Pin_15) == 0)
|
||||
{
|
||||
// 12V_EN
|
||||
GPIOA_SetBits(GPIO_Pin_13);
|
||||
GPIOA_ModeCfg(GPIO_Pin_13, GPIO_ModeOut_PP_5mA);
|
||||
PRINT("12V_EN ON\n");
|
||||
BOOST_EN;
|
||||
PRINT("BOOST_EN\n");
|
||||
|
||||
// LED
|
||||
GPIOA_SetBits(GPIO_Pin_4);
|
||||
GPIOA_ModeCfg(GPIO_Pin_4, GPIO_ModeOut_PP_5mA);
|
||||
// LED_R
|
||||
LED_R_ON;
|
||||
DelayMs(1000);
|
||||
PRINT("LED ON\n");
|
||||
PRINT("LED_R_ON\n");
|
||||
|
||||
GPIOA_ResetBits(GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_15);
|
||||
GPIOA_ModeCfg(GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_15, GPIO_ModeIN_PD);
|
||||
LED_ALL_OFF_DEINIT;
|
||||
DelayMs(1000);
|
||||
PRINT("LED OFF\n");
|
||||
PRINT("LED_ALL_OFF_DEINIT\n");
|
||||
|
||||
GPIOA_SetBits(GPIO_Pin_5);
|
||||
GPIOA_ModeCfg(GPIO_Pin_5, GPIO_ModeOut_PP_5mA);
|
||||
// LED_G
|
||||
LED_G_ON;
|
||||
DelayMs(1000);
|
||||
PRINT("LED ON\n");
|
||||
PRINT("LED_G_ON\n");
|
||||
|
||||
GPIOA_ResetBits(GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_15);
|
||||
GPIOA_ModeCfg(GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_15, GPIO_ModeIN_PD);
|
||||
LED_ALL_OFF_DEINIT;
|
||||
DelayMs(1000);
|
||||
PRINT("LED OFF\n");
|
||||
PRINT("LED_ALL_OFF_DEINIT\n");
|
||||
|
||||
GPIOA_SetBits(GPIO_Pin_15);
|
||||
GPIOA_ModeCfg(GPIO_Pin_15, GPIO_ModeOut_PP_5mA);
|
||||
// LED_Y
|
||||
LED_Y_ON;
|
||||
DelayMs(1000);
|
||||
PRINT("LED ON\n");
|
||||
PRINT("LED_Y_ON\n");
|
||||
|
||||
GPIOA_ResetBits(GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_15);
|
||||
GPIOA_ModeCfg(GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_15, GPIO_ModeIN_PD);
|
||||
LED_ALL_OFF_DEINIT;
|
||||
DelayMs(1000);
|
||||
PRINT("LED OFF\n");
|
||||
PRINT("LED_ALL_OFF_DEINIT\n");
|
||||
|
||||
DelayMs(100);
|
||||
PRINT("DelayMs 700\n");
|
||||
PRINT("Delay 6s\n");
|
||||
|
||||
// EMV_CHARGE
|
||||
EMV_CHARGE_EN;
|
||||
PRINT("EMV_CHARGE_EN\n");
|
||||
|
||||
DelayMs(500);
|
||||
|
||||
EMV_CHARGE_OFF_DEINIT;
|
||||
PRINT("EMV_CHARGE_OFF_DEINIT 1s\n");
|
||||
|
||||
// 12V_EN
|
||||
GPIOA_ResetBits(GPIO_Pin_13);
|
||||
GPIOA_ModeCfg(GPIO_Pin_13, GPIO_ModeOut_PP_5mA);
|
||||
GPIOB_ResetBits(GPIO_Pin_14);
|
||||
GPIOB_ModeCfg(GPIO_Pin_14, GPIO_ModeOut_PP_5mA);
|
||||
PRINT("12V_EN OFF\n");
|
||||
|
||||
DelayMs(1000 * 5);
|
||||
DelayMs(3000);
|
||||
|
||||
// EMV_CTRL
|
||||
GPIOB_SetBits(GPIO_Pin_13);
|
||||
GPIOB_ModeCfg(GPIO_Pin_13, GPIO_ModeOut_PP_5mA);
|
||||
PRINT("EMV_CTRL ON\n");
|
||||
EMV_ON;
|
||||
PRINT("EMV_ON\n");
|
||||
DelayMs(100);
|
||||
|
||||
// EMV_CTRL
|
||||
GPIOB_ResetBits(GPIO_Pin_13);
|
||||
GPIOB_ModeCfg(GPIO_Pin_13, GPIO_ModeIN_PD);
|
||||
PRINT("EMV_CTRL OFF\n");
|
||||
BOOST_OFF_DEINIT;
|
||||
BEEP_OFF_DEINIT;
|
||||
LED_ALL_OFF_DEINIT;
|
||||
EMV_CHARGE_OFF_DEINIT;
|
||||
EMV_OFF_DEINIT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -123,50 +129,22 @@ int main(void)
|
|||
GPIOB_ModeCfg(GPIO_Pin_All, GPIO_ModeIN_PD);
|
||||
#endif
|
||||
#ifdef DEBUG
|
||||
GPIOB_SetBits(bTXD0);
|
||||
GPIOB_ModeCfg(bTXD0, GPIO_ModeOut_PP_5mA);
|
||||
UART0_DefInit();
|
||||
GPIOA_SetBits(bTXD1);
|
||||
GPIOA_ModeCfg(bTXD1, GPIO_ModeOut_PP_5mA);
|
||||
UART1_DefInit();
|
||||
PRINT("Start @ChipID=%02X\n", R8_CHIP_ID);
|
||||
#endif
|
||||
|
||||
// 12V_EN
|
||||
GPIOA_ResetBits(GPIO_Pin_13);
|
||||
GPIOA_ModeCfg(GPIO_Pin_13, GPIO_ModeOut_PP_5mA);
|
||||
|
||||
// EMV_CTRL
|
||||
GPIOB_SetBits(GPIO_Pin_13);
|
||||
GPIOB_ModeCfg(GPIO_Pin_13, GPIO_ModeOut_PP_5mA);
|
||||
PRINT("EMV_CTRL ON\n");
|
||||
DelayMs(100);
|
||||
|
||||
GPIOB_ResetBits(GPIO_Pin_13);
|
||||
PRINT("EMV_CTRL OFF\n");
|
||||
|
||||
// EMV_CTRL
|
||||
GPIOB_ResetBits(GPIO_Pin_13);
|
||||
GPIOB_ModeCfg(GPIO_Pin_13, GPIO_ModeIN_PD);
|
||||
|
||||
// LED
|
||||
GPIOA_ResetBits(GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_15);
|
||||
GPIOA_ModeCfg(GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_15, GPIO_ModeIN_PD);
|
||||
|
||||
// KEY
|
||||
GPIOB_SetBits(GPIO_Pin_14);
|
||||
// ÓÉÍⲿÉÏÀµç×èÁË
|
||||
GPIOB_ModeCfg(GPIO_Pin_14, GPIO_ModeIN_Floating);
|
||||
|
||||
// ADC_VBAT
|
||||
// GPIOAGPPCfg(ENABLE, RB_PIN_PA4_15_DIS);
|
||||
// R16_PIN_ANALOG_IE != RB_PIN_PA4_15_DIS;
|
||||
R32_PIN_CONFIG2 |= (1U << 14);
|
||||
|
||||
// R32_PIN_CONFIG2
|
||||
|
||||
// GPIOA_ResetBits(GPIO_Pin_1);
|
||||
// GPIOA_ModeCfg(GPIO_Pin_14, GPIO_ModeIN_Floating);
|
||||
|
||||
DelayMs(1000 * 3);
|
||||
|
||||
BOOST_OFF_DEINIT;
|
||||
BEEP_OFF_DEINIT;
|
||||
LED_ALL_OFF_DEINIT;
|
||||
EMV_CHARGE_OFF_DEINIT;
|
||||
EMV_OFF_DEINIT;
|
||||
|
||||
BSP_KEY_Init();
|
||||
|
||||
BSP_ADC_Init();
|
||||
|
||||
PRINT("%s\n", VER_LIB);
|
||||
|
|
|
@ -0,0 +1,108 @@
|
|||
/*
|
||||
* @Author : stark1898y 1658608470@qq.com
|
||||
* @Date : 2024-12-09 09:50:56
|
||||
* @LastEditors : stark1898y 1658608470@qq.com
|
||||
* @LastEditTime : 2024-12-09 11:27:01
|
||||
* @FilePath : \BLE_TYQ_CH592F\BSP\inc\bsp_beep_led_emv.h
|
||||
* @Description :
|
||||
*
|
||||
* Copyright (c) 2024 by yzy, All Rights Reserved.
|
||||
*/
|
||||
#ifndef __BSP_BEEP_LED_EMV_H__
|
||||
#define __BSP_BEEP_LED_EMV_H__
|
||||
|
||||
#include "CH59x_common.h"
|
||||
|
||||
|
||||
/**********************BOOST************************ */
|
||||
#define BOOST_EN \
|
||||
do \
|
||||
{ \
|
||||
GPIOB_SetBits(GPIO_Pin_14); \
|
||||
GPIOB_ModeCfg(GPIO_Pin_14, GPIO_ModeOut_PP_5mA); \
|
||||
} while (0);
|
||||
|
||||
#define BOOST_OFF_DEINIT \
|
||||
do \
|
||||
{ \
|
||||
GPIOB_ResetBits(GPIO_Pin_14); \
|
||||
GPIOB_ModeCfg(GPIO_Pin_14, GPIO_ModeIN_PD); \
|
||||
} while (0);
|
||||
|
||||
/***********************BEEP************************ */
|
||||
#define BEEP_ON \
|
||||
do \
|
||||
{ \
|
||||
GPIOA_SetBits(GPIO_Pin_14); \
|
||||
GPIOA_ModeCfg(GPIO_Pin_14, GPIO_ModeOut_PP_5mA);\
|
||||
} while (0);
|
||||
|
||||
#define BEEP_OFF_DEINIT \
|
||||
do \
|
||||
{ \
|
||||
GPIOA_ResetBits(GPIO_Pin_14); \
|
||||
GPIOA_ModeCfg(GPIO_Pin_14, GPIO_ModeIN_Floating); \
|
||||
} while (0);
|
||||
|
||||
/***********************LED************************ */
|
||||
/**********LED_R**************/
|
||||
#define LED_R_ON \
|
||||
do \
|
||||
{ \
|
||||
GPIOA_SetBits(GPIO_Pin_4); \
|
||||
GPIOA_ModeCfg(GPIO_Pin_4, GPIO_ModeOut_PP_5mA); \
|
||||
} while (0);
|
||||
/**********LED_G**************/
|
||||
#define LED_G_ON \
|
||||
do \
|
||||
{ \
|
||||
GPIOA_SetBits(GPIO_Pin_5); \
|
||||
GPIOA_ModeCfg(GPIO_Pin_5, GPIO_ModeOut_PP_5mA); \
|
||||
} while (0);
|
||||
/**********LED_Y**************/
|
||||
#define LED_Y_ON \
|
||||
do \
|
||||
{ \
|
||||
GPIOA_SetBits(GPIO_Pin_15); \
|
||||
GPIOA_ModeCfg(GPIO_Pin_15, GPIO_ModeOut_PP_5mA); \
|
||||
} while (0);
|
||||
|
||||
#define LED_ALL_OFF_DEINIT \
|
||||
do \
|
||||
{ \
|
||||
GPIOA_ResetBits(GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_15); \
|
||||
GPIOA_ModeCfg(GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_15, GPIO_ModeIN_PD); \
|
||||
} while (0);
|
||||
|
||||
/***********************EMV************************ */
|
||||
// EMV_CHARGE
|
||||
#define EMV_CHARGE_EN \
|
||||
do \
|
||||
{ \
|
||||
GPIOB_SetBits(GPIO_Pin_13); \
|
||||
GPIOB_ModeCfg(GPIO_Pin_13, GPIO_ModeOut_PP_5mA); \
|
||||
} while (0);
|
||||
|
||||
#define EMV_CHARGE_OFF_DEINIT \
|
||||
do \
|
||||
{ \
|
||||
GPIOB_ResetBits(GPIO_Pin_13); \
|
||||
GPIOB_ModeCfg(GPIO_Pin_13, GPIO_ModeIN_Floating); \
|
||||
} while (0);
|
||||
|
||||
// EMV_EN
|
||||
#define EMV_ON \
|
||||
do \
|
||||
{ \
|
||||
GPIOB_SetBits(GPIO_Pin_12); \
|
||||
GPIOB_ModeCfg(GPIO_Pin_12, GPIO_ModeOut_PP_5mA);\
|
||||
} while (0);
|
||||
|
||||
#define EMV_OFF_DEINIT \
|
||||
do \
|
||||
{ \
|
||||
GPIOB_ResetBits(GPIO_Pin_12); \
|
||||
GPIOB_ModeCfg(GPIO_Pin_12, GPIO_ModeIN_Floating); \
|
||||
} while (0);
|
||||
|
||||
#endif // !__BSP_BEEP_LED_EMV_H__
|
|
@ -0,0 +1,17 @@
|
|||
#ifndef __BSP_KEY_H__
|
||||
#define __BSP_KEY_H__
|
||||
|
||||
|
||||
#include "CH59x_common.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void BSP_KEY_Init(void);
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // !__BSP_KEY_H__
|
|
@ -61,9 +61,9 @@ void BSP_ADC_Init(void)
|
|||
printf("AverageCountBat = %d\n", CountBat);
|
||||
#endif
|
||||
|
||||
R32_PIN_CONFIG2 |= (1U << 13);
|
||||
/* 单通道采样:选择adc通道3做采样,对应 PA13引脚, 带数据校准功能 */
|
||||
GPIOA_ModeCfg(GPIO_Pin_14, GPIO_ModeIN_Floating);
|
||||
DelayMs(300);
|
||||
GPIOA_ModeCfg(GPIO_Pin_13, GPIO_ModeIN_Floating);
|
||||
|
||||
// 6dB(2倍) (ADC/4096+0.5)*Vref 1.5*Vref 0.525V~1.575V 0.6V~1.5V
|
||||
ADC_ExtSingleChSampInit(SampleFreq_3_2, ADC_PGA_0);
|
||||
|
@ -73,8 +73,8 @@ void BSP_ADC_Init(void)
|
|||
|
||||
DelayMs(300);
|
||||
|
||||
printf("PA14:::::\n");
|
||||
ADC_ChannelCfg(4);
|
||||
printf("PA13:::::\n");
|
||||
ADC_ChannelCfg(3);
|
||||
|
||||
for (i = 0; i < 20; i++)
|
||||
{
|
||||
|
|
|
@ -0,0 +1,80 @@
|
|||
#include "bsp_beep_led_emv.h"
|
||||
|
||||
#if 0
|
||||
void BSP_BOOST_Init(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void BSP_BOOST_DeInit(void)
|
||||
{
|
||||
// 12V_EN
|
||||
GPIOB_ResetBits(GPIO_Pin_14);
|
||||
GPIOB_ModeCfg(GPIO_Pin_14, GPIO_ModeIN_PD);
|
||||
}
|
||||
|
||||
|
||||
void BSP_BEEP_Init(void)
|
||||
{
|
||||
// BEEP
|
||||
GPIOA_ResetBits(GPIO_Pin_14);
|
||||
GPIOA_ModeCfg(GPIO_Pin_14, GPIO_ModeOut_PP_5mA);
|
||||
}
|
||||
|
||||
void BSP_BEEP_DeInit(void)
|
||||
{
|
||||
// BEEP
|
||||
GPIOA_ResetBits(GPIO_Pin_14);
|
||||
// 有数字晶体管的下拉
|
||||
GPIOA_ModeCfg(GPIO_Pin_14, GPIO_ModeIN_Floating);
|
||||
}
|
||||
|
||||
void BSP_LED_Init(void)
|
||||
{
|
||||
// LED_R
|
||||
GPIOA_ResetBits(GPIO_Pin_4);
|
||||
GPIOA_ModeCfg(GPIO_Pin_4, GPIO_ModeOut_PP_5mA);
|
||||
|
||||
// LED_G
|
||||
GPIOA_ResetBits(GPIO_Pin_5);
|
||||
GPIOA_ModeCfg(GPIO_Pin_5, GPIO_ModeOut_PP_5mA);
|
||||
|
||||
// LED_Y
|
||||
GPIOA_ResetBits(GPIO_Pin_15);
|
||||
GPIOA_ModeCfg(GPIO_Pin_15, GPIO_ModeOut_PP_5mA);
|
||||
}
|
||||
|
||||
void BEP_LED_DeInit(void)
|
||||
{
|
||||
// LED
|
||||
GPIOA_ResetBits(GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_15);
|
||||
// 有数字晶体管的下拉
|
||||
GPIOA_ModeCfg(GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_15, GPIO_ModeIN_Floating);
|
||||
}
|
||||
|
||||
void BSP_EMV_Init(void)
|
||||
{
|
||||
// EMV_CHARGE
|
||||
GPIOB_ResetBits(GPIO_Pin_13);
|
||||
GPIOB_ModeCfg(GPIO_Pin_13, GPIO_ModeOut_PP_5mA);
|
||||
|
||||
// EMV_EN
|
||||
GPIOB_ResetBits(GPIO_Pin_12);
|
||||
GPIOB_ModeCfg(GPIO_Pin_12, GPIO_ModeOut_PP_5mA);
|
||||
}
|
||||
|
||||
void BSP_EMV_DeInit(void)
|
||||
{
|
||||
// EMV_CHARGE
|
||||
GPIOB_ResetBits(GPIO_Pin_13);
|
||||
// 有数字晶体管的下拉
|
||||
GPIOB_ModeCfg(GPIO_Pin_13, GPIO_ModeIN_Floating);
|
||||
|
||||
// EMV_EN
|
||||
GPIOB_ResetBits(GPIO_Pin_12);
|
||||
// 有外部下拉电阻
|
||||
GPIOB_ModeCfg(GPIO_Pin_12, GPIO_ModeIN_Floating);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
#include "bsp_key.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void BSP_KEY_Init(void)
|
||||
{
|
||||
// KEY
|
||||
GPIOB_SetBits(GPIO_Pin_15);
|
||||
// 由外部上拉电阻了
|
||||
GPIOB_ModeCfg(GPIO_Pin_15, GPIO_ModeIN_Floating);
|
||||
}
|
|
@ -23,7 +23,7 @@
|
|||
*/
|
||||
void UART1_DefInit(void)
|
||||
{
|
||||
UART1_BaudRateCfg(115200);
|
||||
UART1_BaudRateCfg(921600);
|
||||
R8_UART1_FCR = (2 << 6) | RB_FCR_TX_FIFO_CLR | RB_FCR_RX_FIFO_CLR | RB_FCR_FIFO_EN; // FIFO打开,触发点4字节
|
||||
R8_UART1_LCR = RB_LCR_WORD_SZ;
|
||||
R8_UART1_IER = RB_IER_TXD_EN;
|
||||
|
|
Loading…
Reference in New Issue