感谢楼主,下载成功,安装提示缺少,Java Runtime Environment,然后我安装了Java,然后进入安装,自动选择安装目录,安装一阵,最后提醒, javaw.exe not found ,reinstall java jre;实际上,我的电脑里搜索,有javaw.exe 。因此,MicroXplorer无法安装,困惑。
生成代码鉴赏:论坛啥时候能支持代码片段呢????? ; g3 E1 R, k [9 v , z2 d2 b: y3 o% G/** & }) M- ?" x2 f3 i7 ], J ******************************************************************************6 l& d9 K4 e" p N& G" w) s
* File Name : mx_gpio.c * i; M3 n- g. Y" q * Date : 03/01/2014 15:37:11 ! B* M# n' n' C1 E5 |5 u- s * Description : This file provides code for the configuration: @" y5 F4 f Y- \
* of all used GPIO pins. 4 d! r: h, `$ ]5 m% W4 y ****************************************************************************** : [* B$ v7 {) A8 W- Q5 M * ' Z, I( B0 x2 T& x, O& }% |5 o& F * COPYRIGHT 2014 STMicroelectronics $ \# Z' a% b$ w, |$ X' e( G% Q *& U) @& F+ d4 y% z0 F
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); ^* T& f8 q4 k5 k4 a5 w% @+ Y6 z * You may not use this file except in compliance with the License. ( @* Y7 X2 M! H. K- r# s4 r& F * You may obtain a copy of the License at: * f, R0 W; l7 y$ _4 m! e *5 N/ ]% c3 E* `* m- r+ c% X
* http:www.st.com/software_license_agreement_liberty_v2 3 k' t3 o7 s( g * & x9 s4 J9 M5 O9 A * Unless required by applicable law or agreed to in writing, software ) m) p# W. Q5 N3 z * distributed under the License is distributed on an "AS IS" BASIS, 7 K) L/ W0 ^# p * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.% J/ X8 j. R* z% S7 j7 E3 y' n
* See the License for the specific language governing permissions and 1 |5 i; S/ j- Q% f4 }- a! t; ? * limitations under the License.+ r" `: e4 f1 ?1 E; X
* 8 R' [! Y( Z# j l ****************************************************************************** 7 s; k7 B( x- B) n */' y$ o% U- R5 t! P5 |8 n2 Z9 S e
* @3 H/ ?, r9 Q. R* R2 H, t
/* Includes ------------------------------------------------------------------*/) ]" l2 r9 _. v8 ?% ~
#include "mx_gpio.h" 7 [# T8 p$ ?6 K4 s: o( y) i/* USER CODE BEGIN 0 */) R e7 f" n, {. F3 M+ p
) @* d, |+ L' v: |' Y/* USER CODE END 0 */ 4 u6 ?8 b# `- j& O3 H) ^ 7 O6 Y) v0 z! a( P
/*----------------------------------------------------------------------------*/ ; ]) e; V0 z+ b5 v" g0 O4 e4 {* \/* Configure GPIO */& V* R$ ?; U3 n+ s. x
/*----------------------------------------------------------------------------*/ # D2 \$ {" x- q/* USER CODE BEGIN 1 */+ M& V6 s3 o% @% F" N
; u' Y) G* l' |1 Y, i! i; j- I/* USER CODE END 1 */ / `/ N1 v0 V0 |# e) E5 B g; F& m, h5 X1 G7 t% l' [void mx_pinout_config(void) {% v0 o# G+ a3 W0 V$ `- I
/* Private typedef ---------------------------------------------------------*/$ ?: t: F. }3 b* [
GPIO_InitTypeDef GPIO_InitStruct; 7 F1 U6 d) I, u a Z 9 |3 x5 S6 m7 }) R. n) Y
4 d. @4 C7 m" j \; i) `
/** ADC GPIO Configuration % W1 {0 z g+ a' N, L- E P+ A PA1 ------> ADC_IN1 7 Y- J2 Y0 W3 ?1 b3 } r */ J) x9 U0 a! s. z
: {. O: ?% q' y0 L/ g R0 }3 T. V1 P; u 5 O0 F0 p" [ O% F. Y /*Enable or disable the AHB peripheral clock */ X4 Q; k0 k$ p6 m8 U4 X$ i+ `$ g RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);' ^7 s. v# u( W; h: y
! |* U8 @& w! I4 ~+ J& i
/*Configure GPIO pin */ $ `. P4 T4 r+ v6 ]" O) F! [ GPIO_InitStruct.GPIO_Pin = GPIO_Pin_1; # D' B/ i6 \+ G1 X GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AN; - \7 [" O% A% i- j" l/ g GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL; q w. |: j; b: R9 \! ? GPIO_Init(GPIOA, &GPIO_InitStruct);7 b0 `& N# R/ C
K: { o. k2 z) j3 L. d
$ y _) y% V5 E8 K- X /** I2C1 GPIO Configuration , w9 Q/ S3 P5 m! Y0 V PB6 ------> I2C1_SCL " q4 v6 X6 {9 s3 C# O {- Y& G PB7 ------> I2C1_SDA 6 a& A) m! x( F9 Z3 N */! C! m! ~! q1 [7 G7 W8 e# {
; J4 _9 k! G9 x0 t. O& \ 0 }& S& t; b) T( Y2 F- [, K! T
/*Enable or disable the AHB peripheral clock */ : |& H( [6 ^& ~( v RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOB, ENABLE); 9 j! M2 } s# E) f ; P. |9 p' P2 y ^) T: Z / p0 R- l- y4 D3 A2 B9 j
//!!! GPIO_Init is commented because some parameters are missing0 [7 v! Y7 D( U! z. W. b9 c, g0 M
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_6;/ F z1 }. E/ A, v
GPIO_InitStruct.GPIO_Mode = ; 1 f5 y( y3 B# R0 `6 `) H2 B% R GPIO_InitStruct.GPIO_OType = GPIO_OType_PP; 2 y. d: z7 g- k& K GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL; ( Z' r" U0 w7 i: r* w$ r GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz; % J7 u% a- _; ?6 V( W: i GPIO_Init(GPIOB, &GPIO_InitStruct);7 u! X3 c+ x( x- O6 ]
* a1 l2 ^ E9 w5 M; d9 D, n5 y
$ Z8 l* w/ g' }. j/ r8 t //!!! GPIO_Init is commented because some parameters are missing' `$ N# K5 z9 c+ M# N" r
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_7; 0 _6 C' I# S- ]& Z; r GPIO_InitStruct.GPIO_Mode = ; ) k0 I) v- L3 A& {% `, T6 o8 y GPIO_InitStruct.GPIO_OType = GPIO_OType_PP; ' U3 l8 e4 X9 U$ w8 ]$ F" m GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;3 b% j. t$ c9 R3 x; M3 n1 A
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz; , R3 k, [# P+ O2 u GPIO_Init(GPIOB, &GPIO_InitStruct); ) H2 Z# _2 M6 Q3 e5 N. s% A/ ` / N. `: v% ]; \8 `. r3 ]* d
/*Configure GPIO pin alternate function */ 9 m2 v" q* A0 }; u! c2 \ GPIO_PinAFConfig(GPIOB, GPIO_PinSource6, GPIO_AF_I2C1); . x Z# I3 c; {& I" t m 3 i3 |& F& V! J( C+ J5 i
/*Configure GPIO pin alternate function */ 0 `8 @5 I" U- Y" Y- Y GPIO_PinAFConfig(GPIOB, GPIO_PinSource7, GPIO_AF_I2C1); 9 |1 v3 I, m+ J. o8 A8 W4 W4 n . F/ P0 Q6 W9 P
& i. |# \. F" w! \+ r8 O& Y5 P" I
/** SPI2 GPIO Configuration 0 J+ y- j: N% S* d# k4 N2 S
PB12 ------> SPI2_NSS N+ t) z6 O/ Z7 | PB13 ------> SPI2_SCK 8 w1 ?4 D8 T; d t$ m, { PB14 ------> SPI2_MISO 8 Q: z* s" I9 U* O PB15 ------> SPI2_MOSI* b, o4 k1 w7 y. {5 U
*/: p) k; `" A7 L+ ]% q
. d3 G% k' b5 Q* @/ x
! s- Y7 @4 v( f6 L- u& y" S6 b% n /*Enable or disable the AHB peripheral clock */ % a1 F7 z# f8 K! D6 \) r- _ RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOB, ENABLE); l6 ?1 }0 p' D: y 1 b* Q9 c6 z9 ?5 U2 m 7 u( t$ J' Q; c+ u) y) n8 p6 F: y //!!! GPIO_Init is commented because some parameters are missing ; W2 z- s1 P# E% z GPIO_InitStruct.GPIO_Pin = GPIO_Pin_12; ( _! R5 a0 R L% t g# E) W! c/ I; I- n GPIO_InitStruct.GPIO_Mode = ; / ?/ _7 t: ^9 B1 h3 N ~ GPIO_InitStruct.GPIO_OType = GPIO_OType_PP; * x' J7 U! ~7 R) p' a0 e/ K. a- x5 Z8 ^0 N GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL; $ v* p _" @1 { GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;3 v# a* U! V2 B' L) O' W
GPIO_Init(GPIOB, &GPIO_InitStruct); 6 ?2 C6 {6 g/ K) d 1 J7 b+ g6 x2 L
: `3 V/ O8 i1 Z! {- [ //!!! GPIO_Init is commented because some parameters are missing 2 ~( q+ r s9 V' x4 Y GPIO_InitStruct.GPIO_Pin = GPIO_Pin_13; 8 o8 m9 E$ V n" k GPIO_InitStruct.GPIO_Mode = ; ( L1 E( i" E4 x, c: k, Y2 D, t GPIO_InitStruct.GPIO_OType = GPIO_OType_PP; - V5 k7 ^, p) l GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL; 0 d5 C4 w% F$ W. U. X: e GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz; . q0 R; E# I1 [& F GPIO_Init(GPIOB, &GPIO_InitStruct); ' }8 K6 p _; O: K4 F, g" j: [ ; V2 d: H% h( v/ T9 ~% d
! f0 {+ B( ?- }( E
//!!! GPIO_Init is commented because some parameters are missing % h- b$ N" E) F* O: ]7 D' G GPIO_InitStruct.GPIO_Pin = GPIO_Pin_14; c! y2 `' t9 r, w! @ GPIO_InitStruct.GPIO_Mode = ; 3 j4 t9 z( y) p2 R6 ^9 h z GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;) }6 o* v, I! P. W/ u
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;, j# ~5 v% p' w; W( x5 p0 Y
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;# G: v6 }4 w4 B# N3 ]$ a. W; L& w
GPIO_Init(GPIOB, &GPIO_InitStruct); & E' P. M9 G* @) B1 ]# ]6 u % F; Y* y5 ?6 a1 t8 c* T 8 k' j$ @" t" L' i //!!! GPIO_Init is commented because some parameters are missing * N, o0 E# P2 ^& j GPIO_InitStruct.GPIO_Pin = GPIO_Pin_15; 3 X8 V4 v' R6 C+ m GPIO_InitStruct.GPIO_Mode = ;3 e6 w, i ?6 y4 O) r$ u
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP; + I: L0 L; W+ U h GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;: v& x) x/ ^4 I" C, B$ h r% C
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz; , Q. h/ f0 B, r5 @ GPIO_Init(GPIOB, &GPIO_InitStruct);. D: e: X9 a/ B/ S! {0 }
$ C3 {* _7 A0 B; x( c" \! `
/*Configure GPIO pin alternate function */2 R8 \4 X$ I: a2 f
GPIO_PinAFConfig(GPIOB, GPIO_PinSource12, GPIO_AF_SPI2);$ W& g0 t0 }2 w) r; T3 C
for(i=0; i<4; i++)//R G B 中一个字节对应的发送缓存
{
tmp = (uint8_t)(color &0x00000003);
switch(tmp)
{8 |) R8 n% E Y/ X% }, Y! E; _" X
case 0x00:. A% x: ~ I4 w4 D: r5 @8 y+ s
*pb = BIT00;4 V+ _) ]; z( o) h) c
break;
case 0x01:
*pb = BIT01;
break;2 Z$ |8 r; K7 F+ v; Q$ X! g
case 0x02:* S7 V( k. L( z" J% B. @5 t1 d
*pb = BIT10;& y8 r% q/ }9 s* e# z; s4 F$ n3 \
break;# s( k- a- d- c! v$ |
case 0x03:
*pb = BIT11;& n5 q6 x8 j; I6 F
break;
} P6 G* W: ]% U+ p2 C* b
color = color >>2;" A# |7 Z4 h) @0 p, X7 }$ D+ z, v
pb--;% U e+ h, A" y$ e' i( u
}( V5 b1 u3 \5 w. P
pb += 7;# _7 Y; }0 f2 X+ x* s% A: t; U. |- M8 B
}
这样就可以了,在安装目录了里会有一个.jar文件,双击打开即可
RE:ST公司出品【图形化配置工具】
/**
******************************************************************************6 l& d9 K4 e" p N& G" w) s
* File Name : mx_gpio.c
* Date : 03/01/2014 15:37:11
* Description : This file provides code for the configuration: @" y5 F4 f Y- \
* of all used GPIO pins.
******************************************************************************
*
* COPYRIGHT 2014 STMicroelectronics
*& U) @& F+ d4 y% z0 F
* 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:
*5 N/ ]% c3 E* `* m- r+ c% X
* http:www.st.com/software_license_agreement_liberty_v2
*
* 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.% J/ X8 j. R* z% S7 j7 E3 y' n
* See the License for the specific language governing permissions and
* limitations under the License.+ r" `: e4 f1 ?1 E; X
*
******************************************************************************
*/' y$ o% U- R5 t! P5 |8 n2 Z9 S e
* @3 H/ ?, r9 Q. R* R2 H, t
/* Includes ------------------------------------------------------------------*/) ]" l2 r9 _. v8 ?% ~
#include "mx_gpio.h"
/* USER CODE BEGIN 0 */) R e7 f" n, {. F3 M+ p
/* USER CODE END 0 */
7 O6 Y) v0 z! a( P
/*----------------------------------------------------------------------------*/
/* Configure GPIO */& V* R$ ?; U3 n+ s. x
/*----------------------------------------------------------------------------*/
/* USER CODE BEGIN 1 */+ M& V6 s3 o% @% F" N
/* USER CODE END 1 */
void mx_pinout_config(void) {% v0 o# G+ a3 W0 V$ `- I
/* Private typedef ---------------------------------------------------------*/$ ?: t: F. }3 b* [
GPIO_InitTypeDef GPIO_InitStruct;
9 |3 x5 S6 m7 }) R. n) Y
4 d. @4 C7 m" j \; i) `
/** ADC GPIO Configuration
PA1 ------> ADC_IN1
*/ J) x9 U0 a! s. z
/*Enable or disable the AHB peripheral clock */
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);' ^7 s. v# u( W; h: y
! |* U8 @& w! I4 ~+ J& i
/*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);7 b0 `& N# R/ C
K: { o. k2 z) j3 L. d
/** I2C1 GPIO Configuration
PB6 ------> I2C1_SCL
PB7 ------> I2C1_SDA
*/! C! m! ~! q1 [7 G7 W8 e# {
0 }& S& t; b) T( Y2 F- [, K! T
/*Enable or disable the AHB peripheral clock */
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOB, ENABLE);
/ p0 R- l- y4 D3 A2 B9 j
//!!! GPIO_Init is commented because some parameters are missing0 [7 v! Y7 D( U! z. W. b9 c, g0 M
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_6;/ F z1 }. E/ A, v
GPIO_InitStruct.GPIO_Mode = ;
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);7 u! X3 c+ x( x- O6 ]
* a1 l2 ^ E9 w5 M; d9 D, n5 y
//!!! GPIO_Init is commented because some parameters are missing' `$ N# K5 z9 c+ M# N" r
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_7;
GPIO_InitStruct.GPIO_Mode = ;
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;3 b% j. t$ c9 R3 x; M3 n1 A
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;
GPIO_Init(GPIOB, &GPIO_InitStruct);
/ N. `: v% ]; \8 `. r3 ]* d
/*Configure GPIO pin alternate function */
GPIO_PinAFConfig(GPIOB, GPIO_PinSource6, GPIO_AF_I2C1);
3 i3 |& F& V! J( C+ J5 i
/*Configure GPIO pin alternate function */
GPIO_PinAFConfig(GPIOB, GPIO_PinSource7, GPIO_AF_I2C1);
. F/ P0 Q6 W9 P
& i. |# \. F" w! \+ r8 O& Y5 P" I
/** SPI2 GPIO Configuration 0 J+ y- j: N% S* d# k4 N2 S
PB12 ------> SPI2_NSS
PB13 ------> SPI2_SCK
PB14 ------> SPI2_MISO
PB15 ------> SPI2_MOSI* b, o4 k1 w7 y. {5 U
*/: p) k; `" A7 L+ ]% q
. d3 G% k' b5 Q* @/ x
/*Enable or disable the AHB peripheral clock */
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOB, ENABLE);
//!!! GPIO_Init is commented because some parameters are missing
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_12;
GPIO_InitStruct.GPIO_Mode = ;
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;3 v# a* U! V2 B' L) O' W
GPIO_Init(GPIOB, &GPIO_InitStruct);
1 J7 b+ g6 x2 L
//!!! 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;
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;
GPIO_Init(GPIOB, &GPIO_InitStruct);
; V2 d: H% h( v/ T9 ~% d
! f0 {+ B( ?- }( E
//!!! 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;) }6 o* v, I! P. W/ u
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;, j# ~5 v% p' w; W( x5 p0 Y
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;# G: v6 }4 w4 B# N3 ]$ a. W; L& w
GPIO_Init(GPIOB, &GPIO_InitStruct);
//!!! GPIO_Init is commented because some parameters are missing
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_15;
GPIO_InitStruct.GPIO_Mode = ;3 e6 w, i ?6 y4 O) r$ u
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;: v& x) x/ ^4 I" C, B$ h r% C
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;
GPIO_Init(GPIOB, &GPIO_InitStruct);. D: e: X9 a/ B/ S! {0 }
$ C3 {* _7 A0 B; x( c" \! `
/*Configure GPIO pin alternate function */2 R8 \4 X$ I: a2 f
GPIO_PinAFConfig(GPIOB, GPIO_PinSource12, GPIO_AF_SPI2);$ W& g0 t0 }2 w) r; T3 C
/*Configure GPIO pin alternate function */
GPIO_PinAFConfig(GPIOB, GPIO_PinSource13, GPIO_AF_SPI2);5 @( A7 |: V9 _, ], B. N
}& _9 U7 v. H$ O% Y
/*Configure GPIO pin alternate function */
GPIO_PinAFConfig(GPIOB, GPIO_PinSource14, GPIO_AF_SPI2);
3 o# o1 k! Q2 I1 x$ M- D( ?
/*Configure GPIO pin alternate function */' Z" p0 f$ `: C3 G( A" [
GPIO_PinAFConfig(GPIOB, GPIO_PinSource15, GPIO_AF_SPI2);
# C9 x. X# Q3 [8 }
/** USART1 GPIO Configuration
PA9 ------> USART1_TX7 G+ f# Y; @6 E/ C
PA10 ------> USART1_RX3 O& b5 c. m2 f3 }
*/: _' d4 R# ?0 D3 T
/*Enable or disable the AHB peripheral clock */
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);
) p2 [5 x, D( K) {! o# W5 B# C
//!!! GPIO_Init is commented because some parameters are missing
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_9;, @' [* D% W7 h1 U' f5 `5 G7 y
GPIO_InitStruct.GPIO_Mode = ;
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;8 y8 w# p( \1 F
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;
GPIO_Init(GPIOA, &GPIO_InitStruct);
% Q' ]: S" a5 T7 m1 [
* z! V5 a7 Z8 u+ E& A2 r) l, r) t8 f
//!!! GPIO_Init is commented because some parameters are missing! J& Q" f6 j1 i9 ~5 A; K
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_10;' Q2 n& X1 F. @9 W0 \! m
GPIO_InitStruct.GPIO_Mode = ;
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;# {3 `7 P$ Q5 G2 V& ^
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;
GPIO_Init(GPIOA, &GPIO_InitStruct);: D) m- F |; u3 @8 [( f
- \" `& N0 g0 g
/*Configure GPIO pin alternate function */- j& D2 x$ |' k% U4 E
GPIO_PinAFConfig(GPIOA, GPIO_PinSource9, GPIO_AF_USART1);
9 N/ |& `8 X( i8 g" v! G
/*Configure GPIO pin alternate function */
GPIO_PinAFConfig(GPIOA, GPIO_PinSource10, GPIO_AF_USART1);, O" N# Y! A1 B) q& N
/** USB GPIO Configuration
PA11 ------> USB_DM% v( t: Q1 \0 R$ ~ W3 _" ~8 c
PA12 ------> USB_DP! M D! n* i2 z" ?3 v: r: k
*/* z9 g1 q8 R9 I' @% A) V; X! v
9 A( A3 Z4 u* Y* s* b
% I3 k' B, k' X% J
/*Enable or disable the AHB peripheral clock */9 }7 e% V1 I H; S, n4 v) C, B, p
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);
8 n( X* g0 M( U+ N- ^! O
//!!! GPIO_Init is commented because some parameters are missing
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_11;
GPIO_InitStruct.GPIO_Mode = ;
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);
) W* v# \/ D" B. r
//!!! GPIO_Init is commented because some parameters are missing
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_12;
GPIO_InitStruct.GPIO_Mode = ;
GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;6 j5 C, x' x+ U! O# M
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_400KHz;3 E" n+ k, E) p1 w5 F4 J
GPIO_Init(GPIOA, &GPIO_InitStruct);+ Z2 {( `/ m$ s5 Y5 ^ S G! w
! `+ \! M/ ^/ g" D
3 m: X+ w* D) I, M% z: l
/** Configure pins as GPIO
PA8 ------> GPIO_Input5 `6 @! M& W1 |, c& @
*/
, g2 |5 i+ N7 D' p% m% r0 m+ }
/*Enable or disable the AHB peripheral clock */
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);
: Z6 K: h& g% ?, l. o
/*Configure GPIO pin */
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_8;
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IN;% O4 A3 Q1 @$ I) M
GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;0 U8 s# d. e7 T( f( `" O. L ^6 k
GPIO_Init(GPIOA, &GPIO_InitStruct);3 s2 C1 }, I9 k. p" a
}
/* USER CODE BEGIN 2 */! X! r1 N. [, Q: p0 j# f5 \& r6 G
/* 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公司出品【图形化配置工具】