感谢楼主,下载成功,安装提示缺少,Java Runtime Environment,然后我安装了Java,然后进入安装,自动选择安装目录,安装一阵,最后提醒, javaw.exe not found ,reinstall java jre;实际上,我的电脑里搜索,有javaw.exe 。因此,MicroXplorer无法安装,困惑。
生成代码鉴赏:论坛啥时候能支持代码片段呢????? / }* z( z7 R& Y) K! H/ G 3 m2 S6 Y4 V; U8 V6 Y" y$ }
/**8 S1 c! P: X) Z5 M* j+ B/ y
******************************************************************************3 f9 F0 M5 e, ?: w9 N! J: F K6 ^
* File Name : mx_gpio.c , {1 l5 t( g( L0 I * Date : 03/01/2014 15:37:11 ' N1 y0 f2 \% J, x+ \! C; Y. s! i * Description : This file provides code for the configuration1 H; y( M' { q2 @. G. _
* of all used GPIO pins.* Y0 e% |: C; ?" h; |) {$ l
****************************************************************************** : Y8 J4 k+ i+ ^- m+ ^ * 0 V: G8 I+ o: c$ I * COPYRIGHT 2014 STMicroelectronics % R1 x7 `! l5 R) a$ L * ) i9 N$ T o6 I( v5 m * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); ; B# d2 f6 y% ~4 |5 {% Q, y * You may not use this file except in compliance with the License. 2 O9 ?9 q! ~, \% |8 `' Z * You may obtain a copy of the License at: . g9 M# u8 k( ?+ p * & `9 |, [* P0 k- L& B4 W * http:www.st.com/software_license_agreement_liberty_v2- {# _7 [9 K& k
*; J- L, p: Y8 ^" M
* Unless required by applicable law or agreed to in writing, software 4 V5 s# y* A* B* N: q2 S * distributed under the License is distributed on an "AS IS" BASIS, ' R4 r& ~, X8 y0 z4 F * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.3 k# a. A! n; R
* See the License for the specific language governing permissions and# B. ]1 x$ ^0 o
* limitations under the License. 9 r- a+ ?; b8 @, y *5 U8 a2 t& ?$ U: ~2 z$ \
******************************************************************************& u3 ^8 K, b+ F6 q0 v
*/ 8 n: G) M! F+ t 7 E9 O: l4 `& e' O# ?9 l2 \
/* Includes ------------------------------------------------------------------*/( b8 ^' y+ t& R( A; }, C& h
#include "mx_gpio.h" * |0 K- L' Z- B5 Z! F6 U- p0 h$ X/* USER CODE BEGIN 0 */ r: L( z5 K: t 4 K8 K+ ^! P5 d; M2 ?
/* USER CODE END 0 */ ! e$ P$ b5 }! b; p; g# ?& [ " Y8 v- D3 [0 M1 p& p5 g4 h/*----------------------------------------------------------------------------*/ ' i/ L& C9 K5 q3 p/* Configure GPIO */ @- |% s' ^8 Z2 Q O: P/ O3 }4 k/*----------------------------------------------------------------------------*/" w! I7 c5 x% i% I7 d. l
/* USER CODE BEGIN 1 */ " x1 j; o/ B8 u3 L+ p$ e8 i & B% v. Z5 _. \ t/* USER CODE END 1 */ ( O: c. R J5 f" n# M/ c+ h I 9 g$ z5 W5 K; H; S3 ~1 z' A" L
void mx_pinout_config(void) {% B+ {/ y) e4 t: n2 X4 b, R
/* Private typedef ---------------------------------------------------------*/ 5 t. z2 v6 \/ v6 u6 n0 I, H: E/ l i+ W GPIO_InitTypeDef GPIO_InitStruct;5 P( ^, B. }* _3 H5 O
% j$ u% y" L4 r% U) ]1 z/ z
! E5 O B" C5 }: V9 w- I' v /** ADC GPIO Configuration 1 _4 _2 _& s& K* D$ G6 y9 _0 Z' G
PA1 ------> ADC_IN1 , L" |$ K( \ V */ . R: u' A2 |- @# O; { 3 u# m+ m$ M$ r' j) c* ?9 Y. y
9 f3 @- P( k: A( j$ l
/*Enable or disable the AHB peripheral clock */9 w' `4 F- t' I
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE); 9 M1 S* f: A5 ^. p% b # r2 N8 E+ w: R; O1 P/ j! P# H# j /*Configure GPIO pin */. r: T* B6 t$ {6 t
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_1; r6 }; I3 H9 D% d5 D GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AN; 4 A5 ?0 M+ c& C: ^ GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL; ( X( X$ k1 U! l GPIO_Init(GPIOA, &GPIO_InitStruct); - \- [2 R8 K. c- s 3 {) G- p) e" P" s8 a4 L ; E [3 n' |, |* Q0 p /** I2C1 GPIO Configuration ; L. r+ d: h& p% w/ Q
PB6 ------> I2C1_SCL) v1 G" w, M$ B
PB7 ------> I2C1_SDA ! ^5 ^1 ] G$ s0 Z */+ Y' }: X( ]$ H2 V+ ^ Z
, ^; }7 j% u" O7 d0 [. d j: s9 g( s% ]1 I" g0 Z. D4 Z /*Enable or disable the AHB peripheral clock */ ) X8 o, R' J9 h/ O. I6 q RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOB, ENABLE); ) z0 e0 |5 { ^6 f 8 [' {' z L5 o/ Z# y. f
, b' |. t! k# d) W: ^- K
//!!! GPIO_Init is commented because some parameters are missing ' |- ] t/ J& g! y GPIO_InitStruct.GPIO_Pin = GPIO_Pin_6;% Z Z7 P. c( L& Q( C
GPIO_InitStruct.GPIO_Mode = ;: i" P) h) o* s( G' p: d
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP; * u- @0 b7 R; i2 C GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;2 s9 s6 j; m" ~6 i7 [
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;9 l, A1 w2 O1 m- c
GPIO_Init(GPIOB, &GPIO_InitStruct); - Q6 H- T. G e2 }% R0 C4 l- x! b + j; F1 ~' j* s, d5 }. y t: l7 s( ]/ l6 J0 | u, ~/ B
//!!! GPIO_Init is commented because some parameters are missing 5 G9 v, s0 W7 g GPIO_InitStruct.GPIO_Pin = GPIO_Pin_7; " u, f' G: ~$ j2 q3 I5 j: ~ GPIO_InitStruct.GPIO_Mode = ;$ x2 q4 Q1 i- V: e
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP; % Q& b" L% \( a5 T6 Z" g, i! h7 x GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL; " C" K6 S6 }; D* `" ~4 H' b% n GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;0 f' i1 Z3 R1 d' W4 K5 O Q
GPIO_Init(GPIOB, &GPIO_InitStruct);7 Y* R& P9 s% G
p) j: y7 w+ S7 a. N9 R5 l7 c
/*Configure GPIO pin alternate function */& `0 a" D$ p5 {+ i
GPIO_PinAFConfig(GPIOB, GPIO_PinSource6, GPIO_AF_I2C1); ( v" ?; V- ?) g- T7 l+ W D' {* z3 N 1 U$ a7 q3 n A5 U
/*Configure GPIO pin alternate function */: l: ]0 q1 K3 Q
GPIO_PinAFConfig(GPIOB, GPIO_PinSource7, GPIO_AF_I2C1);6 M6 O' ?/ b, p/ [9 p, C
" Q6 u3 ^) N$ [& x! q ; {! u) b4 g# `, E /** SPI2 GPIO Configuration ' h* C e1 J% [0 C# [# t PB12 ------> SPI2_NSS, a# W7 k- s$ G! J8 A/ F$ z
PB13 ------> SPI2_SCK7 a/ ?; d1 N" y
PB14 ------> SPI2_MISO) x! v) j9 Y6 Q+ ?. x; q E x
PB15 ------> SPI2_MOSI) T2 L! U) [ t. z
*/4 o: I6 ?5 c, s4 q O. M
- |1 C' v# M5 D. }/ B$ C- f4 \" {, F 2 t8 d$ {5 ?0 m Y; y /*Enable or disable the AHB peripheral clock */ ( N3 z& v( V J3 A' F, q( n, S RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOB, ENABLE);, h+ X5 N: A& F5 @8 n! |
+ E2 `4 i" [$ V & K7 h- m7 l- v //!!! GPIO_Init is commented because some parameters are missing6 m) i$ J: g5 S3 ]# q( M7 j
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_12; 3 {! b' h, G, |1 \3 ]. v GPIO_InitStruct.GPIO_Mode = ; 9 M* P9 N. v' q" Q7 K. W GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;' ]1 o& }4 E( E0 S }" W- j2 s( E
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL; - W, q* L- r6 p# f7 d2 f( w/ R GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz; ; r7 Q4 d, r% V- Z GPIO_Init(GPIOB, &GPIO_InitStruct); - ~( n7 J! Y0 S 2 y% V! d: v, m G- ]% n $ c; m% ^3 B1 q4 G v
//!!! GPIO_Init is commented because some parameters are missing ! b) l B/ k, ^) R4 x8 f GPIO_InitStruct.GPIO_Pin = GPIO_Pin_13; 8 k) S; ^+ V; p! m, j GPIO_InitStruct.GPIO_Mode = ; & c3 B/ Y4 _0 j% n/ \ GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;/ u1 O- l/ ~0 Q( @
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL; 6 d6 V$ |# W- D$ Z4 k- T GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;& K2 G. f T) l \$ ^
GPIO_Init(GPIOB, &GPIO_InitStruct);& f* Q, f- U) h) L
4 C8 P: k! @' Z+ c, v
" j9 u# q) p# \6 V! w5 w/ x
//!!! GPIO_Init is commented because some parameters are missing 1 k3 S' U9 R5 A GPIO_InitStruct.GPIO_Pin = GPIO_Pin_14; 3 M) w7 A S2 e GPIO_InitStruct.GPIO_Mode = ;3 m4 m) t# t9 B
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;6 ?6 j# g6 j7 ?5 ?+ C! c
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL; # A1 b# ]3 w* X2 D' k% z- t GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz; ! J! d9 U6 c9 p7 j7 ^0 C GPIO_Init(GPIOB, &GPIO_InitStruct);- ^! x; n9 _3 m8 N
for(i=0; i<4; i++)//R G B 中一个字节对应的发送缓存
{' v$ i; c, M* j5 N/ z
tmp = (uint8_t)(color &0x00000003);0 Q+ ?: ?# ?6 I# Y
switch(tmp)
{$ y) B; L0 ~( o6 v; V) e6 Z
case 0x00:/ e5 [. d/ ` o" P K, z8 t
*pb = BIT00;
break;
case 0x01:. C8 W8 K0 `; e: K9 c
*pb = BIT01;9 n2 ~5 q+ L2 `0 W$ H- ~/ ?* V
break;2 H1 o+ p& X1 Z% V
case 0x02:
*pb = BIT10;
break;0 G8 c6 f9 G- ^! h5 I% z8 G
case 0x03:
*pb = BIT11;9 ?# w7 S/ T( l- d, X
break;
}
color = color >>2;
pb--; _' E$ b5 A) d5 M0 D
}
pb += 7;
}
这样就可以了,在安装目录了里会有一个.jar文件,双击打开即可
RE:ST公司出品【图形化配置工具】
3 m2 S6 Y4 V; U8 V6 Y" y$ }
/**8 S1 c! P: X) Z5 M* j+ B/ y
******************************************************************************3 f9 F0 M5 e, ?: w9 N! J: F K6 ^
* File Name : mx_gpio.c
* Date : 03/01/2014 15:37:11
* Description : This file provides code for the configuration1 H; y( M' { q2 @. G. _
* of all used GPIO pins.* Y0 e% |: C; ?" h; |) {$ l
******************************************************************************
*
* COPYRIGHT 2014 STMicroelectronics
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http:www.st.com/software_license_agreement_liberty_v2- {# _7 [9 K& k
*; J- L, p: Y8 ^" M
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.3 k# a. A! n; R
* See the License for the specific language governing permissions and# B. ]1 x$ ^0 o
* limitations under the License.
*5 U8 a2 t& ?$ U: ~2 z$ \
******************************************************************************& u3 ^8 K, b+ F6 q0 v
*/
7 E9 O: l4 `& e' O# ?9 l2 \
/* Includes ------------------------------------------------------------------*/( b8 ^' y+ t& R( A; }, C& h
#include "mx_gpio.h"
/* USER CODE BEGIN 0 */
4 K8 K+ ^! P5 d; M2 ?
/* USER CODE END 0 */
/*----------------------------------------------------------------------------*/
/* Configure GPIO */
/*----------------------------------------------------------------------------*/" w! I7 c5 x% i% I7 d. l
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
9 g$ z5 W5 K; H; S3 ~1 z' A" L
void mx_pinout_config(void) {% B+ {/ y) e4 t: n2 X4 b, R
/* Private typedef ---------------------------------------------------------*/
GPIO_InitTypeDef GPIO_InitStruct;5 P( ^, B. }* _3 H5 O
% j$ u% y" L4 r% U) ]1 z/ z
/** ADC GPIO Configuration 1 _4 _2 _& s& K* D$ G6 y9 _0 Z' G
PA1 ------> ADC_IN1
*/
3 u# m+ m$ M$ r' j) c* ?9 Y. y
9 f3 @- P( k: A( j$ l
/*Enable or disable the AHB peripheral clock */9 w' `4 F- t' I
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);
/*Configure GPIO pin */. r: T* B6 t$ {6 t
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_1;
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AN;
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(GPIOA, &GPIO_InitStruct);
/** I2C1 GPIO Configuration ; L. r+ d: h& p% w/ Q
PB6 ------> I2C1_SCL) v1 G" w, M$ B
PB7 ------> I2C1_SDA
*/+ Y' }: X( ]$ H2 V+ ^ Z
/*Enable or disable the AHB peripheral clock */
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOB, ENABLE);
8 [' {' z L5 o/ Z# y. f
, b' |. t! k# d) W: ^- K
//!!! GPIO_Init is commented because some parameters are missing
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_6;% Z Z7 P. c( L& Q( C
GPIO_InitStruct.GPIO_Mode = ;: i" P) h) o* s( G' p: d
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;2 s9 s6 j; m" ~6 i7 [
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;9 l, A1 w2 O1 m- c
GPIO_Init(GPIOB, &GPIO_InitStruct);
t: l7 s( ]/ l6 J0 | u, ~/ B
//!!! GPIO_Init is commented because some parameters are missing
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_7;
GPIO_InitStruct.GPIO_Mode = ;$ x2 q4 Q1 i- V: e
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;0 f' i1 Z3 R1 d' W4 K5 O Q
GPIO_Init(GPIOB, &GPIO_InitStruct);7 Y* R& P9 s% G
p) j: y7 w+ S7 a. N9 R5 l7 c
/*Configure GPIO pin alternate function */& `0 a" D$ p5 {+ i
GPIO_PinAFConfig(GPIOB, GPIO_PinSource6, GPIO_AF_I2C1);
1 U$ a7 q3 n A5 U
/*Configure GPIO pin alternate function */: l: ]0 q1 K3 Q
GPIO_PinAFConfig(GPIOB, GPIO_PinSource7, GPIO_AF_I2C1);6 M6 O' ?/ b, p/ [9 p, C
/** SPI2 GPIO Configuration
PB12 ------> SPI2_NSS, a# W7 k- s$ G! J8 A/ F$ z
PB13 ------> SPI2_SCK7 a/ ?; d1 N" y
PB14 ------> SPI2_MISO) x! v) j9 Y6 Q+ ?. x; q E x
PB15 ------> SPI2_MOSI) T2 L! U) [ t. z
*/4 o: I6 ?5 c, s4 q O. M
/*Enable or disable the AHB peripheral clock */
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOB, ENABLE);, h+ X5 N: A& F5 @8 n! |
//!!! GPIO_Init is commented because some parameters are missing6 m) i$ J: g5 S3 ]# q( M7 j
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_12;
GPIO_InitStruct.GPIO_Mode = ;
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;' ]1 o& }4 E( E0 S }" W- j2 s( E
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;
GPIO_Init(GPIOB, &GPIO_InitStruct);
$ c; m% ^3 B1 q4 G v
//!!! GPIO_Init is commented because some parameters are missing
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_13;
GPIO_InitStruct.GPIO_Mode = ;
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;/ u1 O- l/ ~0 Q( @
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;& K2 G. f T) l \$ ^
GPIO_Init(GPIOB, &GPIO_InitStruct);& f* Q, f- U) h) L
4 C8 P: k! @' Z+ c, v
" j9 u# q) p# \6 V! w5 w/ x
//!!! GPIO_Init is commented because some parameters are missing
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_14;
GPIO_InitStruct.GPIO_Mode = ;3 m4 m) t# t9 B
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;6 ?6 j# g6 j7 ?5 ?+ C! c
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;
GPIO_Init(GPIOB, &GPIO_InitStruct);- ^! x; n9 _3 m8 N
6 _0 R# q6 j! I7 c& K/ p1 V! B
//!!! GPIO_Init is commented because some parameters are missing
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_15;6 w, p7 n: ?; L) Z3 R
GPIO_InitStruct.GPIO_Mode = ;
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;1 ?2 E5 Q0 l M! H0 r) v: C7 c2 @
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;, j( I) ^# R9 d- b; \
GPIO_Init(GPIOB, &GPIO_InitStruct);2 X* {! }! ]8 J% J# J, D) |# |( B
/*Configure GPIO pin alternate function */) j+ P4 v ^% t! Z
GPIO_PinAFConfig(GPIOB, GPIO_PinSource12, GPIO_AF_SPI2);
% @, s/ {7 G$ [# X# |
/*Configure GPIO pin alternate function */
GPIO_PinAFConfig(GPIOB, GPIO_PinSource13, GPIO_AF_SPI2);+ b: m, g( [% {
: ^3 H' D: H+ P, @
/*Configure GPIO pin alternate function */
GPIO_PinAFConfig(GPIOB, GPIO_PinSource14, GPIO_AF_SPI2);1 ~: j" { [1 t+ \
+ q; t* Y% c+ `( J( U* O0 d
/*Configure GPIO pin alternate function */
GPIO_PinAFConfig(GPIOB, GPIO_PinSource15, GPIO_AF_SPI2);
; Q& N$ p6 L/ g# a, H; L1 E4 M- A* O
/** USART1 GPIO Configuration # k2 C) ~# n. E9 ]2 [- Q
PA9 ------> USART1_TX% X" I6 }% q1 k3 W; m* D
PA10 ------> USART1_RX
*/$ i" m0 @2 b$ H* ~0 l
/*Enable or disable the AHB peripheral clock */
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);
" }/ [0 T# I- k# y$ @+ e* Y7 A
//!!! GPIO_Init is commented because some parameters are missing
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_9;6 Q9 [& g8 P# C0 }: {
GPIO_InitStruct.GPIO_Mode = ;* s9 ]6 N# I& d
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;( e( P) Z( I& J' j$ }- A. u
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;
GPIO_Init(GPIOA, &GPIO_InitStruct);
8 Z' }7 {4 U- D& B# F/ \) ?
" X% ]& `) R2 Q) N+ N9 q+ P
//!!! GPIO_Init is commented because some parameters are missing
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_10;) {' o5 G) M1 g& l5 z6 |
GPIO_InitStruct.GPIO_Mode = ;- o* t1 r" E$ \
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;( w7 Z9 a0 c* {& X* ?6 A. j
GPIO_Init(GPIOA, &GPIO_InitStruct); A4 q0 X& C \2 ?" K% q
/*Configure GPIO pin alternate function */
GPIO_PinAFConfig(GPIOA, GPIO_PinSource9, GPIO_AF_USART1);5 U- ?2 @% N" l2 E5 A2 s% y' X+ P- g
/*Configure GPIO pin alternate function */7 \) u0 f# R2 W/ i# b% |1 i
GPIO_PinAFConfig(GPIOA, GPIO_PinSource10, GPIO_AF_USART1);
1 M, d/ o* |( @8 @3 B1 L
, T3 M9 t: t' X4 V+ d% k% U; l
/** USB GPIO Configuration * `) n7 p0 P6 [: q4 g! ~) q' p
PA11 ------> USB_DM
PA12 ------> USB_DP
*/+ ~( l6 s H4 V3 u" Z
4 N. m+ @* ?1 M" _# O
/*Enable or disable the AHB peripheral clock */
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);8 t" N4 Z$ z' h) u4 [* B. f3 E
//!!! GPIO_Init is commented because some parameters are missing
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_11;+ x0 K+ k( r/ @7 x; C% ^( ~
GPIO_InitStruct.GPIO_Mode = ;+ F- j! Q) _: B3 s
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;7 a7 ?2 x. o- I; s& y3 }4 e2 y- J- e
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;6 |# S3 X: s$ \ F' `+ f! ]$ [
GPIO_Init(GPIOA, &GPIO_InitStruct);
//!!! GPIO_Init is commented because some parameters are missing4 s# _- k+ b$ H k: Z! I
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_12;
GPIO_InitStruct.GPIO_Mode = ;
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;5 j. r2 h$ O$ [: e; s3 a5 K
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;6 d U" @! U% i9 ^* h' _+ ~' Q; q( e& u
GPIO_Init(GPIOA, &GPIO_InitStruct);3 f [. B' Q5 a {
# z# _: ^0 q5 P, G7 S% z/ B- }8 D3 I
& _8 j1 h' |" ^
/** Configure pins as GPIO% u3 G7 v1 R; k1 w/ F
PA8 ------> GPIO_Input) F* h- Z+ O( C+ ~. ?
*/
/*Enable or disable the AHB peripheral clock */$ }4 J4 |* F$ S; x( T5 w6 b& g
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);- A* c9 M, P) h9 C0 C; K
+ Y! K/ O R7 l6 O. u g
/*Configure GPIO pin */( ~' J# M* ^% v' y: y
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_8;
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IN;: r2 f, }* p$ H" C
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(GPIOA, &GPIO_InitStruct);2 P0 Y, k% j' B5 k
}4 J" [0 C7 M$ D; o a* D/ x4 N; ~
/* USER CODE BEGIN 2 */; d( a* N9 f$ w- a8 C8 ~' w; z1 o4 \
/* USER CODE END 2 */) v, C9 Y- j9 J o
回复:ST公司出品【图形化配置工具】
RE:ST公司出品【图形化配置工具】
RE:ST公司出品【图形化配置工具】
RE:ST公司出品【图形化配置工具】
RE:ST公司出品【图形化配置工具】
RE:ST公司出品【图形化配置工具】
RE:ST公司出品【图形化配置工具】
RE:ST公司出品【图形化配置工具】
回复:ST公司出品【图形化配置工具】
回复:ST公司出品【图形化配置工具】
RE:ST公司出品【图形化配置工具】
RE:ST公司出品【图形化配置工具】
RE:ST公司出品【图形化配置工具】