感谢楼主,下载成功,安装提示缺少,Java Runtime Environment,然后我安装了Java,然后进入安装,自动选择安装目录,安装一阵,最后提醒, javaw.exe not found ,reinstall java jre;实际上,我的电脑里搜索,有javaw.exe 。因此,MicroXplorer无法安装,困惑。
生成代码鉴赏:论坛啥时候能支持代码片段呢?????6 v- y# E+ n5 Y j b6 B" Y
* G) N. k, s; X2 C4 E
/** $ C5 |" @9 t" o3 |5 k2 ^ ****************************************************************************** - G) S, [9 C# d" L * File Name : mx_gpio.c% q) u c' s8 n+ t6 K. Y, L
* Date : 03/01/2014 15:37:11 5 V# q# Y9 q0 ~1 W1 L: f9 S& E * Description : This file provides code for the configuration% T2 a6 L3 p6 e" D
* of all used GPIO pins.# C6 x0 R# s1 V* g
****************************************************************************** 0 X5 k. k4 _& ]+ H+ P! o5 } |% q * 0 L( Z4 w- r/ v$ n * COPYRIGHT 2014 STMicroelectronics , \. H) q* L! g2 R; I *2 e( A; O: d2 Q0 d' Q0 J9 n
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); 4 x8 x/ D. S; _5 d* b g * You may not use this file except in compliance with the License. 1 ~# H5 Y+ B* q4 b8 l * You may obtain a copy of the License at: # J/ a' G4 n, m' L * $ a5 \' G1 Y2 F7 y' F, j) R1 J * http:www.st.com/software_license_agreement_liberty_v21 p1 J+ i7 b; v1 F3 X5 d5 W0 l1 q; X
* & z/ [. n3 l L& U e! s; B0 } * Unless required by applicable law or agreed to in writing, software ; e! k' v" K2 u1 s5 {, ~% K2 j * distributed under the License is distributed on an "AS IS" BASIS, 8 W* Q5 _+ i9 _1 m6 S1 I
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - E N3 ~/ E# N * See the License for the specific language governing permissions and& K ]5 `6 t0 n) ]& y& F+ `
* limitations under the License.0 }) b8 y# u( C
*3 V7 C* O" q+ z4 P# [$ i( Y0 C
******************************************************************************4 K! }* J0 u9 ]" A; G0 i
*/ # R/ P2 F) ]$ C ) ]' q$ z4 |" K9 l
/* Includes ------------------------------------------------------------------*/ ' B7 ]- i/ }/ @6 m$ V2 M/ W#include "mx_gpio.h"* C E: E6 v9 d1 ^% t% O% A8 Z& ~+ b
/* USER CODE BEGIN 0 */$ b& b2 u/ U2 m7 n
; u8 P+ X1 f& L6 n- R
/* USER CODE END 0 */7 J- f! S* F) h( Y
8 k0 N/ O% U( F% w3 t$ y
/*----------------------------------------------------------------------------*/. S f" g R/ F. V$ b9 ` N9 y
/* Configure GPIO */* B1 y( A' S" g
/*----------------------------------------------------------------------------*/ 1 \3 Q: d: K3 M/* USER CODE BEGIN 1 */) `( W l' I1 z1 i
3 C5 M& H8 ^% j# O
/* USER CODE END 1 */2 E1 q7 s2 H$ t
; k+ c: g, `( gvoid mx_pinout_config(void) { + T7 G! Z8 A& f6 l% x1 a0 b /* Private typedef ---------------------------------------------------------*/, o% |$ W$ h- f
GPIO_InitTypeDef GPIO_InitStruct; 9 U) ?. n6 s3 r c 8 N+ C3 {: S$ T " E' g8 B; N Z" ?) V
/** ADC GPIO Configuration / I$ }9 p$ W' O2 o k. i" s" S0 j PA1 ------> ADC_IN1 & n8 H, @4 D3 }: q, J6 O */; I( h) ?: G. d+ e
( s8 M6 D* K5 a9 t' |+ D2 K" |) H1 m . h* s) z2 B3 w% f, }( I5 F /*Enable or disable the AHB peripheral clock */+ g h, z' w& \
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE); ' o" U$ H6 i. Q! p+ i ' `/ w8 t8 T( \% O1 [; c4 s
/*Configure GPIO pin */ 4 {7 V, N2 V- n, i: K) T3 ?1 M2 Q GPIO_InitStruct.GPIO_Pin = GPIO_Pin_1; # Q6 \, {+ j- b3 C Y/ b GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AN; 1 G" M" b+ K7 d, z" Z GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL; " ~% j% m4 _" g# M GPIO_Init(GPIOA, &GPIO_InitStruct); 6 O' \8 y* a9 r9 G8 ?0 Y 4 d5 }& X; o6 E* s 5 ?: X6 V& F4 B; D3 d: B0 R /** I2C1 GPIO Configuration ) P- L) s- P- A
PB6 ------> I2C1_SCL' \" u' c: W2 Y% F& @& A- b. `9 A
PB7 ------> I2C1_SDA # |' Y4 C) d& q g1 D$ b& [ */ : {5 C( p3 o9 Z2 _, N( T- y E + V( ~- a5 ~" m: K- k( t6 X / ~+ L; z! C. L1 { /*Enable or disable the AHB peripheral clock */0 H$ l# w" Q; o" ]& V
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOB, ENABLE);2 P2 ^4 H8 U4 e2 f) F
; I/ a3 I4 X0 _& ` 3 m5 D$ A) c, i. @$ y
//!!! GPIO_Init is commented because some parameters are missing9 R0 S- \7 E; s- N2 r# W8 O
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_6;7 _! U) j. |9 B; Z! ~% S! G
GPIO_InitStruct.GPIO_Mode = ; - q8 |3 j6 L9 e8 o: f1 N GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;; U6 A! h5 u$ X% S
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;+ H) z. u' G: D7 b0 l' J
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz; / d% U$ i- t- {7 J6 Y' B0 J GPIO_Init(GPIOB, &GPIO_InitStruct); ], ? _% b" \. O+ {9 R 5 o. D, _" Y0 `! `) e2 ~6 K4 E0 Z
- E( |4 g& q: }$ o) E //!!! GPIO_Init is commented because some parameters are missing ( s* u5 M, H5 t5 i4 X GPIO_InitStruct.GPIO_Pin = GPIO_Pin_7;! o8 |* K+ J' C3 M5 a& m! A
GPIO_InitStruct.GPIO_Mode = ; 2 S# Y; L+ {; @) k; ? GPIO_InitStruct.GPIO_OType = GPIO_OType_PP; @! _! Q2 G3 {/ i! l* {! r6 z
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL; / y! N4 x% i2 w) `/ I( K GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz; W* k# \7 R% z7 \/ r
GPIO_Init(GPIOB, &GPIO_InitStruct); _% O4 ^- K( g5 s1 |7 z 0 M' U, u# F. H- {+ G0 }
/*Configure GPIO pin alternate function */! ^0 q' w2 {. |/ L
GPIO_PinAFConfig(GPIOB, GPIO_PinSource6, GPIO_AF_I2C1);' V) A8 N. ^. z- a$ I* q
+ _8 s+ L' D7 r5 ~2 y/ j
/*Configure GPIO pin alternate function */1 ]! @9 K: s/ {1 p. O
GPIO_PinAFConfig(GPIOB, GPIO_PinSource7, GPIO_AF_I2C1);8 ~" G1 ?* F/ t9 ?; [
: L8 S: O% }8 m0 f% [* R
8 ] V! W# t) ?1 \# N8 W( a /** SPI2 GPIO Configuration : Z$ x: d$ I4 C: N7 v' l3 b* |" X
PB12 ------> SPI2_NSS - H8 D- x7 D# { PB13 ------> SPI2_SCK5 W4 i" R1 Q+ N- s6 y) g% o/ l
PB14 ------> SPI2_MISO . U2 w- }0 o, l4 U% Y PB15 ------> SPI2_MOSI2 k$ f' `% ~, I8 x) }1 B
*/0 ^: v: G) A$ I6 u& M
; g( v% p) L. ^) c8 g4 N9 U % a( @, \6 O/ I3 t( A /*Enable or disable the AHB peripheral clock */ 5 m# Y; W0 N; v RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOB, ENABLE); " ~8 h! A: s0 N( q/ R ! t, i/ U9 h; t2 e1 u6 b. j , K) C2 i S+ I/ f //!!! GPIO_Init is commented because some parameters are missing S' b; \# Y7 Q
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_12;, }( n% u2 d3 t$ R) Z# B
GPIO_InitStruct.GPIO_Mode = ;; C& Z+ T" v) T
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP; 7 B4 o+ u0 X3 J6 ~0 P GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL; & C" b# c6 o9 u1 H, P GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz; V; j/ x4 Y$ C GPIO_Init(GPIOB, &GPIO_InitStruct);: \- S X2 I8 i% m0 E
" C) j3 |" {4 C* X* P; a2 i P6 c: {& U# c z3 ?7 C. P
//!!! GPIO_Init is commented because some parameters are missing . y3 Z% A! e0 D" x+ Q: E GPIO_InitStruct.GPIO_Pin = GPIO_Pin_13;1 y) v* |( a0 ?
GPIO_InitStruct.GPIO_Mode = ; $ I8 L; `' w& W& q GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;/ b8 [$ I: F) i0 ?2 f5 G" O
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL; + r# e/ D$ A" e6 j GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;# a0 z4 A9 b. O, ^0 `6 j6 C7 X# q# X
GPIO_Init(GPIOB, &GPIO_InitStruct);& \8 ^2 Q) a1 o# C9 o1 ~! e
6 K5 B: t& u; C9 U) G3 t
% Q9 j+ f! y- ~# H
//!!! GPIO_Init is commented because some parameters are missing ) D( o) g' c! X% K- { GPIO_InitStruct.GPIO_Pin = GPIO_Pin_14; , a' e+ J0 }. M$ V0 g9 e GPIO_InitStruct.GPIO_Mode = ; * @6 q$ P1 j& Y* Y GPIO_InitStruct.GPIO_OType = GPIO_OType_PP; / y- z1 j# n$ r$ e" T# x& S+ s GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;6 P5 `) x3 R. r6 u/ `
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;, H1 ?+ i# d; }, z; m
GPIO_Init(GPIOB, &GPIO_InitStruct);* N3 O+ S0 k3 v% N2 w U/ X
; Z" |6 @/ a. F5 m* y) p/ t
o4 Y3 @$ X6 g1 v6 O, }
//!!! GPIO_Init is commented because some parameters are missing( \1 n, m0 g$ D/ v; v) j. Y
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_15;5 j4 ~- x# I1 x! C/ I# t
GPIO_InitStruct.GPIO_Mode = ; 4 H8 O3 A( y0 Z2 A0 G8 l# L! C4 {5 y GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;# R7 P8 c! v) ?) ^ \& G1 ~
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;! A5 g1 @' l f, K; g
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;; n" n8 |* N J/ |$ F& v6 K2 c
GPIO_Init(GPIOB, &GPIO_InitStruct); 3 J7 Y/ s$ F/ m$ b; n& {7 O* w + Z: o; q( t4 {% b6 c2 d /*Configure GPIO pin alternate function */ $ n) H$ n1 u1 E( r+ x/ r5 C GPIO_PinAFConfig(GPIOB, GPIO_PinSource12, GPIO_AF_SPI2);$ P0 T, s; E6 M9 l/ F
2 i8 g1 Z3 F6 a8 E
/*Configure GPIO pin alternate function */ 5 h& P& \/ v) e7 _2 v GPIO_PinAFConfig(GPIOB, GPIO_PinSource13, GPIO_AF_SPI2); ' z0 |, L Y! o; q# t U4 z' y ! C, m$ X! C K; N
/*Configure GPIO pin alternate function */ - e. k7 w* E4 z( v% v+ n GPIO_PinAFConfig(GPIOB, GPIO_PinSource14, GPIO_AF_SPI2);9 O8 {5 V9 ~. Y) F% Z, P
" |3 I; x5 T# L; J$ r/ c8 } /*Configure GPIO pin alternate function */1 U! T" x# z3 E) d* w5 L
GPIO_PinAFConfig(GPIOB, GPIO_PinSource15, GPIO_AF_SPI2); 4 y" c% K k/ x) {! y" y2 ? - D* A/ V7 E* [: a. K7 X/ F ( J' X* P! o* g0 }% ?! O
/** USART1 GPIO Configuration r# R% P& b) B+ G7 K
PA9 ------> USART1_TX . E/ a2 e9 e1 ?! D* v- b PA10 ------> USART1_RX % o: z. Z, @) C: F) \ */4 G0 F( d0 W5 X
9 Z, i7 s$ ^# B 6 P4 ?$ ~' C/ O3 m4 } /*Enable or disable the AHB peripheral clock */7 W) o/ k9 [, E
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE); # J, F$ P! U4 ]" a . m$ M- o- ?( X3 C
3 p/ I1 x% ?3 c0 {2 [ //!!! GPIO_Init is commented because some parameters are missing" J. z0 T/ J1 o% \
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_9;4 V# s8 }7 o8 K' g7 H5 F
GPIO_InitStruct.GPIO_Mode = ;/ ^( ?5 @2 h& G8 C$ O
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;6 E9 p, a- n* N! u
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL; ! F4 t# Z1 o% G& \ GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz; $ A& | j: C4 o' ~) R9 L( o, P+ L GPIO_Init(GPIOA, &GPIO_InitStruct);! S. N. a% X) Y- H
3 A4 }6 X6 {4 A+ Y+ H" Z& \3 m 3 k$ t4 `6 N3 a- H //!!! GPIO_Init is commented because some parameters are missing' c: }; u. s% G6 X
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_10; + k- H- z" { Q- b5 g GPIO_InitStruct.GPIO_Mode = ;2 T/ J* H* h8 r! f" ~$ i( }
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP; ) k' H& E- F1 I* ? GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;7 F+ a. i' z5 g. A
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;! f" ]: C( \, \+ P3 L! _
GPIO_Init(GPIOA, &GPIO_InitStruct); " H1 @- `0 _: F1 \0 r8 t a" Z, q) R+ _. |1 X9 v& J' K /*Configure GPIO pin alternate function */ / ^+ [! x. M6 I5 C! n GPIO_PinAFConfig(GPIOA, GPIO_PinSource9, GPIO_AF_USART1);3 c. T" b& D- I; C
4 f1 |- f1 G- u( c& M
/*Configure GPIO pin alternate function */7 O0 N8 |5 S) d' e4 ?( O3 H' o
GPIO_PinAFConfig(GPIOA, GPIO_PinSource10, GPIO_AF_USART1); 0 D- ?/ M5 A+ x. j ] 5 ]( Z }* N* u1 j
$ ~. S% A& Z, M( ]4 m
/** USB GPIO Configuration + K' F2 {1 n) u2 V+ Y PA11 ------> USB_DM 7 @+ b9 w3 X; v" x' {! h PA12 ------> USB_DP' s5 M* k+ B* u" g
*/, e4 h2 q+ j6 i0 j
; R D% m; M' @) M2 K5 ? t8 D 5 ^. F% {; [. X% I* s: q( |) o3 M /*Enable or disable the AHB peripheral clock *// j v4 ?. W- G; P- E" s; ~
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);1 ?3 u/ c3 R# ^& R
+ H# q4 `/ @$ G- Q& T
, j( f% Y$ `( g% Z c4 _% ^ //!!! GPIO_Init is commented because some parameters are missing4 d( r7 Y+ L1 ?# W z; _/ X. `+ c
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_11;+ S- c0 J6 m$ q0 e& y
GPIO_InitStruct.GPIO_Mode = ;+ m* ?, R1 u# K
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP; 5 k: [. ? w% K0 \; Z0 w7 F1 _9 C GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL; $ V; V: m0 }7 V( o2 Q4 b GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;# C6 o8 j1 W; e% @8 l3 L
GPIO_Init(GPIOA, &GPIO_InitStruct); 8 h( ?& S) o9 n- e r. C9 G, Q; g3 p! u 3 d6 r" f1 {$ a& n' p7 ] //!!! GPIO_Init is commented because some parameters are missing , \" u! M9 q( F! ~/ V GPIO_InitStruct.GPIO_Pin = GPIO_Pin_12;4 c1 f+ q% a2 R
GPIO_InitStruct.GPIO_Mode = ;- t+ w4 M; @8 W/ O9 E
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP; 0 I+ g% Q2 m2 s2 r7 V GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL; 1 l8 w5 t8 ]; P6 u; P GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz; - t: z: v! X, J GPIO_Init(GPIOA, &GPIO_InitStruct);1 h! B% y* y! q9 J0 \( _
* ~* l0 ~. y8 m1 Z4 V
* Q) c6 Z) ^- T /** Configure pins as GPIO$ e6 \; a. e9 R' [2 `
PA8 ------> GPIO_Input: ?! W9 D, b; d' W
*/ " ]9 |# m2 Q# R* r! o v b4 b5 L* q* }. }$ ^% f, n8 H
% P! o N5 }. l9 E /*Enable or disable the AHB peripheral clock */ 5 Z9 R+ A8 v9 J# ?5 L* @ RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE); - k! f5 `( z2 ?7 N. t4 ?1 ^/ | ! y- R9 q6 K8 K5 C& u /*Configure GPIO pin */ $ g" j' l$ h3 M$ \% ?/ [ GPIO_InitStruct.GPIO_Pin = GPIO_Pin_8;$ A( c$ M! C( x4 @1 ], x
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IN; # P3 X9 o7 _- |1 C$ E GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL; 2 f. }! B/ T: }# F, B& |2 x GPIO_Init(GPIOA, &GPIO_InitStruct);0 _' Y: V. s7 p h1 o/ H
} 3 c. S# u3 l$ X! G7 }5 Y: R$ B 1 {9 n2 T8 c v- L7 A
/* USER CODE BEGIN 2 */ 9 W1 d# b. G$ f; n5 j: F2 J . N" _. X' R E+ d: C
/* USER CODE END 2 */ n6 M {) ^8 W( K/ r$ a! N# z
for(i=0; i<4; i++)//R G B 中一个字节对应的发送缓存6 J9 M3 f6 J6 Z2 d# m. u
{" b. \" A: S. U" X) L5 X- |
tmp = (uint8_t)(color &0x00000003);# p% v* O( u( E
switch(tmp)) W7 o- P* y7 `- L! Q
{
case 0x00:
*pb = BIT00;& @- F( F% ^0 K' P
break; ?5 t8 Z7 Z4 F4 \; l
case 0x01:
*pb = BIT01;& r& r- p7 M: }
break; r8 B3 n3 a1 g G, _8 Z0 `
case 0x02:
*pb = BIT10;2 _, [: n9 d$ U: m/ a P
break;7 K+ F% s: l- `$ _: N1 X4 q
case 0x03:
*pb = BIT11;0 o! e. Z0 c1 ~) [; k* O+ _+ z
break;
}
color = color >>2;
pb--;
}
pb += 7;0 n) |6 K6 I6 W ~- I6 m4 \
}
这样就可以了,在安装目录了里会有一个.jar文件,双击打开即可
RE:ST公司出品【图形化配置工具】
* G) N. k, s; X2 C4 E
/**
******************************************************************************
* File Name : mx_gpio.c% q) u c' s8 n+ t6 K. Y, L
* Date : 03/01/2014 15:37:11
* Description : This file provides code for the configuration% T2 a6 L3 p6 e" D
* of all used GPIO pins.# C6 x0 R# s1 V* g
******************************************************************************
*
* COPYRIGHT 2014 STMicroelectronics
*2 e( A; O: d2 Q0 d' Q0 J9 n
* 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_v21 p1 J+ i7 b; v1 F3 X5 d5 W0 l1 q; X
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, 8 W* Q5 _+ i9 _1 m6 S1 I
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and& K ]5 `6 t0 n) ]& y& F+ `
* limitations under the License.0 }) b8 y# u( C
*3 V7 C* O" q+ z4 P# [$ i( Y0 C
******************************************************************************4 K! }* J0 u9 ]" A; G0 i
*/
) ]' q$ z4 |" K9 l
/* Includes ------------------------------------------------------------------*/
#include "mx_gpio.h"* C E: E6 v9 d1 ^% t% O% A8 Z& ~+ b
/* USER CODE BEGIN 0 */$ b& b2 u/ U2 m7 n
; u8 P+ X1 f& L6 n- R
/* USER CODE END 0 */7 J- f! S* F) h( Y
8 k0 N/ O% U( F% w3 t$ y
/*----------------------------------------------------------------------------*/. S f" g R/ F. V$ b9 ` N9 y
/* Configure GPIO */* B1 y( A' S" g
/*----------------------------------------------------------------------------*/
/* USER CODE BEGIN 1 */) `( W l' I1 z1 i
3 C5 M& H8 ^% j# O
/* USER CODE END 1 */2 E1 q7 s2 H$ t
void mx_pinout_config(void) {
/* Private typedef ---------------------------------------------------------*/, o% |$ W$ h- f
GPIO_InitTypeDef GPIO_InitStruct;
" E' g8 B; N Z" ?) V
/** ADC GPIO Configuration
PA1 ------> ADC_IN1
*/; I( h) ?: G. d+ e
/*Enable or disable the AHB peripheral clock */+ g h, z' w& \
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);
' `/ w8 t8 T( \% O1 [; c4 s
/*Configure GPIO pin */
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 ) P- L) s- P- A
PB6 ------> I2C1_SCL' \" u' c: W2 Y% F& @& A- b. `9 A
PB7 ------> I2C1_SDA
*/
/*Enable or disable the AHB peripheral clock */0 H$ l# w" Q; o" ]& V
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOB, ENABLE);2 P2 ^4 H8 U4 e2 f) F
3 m5 D$ A) c, i. @$ y
//!!! GPIO_Init is commented because some parameters are missing9 R0 S- \7 E; s- N2 r# W8 O
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_6;7 _! U) j. |9 B; Z! ~% S! G
GPIO_InitStruct.GPIO_Mode = ;
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;; U6 A! h5 u$ X% S
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;+ H) z. u' G: D7 b0 l' J
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;
GPIO_Init(GPIOB, &GPIO_InitStruct);
5 o. D, _" Y0 `! `) e2 ~6 K4 E0 Z
//!!! GPIO_Init is commented because some parameters are missing
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_7;! o8 |* K+ J' C3 M5 a& m! A
GPIO_InitStruct.GPIO_Mode = ;
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP; @! _! Q2 G3 {/ i! l* {! r6 z
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz; W* k# \7 R% z7 \/ r
GPIO_Init(GPIOB, &GPIO_InitStruct);
0 M' U, u# F. H- {+ G0 }
/*Configure GPIO pin alternate function */! ^0 q' w2 {. |/ L
GPIO_PinAFConfig(GPIOB, GPIO_PinSource6, GPIO_AF_I2C1);' V) A8 N. ^. z- a$ I* q
+ _8 s+ L' D7 r5 ~2 y/ j
/*Configure GPIO pin alternate function */1 ]! @9 K: s/ {1 p. O
GPIO_PinAFConfig(GPIOB, GPIO_PinSource7, GPIO_AF_I2C1);8 ~" G1 ?* F/ t9 ?; [
: L8 S: O% }8 m0 f% [* R
/** SPI2 GPIO Configuration : Z$ x: d$ I4 C: N7 v' l3 b* |" X
PB12 ------> SPI2_NSS
PB13 ------> SPI2_SCK5 W4 i" R1 Q+ N- s6 y) g% o/ l
PB14 ------> SPI2_MISO
PB15 ------> SPI2_MOSI2 k$ f' `% ~, I8 x) }1 B
*/0 ^: v: G) A$ I6 u& M
/*Enable or disable the AHB peripheral clock */
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOB, ENABLE);
//!!! GPIO_Init is commented because some parameters are missing S' b; \# Y7 Q
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_12;, }( n% u2 d3 t$ R) Z# B
GPIO_InitStruct.GPIO_Mode = ;; C& Z+ T" v) T
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;
GPIO_Init(GPIOB, &GPIO_InitStruct);: \- S X2 I8 i% m0 E
P6 c: {& U# c z3 ?7 C. P
//!!! GPIO_Init is commented because some parameters are missing
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_13;1 y) v* |( a0 ?
GPIO_InitStruct.GPIO_Mode = ;
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;/ b8 [$ I: F) i0 ?2 f5 G" O
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;# a0 z4 A9 b. O, ^0 `6 j6 C7 X# q# X
GPIO_Init(GPIOB, &GPIO_InitStruct);& \8 ^2 Q) a1 o# C9 o1 ~! e
6 K5 B: t& u; C9 U) G3 t
% Q9 j+ f! y- ~# H
//!!! GPIO_Init is commented because some parameters are missing
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_14;
GPIO_InitStruct.GPIO_Mode = ;
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;6 P5 `) x3 R. r6 u/ `
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;, H1 ?+ i# d; }, z; m
GPIO_Init(GPIOB, &GPIO_InitStruct);* N3 O+ S0 k3 v% N2 w U/ X
; Z" |6 @/ a. F5 m* y) p/ t
o4 Y3 @$ X6 g1 v6 O, }
//!!! GPIO_Init is commented because some parameters are missing( \1 n, m0 g$ D/ v; v) j. Y
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_15;5 j4 ~- x# I1 x! C/ I# t
GPIO_InitStruct.GPIO_Mode = ;
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;# R7 P8 c! v) ?) ^ \& G1 ~
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;! A5 g1 @' l f, K; g
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;; n" n8 |* N J/ |$ F& v6 K2 c
GPIO_Init(GPIOB, &GPIO_InitStruct);
/*Configure GPIO pin alternate function */
GPIO_PinAFConfig(GPIOB, GPIO_PinSource12, GPIO_AF_SPI2);$ P0 T, s; E6 M9 l/ F
2 i8 g1 Z3 F6 a8 E
/*Configure GPIO pin alternate function */
GPIO_PinAFConfig(GPIOB, GPIO_PinSource13, GPIO_AF_SPI2);
! C, m$ X! C K; N
/*Configure GPIO pin alternate function */
GPIO_PinAFConfig(GPIOB, GPIO_PinSource14, GPIO_AF_SPI2);9 O8 {5 V9 ~. Y) F% Z, P
/*Configure GPIO pin alternate function */1 U! T" x# z3 E) d* w5 L
GPIO_PinAFConfig(GPIOB, GPIO_PinSource15, GPIO_AF_SPI2);
( J' X* P! o* g0 }% ?! O
/** USART1 GPIO Configuration r# R% P& b) B+ G7 K
PA9 ------> USART1_TX
PA10 ------> USART1_RX
*/4 G0 F( d0 W5 X
/*Enable or disable the AHB peripheral clock */7 W) o/ k9 [, E
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);
. m$ M- o- ?( X3 C
//!!! GPIO_Init is commented because some parameters are missing" J. z0 T/ J1 o% \
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_9;4 V# s8 }7 o8 K' g7 H5 F
GPIO_InitStruct.GPIO_Mode = ;/ ^( ?5 @2 h& G8 C$ O
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;6 E9 p, a- n* N! u
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;
GPIO_Init(GPIOA, &GPIO_InitStruct);! S. N. a% X) Y- H
//!!! GPIO_Init is commented because some parameters are missing' c: }; u. s% G6 X
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_10;
GPIO_InitStruct.GPIO_Mode = ;2 T/ J* H* h8 r! f" ~$ i( }
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;7 F+ a. i' z5 g. A
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;! f" ]: C( \, \+ P3 L! _
GPIO_Init(GPIOA, &GPIO_InitStruct);
/*Configure GPIO pin alternate function */
GPIO_PinAFConfig(GPIOA, GPIO_PinSource9, GPIO_AF_USART1);3 c. T" b& D- I; C
4 f1 |- f1 G- u( c& M
/*Configure GPIO pin alternate function */7 O0 N8 |5 S) d' e4 ?( O3 H' o
GPIO_PinAFConfig(GPIOA, GPIO_PinSource10, GPIO_AF_USART1);
5 ]( Z }* N* u1 j
$ ~. S% A& Z, M( ]4 m
/** USB GPIO Configuration
PA11 ------> USB_DM
PA12 ------> USB_DP' s5 M* k+ B* u" g
*/, e4 h2 q+ j6 i0 j
/*Enable or disable the AHB peripheral clock *// j v4 ?. W- G; P- E" s; ~
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);1 ?3 u/ c3 R# ^& R
+ H# q4 `/ @$ G- Q& T
//!!! GPIO_Init is commented because some parameters are missing4 d( r7 Y+ L1 ?# W z; _/ X. `+ c
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_11;+ S- c0 J6 m$ q0 e& y
GPIO_InitStruct.GPIO_Mode = ;+ m* ?, R1 u# K
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;# C6 o8 j1 W; e% @8 l3 L
GPIO_Init(GPIOA, &GPIO_InitStruct);
//!!! GPIO_Init is commented because some parameters are missing
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_12;4 c1 f+ q% a2 R
GPIO_InitStruct.GPIO_Mode = ;- t+ w4 M; @8 W/ O9 E
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;
GPIO_Init(GPIOA, &GPIO_InitStruct);1 h! B% y* y! q9 J0 \( _
* ~* l0 ~. y8 m1 Z4 V
/** Configure pins as GPIO$ e6 \; a. e9 R' [2 `
PA8 ------> GPIO_Input: ?! W9 D, b; d' W
*/
b4 b5 L* q* }. }$ ^% f, n8 H
/*Enable or disable the AHB peripheral clock */
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);
/*Configure GPIO pin */
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_8;$ A( c$ M! C( x4 @1 ], x
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IN;
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(GPIOA, &GPIO_InitStruct);0 _' Y: V. s7 p h1 o/ H
}
1 {9 n2 T8 c v- L7 A
/* USER CODE BEGIN 2 */
. N" _. X' R E+ d: C
/* USER CODE END 2 */
回复:ST公司出品【图形化配置工具】
RE:ST公司出品【图形化配置工具】
RE:ST公司出品【图形化配置工具】
RE:ST公司出品【图形化配置工具】
RE:ST公司出品【图形化配置工具】
RE:ST公司出品【图形化配置工具】
RE:ST公司出品【图形化配置工具】
RE:ST公司出品【图形化配置工具】
回复:ST公司出品【图形化配置工具】
回复:ST公司出品【图形化配置工具】
RE:ST公司出品【图形化配置工具】
RE:ST公司出品【图形化配置工具】
RE:ST公司出品【图形化配置工具】