感谢楼主,下载成功,安装提示缺少,Java Runtime Environment,然后我安装了Java,然后进入安装,自动选择安装目录,安装一阵,最后提醒, javaw.exe not found ,reinstall java jre;实际上,我的电脑里搜索,有javaw.exe 。因此,MicroXplorer无法安装,困惑。
7 q% D& a, y, S, q* Y& [1 o! }/** ( W; _% v5 y: k ****************************************************************************** 0 [, ]# G' M8 g' O * File Name : mx_gpio.c " N# ~5 a) d( o2 ^3 W * Date : 03/01/2014 15:37:11 # o% }. f8 ?4 L8 D * Description : This file provides code for the configuration; V: v' J0 z; Y
* of all used GPIO pins. 0 x9 v* c5 [# C& A; X ****************************************************************************** 1 N) p' e2 S& D: I% Z8 | * ) O$ Q6 a9 |& z* f' M' C * COPYRIGHT 2014 STMicroelectronics " B' z8 l% _2 E: S% [ * 9 W; P2 U; b2 `' T/ w$ m * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");5 ~( i# J$ c4 T
* You may not use this file except in compliance with the License.( R1 i& R* ?' `! u" R8 A5 W( P3 y
* You may obtain a copy of the License at: m4 k- x+ h8 O% }% n2 u$ l *8 |! p2 `. H2 N6 P7 T4 _
* http:www.st.com/software_license_agreement_liberty_v2 - g/ D% v+ t& I7 H2 w7 O; K * , \' Q- @# p) e* m# ]+ ? * Unless required by applicable law or agreed to in writing, software 9 _7 Y" J! {( P1 v1 e
* distributed under the License is distributed on an "AS IS" BASIS, 4 Y2 T; z( r) L$ d
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.9 i) j- O& j" P+ i4 r
* See the License for the specific language governing permissions and# W+ ?. C: f4 I$ k) K( q0 b
* limitations under the License.1 x3 m- D+ g# B z6 z! e
*' V. `9 ~, }5 ]' C( ^1 J3 e* P
******************************************************************************) y5 V l5 I8 [/ H$ r: s
*/ 4 r$ E5 B7 w5 m: [! { ! n8 E7 V! Z# b3 v% @/* Includes ------------------------------------------------------------------*/ 8 V3 y# Y# h, M* c#include "mx_gpio.h" ! l; S ]. J1 M9 ?! M% }/* USER CODE BEGIN 0 */) a9 O8 ~# I; `! M8 V9 k- u
1 Q3 i b! k' L1 { `, G
/* USER CODE END 0 */ 3 e' m$ t8 r$ ?9 v& D & N' {! g! E: L. Z' E/*----------------------------------------------------------------------------*/ , O+ z; `5 | o1 F4 n( w/* Configure GPIO */ 0 f5 Y. x# D8 `5 I! `- e1 u0 {8 ]/*----------------------------------------------------------------------------*/2 D! s4 b+ B& }! ]
/* USER CODE BEGIN 1 */6 D& K5 \( G+ {& _
" F- U! ^% d- S( Q
/* USER CODE END 1 */+ X/ h- J, L8 F) W9 P
5 V9 d8 ^2 H! R0 @# r/ w
void mx_pinout_config(void) { / D* n4 {! }4 ~" h$ h; W /* Private typedef ---------------------------------------------------------*/ 7 V S5 |: |8 c& r GPIO_InitTypeDef GPIO_InitStruct; " g, n. E* ~! t6 P. q 1 l( d% R, J" g4 N
5 o* b' C5 R" @! J
/** ADC GPIO Configuration 0 ?7 U& q. z7 w! ?% _ PA1 ------> ADC_IN1+ K9 K; I1 U# |' r [1 ]5 S$ K& V
*/( `3 x- \: f8 M8 D4 G" d" C: q7 F
# x( q3 T1 I6 Z5 F4 b3 \ 8 x. {* T" W6 y6 k/ s/ p4 C9 S1 r /*Enable or disable the AHB peripheral clock */ 0 }" W) E6 u2 @1 L& ?7 S# _ RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE); 7 M5 m6 W; m; c% | e7 Q9 ~4 ] 9 \$ h& |/ l. Z$ H" J4 F j /*Configure GPIO pin */$ D/ B) x D+ s
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_1; g% z' t1 q' S1 L8 g# a3 B$ U GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AN;; _$ u* Y- {; ?% Z& p% j
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL; & v- K4 f, W7 S+ n; ~* ?1 L" n GPIO_Init(GPIOA, &GPIO_InitStruct); - r5 W9 c% V2 v' @# c 5 C) X0 T3 ^3 B* k+ h7 @4 H 5 ~/ G4 Q, \: O; D /** I2C1 GPIO Configuration 0 l o8 M9 B8 n; i5 g3 a: e, z( z
PB6 ------> I2C1_SCL, E2 O2 A1 ?- B
PB7 ------> I2C1_SDA - v; n1 a% M7 Z */1 X# a2 I0 s/ B3 U; i
, @# p7 a r3 q. ?2 l
r( W+ q- ^9 N( V+ H; ~- ~+ w; S /*Enable or disable the AHB peripheral clock */ 2 d& R& T& ~3 i5 J' v RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOB, ENABLE); + g! o9 H5 D1 h8 R 7 D" q* W( L! D5 d: J
% M% K+ m2 |6 e& W$ q4 N& { w
//!!! GPIO_Init is commented because some parameters are missing( r1 ^; _. @$ n# D; R0 }
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_6; . V) p" h8 v) w GPIO_InitStruct.GPIO_Mode = ; & B* l3 u1 o9 p2 \$ ~4 U; M- P" n$ G GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;/ m- ^" h! v+ u; {% _1 A4 r
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;" v5 Y2 X/ u5 h7 ?
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz; + Z1 P& \+ d2 r# i GPIO_Init(GPIOB, &GPIO_InitStruct); $ A4 f* v7 w; B 9 W& f9 [$ G3 O" ~& l1 y 8 z- k% a( @% U# w4 t
//!!! GPIO_Init is commented because some parameters are missing$ t4 d9 L4 e6 [- b
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_7; % k, `3 G6 z- b$ d5 t3 l GPIO_InitStruct.GPIO_Mode = ;+ r9 {% P; E2 i( G* {
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP; 5 A/ ^; k& S+ Z GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL; % W0 {1 n7 e& b4 b1 } GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;" ]; E6 v+ j6 C8 l0 L2 J
GPIO_Init(GPIOB, &GPIO_InitStruct); 4 l, u) r) W/ ?! k ! |- X# E& ]1 a' m: h/ S" N. M
/*Configure GPIO pin alternate function */ 6 t& _1 o' W% ~2 ?8 c! y7 M! Q GPIO_PinAFConfig(GPIOB, GPIO_PinSource6, GPIO_AF_I2C1); ( m4 I4 x4 [: t" F4 z; v4 F7 S 8 C k1 U. w; t$ K( m; k. L /*Configure GPIO pin alternate function */, K A5 @$ @: d0 ]
GPIO_PinAFConfig(GPIOB, GPIO_PinSource7, GPIO_AF_I2C1);1 I5 A9 @. C, u5 ?2 t
( q" ~5 K6 @( G ?! J " j2 D B) I9 w5 }: @4 @9 v
/** SPI2 GPIO Configuration 5 L3 R4 Y# A: Q# Q' k* D
PB12 ------> SPI2_NSS 6 G5 ^1 p! x! o/ G% R PB13 ------> SPI2_SCK' @, d# J% G# @
PB14 ------> SPI2_MISO 8 {- q$ X) [: T2 T. c: t- A PB15 ------> SPI2_MOSI! ?5 J" u+ a* g4 J! C B4 U7 N* f) B
*/* S/ U0 {1 D0 x: G/ G
& E3 x( D, c1 }4 l1 ?0 Z8 G
6 Q. y3 L& o, ]: u# V4 @
/*Enable or disable the AHB peripheral clock */2 S# e0 q* |2 t& D1 t- M T
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOB, ENABLE);% w7 H: }. }7 h2 B+ S- l
# T, Z/ A+ O- y4 P6 s7 y# ~' U ) z6 V: A( i' t E U0 E //!!! GPIO_Init is commented because some parameters are missing 4 `8 v* H7 D+ i GPIO_InitStruct.GPIO_Pin = GPIO_Pin_12;, }( L$ z; V8 F, n& S- ?
GPIO_InitStruct.GPIO_Mode = ;- ?/ w a1 r; k* a$ b
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;; @7 A) v: D$ l4 N. k
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;( S: L S9 l& U+ P4 h
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;1 J# w1 W" y5 F, B- r
GPIO_Init(GPIOB, &GPIO_InitStruct); ! Z& B0 M7 g* o. a* G 4 z9 A: I4 @+ k2 [ P1 `) B
& d. E& h; R1 X9 P6 Z
//!!! GPIO_Init is commented because some parameters are missing 7 G% `$ ]6 @" ~, C0 Z7 Q0 D. Z6 m GPIO_InitStruct.GPIO_Pin = GPIO_Pin_13;3 y; [! o# r8 T8 t5 O# h. C5 ]
GPIO_InitStruct.GPIO_Mode = ;9 u+ m$ e1 Y: V+ }% r& F; I- c8 t
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;5 }: Z+ {- V6 s7 a: M" [: m- M8 z
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;, h5 O5 i9 I0 M( j v1 F
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz; $ m2 P) W+ ^# E4 E6 d3 z GPIO_Init(GPIOB, &GPIO_InitStruct);8 q' W; U7 X9 O3 E, l5 h
( X4 p* y# V2 y/ u* H
, c! h L6 O' D
//!!! GPIO_Init is commented because some parameters are missing 0 H. l0 W" _% [% K( o# B GPIO_InitStruct.GPIO_Pin = GPIO_Pin_14; . f8 i# L. b3 f% Q0 k GPIO_InitStruct.GPIO_Mode = ;1 A6 u# g5 V2 g# L/ p$ g( ^# ?
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP; ) W. [2 z0 j5 v; y7 {- X- @ GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;0 z3 q* Y7 O8 F* [: [) }2 I6 k
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz; ; i M( e* X$ L2 s3 g! w GPIO_Init(GPIOB, &GPIO_InitStruct); 8 p5 R* |0 f* F1 u) f % i. ^& s4 R0 J3 Y9 v4 C! L) l " `8 Y/ m" ?$ A6 @
//!!! GPIO_Init is commented because some parameters are missing6 d1 L: ^4 u1 ?! S U$ e4 V
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_15; ' ~2 Q y" a: R l GPIO_InitStruct.GPIO_Mode = ; - S6 G8 c* Z# _: L+ m3 }* F GPIO_InitStruct.GPIO_OType = GPIO_OType_PP; ' B. j- H0 L- ~- s9 g GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;4 y/ j, T/ _0 L' w8 ]9 ~0 @1 o
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;2 w$ |# y1 Z r, e
GPIO_Init(GPIOB, &GPIO_InitStruct); $ r3 s, ~% q2 `+ O + q% j' i0 ]+ i. ~0 R, ?( d$ F( ~
/*Configure GPIO pin alternate function */ $ R! K7 O/ Y5 j( t* h GPIO_PinAFConfig(GPIOB, GPIO_PinSource12, GPIO_AF_SPI2);" b; x- g K/ t4 d* v
* ^7 o0 P1 h$ W: I- r( N
/*Configure GPIO pin alternate function */ + P/ e8 J' t: t+ G; z4 C H GPIO_PinAFConfig(GPIOB, GPIO_PinSource13, GPIO_AF_SPI2); 6 W6 v' v C6 E1 r2 _% E- C / o7 D2 s# M4 l! |0 L) j9 }
/*Configure GPIO pin alternate function */ 1 G- J$ _& D' a* C GPIO_PinAFConfig(GPIOB, GPIO_PinSource14, GPIO_AF_SPI2); 4 W' ~- ?. I. Q/ V 5 a3 D. D2 k) o+ a$ W2 X /*Configure GPIO pin alternate function */, P: \5 k6 k1 ?2 |, D
GPIO_PinAFConfig(GPIOB, GPIO_PinSource15, GPIO_AF_SPI2);8 m4 t% c- C6 k1 `2 N5 q( K- N3 W
2 L: N: w& w) p' I* M+ `
$ w$ `- N! u' p' I. q9 \6 n6 L6 i, R
/** USART1 GPIO Configuration 6 W0 w* {$ e. q9 I, U& A, p7 t PA9 ------> USART1_TX! Q. O* f0 @6 n6 @: U j
PA10 ------> USART1_RX , Y7 N8 s% D! p */( t! L5 t9 U% B& e* N5 X* L4 A
& y d8 _6 K* c2 M" J
& [. j h% C* N) Z- \ /*Enable or disable the AHB peripheral clock */2 D& ?$ I) i0 e$ w% \ I# t
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);0 X. `! |/ ^/ R% h
m( o2 J3 d8 f2 g: ^' H& s ! l |; e( l' h4 ~! \; ^4 b //!!! GPIO_Init is commented because some parameters are missing5 y m; a1 @& g' D
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_9;# Y$ j! a) f4 G1 A
GPIO_InitStruct.GPIO_Mode = ; ! S' V. x) h f$ A( m$ Q1 t* r. k GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;% y% M* r6 l# g4 f
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;) ]% H* K6 \& @" h
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;9 ?0 Q. U$ A3 R- m
GPIO_Init(GPIOA, &GPIO_InitStruct); 0 C$ @" a$ d4 A( V 1 K) m" T5 `4 b/ b ^! l* S3 j0 ^- l2 @' f
//!!! GPIO_Init is commented because some parameters are missing. I1 z( ]/ O# F9 _+ w; |- ]
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_10; 6 D3 ^9 `/ n% p3 Y4 B: Q0 x# r* \ GPIO_InitStruct.GPIO_Mode = ;% [5 \4 W& i" k! I4 Z |
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;6 ]( r/ C7 U3 v3 Q) a
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL; 1 e. t6 Z$ C% a8 w- q9 b GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz; 1 w7 ?$ D% ]/ u/ X" h' M! Q& E GPIO_Init(GPIOA, &GPIO_InitStruct);6 J3 j6 U4 g& s4 d/ G
$ i: L1 |* E0 n) d
/*Configure GPIO pin alternate function */ ( ?( S1 ~4 g& G) D. l2 x* b GPIO_PinAFConfig(GPIOA, GPIO_PinSource9, GPIO_AF_USART1);; l- K8 m7 W+ ~& q, _
. V& @' Q; ^$ d6 o. x& @: ] /*Configure GPIO pin alternate function */ ) a: s( V+ q" q GPIO_PinAFConfig(GPIOA, GPIO_PinSource10, GPIO_AF_USART1);& { g+ s' t7 y3 G N4 t
+ h% p) K0 Q6 S; m6 R 7 E5 M. F B: l) E. P. v) `, } /** USB GPIO Configuration & D4 |1 T2 G6 g9 h5 r PA11 ------> USB_DM ; {* X* V2 t8 S+ d, A t PA12 ------> USB_DP ( b( j1 l, C# M */ 8 f* x9 W" v" d; A% n / }* o- b5 l5 W4 z+ v, t3 Z
) c/ b) R+ f+ {" ]2 D' X: h
/*Enable or disable the AHB peripheral clock */% M. o ~) |2 `6 l6 J
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE); . y, f. c, u5 A# M: y 9 I. Z' K$ O, L
/ M1 Q% A7 f. j: }, D& y* B
//!!! GPIO_Init is commented because some parameters are missing 9 E: @* {* O2 f GPIO_InitStruct.GPIO_Pin = GPIO_Pin_11; ) C% w/ V+ q4 p5 V GPIO_InitStruct.GPIO_Mode = ;2 l9 `( x) C F: G3 a% T
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP; ( X4 V) [- O, C. @: Z! ~8 o6 u. n1 ^ GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;1 A3 M' E8 l# L5 g/ d
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;; C- ?+ @! m: e& Y0 s" y* j# O
GPIO_Init(GPIOA, &GPIO_InitStruct); ' ]( X3 d* t( z5 U; p0 c " x" J7 W! z$ E" t
" ~/ S" c/ p6 N/ u* p8 P% {4 r //!!! GPIO_Init is commented because some parameters are missing # C7 j' z7 @1 y# ? GPIO_InitStruct.GPIO_Pin = GPIO_Pin_12;/ T+ p: G2 t' R8 O2 s
GPIO_InitStruct.GPIO_Mode = ; % s1 F& p" O# f/ m r7 O0 c# q9 j% W GPIO_InitStruct.GPIO_OType = GPIO_OType_PP; ( ?. M" X; v0 t, E* D6 c6 R- @ GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;% m0 w$ h% n, J& M
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz; r; U% P G/ T! z1 k ~1 _ GPIO_Init(GPIOA, &GPIO_InitStruct);5 ^- f: n+ n% q' ` t# n
: s5 \8 L. g1 e1 K2 D) W( S6 |+ ] ( F/ M3 r0 [' V) {8 p) V6 B /** Configure pins as GPIO% h, W' r- l- H' \* ^
PA8 ------> GPIO_Input ' Z T$ I, ~6 P */ 4 i% v; E2 v0 O2 p' a$ J 2 H3 s3 X/ ?0 `2 v3 | 9 [: v5 b4 E* C9 O
/*Enable or disable the AHB peripheral clock */ 6 L5 p2 v$ C% {/ }1 W' | RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE); + {8 e- F4 F0 s6 W 4 v" Z, x4 `" P /*Configure GPIO pin */ 7 l! D9 k: o2 ~9 E' w# f: r GPIO_InitStruct.GPIO_Pin = GPIO_Pin_8;4 i3 W0 S) p) F7 q
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IN; 9 B9 s) M4 \1 _! \ GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;# |% E# w$ `! E K1 G9 A
GPIO_Init(GPIOA, &GPIO_InitStruct); . V- P2 c; Z9 x}$ I, ]5 A+ l) t5 Z7 _ I5 O- U
; j, V, U" h# [4 V& S3 c9 y
/* USER CODE BEGIN 2 */( N/ U: i0 e* _; p9 H6 r6 d: \
: P# M3 s- ~" `* p0 H
/* USER CODE END 2 */+ o, d, f* P ^0 M Z C2 s
for(i=0; i<4; i++)//R G B 中一个字节对应的发送缓存* e$ `: s; S+ ]- m& T0 V/ [5 i+ A" s
{0 s4 m& a: X4 p; Y( K: b0 b
tmp = (uint8_t)(color &0x00000003);
switch(tmp)1 E* \. I% S) g( L
{0 c4 \5 }8 A: @' v
case 0x00:* w5 g! r" M. l9 D+ d1 z* j
*pb = BIT00;
break;" \6 N: `3 d8 i( A" G0 r! g
case 0x01:+ c, X( s ~: P! y, e- N
*pb = BIT01;" v! o6 O; k7 W# A' J
break;( B: w& ]0 P6 i* u- X* s
case 0x02:, [# Z6 c. h L) z/ ^
*pb = BIT10;& P( b! n: g. }( s* I2 H h
break; T$ f& C# o: i8 p
case 0x03: X) A* k7 x/ ? ?7 x" }) O
*pb = BIT11;
break;
}& r! s) N) D- L# b- f2 {# z
color = color >>2;
pb--; t8 V; l1 A& T
}
pb += 7;/ _8 ~% y0 Q5 J$ |1 [
}
这样就可以了,在安装目录了里会有一个.jar文件,双击打开即可
RE:ST公司出品【图形化配置工具】
/**
******************************************************************************
* File Name : mx_gpio.c
* Date : 03/01/2014 15:37:11
* Description : This file provides code for the configuration; V: v' J0 z; Y
* of all used GPIO pins.
******************************************************************************
*
* COPYRIGHT 2014 STMicroelectronics
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");5 ~( i# J$ c4 T
* You may not use this file except in compliance with the License.( R1 i& R* ?' `! u" R8 A5 W( P3 y
* You may obtain a copy of the License at:
*8 |! p2 `. H2 N6 P7 T4 _
* http:www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software 9 _7 Y" J! {( P1 v1 e
* distributed under the License is distributed on an "AS IS" BASIS, 4 Y2 T; z( r) L$ d
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.9 i) j- O& j" P+ i4 r
* See the License for the specific language governing permissions and# W+ ?. C: f4 I$ k) K( q0 b
* limitations under the License.1 x3 m- D+ g# B z6 z! e
*' V. `9 ~, }5 ]' C( ^1 J3 e* P
******************************************************************************) y5 V l5 I8 [/ H$ r: s
*/
/* Includes ------------------------------------------------------------------*/
#include "mx_gpio.h"
/* USER CODE BEGIN 0 */) a9 O8 ~# I; `! M8 V9 k- u
1 Q3 i b! k' L1 { `, G
/* USER CODE END 0 */
/*----------------------------------------------------------------------------*/
/* Configure GPIO */
/*----------------------------------------------------------------------------*/2 D! s4 b+ B& }! ]
/* USER CODE BEGIN 1 */6 D& K5 \( G+ {& _
" F- U! ^% d- S( Q
/* USER CODE END 1 */+ X/ h- J, L8 F) W9 P
5 V9 d8 ^2 H! R0 @# r/ w
void mx_pinout_config(void) {
/* Private typedef ---------------------------------------------------------*/
GPIO_InitTypeDef GPIO_InitStruct;
1 l( d% R, J" g4 N
5 o* b' C5 R" @! J
/** ADC GPIO Configuration
PA1 ------> ADC_IN1+ K9 K; I1 U# |' r [1 ]5 S$ K& V
*/( `3 x- \: f8 M8 D4 G" d" C: q7 F
/*Enable or disable the AHB peripheral clock */
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);
/*Configure GPIO pin */$ D/ B) x D+ s
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_1;
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AN;; _$ u* Y- {; ?% Z& p% j
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(GPIOA, &GPIO_InitStruct);
/** I2C1 GPIO Configuration 0 l o8 M9 B8 n; i5 g3 a: e, z( z
PB6 ------> I2C1_SCL, E2 O2 A1 ?- B
PB7 ------> I2C1_SDA
*/1 X# a2 I0 s/ B3 U; i
, @# p7 a r3 q. ?2 l
/*Enable or disable the AHB peripheral clock */
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOB, ENABLE);
7 D" q* W( L! D5 d: J
% M% K+ m2 |6 e& W$ q4 N& { w
//!!! GPIO_Init is commented because some parameters are missing( r1 ^; _. @$ n# D; R0 }
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_6;
GPIO_InitStruct.GPIO_Mode = ;
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;/ m- ^" h! v+ u; {% _1 A4 r
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;" v5 Y2 X/ u5 h7 ?
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;
GPIO_Init(GPIOB, &GPIO_InitStruct);
8 z- k% a( @% U# w4 t
//!!! GPIO_Init is commented because some parameters are missing$ t4 d9 L4 e6 [- b
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_7;
GPIO_InitStruct.GPIO_Mode = ;+ r9 {% P; E2 i( G* {
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;" ]; E6 v+ j6 C8 l0 L2 J
GPIO_Init(GPIOB, &GPIO_InitStruct);
! |- X# E& ]1 a' m: h/ S" N. M
/*Configure GPIO pin alternate function */
GPIO_PinAFConfig(GPIOB, GPIO_PinSource6, GPIO_AF_I2C1);
/*Configure GPIO pin alternate function */, K A5 @$ @: d0 ]
GPIO_PinAFConfig(GPIOB, GPIO_PinSource7, GPIO_AF_I2C1);1 I5 A9 @. C, u5 ?2 t
" j2 D B) I9 w5 }: @4 @9 v
/** SPI2 GPIO Configuration 5 L3 R4 Y# A: Q# Q' k* D
PB12 ------> SPI2_NSS
PB13 ------> SPI2_SCK' @, d# J% G# @
PB14 ------> SPI2_MISO
PB15 ------> SPI2_MOSI! ?5 J" u+ a* g4 J! C B4 U7 N* f) B
*/* S/ U0 {1 D0 x: G/ G
& E3 x( D, c1 }4 l1 ?0 Z8 G
6 Q. y3 L& o, ]: u# V4 @
/*Enable or disable the AHB peripheral clock */2 S# e0 q* |2 t& D1 t- M T
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOB, ENABLE);% w7 H: }. }7 h2 B+ S- l
//!!! GPIO_Init is commented because some parameters are missing
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_12;, }( L$ z; V8 F, n& S- ?
GPIO_InitStruct.GPIO_Mode = ;- ?/ w a1 r; k* a$ b
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;; @7 A) v: D$ l4 N. k
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;( S: L S9 l& U+ P4 h
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;1 J# w1 W" y5 F, B- r
GPIO_Init(GPIOB, &GPIO_InitStruct);
4 z9 A: I4 @+ k2 [ P1 `) B
& d. E& h; R1 X9 P6 Z
//!!! GPIO_Init is commented because some parameters are missing
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_13;3 y; [! o# r8 T8 t5 O# h. C5 ]
GPIO_InitStruct.GPIO_Mode = ;9 u+ m$ e1 Y: V+ }% r& F; I- c8 t
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;5 }: Z+ {- V6 s7 a: M" [: m- M8 z
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;, h5 O5 i9 I0 M( j v1 F
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;
GPIO_Init(GPIOB, &GPIO_InitStruct);8 q' W; U7 X9 O3 E, l5 h
( X4 p* y# V2 y/ u* H
, c! h L6 O' D
//!!! GPIO_Init is commented because some parameters are missing
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_14;
GPIO_InitStruct.GPIO_Mode = ;1 A6 u# g5 V2 g# L/ p$ g( ^# ?
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;0 z3 q* Y7 O8 F* [: [) }2 I6 k
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;
GPIO_Init(GPIOB, &GPIO_InitStruct);
" `8 Y/ m" ?$ A6 @
//!!! GPIO_Init is commented because some parameters are missing6 d1 L: ^4 u1 ?! S U$ e4 V
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_15;
GPIO_InitStruct.GPIO_Mode = ;
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;4 y/ j, T/ _0 L' w8 ]9 ~0 @1 o
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;2 w$ |# y1 Z r, e
GPIO_Init(GPIOB, &GPIO_InitStruct);
+ q% j' i0 ]+ i. ~0 R, ?( d$ F( ~
/*Configure GPIO pin alternate function */
GPIO_PinAFConfig(GPIOB, GPIO_PinSource12, GPIO_AF_SPI2);" b; x- g K/ t4 d* v
* ^7 o0 P1 h$ W: I- r( N
/*Configure GPIO pin alternate function */
GPIO_PinAFConfig(GPIOB, GPIO_PinSource13, GPIO_AF_SPI2);
/ o7 D2 s# M4 l! |0 L) j9 }
/*Configure GPIO pin alternate function */
GPIO_PinAFConfig(GPIOB, GPIO_PinSource14, GPIO_AF_SPI2);
/*Configure GPIO pin alternate function */, P: \5 k6 k1 ?2 |, D
GPIO_PinAFConfig(GPIOB, GPIO_PinSource15, GPIO_AF_SPI2);8 m4 t% c- C6 k1 `2 N5 q( K- N3 W
2 L: N: w& w) p' I* M+ `
$ w$ `- N! u' p' I. q9 \6 n6 L6 i, R
/** USART1 GPIO Configuration
PA9 ------> USART1_TX! Q. O* f0 @6 n6 @: U j
PA10 ------> USART1_RX
*/( t! L5 t9 U% B& e* N5 X* L4 A
& y d8 _6 K* c2 M" J
/*Enable or disable the AHB peripheral clock */2 D& ?$ I) i0 e$ w% \ I# t
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);0 X. `! |/ ^/ R% h
//!!! GPIO_Init is commented because some parameters are missing5 y m; a1 @& g' D
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_9;# Y$ j! a) f4 G1 A
GPIO_InitStruct.GPIO_Mode = ;
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;% y% M* r6 l# g4 f
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;) ]% H* K6 \& @" h
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;9 ?0 Q. U$ A3 R- m
GPIO_Init(GPIOA, &GPIO_InitStruct);
^! l* S3 j0 ^- l2 @' f
//!!! GPIO_Init is commented because some parameters are missing. I1 z( ]/ O# F9 _+ w; |- ]
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_10;
GPIO_InitStruct.GPIO_Mode = ;% [5 \4 W& i" k! I4 Z |
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;6 ]( r/ C7 U3 v3 Q) a
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;
GPIO_Init(GPIOA, &GPIO_InitStruct);6 J3 j6 U4 g& s4 d/ G
$ i: L1 |* E0 n) d
/*Configure GPIO pin alternate function */
GPIO_PinAFConfig(GPIOA, GPIO_PinSource9, GPIO_AF_USART1);; l- K8 m7 W+ ~& q, _
/*Configure GPIO pin alternate function */
GPIO_PinAFConfig(GPIOA, GPIO_PinSource10, GPIO_AF_USART1);& { g+ s' t7 y3 G N4 t
/** USB GPIO Configuration
PA11 ------> USB_DM
PA12 ------> USB_DP
*/
/ }* o- b5 l5 W4 z+ v, t3 Z
) c/ b) R+ f+ {" ]2 D' X: h
/*Enable or disable the AHB peripheral clock */% M. o ~) |2 `6 l6 J
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);
9 I. Z' K$ O, L
/ M1 Q% A7 f. j: }, D& y* B
//!!! GPIO_Init is commented because some parameters are missing
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_11;
GPIO_InitStruct.GPIO_Mode = ;2 l9 `( x) C F: G3 a% T
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;1 A3 M' E8 l# L5 g/ d
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;; C- ?+ @! m: e& Y0 s" y* j# O
GPIO_Init(GPIOA, &GPIO_InitStruct);
" x" J7 W! z$ E" t
//!!! GPIO_Init is commented because some parameters are missing
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_12;/ T+ p: G2 t' R8 O2 s
GPIO_InitStruct.GPIO_Mode = ;
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;% m0 w$ h% n, J& M
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;
GPIO_Init(GPIOA, &GPIO_InitStruct);5 ^- f: n+ n% q' ` t# n
/** Configure pins as GPIO% h, W' r- l- H' \* ^
PA8 ------> GPIO_Input
*/
9 [: v5 b4 E* C9 O
/*Enable or disable the AHB peripheral clock */
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);
/*Configure GPIO pin */
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_8;4 i3 W0 S) p) F7 q
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IN;
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;# |% E# w$ `! E K1 G9 A
GPIO_Init(GPIOA, &GPIO_InitStruct);
}$ I, ]5 A+ l) t5 Z7 _ I5 O- U
; j, V, U" h# [4 V& S3 c9 y
/* USER CODE BEGIN 2 */( N/ U: i0 e* _; p9 H6 r6 d: \
: P# M3 s- ~" `* p0 H
/* USER CODE END 2 */+ o, d, f* P ^0 M Z C2 s
回复:ST公司出品【图形化配置工具】
RE:ST公司出品【图形化配置工具】
RE:ST公司出品【图形化配置工具】
RE:ST公司出品【图形化配置工具】
RE:ST公司出品【图形化配置工具】
RE:ST公司出品【图形化配置工具】
RE:ST公司出品【图形化配置工具】
RE:ST公司出品【图形化配置工具】
回复:ST公司出品【图形化配置工具】
回复:ST公司出品【图形化配置工具】
RE:ST公司出品【图形化配置工具】
RE:ST公司出品【图形化配置工具】
RE:ST公司出品【图形化配置工具】