[X9D] Some more drivers added (keys / power).

[ACT] Splash. Simu working. All screens need to be reworked!
This commit is contained in:
bsongis
2012-12-21 18:29:59 +00:00
parent cea3ee724e
commit a78c5d348e
22 changed files with 616 additions and 413 deletions
+57 -93
View File
@@ -1,46 +1,47 @@
#ifndef _HAL_
#define _HAL_
/********************************
GPIOS----所有涉及GPIO的定义
*******************************************/
/*
* GPIOS
*/
#define RCC_AHB1Periph_GPIOBUTTON (RCC_AHB1Periph_GPIOA|RCC_AHB1Periph_GPIOB|RCC_AHB1Periph_GPIOC|RCC_AHB1Periph_GPIOD|RCC_AHB1Periph_GPIOE)
//Button
#define PIN_BUTTON_UP GPIO_Pin_0 //SW3 PE.10
#define PIN_BUTTON_ENTER GPIO_Pin_1 //SW2 PE.11
#define PIN_BUTTON_DOWN GPIO_Pin_2 //SW1 PE.12
#define PIN_HOME GPIO_Pin_11 //SW4 PD.07
#define PIN_ESC GPIO_Pin_12 //SW5 PD.03
#define PIN_PAGE GPIO_Pin_10 //SW6 PD.02
//Trim
#define PIN_TRIM1_UP GPIO_Pin_3 //PC.03
// Keys
#define PIN_BUTTON_PLUS GPIO_Pin_0 //SW3 PE.10
#define PIN_BUTTON_ENTER GPIO_Pin_1 //SW2 PE.11
#define PIN_BUTTON_MINUS GPIO_Pin_2 //SW1 PE.12
#define PIN_BUTTON_MENU GPIO_Pin_11 //SW4 PD.07
#define PIN_BUTTON_EXIT GPIO_Pin_12 //SW5 PD.03
#define PIN_BUTTON_PAGE GPIO_Pin_10 //SW6 PD.02
// Trims
#define PIN_TRIM1_UP GPIO_Pin_3 //PC.03
#define PIN_TRIM1_DN GPIO_Pin_2 //PC.02
#define PIN_TRIM2_UP GPIO_Pin_1 //PC.01
#define PIN_TRIM2_DN GPIO_Pin_13 //PC.13
#define PIN_TRIM3_UP GPIO_Pin_4 //PE.04
#define PIN_TRIM3_DN GPIO_Pin_3 //PE.03
#define PIN_TRIM4_UP GPIO_Pin_6 //PE.06
#define PIN_TRIM4_DN GPIO_Pin_5 //PE.05
#define PIN_TRIM2_UP GPIO_Pin_1 //PC.01
#define PIN_TRIM2_DN GPIO_Pin_13 //PC.13
#define PIN_TRIM3_UP GPIO_Pin_4 //PE.04
#define PIN_TRIM3_DN GPIO_Pin_3 //PE.03
#define PIN_TRIM4_UP GPIO_Pin_6 //PE.06
#define PIN_TRIM4_DN GPIO_Pin_5 //PE.05
//Switch
#define PIN_SW_A_L GPIO_Pin_14 //PE.14
#define PIN_SW_B_H GPIO_Pin_3 //PB.03
#define PIN_SW_B_L GPIO_Pin_4 //PB.04
#define PIN_SW_C_H GPIO_Pin_5 //PB.05
#define PIN_SW_C_L GPIO_Pin_6 //PB.06
#define PIN_SW_D_H GPIO_Pin_7 //PB.07
#define PIN_SW_D_L GPIO_Pin_2 //PE.02
#define PIN_SW_E_H GPIO_Pin_0 //PB.00
#define PIN_SW_E_L GPIO_Pin_5 //PA.05
#define PIN_SW_F_H GPIO_Pin_7 //PE.07
#define PIN_SW_F_L GPIO_Pin_1 //PB.01
#define PIN_SW_G_H GPIO_Pin_9 //PE.09
#define PIN_SW_G_L GPIO_Pin_8 //PE.08
#define PIN_SW_H_L GPIO_Pin_13 //PE.13
// Switchs
#define PIN_SW_A_L GPIO_Pin_14 //PE.14
#define PIN_SW_B_H GPIO_Pin_3 //PB.03
#define PIN_SW_B_L GPIO_Pin_4 //PB.04
#define PIN_SW_C_H GPIO_Pin_5 //PB.05
#define PIN_SW_C_L GPIO_Pin_6 //PB.06
#define PIN_SW_D_H GPIO_Pin_7 //PB.07
#define PIN_SW_D_L GPIO_Pin_2 //PE.02
#define PIN_SW_E_H GPIO_Pin_0 //PB.00
#define PIN_SW_E_L GPIO_Pin_5 //PA.05
#define PIN_SW_F_H GPIO_Pin_7 //PE.07
#define PIN_SW_F_L GPIO_Pin_1 //PB.01
#define PIN_SW_G_H GPIO_Pin_9 //PE.09
#define PIN_SW_G_L GPIO_Pin_8 //PE.08
#define PIN_SW_H_L GPIO_Pin_13 //PE.13
//ADC---8个
// ADC
#define PIN_STK_J1 GPIO_Pin_0 //PA.00
#define PIN_STK_J2 GPIO_Pin_1 //PA.01
#define PIN_STK_J3 GPIO_Pin_2 //PA.02
@@ -52,10 +53,10 @@ GPIOS----
#define PIN_MVOLT GPIO_Pin_0 //PC.00
#define RCC_AHB1Periph_GPIOADC RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOC
//DAC---1个
// DAC
#define PIN_AUDIO_DAC GPIO_Pin_4 //PA.04
//Power_OFF Delay and LED
// Power_OFF Delay and LED
#define PIN_PWR_LED GPIO_Pin_6 //PC.06
#define PIN_PWR_STATUS GPIO_Pin_1 //PD.01
#define PIN_MCU_PWR GPIO_Pin_0 //PD.00
@@ -63,40 +64,41 @@ GPIOS----
#define GPIOPWRLED GPIOC
#define GPIOPWR GPIOD
//Smart-Port
// Smart-Port
#define PIN_SPORT_ON GPIO_Pin_4 //PD.04
#define PIN_SPORT_TX GPIO_Pin_5 //PD.05
#define PIN_SPORT_RX GPIO_Pin_6 //PD.06
//Trainer Port
// Trainer Port
#define PIN_TR_PPM_IN GPIO_Pin_8 //PC.08
#define PIN_TR_PPM_OUT GPIO_Pin_9 //PC.09
//Cppm
// Cppm
#define RCC_AHB1Periph_GPIOCPPM RCC_AHB1Periph_GPIOA
#define PIN_CPPM_OUT GPIO_Pin_8 //PA.08
#define GPIOCPPM GPIOA
#define GPIO_PinSource_CPPM GPIO_PinSource8
//Heart Beat
// Heart Beat
#define PIN_HEART_BEAT GPIO_Pin_7 //PC.07
//Update UART----RS232 ---UART3
// Update UART----RS232 ---UART3
#define PIN_UPDATE_UART_TX GPIO_Pin_10 //PB.10
#define PIN_UPDATE_UART_RX GPIO_Pin_11 //PB.11
//USB_OTG
// USB_OTG
#define PIN_FS_VBUS GPIO_Pin_9 //PA.09
#define PIN_FS_ID GPIO_Pin_10 //PA.10
#define PIN_FS_DM GPIO_Pin_11 //PA.11
#define PIN_FS_DP GPIO_Pin_12 //PA.12
//BackLight PB8
// BackLight PB8
#define RCC_AHB1Periph_GPIOBL RCC_AHB1Periph_GPIOB
#define GPIO_Pin_BL GPIO_Pin_8 //PB.08
#define GPIOBL GPIOB
#define GPIO_PinSource_BL GPIO_PinSource8
//LCD GPIOD 10-14 模拟spi
// LCD GPIOD 10-14
#define RCC_AHB1Periph_LCD RCC_AHB1Periph_GPIOD
#define GPIO_LCD GPIOD
#define PIN_LCD_MOSI GPIO_Pin_10 //PD.10
@@ -105,7 +107,7 @@ GPIOS----
#define PIN_LCD_A0 GPIO_Pin_13 //PD.13
#define PIN_LCD_RST //GPIO_Pin_12 //pd12 test //RESET occurs when powered up,but should delay before initialize
//Audio----I2S3
// Audio----I2S3
//#define CODEC_I2S_ADDRESS 0x4000380C
#define CODEC_I2S SPI3
#define CODEC_I2S_CLK RCC_APB1Periph_SPI3
@@ -127,7 +129,7 @@ GPIOS----
//#define CODEC_I2S_FLT GPIO_Pin_ //IIR/FIR
//#define CODEC_I2S_MODE GPIO_Pin_ //Connect to GND=I2S_STANDARD
//Eeprom与cat5137
// Eeprom 5137
#define I2C_EE_GPIO GPIOE
#define I2C_EE_WP_GPIO GPIOB
#define I2C_EE_GPIO_CLK RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_GPIOE
@@ -135,7 +137,7 @@ GPIOS----
#define I2C_EE_SDA GPIO_Pin_0 //PE0
#define I2C_EE_WP GPIO_Pin_9 //PB9
//SD卡---spi2
// SD---spi2
#define SPI_SD SPI2
#define GPIO_AF_SD GPIO_AF_SPI2
#define RCC_AHB1Periph_GPIO_CS RCC_AHB1Periph_GPIOB
@@ -157,28 +159,14 @@ GPIOS----
#define GPIO_Pin_WP GPIO_Pin_8 //PD.08
#define GPIO_Pin_CP GPIO_Pin_9 //PD.09
#define GPIO_CTL_SD GPIOD
/*****************************************************************************
**************************************************************************
*******************************************************************************/
//其他接口涉及的可修改的宏定义
/******************************
lcd用
**************************************/
#define HIGHT (64)
#define WIDTH (212)
/*****************************************
Audio----I2S3-----SPI3
***************************************************************/
//#define CODEC_MCLK_ENABLED
// Audio----I2S3-----SPI3
#define CODEC_MCLK_DISABLED
#define CODEC_USE_INT
//#define CODEC_USE_DMA
#define AudioFreq I2S_AudioFreq_44k
/*************************************************
模拟I2C---EEPROM and CAT5137共用
********************************************************/
// EEPROM and CAT5137
#define EE_M24C08 /* Support the device: M24C08. */
//#define EE_M24C64_32 /* Support the devices: M24C32 and M24C64 */
#define I2C_Speed 200000
@@ -204,16 +192,14 @@ Audio----I2S3-----SPI3
#define I2C_CAT5137_ADDRESS 0x5C//0101110
#endif
/*****************************************
SD card----SPI2
***************************************************************/
// SD card----SPI2
// demo uses a command line option to define this (see Makefile):
// #define STM32_SD_USE_DMA
#ifdef STM32_SD_USE_DMA
// #warning "Information only: using DMA"
#pragma message "*** Using DMA ***"
#endif
/* set to 1 to provide a disk_ioctrl function even if not needed by the FatFs */
#define STM32_SD_DISK_IOCTRL_FORCE (0)
@@ -223,33 +209,11 @@ SD card----SPI2
#define SPI_BaudRatePrescaler_SPI_SD SPI_BaudRatePrescaler_4 // - for SPI1 and full-speed APB2: 60MHz/4 =15MHZ < 20MHZ
//selectable
//DMA相关未作修改
// Selectable
// DMA
#define DMA_Channel_SPI_SD_RX DMA1_Channel2
#define DMA_Channel_SPI_SD_TX DMA1_Channel3
#define DMA_FLAG_SPI_SD_TC_RX DMA1_FLAG_TC2
#define DMA_FLAG_SPI_SD_TC_TX DMA1_FLAG_TC3
/******************************************
***************************************************************/
#endif
#endif
+42 -168
View File
@@ -33,184 +33,58 @@
#include "../open9x.h"
#if 0
// TODO code from FrSky
void detect_buttons()
{
short t_pin; short t_pin1;
static short key_down_interval;
key_down_interval++;
t_pin = (~(GPIOC->IDR))
& (PIN_BUTTON_UP | PIN_BUTTON_ENTER | PIN_BUTTON_DOWN);
t_pin1 = (~(GPIOB->IDR)) & (PIN_POWER | PIN_BIND);
if ((t_pin1 & PIN_BIND) && (!(pin_status1 & PIN_BIND))
&& (!(t_pin1 & PIN_POWER))) {
}
if ((t_pin1 & PIN_POWER) && (!(pin_status1 & PIN_POWER))) {
}
if ((pin_status1 & PIN_BIND) && (pin_status1 & PIN_POWER)) {
static char t_pin_bind;
t_pin_bind++; //Õâ¸ö±äÁ¿
if ((t_pin_bind == 39) || (t_pin_bind == 69)) {
t_pin_bind = 40;
//SetIDProc(0,0,0,t_pin_bind);
}
}
if ((t_pin & PIN_BUTTON_UP) && (!(pin_status & PIN_BUTTON_UP))) {
}
if ((t_pin & PIN_BUTTON_ENTER) && (!(pin_status & PIN_BUTTON_ENTER))) {
}
if ((t_pin & PIN_BUTTON_DOWN) && (!(pin_status & PIN_BUTTON_DOWN))) {
}
//////////////////////////////////////////////////////////////////////////////////////
if ((pin_status & PIN_BUTTON_UP)) {
static char t_pin_up;
t_pin_up++; //Õâ¸ö±äÁ¿
if ((t_pin_up == 9) || (t_pin_up == 22)) {
t_pin_up = 10;
}
else if ((!(t_pin & PIN_BUTTON_UP))) {
}
}
if ((pin_status & PIN_BUTTON_ENTER)) {
static char t_pin_enter;
t_pin_enter++;
if ((t_pin_enter == 9) || (t_pin_enter == 22)) {
t_pin_enter = 10;
}
else if ((!(t_pin & PIN_BUTTON_ENTER))) {
if (t_pin_enter < 9)
t_pin_enter = 0;
}
}
if ((pin_status & PIN_BUTTON_DOWN)) {
static char t_pin_down;
t_pin_down++;
if ((t_pin_down == 9) || (t_pin_down == 22)) {
t_pin_down = 10;
}
else if ((!(t_pin & PIN_BUTTON_DOWN))) {
if (t_pin_down < 9)
t_pin_down = 0;
}
}
pin_status = t_pin;
pin_status1 = t_pin1;
}
#endif
// TODO FrSky code included PIN_BIND and PIN_POWER
uint32_t readKeys()
{
register uint32_t x = GPIOC->IDR; // 6 LEFT, 5 RIGHT, 4 DOWN, 3 UP
register uint32_t y = 0;
register uint32_t d = GPIOD->IDR;
register uint32_t e = GPIOE->IDR;
register uint32_t result = 0;
if (x & 0x00000020)
y |= 0x02 << KEY_ENTER;
if (x & 0x00000010)
y |= 0x02 << KEY_PLUS;
if (x & 0x00000008)
y |= 0x02 << KEY_MINUS;
if (x & 0x00000002)
y |= 0x02 << KEY_MENU;
if (x & 0x00000040)
y |= 0x02 << KEY_PAGE;
if (x & 0x01000000)
y |= 0x02 << KEY_EXIT;
if (e & PIN_BUTTON_ENTER)
result |= 0x02 << KEY_ENTER;
if (e & PIN_BUTTON_PLUS)
result |= 0x02 << KEY_PLUS;
if (e & PIN_BUTTON_MINUS)
result |= 0x02 << KEY_MINUS;
// printf("readKeys(): %x => %x\n", x, y); fflush(stdout);
if (d & PIN_BUTTON_MENU)
result |= 0x02 << KEY_MENU;
if (d & PIN_BUTTON_PAGE)
result |= 0x02 << KEY_PAGE;
if (d & PIN_BUTTON_EXIT)
result |= 0x02 << KEY_EXIT;
return y ;
// printf("readKeys(): %x %x => %x\n", d, e, result); fflush(stdout);
return result;
}
uint32_t readTrims()
{
#if 0
register uint32_t c = GPIOC->IDR;
register uint32_t e = GPIOE->IDR;
register uint32_t result = 0;
uint32_t trims;
uint32_t trima;
if (c & PIN_TRIM1_UP)
result |= 0x02;
if (c & PIN_TRIM1_DN)
result |= 0x01;
if (c & PIN_TRIM2_UP)
result |= 0x04;
if (c & PIN_TRIM2_DN)
result |= 0x03;
trims = 0;
if (e & PIN_TRIM3_UP)
result |= 0x06;
if (e & PIN_TRIM3_DN)
result |= 0x05;
if (e & PIN_TRIM4_UP)
result |= 0x08;
if (e & PIN_TRIM4_DN)
result |= 0x07;
trima = PIOA->PIO_PDSR;
// TRIM_LH_DOWN PA7 (PA23)
#if defined(REVA)
if ( ( trima & 0x0080 ) == 0 )
#else
if ((trima & 0x00800000) == 0)
#endif
{
trims |= 1;
}
// TRIM_LV_DOWN PA27 (PA24)
#if defined(REVA)
if ( ( trima & 0x08000000 ) == 0 )
#else
if ((trima & 0x01000000) == 0)
#endif
{
trims |= 4;
}
// TRIM_RV_UP PA30 (PA1)
#if defined(REVA)
if ( ( trima & 0x40000000 ) == 0 )
#else
if ((trima & 0x00000002) == 0)
#endif
{
trims |= 0x20;
}
// TRIM_RH_DOWN PA29 (PA0)
#if defined(REVA)
if ( ( trima & 0x20000000 ) == 0 )
#else
if ((trima & 0x00000001) == 0)
#endif
{
trims |= 0x40;
}
// TRIM_LH_UP PB4
if ((PIOB->PIO_PDSR & 0x10) == 0) {
trims |= 2;
}
trima = PIOC->PIO_PDSR;
// TRIM_LV_UP PC28
if ((trima & 0x10000000) == 0) {
trims |= 8;
}
// TRIM_RV_DOWN PC10
if ((trima & 0x00000400) == 0) {
trims |= 0x10;
}
// TRIM_RH_UP PC9
if ((trima & 0x00000200) == 0) {
trims |= 0x80;
}
return trims;
#endif
return 0;
return result;
}
uint8_t keyDown()
@@ -246,16 +120,16 @@ void keysInit()
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOBUTTON, ENABLE);
/* GPIO Configuration*/
GPIO_InitStructure.GPIO_Pin = PIN_BUTTON_UP | PIN_BUTTON_ENTER | PIN_BUTTON_DOWN | PIN_TRIM3_UP | PIN_TRIM3_DN
GPIO_InitStructure.GPIO_Pin = PIN_BUTTON_PLUS | PIN_BUTTON_ENTER | PIN_BUTTON_MINUS | PIN_TRIM3_UP | PIN_TRIM3_DN
| PIN_TRIM4_UP |PIN_TRIM4_DN | PIN_SW_A_L | PIN_SW_D_L | PIN_SW_F_H | PIN_SW_G_H
| PIN_SW_G_L | PIN_SW_H_L;
| PIN_SW_G_L | PIN_SW_H_L;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP ;
GPIO_Init(GPIOE, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = PIN_HOME | PIN_ESC | PIN_PAGE;
GPIO_InitStructure.GPIO_Pin = PIN_BUTTON_MENU | PIN_BUTTON_EXIT | PIN_BUTTON_PAGE;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
-50
View File
@@ -1,50 +0,0 @@
#include "hal.h"
#include "stm32f2xx.h"
#include "pwr_ctrl.h"
void pwr_ctrl_down()
{
GPIO_SetBits(GPIOPWR,PIN_MCU_PWR);
//ee_save_data();
GPIO_ResetBits(GPIOPWR,PIN_MCU_PWR);
}
void pwr_ctrl_on()
{
}
void check_pwr() //¶¨Ê±ÒÖ»òÖжϣ¬ÔÙ²âÊÔ
{
if( GPIO_ReadInputDataBit(GPIOPWR,PIN_PWR_STATUS) == Bit_RESET)
{
pwr_ctrl_down();
}
}
void pwr_io_init()
{
GPIO_InitTypeDef GPIO_InitStructure;
/* GPIOC GPIOD clock enable */
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOPWR, ENABLE);
/* GPIO Configuration*/
GPIO_InitStructure.GPIO_Pin = PIN_MCU_PWR | PIN_PWR_ON;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP ;
GPIO_Init(GPIOPWR, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = PIN_PWR_STATUS;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
GPIO_Init(GPIOPWR, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = PIN_PWR_LED;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP ;
GPIO_Init(GPIOPWRLED, &GPIO_InitStructure);
}
-7
View File
@@ -1,7 +0,0 @@
#ifndef _PWR_CTRL_H_
#define _PWR_CTRL_H_
#endif
+74
View File
@@ -0,0 +1,74 @@
/*
* Authors (alphabetical order)
* - Bertrand Songis <bsongis@gmail.com>
* - Bryan J. Rentoul (Gruvin) <gruvin@gmail.com>
* - Cameron Weeks <th9xer@gmail.com>
* - Erez Raviv
* - Jean-Pierre Parisy
* - Karl Szmutny <shadow@privy.de>
* - Michael Blandford
* - Michal Hlavinka
* - Pat Mackenzie
* - Philip Moss
* - Rob Thomson
* - Romolo Manfredini <romolo.manfredini@gmail.com>
* - Thomas Husterer
*
* open9x is based on code named
* gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/,
* er9x by Erez Raviv: http://code.google.com/p/er9x/,
* and the original (and ongoing) project by
* Thomas Husterer, th9x: http://code.google.com/p/th9x/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include "../open9x.h"
void soft_power_off()
{
GPIO_SetBits(GPIOPWR,PIN_MCU_PWR);
GPIO_ResetBits(GPIOPWR,PIN_MCU_PWR);
}
uint32_t check_soft_power()
{
if (GPIO_ReadInputDataBit(GPIOPWR,PIN_PWR_STATUS) == Bit_RESET)
return e_power_off;
else
return e_power_on;
}
void pwrInit()
{
GPIO_InitTypeDef GPIO_InitStructure;
/* GPIOC GPIOD clock enable */
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOPWR, ENABLE);
/* GPIO Configuration*/
GPIO_InitStructure.GPIO_Pin = PIN_MCU_PWR | PIN_PWR_LED;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP ;
GPIO_Init(GPIOPWR, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = PIN_PWR_STATUS;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
GPIO_Init(GPIOPWR, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = PIN_PWR_LED;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP ;
GPIO_Init(GPIOPWRLED, &GPIO_InitStructure);
}
+1 -30
View File
@@ -153,35 +153,6 @@ void cancelTimer(char timerID)
}
/**************************************************************************
*****************************************************************************
******************************************************************************/
@@ -253,4 +224,4 @@ void cancelTimer(char timerID)
}
/****************************************************************************
****************************************************************************/
****************************************************************************/