01. 概述
; p8 n& K7 g/ ^6 `$ I: u" aFSMC 相关的库函数分布在 stm32f4xx_fsmc.c 文件和头文件 stm32f4xx_fsmc.h 中。
/ g$ r1 ?3 ~& h6 f$ I) H7 c% l0 X- M0 |! V* W# `4 F
02. 相关类型% {8 A& `7 V1 I) ?. d! i: z. ?! X6 A
FSMC_NORSRAMTimingInitTypeDef类型
: H7 _1 I) z& j8 z- }" W- r; v. I' p, v* `7 Y, O
- 5 `/ T" \: M' N; c6 m @; f
- /** ) t) d2 a; S' H8 Q- y
- * @brief Timing parameters For NOR/SRAM Banks
: W) G; T8 W4 c0 ? - */
# v9 x) e# E2 F - typedef struct8 A U! m( g/ ^; N7 E
- {
& j& J7 T7 {) m8 K; n$ S - uint32_t FSMC_AddressSetupTime; /*!< Defines the number of HCLK cycles to configure7 T* q! H& q6 w- ~5 o& R {
- the duration of the address setup time.
: q$ d4 |$ U: p5 X - This parameter can be a value between 0 and 0xF.8 t. C. m! g; z/ H
- @note This parameter is not used with synchronous NOR Flash memories. */% p$ n! q; f) r% @
: y/ P. C2 q; r5 n# M4 l8 C1 U0 O" X- uint32_t FSMC_AddressHoldTime; /*!< Defines the number of HCLK cycles to configure
( \* J n- P- I8 u3 a/ L! b - the duration of the address hold time.
2 `$ d) X* A0 p% q" h6 i - This parameter can be a value between 0 and 0xF. / k, c; k+ d* x5 v( b! k8 l
- @note This parameter is not used with synchronous NOR Flash memories.*/
) H9 c6 L. k5 }) m+ n; L
* v; ?7 Z1 ?# o/ n- uint32_t FSMC_DataSetupTime; /*!< Defines the number of HCLK cycles to configure; _' G% j2 O$ k: |: ?
- the duration of the data setup time.9 M/ j) n! V$ G
- This parameter can be a value between 0 and 0xFF.
: a: x3 }3 {0 J+ \ - @note This parameter is used for SRAMs, ROMs and asynchronous multiplexed NOR Flash memories. */
) u/ T3 \9 Q6 q7 a: T3 @$ ^7 C - " F( U0 L: k& a: }0 X2 I% Q
- uint32_t FSMC_BusTurnAroundDuration; /*!< Defines the number of HCLK cycles to configure
7 T; D# q- K! G1 X& V - the duration of the bus turnaround.$ v9 s, ?; \0 J$ r) O& S" s; v! L
- This parameter can be a value between 0 and 0xF.- n) I( g6 V0 ^6 L' l$ o# u" f
- @note This parameter is only used for multiplexed NOR Flash memories. */) D% A7 r3 T) R" u: ~, H3 g( T
# S0 n Q/ }/ O5 p$ c/ i' d- uint32_t FSMC_CLKDivision; /*!< Defines the period of CLK clock output signal, expressed in number of HCLK cycles.4 k/ Y# K6 E) w
- This parameter can be a value between 1 and 0xF.
1 Y; h+ z1 N4 T. i b7 A0 J - @note This parameter is not used for asynchronous NOR Flash, SRAM or ROM accesses. */* T* \0 e- S) ], {1 @
# B7 V% S8 f. d/ d' L" g- uint32_t FSMC_DataLatency; /*!< Defines the number of memory clock cycles to issue% ]$ u' f( l( L! e4 I9 \
- to the memory before getting the first data.6 w# S" l( l. \; R# i
- The parameter value depends on the memory type as shown below:
" u6 y- _7 B) U) S& ~, l - - It must be set to 0 in case of a CRAM
9 V& U9 s0 x( B! m) G# r. ` - - It is don't care in asynchronous NOR, SRAM or ROM accesses' f: j1 Y4 U) [, B% z
- - It may assume a value between 0 and 0xF in NOR Flash memories
" c3 M2 `8 G9 i8 {& z3 X2 K - with synchronous burst mode enable *// k7 P. V' e/ N! M( c
- ; V, b4 R1 w |4 e5 a
- uint32_t FSMC_AccessMode; /*!< Specifies the asynchronous access mode. 7 F- }+ g; X* }: W0 @. d( ^& G/ ?
- This parameter can be a value of @ref FSMC_Access_Mode */. f5 t9 {- z) t% E
- }FSMC_NORSRAMTimingInitTypeDef;
复制代码 9 R* K. k, j& y, f* T2 a. E, S
FSMC_NORSRAMInitTypeDef类型
+ H9 }6 `' g, @% f& G) p; D5 O8 m' i
- /**
8 U. @* M( q8 {) _: @5 i - * @brief FSMC NOR/SRAM Init structure definition
1 e) H4 h- o' T" ^) ^" s( ~# H - */
% |) }+ W! |5 a5 K0 _; J& G w H; ] - typedef struct4 v+ s: | K! }) B* {; f
- {1 L+ ~5 L; `2 C1 u/ b
- uint32_t FSMC_Bank; /*!< Specifies the NOR/SRAM memory bank that will be used.
& u& s* C* ` h+ i% D# R+ o - This parameter can be a value of @ref FSMC_NORSRAM_Bank */- c" b1 \9 R5 V6 I5 I2 G+ k
6 \7 d: b- c* H7 G- uint32_t FSMC_DataAddressMux; /*!< Specifies whether the address and data values are
Y: P4 o- Z) M, C- G - multiplexed on the data bus or not.
; v+ S. \- N4 m- a% H4 p - This parameter can be a value of @ref FSMC_Data_Address_Bus_Multiplexing */
# Y9 x, D% y) I7 u6 S2 z - , r! ]' d" Q; \4 e+ F' o Z0 a( m( P
- uint32_t FSMC_MemoryType; /*!< Specifies the type of external memory attached to
% i1 R$ ]/ l: k& N - the corresponding memory bank.. b! r U% c9 C8 ^3 u
- This parameter can be a value of @ref FSMC_Memory_Type */
; l7 i' \7 d7 k- W+ Y2 R& U
3 E4 |$ |+ O" \2 L2 V0 i- uint32_t FSMC_MemoryDataWidth; /*!< Specifies the external memory device width.( t0 p) X$ F8 ?0 h
- This parameter can be a value of @ref FSMC_Data_Width */
0 t, A w9 T" g: @( I. V0 A; j - / }: {& c! w: `: Z3 K
- uint32_t FSMC_BurstAccessMode; /*!< Enables or disables the burst access mode for Flash memory,
, [* E" Z/ U/ y4 E/ s+ o3 C. n3 e - valid only with synchronous burst Flash memories.
' a: W, N2 D3 ^ - This parameter can be a value of @ref FSMC_Burst_Access_Mode */; O+ I% S% _; |( R/ x
; P3 h$ n5 j% V- uint32_t FSMC_AsynchronousWait; /*!< Enables or disables wait signal during asynchronous transfers,
7 u3 X. g0 X9 V. }/ e - valid only with asynchronous Flash memories.
& B2 [% V# |0 K) W& A! m( K - This parameter can be a value of @ref FSMC_AsynchronousWait */
$ S- x" @6 @6 a# i. ^" `7 z
: \* T) |1 q& v( e9 o- uint32_t FSMC_WaitSignalPolarity; /*!< Specifies the wait signal polarity, valid only when accessing
( X; j3 u) l {( J6 j) j - the Flash memory in burst mode.
3 |2 N& E3 j3 E8 x6 d - This parameter can be a value of @ref FSMC_Wait_Signal_Polarity */! d& @6 I" n$ P: Z5 z7 }! [2 {
7 @0 P a- J" A. c; ]: C- uint32_t FSMC_WrapMode; /*!< Enables or disables the Wrapped burst access mode for Flash
! u, I+ ]# y5 y2 y - memory, valid only when accessing Flash memories in burst mode.9 z3 F: s6 w& z: p1 u d
- This parameter can be a value of @ref FSMC_Wrap_Mode */. J' w! k2 B0 V0 F: W/ `% a2 |; a
* m# x9 F0 @# Z! B! t& [- uint32_t FSMC_WaitSignalActive; /*!< Specifies if the wait signal is asserted by the memory one
: t/ `3 C/ Q! \5 {4 x- ?7 H - clock cycle before the wait state or during the wait state,9 [* p$ y: Q/ k8 }8 k6 y$ j% H
- valid only when accessing memories in burst mode. ' u9 r! w0 a! ?$ @8 w, i
- This parameter can be a value of @ref FSMC_Wait_Timing */! M0 ?3 ?9 n* A
! b5 y/ }% O1 N1 w- uint32_t FSMC_WriteOperation; /*!< Enables or disables the write operation in the selected bank by the FSMC.
; b9 x7 S9 ]- V/ L5 u- N - This parameter can be a value of @ref FSMC_Write_Operation */' b- P4 [! I9 i9 j( n
- - p4 q: Q9 c! ]0 u( x/ N
- uint32_t FSMC_WaitSignal; /*!< Enables or disables the wait state insertion via wait( G- y) V- ~% R4 k; f7 G
- signal, valid for Flash memory access in burst mode. / t8 B5 ^& l" o3 o7 T' k
- This parameter can be a value of @ref FSMC_Wait_Signal */6 a/ E B$ n4 P0 r$ c3 F# F Z- z u6 F
- ! u( J6 W* q$ F: M4 C
- uint32_t FSMC_ExtendedMode; /*!< Enables or disables the extended mode.9 i, s1 _* Q. D& H* r2 n8 R! {
- This parameter can be a value of @ref FSMC_Extended_Mode */# ^: R9 m8 c: q5 W5 i# K
- 7 _2 q- _6 M9 C% ~, m" I
- uint32_t FSMC_WriteBurst; /*!< Enables or disables the write burst operation.% T* e; q, s1 m0 H9 ~
- This parameter can be a value of @ref FSMC_Write_Burst */
! d! ?/ L W2 T P$ F5 Y
, H d% w3 t8 A2 I$ h- FSMC_NORSRAMTimingInitTypeDef* FSMC_ReadWriteTimingStruct; /*!< Timing Parameters for write and read access if the Extended Mode is not used*/
/ A. w4 \: A! j6 r# }0 n6 O - : P: H# Q; X7 h( l- x: H7 d
- FSMC_NORSRAMTimingInitTypeDef* FSMC_WriteTimingStruct; /*!< Timing Parameters for write access if the Extended Mode is used*/
7 u2 l0 Q- ~; M( h' T7 s n$ i - }FSMC_NORSRAMInitTypeDef;
复制代码 8 _8 V$ n6 \% R
FSMC_NAND_PCCARDTimingInitTypeDef类型+ X% L+ O3 C$ U+ L5 @/ i$ l
7 x( L' b# m: J9 H/ e
- /** # G& P5 X- S, o" e- U5 O9 o; B
- * @brief Timing parameters For FSMC NAND and PCCARD Banks
( O4 o, I4 H* a) r i5 z0 ` - */
$ |1 J1 e) ~$ } - typedef struct$ P. d: s0 L h, L) ^& b
- {
2 {$ Z- H6 `6 L' N: l - uint32_t FSMC_SetupTime; /*!< Defines the number of HCLK cycles to setup address before
& T6 B: }- M* D - the command assertion for NAND Flash read or write access* L" [: t4 |6 U7 A
- to common/Attribute or I/O memory space (depending on
1 r1 I9 T; J9 k( @- W9 b* I q - the memory space timing to be configured).
8 |, Z- ?, J' r5 f) Q - This parameter can be a value between 0 and 0xFF.*/
- i+ |/ O8 u) H4 L, {$ @2 W - 3 D7 P- E5 {0 ]6 y. `8 i# V$ ~0 h
- uint32_t FSMC_WaitSetupTime; /*!< Defines the minimum number of HCLK cycles to assert the
3 E3 C) H4 A4 ^; u% O - command for NAND Flash read or write access to) M; O. b1 b3 O1 X5 u8 q
- common/Attribute or I/O memory space (depending on the
/ b) v) Y# U- k# V) j: g - memory space timing to be configured). 3 a5 z, y2 r/ ^3 `2 W" P
- This parameter can be a number between 0x00 and 0xFF */; T; P# o5 M7 H. S& v
+ }; v- x1 {2 V! B2 d1 ]' s$ Y- uint32_t FSMC_HoldSetupTime; /*!< Defines the number of HCLK clock cycles to hold address# C4 t4 c0 ^' j
- (and data for write access) after the command de-assertion: q2 V7 l' q4 ] W- y
- for NAND Flash read or write access to common/Attribute
4 ]# K; l% X6 s; |9 w$ ?2 Y% \. Z - or I/O memory space (depending on the memory space timing
! E& G$ O. @8 F. s) g/ l - to be configured).
2 K x% r. q& ^; P - This parameter can be a number between 0x00 and 0xFF */% O* f1 N6 D7 i. P( I% C( Q1 v: V
) q; p2 R E1 m7 \0 ]. a3 g- uint32_t FSMC_HiZSetupTime; /*!< Defines the number of HCLK clock cycles during which the
4 O0 f7 Z# ?) F1 V - data bus is kept in HiZ after the start of a NAND Flash% ]0 o# H" z. h( m: ~0 f$ P
- write access to common/Attribute or I/O memory space (depending
* L" b; X: c. z+ g8 F - on the memory space timing to be configured).
. ]) z' J5 @* N2 I' s1 m - This parameter can be a number between 0x00 and 0xFF */
0 u+ r' z% J+ Y1 M A - }FSMC_NAND_PCCARDTimingInitTypeDef;
复制代码 0 v- r, T7 _) b" t* Y
FSMC_NANDInitTypeDef类型 J4 |4 n3 B4 P5 ~
. M9 c- i1 @) N) f+ V- /** $ W K3 ?. u9 z( F
- * @brief FSMC NAND Init structure definition
4 A9 H9 r9 o( e7 C( c7 d+ n - */
3 k/ L- G0 p5 F! H# _ t+ M) o8 P - typedef struct
/ c( b8 h' b4 w8 V+ B p - {
7 w1 P5 P2 a: C# S+ b - uint32_t FSMC_Bank; /*!< Specifies the NAND memory bank that will be used.9 O* t8 |5 Y- E6 w2 `% j* `1 i
- This parameter can be a value of @ref FSMC_NAND_Bank */
p+ i+ ?6 M7 ^% O: U& {& V) K - . O/ ]! I* Y, B. O4 t
- uint32_t FSMC_Waitfeature; /*!< Enables or disables the Wait feature for the NAND Memory Bank.3 `# A$ m* e7 c- ~, D6 ^
- This parameter can be any value of @ref FSMC_Wait_feature */
" s# U4 m K7 q& p( |& @7 _. T
8 q: [/ n8 u( B+ Q" B {6 Y3 ~- uint32_t FSMC_MemoryDataWidth; /*!< Specifies the external memory device width./ y( y( b# w* H
- This parameter can be any value of @ref FSMC_Data_Width */2 D0 V! z* s s4 Y" a
2 t& S% j7 X/ ]) _' ?7 }9 C- uint32_t FSMC_ECC; /*!< Enables or disables the ECC computation.$ B4 y5 @; {! D5 `; X+ e8 L* F3 u
- This parameter can be any value of @ref FSMC_ECC */
$ J6 D/ s- P7 T( t& D
" n _" ? b1 F- uint32_t FSMC_ECCPageSize; /*!< Defines the page size for the extended ECC.
- h5 A. a, a1 r - This parameter can be any value of @ref FSMC_ECC_Page_Size */9 U! O1 `3 u$ k( z& T3 g
- / u9 F7 ?! w2 N& R1 k; ^8 y$ ?
- uint32_t FSMC_TCLRSetupTime; /*!< Defines the number of HCLK cycles to configure the. A0 U: M, `6 D. R' ?* K
- delay between CLE low and RE low.
, W2 o' }9 H2 l- I - This parameter can be a value between 0 and 0xFF. */
, U2 G) M5 `0 _ - ^ t1 \3 c) ?( |& h
- uint32_t FSMC_TARSetupTime; /*!< Defines the number of HCLK cycles to configure the/ {. D& `/ y0 L9 ]" K8 p; G
- delay between ALE low and RE low.
! N& L$ x, u3 S$ T* f4 ~ - This parameter can be a number between 0x0 and 0xFF */
5 q! z/ ]$ ]( J! |, w0 n
4 o! { T- Q1 p3 E- FSMC_NAND_PCCARDTimingInitTypeDef* FSMC_CommonSpaceTimingStruct; /*!< FSMC Common Space Timing */
; q1 E2 A; n( I: L# ~' ]8 p
' R m# ]4 [6 U2 Z2 ~: |- FSMC_NAND_PCCARDTimingInitTypeDef* FSMC_AttributeSpaceTimingStruct; /*!< FSMC Attribute Space Timing */
/ o) J o, G6 ?6 ^ - }FSMC_NANDInitTypeDef;
复制代码
# O3 w1 J& y' Q( JFSMC_PCCARDInitTypeDef类型
" }( v% N. q7 o$ b! F' m7 v( v: \& W
- d7 b S8 P3 J- /** 8 N, G; I3 F( g1 I, U
- * @brief FSMC PCCARD Init structure definition
& _; \" g7 q( P - */
# A9 A# p( A; Y% q5 m2 ]: a - % l* n0 D, J$ b7 d5 q' @6 ?" }
- typedef struct7 n; @* V3 j& p- c) s* ]
- {9 u3 l1 M4 [$ Q# W6 G
- uint32_t FSMC_Waitfeature; /*!< Enables or disables the Wait feature for the Memory Bank.
9 r p# `) b+ R$ [' ` - This parameter can be any value of @ref FSMC_Wait_feature */. Z/ c- F# L, m
# T/ O' D" s/ j7 Y* e- uint32_t FSMC_TCLRSetupTime; /*!< Defines the number of HCLK cycles to configure the
; b, y( K H6 z" S, {3 z - delay between CLE low and RE low.
4 |7 E4 F& V$ U. _& g2 {% H- x - This parameter can be a value between 0 and 0xFF. */
, ~+ ?- a! J& u* m+ f
2 T9 L# J* y+ T# P- uint32_t FSMC_TARSetupTime; /*!< Defines the number of HCLK cycles to configure the
0 ]' q: a4 O5 D) C# d - delay between ALE low and RE low., M7 e3 D w( `
- This parameter can be a number between 0x0 and 0xFF */
' v: G# x4 @- r7 }2 e* b - . f9 `0 O1 X5 p2 L( {. s) Z) Y% e- n
. t5 M8 c6 ?7 J) N; q- FSMC_NAND_PCCARDTimingInitTypeDef* FSMC_CommonSpaceTimingStruct; /*!< FSMC Common Space Timing */6 [% U7 p: a" Y& J+ m
- 7 ^2 W6 n/ a4 P( W ~1 ~/ x# L
- FSMC_NAND_PCCARDTimingInitTypeDef* FSMC_AttributeSpaceTimingStruct; /*!< FSMC Attribute Space Timing */
- z: O, z/ Y# k9 R& k0 c; G! ]
0 z' O2 m5 j& Y& D- FSMC_NAND_PCCARDTimingInitTypeDef* FSMC_IOSpaceTimingStruct; /*!< FSMC IO Space Timing */
8 Y! I; G* \1 c. i* d" ]! T - }FSMC_PCCARDInitTypeDef;9 g+ S3 z/ ^, ?
复制代码
; l! |! j8 ?+ A$ Q1 j9 a# Q/ S相关宏定义
1 k R8 q( _7 Y) t, x% _" h6 J) ?& L [- I
- /** @defgroup FSMC_Exported_Constants2 v8 e; r+ c* m7 m) Z( w
- * @{
$ y$ k( ~! x" H. H+ @ - */) r/ |! s- L) S' X' s, S
- 6 n0 \7 f% w+ L8 [9 e
- /** @defgroup FSMC_NORSRAM_Bank 4 {' k$ x& `* |0 s% p Z6 r$ F, q! s
- * @{
6 W9 J8 y/ g$ V x - */1 H+ v- v* j; [/ f5 g2 f7 K
- #define FSMC_Bank1_NORSRAM1 ((uint32_t)0x00000000): F% e& R: c4 b; z3 X+ [
- #define FSMC_Bank1_NORSRAM2 ((uint32_t)0x00000002)
$ f/ y5 S( F: Y; j- m2 `# c) { - #define FSMC_Bank1_NORSRAM3 ((uint32_t)0x00000004)3 K' E) z7 Z7 C7 T
- #define FSMC_Bank1_NORSRAM4 ((uint32_t)0x00000006); |, Z6 x: n7 I" a2 O) N4 p/ V
- /**5 Q* }4 W0 C$ D+ R& f
- * @}
! G! |5 Y- N; X. e% Z - */. i3 R! e8 N) L3 e
2 {' n3 B. S" G- U' I- /** @defgroup FSMC_NAND_Bank : \/ \; M9 F/ T1 j: A) w' P
- * @{
; O; B. }+ J m: B - */
$ E2 e4 [0 G8 }) q: x# ] - #define FSMC_Bank2_NAND ((uint32_t)0x00000010)3 Z& V3 m5 P4 e) t8 H6 i
- #define FSMC_Bank3_NAND ((uint32_t)0x00000100)- W4 p8 ?, p6 H- P: L7 x3 ?
- /**, z2 h3 w" c7 Y
- * @}
' l, f8 ~# o! y q. s* R9 D - */
. \% T3 r% q7 U6 s { - ( g) ~! H( k) q( t' }" M* \5 X- q! E
- /** @defgroup FSMC_PCCARD_Bank
# K( E% {" n5 n/ q* |2 ^3 M5 s2 e6 ^ - * @{
) s9 s; U& g- }8 N - */ * m0 m; n' I9 R- T) b
- #define FSMC_Bank4_PCCARD ((uint32_t)0x00001000). e# r! k/ i, v/ p# L" k
- /**5 R+ p: F+ g3 T
- * @}9 q! S% t/ Y5 D3 p& Q
- */
E6 Q% f' P# @7 i- k' `1 I - # M: s! D) l$ a6 s! t4 Q
- #define IS_FSMC_NORSRAM_BANK(BANK) (((BANK) == FSMC_Bank1_NORSRAM1) || \
! i% t5 _5 \% R) x$ ? - ((BANK) == FSMC_Bank1_NORSRAM2) || \
5 k. S; f$ a! M4 ~6 E - ((BANK) == FSMC_Bank1_NORSRAM3) || \
, y+ Y: u* i4 G, l - ((BANK) == FSMC_Bank1_NORSRAM4))
8 C; F! x; u2 i# _4 g% |
* f: l8 Y2 B' ?! \/ A$ a( D- #define IS_FSMC_NAND_BANK(BANK) (((BANK) == FSMC_Bank2_NAND) || \- y! C9 t% X- z
- ((BANK) == FSMC_Bank3_NAND))3 Z4 U9 o) [2 R# O
4 s: g; J) K7 h' L- #define IS_FSMC_GETFLAG_BANK(BANK) (((BANK) == FSMC_Bank2_NAND) || \
7 U# }! c* g w5 c8 o. S- G - ((BANK) == FSMC_Bank3_NAND) || \- c8 Q- M: p# Z
- ((BANK) == FSMC_Bank4_PCCARD))
* P% s9 A' b* Q! W3 \* y" i - e" _! B n; y9 F" Z6 |
- #define IS_FSMC_IT_BANK(BANK) (((BANK) == FSMC_Bank2_NAND) || \
7 Z6 Y9 t3 K6 ^6 W ~. d* E) z" Q - ((BANK) == FSMC_Bank3_NAND) || \
2 Q/ n5 [9 f" l6 U5 u, \ - ((BANK) == FSMC_Bank4_PCCARD))
: s" ^+ V- T0 T* [% s' D - ; g4 \, ~8 v# _$ A7 Q& [) C
- /** @defgroup FSMC_NOR_SRAM_Controller ! |0 S5 \' j m! \
- * @{
( ~/ ~ b* Q! J& x7 |4 p: O - */* l( r# k& t' f4 c
7 m7 _' L0 T, b" F- /** @defgroup FSMC_Data_Address_Bus_Multiplexing 3 b9 [6 O; L H7 _0 h$ J" ]4 h% @
- * @{
) D- ~/ H5 B' @) b' R" L - */
( n' r& w- e h4 \: ?5 h% j
9 c- L+ [' ~* Q/ d( J% C( J4 M/ j- X- #define FSMC_DataAddressMux_Disable ((uint32_t)0x00000000)3 ^& |2 e% j- \1 z" p8 U
- #define FSMC_DataAddressMux_Enable ((uint32_t)0x00000002)
# B) t0 J b3 h5 Y. r; s - #define IS_FSMC_MUX(MUX) (((MUX) == FSMC_DataAddressMux_Disable) || \
5 |; w$ B/ W/ Q, Y* ]* X - ((MUX) == FSMC_DataAddressMux_Enable))
0 _0 @# E# ^9 E - /**. K0 t/ C# l7 D/ r( _5 {
- * @}9 v- {, }4 J( L) c8 Q0 t8 |
- */$ r2 }: x3 S4 o" ?/ o
% U1 T7 q w+ b0 b( ~6 w- /** @defgroup FSMC_Memory_Type
* a/ j* D I6 p' |3 s9 S Y - * @{: |/ Y, |/ a3 F
- */
% G# k% w1 K" Q. W6 j( q7 e
3 h; C6 u' W+ T+ Y7 N# P- #define FSMC_MemoryType_SRAM ((uint32_t)0x00000000)
/ g, W. v/ j d! W, L N! v# |. | - #define FSMC_MemoryType_PSRAM ((uint32_t)0x00000004)8 x% }4 q! j" ]1 [* i5 Y
- #define FSMC_MemoryType_NOR ((uint32_t)0x00000008)
: I- E- N& r; q - #define IS_FSMC_MEMORY(MEMORY) (((MEMORY) == FSMC_MemoryType_SRAM) || \
: ~7 g6 {) P5 ~3 p$ k - ((MEMORY) == FSMC_MemoryType_PSRAM)|| \0 A0 {& J3 N. f% r1 p0 x/ u
- ((MEMORY) == FSMC_MemoryType_NOR))
$ d2 I! U0 l( j, F! v) t - /**2 `, @+ H" Q. @! J% `! j
- * @}
. |6 B: p& U+ a: L+ X4 I - */7 e o { L5 q
* C$ r$ O& `: @3 t7 P- /** @defgroup FSMC_Data_Width 9 N+ P) k, s5 f1 N C0 A
- * @{
8 x( G8 B% v+ v( o& z2 G - */
# O* ]' ~# _. R. z+ n - + j: X2 R* e; P a$ B! |& p' w3 k
- #define FSMC_MemoryDataWidth_8b ((uint32_t)0x00000000)
, H& R0 T$ N9 {% L$ ] - #define FSMC_MemoryDataWidth_16b ((uint32_t)0x00000010). G. ~! s, {$ h
- #define IS_FSMC_MEMORY_WIDTH(WIDTH) (((WIDTH) == FSMC_MemoryDataWidth_8b) || \
: l5 e0 d/ ~/ P. @8 z9 i6 e - ((WIDTH) == FSMC_MemoryDataWidth_16b))
6 O' E* j7 W, e* F0 r5 V" G- z - /**
9 ] X$ @' {/ L: B/ Z% ] - * @}- O# J( m+ c4 I: O6 B& \# |
- */
( k7 G& S9 m4 i5 S8 c - + ^' m' f. `3 J8 A
- /** @defgroup FSMC_Burst_Access_Mode & t( R- N! E; K0 P0 q: i. W! I. k7 Y
- * @{- X e1 F3 ]/ c
- */' q2 e3 V: ?7 Z3 b
- ( W# t( e* x# i D/ x
- #define FSMC_BurstAccessMode_Disable ((uint32_t)0x00000000)
5 k* o4 Q0 b3 S( X - #define FSMC_BurstAccessMode_Enable ((uint32_t)0x00000100)
$ N; X6 L4 n6 d# G! a+ H - #define IS_FSMC_BURSTMODE(STATE) (((STATE) == FSMC_BurstAccessMode_Disable) || \8 N+ v9 V! P l2 ^. k4 p
- ((STATE) == FSMC_BurstAccessMode_Enable))) u4 i, ^% b$ Y: }7 A' ^
- /**! t2 l) e! [" V+ a3 a, R( t1 ? ^
- * @}* D! b. L9 q7 w
- */
e0 J3 t7 s, O - : u) I+ K- P, t7 i. a
- /** @defgroup FSMC_AsynchronousWait
% w6 w3 [$ b; |) b# f- p$ A& R4 Y$ y) z - * @{+ T) N/ n. j5 E+ T0 `! r4 n3 z
- */
7 {5 I, A# V/ S - #define FSMC_AsynchronousWait_Disable ((uint32_t)0x00000000)
% C; {) W* s& ]( Y4 Z - #define FSMC_AsynchronousWait_Enable ((uint32_t)0x00008000)- I9 i0 ^( u% `# U3 ?. r8 ~# G/ H
- #define IS_FSMC_ASYNWAIT(STATE) (((STATE) == FSMC_AsynchronousWait_Disable) || \
' D% q: F- N8 |2 a - ((STATE) == FSMC_AsynchronousWait_Enable))
: d; a& U( K, W: |1 w7 u - /** U) Y' O2 ^1 v* t! N7 o" |# l
- * @}5 r" r. W6 V0 s0 G. v( E
- */; D7 z! j4 B, \6 ^* W1 Q
- # t3 W# C ]( h* u) ^
- /** @defgroup FSMC_Wait_Signal_Polarity
' @2 C) v7 z: D* p* d - * @{
0 @5 L) a9 ?# `5 \! I6 O - */2 _1 w# |- O4 v/ V2 n" n& }3 |
- #define FSMC_WaitSignalPolarity_Low ((uint32_t)0x00000000): }/ s2 H, b, e
- #define FSMC_WaitSignalPolarity_High ((uint32_t)0x00000200); \& X7 h3 @0 X0 }7 ?' u
- #define IS_FSMC_WAIT_POLARITY(POLARITY) (((POLARITY) == FSMC_WaitSignalPolarity_Low) || \7 Z" C" k" U& Q( Y
- ((POLARITY) == FSMC_WaitSignalPolarity_High))
4 i# u$ U8 p9 O- z5 K - /**
$ b; R$ Q% L; ~: S - * @}
' G% \1 f7 V" j ]+ X - */
1 f1 V% P5 U3 r9 Y - 2 X% t7 ?* l% L, S, P! F
- /** @defgroup FSMC_Wrap_Mode : l! |: ?, p8 N" _2 {: K, q
- * @{* X7 h. S9 D- n9 R; X: s; J
- */
; e, ?0 P6 l% F% c4 _ - #define FSMC_WrapMode_Disable ((uint32_t)0x00000000); T. m4 H% [3 O; c& m
- #define FSMC_WrapMode_Enable ((uint32_t)0x00000400) 2 _: l" P6 J. E
- #define IS_FSMC_WRAP_MODE(MODE) (((MODE) == FSMC_WrapMode_Disable) || \- m/ ~3 Y& Y5 p& V2 r
- ((MODE) == FSMC_WrapMode_Enable))# [$ [2 c. I7 O; P$ g/ t
- /**
7 B2 p6 F |8 b - * @}
! Y( D W) a. l6 J0 I6 u - */4 V M5 }' ~2 e
; u5 ]3 `! I' Q7 `- /** @defgroup FSMC_Wait_Timing
. g' O1 x1 t; P- \! W - * @{' `: {- h6 A2 W
- */
" {6 G. ^8 b3 f* s1 j - #define FSMC_WaitSignalActive_BeforeWaitState ((uint32_t)0x00000000)- d0 k+ X, S4 D, Z
- #define FSMC_WaitSignalActive_DuringWaitState ((uint32_t)0x00000800) 1 g$ y# c- N+ X6 Q( }( G0 l; p% D
- #define IS_FSMC_WAIT_SIGNAL_ACTIVE(ACTIVE) (((ACTIVE) == FSMC_WaitSignalActive_BeforeWaitState) || \% ^* B: E# `! I3 _! W) z
- ((ACTIVE) == FSMC_WaitSignalActive_DuringWaitState))
; B% w& C: k$ | a' E8 D1 R/ S - /**, _2 ^; p/ W3 G: |# V
- * @}4 q9 t$ M( H4 w, Z3 u
- */
4 K, m# x q1 m% j1 t0 _) I - ' e" i& L; B# l- [
- /** @defgroup FSMC_Write_Operation
# I2 V0 o |/ ^ - * @{- x, ^1 @9 X1 e+ {& }/ C
- */% n) V0 X2 q {& S3 F* ?
- #define FSMC_WriteOperation_Disable ((uint32_t)0x00000000)
& B2 [$ c5 q+ y8 u# h& M3 I - #define FSMC_WriteOperation_Enable ((uint32_t)0x00001000)
" C5 \# d3 F. {. Y - #define IS_FSMC_WRITE_OPERATION(OPERATION) (((OPERATION) == FSMC_WriteOperation_Disable) || \& l8 ~4 O# A+ ~' g3 _' K
- ((OPERATION) == FSMC_WriteOperation_Enable)) , K9 `; m8 e+ Q J& o
- /**
( i! N% t% L( Y) z/ e2 \ - * @}3 J2 O3 c$ \" B7 k% A# G a
- */
' ]& L. _! s0 Y- |8 o; {: a) E
" H7 g/ `5 r7 N9 n) ]- /** @defgroup FSMC_Wait_Signal
0 i2 D: Z% q# P. B - * @{% L) a& L: j2 F0 X( H
- */# @% y } c5 `) T
- #define FSMC_WaitSignal_Disable ((uint32_t)0x00000000). j9 B6 ?5 V) ~% G, [' O
- #define FSMC_WaitSignal_Enable ((uint32_t)0x00002000) 1 K6 R* j8 `7 c# y
- #define IS_FSMC_WAITE_SIGNAL(SIGNAL) (((SIGNAL) == FSMC_WaitSignal_Disable) || \7 a5 v, F( Z- p- B/ I& P: `9 Y
- ((SIGNAL) == FSMC_WaitSignal_Enable))5 S9 I l' v7 R
- /**
6 L$ b: h' l, I. C2 z - * @}
6 r' u& b$ v2 M% x* ~" M# R) S. i - */3 }) m$ Y& a# I2 P8 U
- . d6 a3 C M/ |# e
- /** @defgroup FSMC_Extended_Mode
, s6 \4 [# y! ]$ u! g: I% P - * @{
+ M5 x- E3 J9 X( ]8 Q' f3 `# _ - */
- m+ S- C& x9 R! Z/ @4 } - #define FSMC_ExtendedMode_Disable ((uint32_t)0x00000000)
: g |( r* h/ J; {/ i, X# I - #define FSMC_ExtendedMode_Enable ((uint32_t)0x00004000)( M1 u' L+ p7 T9 K! Q
0 A" X; v' U# N# ^2 J6 |, `- #define IS_FSMC_EXTENDED_MODE(MODE) (((MODE) == FSMC_ExtendedMode_Disable) || \
1 @3 S( }2 [4 Y8 G1 p* y - ((MODE) == FSMC_ExtendedMode_Enable)) ( V. y" s$ B4 _% M, S: t4 E
- /**9 b1 M* M! ]) E9 v: d" ^
- * @}
+ o4 ?* e% b4 l' P5 G8 o$ m! _ - */1 y) Q2 y, P# ^ R: H$ C! s
- % z9 J: D N$ ?1 Y
- /** @defgroup FSMC_Write_Burst : z/ s6 ^; U1 _' @) J7 S9 y8 z
- * @{
% y# Z+ X8 i# a2 v, P - */$ V- g; B6 K j% O) C
- * f6 N; v5 {4 t7 a; l; C' @6 e
- #define FSMC_WriteBurst_Disable ((uint32_t)0x00000000)3 j% Y0 |' f. ^8 W7 `0 B
- #define FSMC_WriteBurst_Enable ((uint32_t)0x00080000)
& L. g$ W+ _( V% A1 } - #define IS_FSMC_WRITE_BURST(BURST) (((BURST) == FSMC_WriteBurst_Disable) || \
% X$ b2 }1 P0 p# U! u4 C" e5 ~- X$ m; U - ((BURST) == FSMC_WriteBurst_Enable))
2 l* M+ L9 o1 V+ g+ `: G - /**1 C. S$ o" i3 r& m
- * @}
. t* f7 {$ t; U/ {6 q" } - */
\1 P" D- p% z5 Q: S3 d6 |- P
1 g; c+ A' X- z$ |* ^: d; x) w- /** @defgroup FSMC_Address_Setup_Time 0 W+ F# I, i/ f4 h' t Z( l
- * @{6 P8 \5 W! {* }, M7 \( H u
- */8 W' w2 `! M/ |. {4 o/ E+ Q! \; O
- #define IS_FSMC_ADDRESS_SETUP_TIME(TIME) ((TIME) <= 0xF). A+ A! ?: h. }1 N1 `/ `
- /**7 t7 ^; j0 d* k
- * @}
/ ]% v8 {* B; S2 H& z) f8 H. S$ c - */
, H9 x5 {1 H1 n* W; U" [: Y6 \ - ! ] Z) K3 A& p! `/ _$ ]
- /** @defgroup FSMC_Address_Hold_Time
8 |# Y# O; I" ~ - * @{3 |8 V+ A8 c- J% W& ^! G
- */" a4 i [/ Z$ @2 I) j: e
- #define IS_FSMC_ADDRESS_HOLD_TIME(TIME) ((TIME) <= 0xF)
" U' t9 I5 j, j' _! E+ Y/ S - /**
, G" h- ]; U5 _7 p2 E! @0 ~ - * @}
; `) K- T$ d( j# S - */
# [$ c2 n* u( c& b' X
3 t7 v! P+ L( I d v- /** @defgroup FSMC_Data_Setup_Time ( M4 U9 a8 k" h s( G- s) ~
- * @{
/ ]0 m) \1 d. ?& ~5 m6 M - */0 H* z7 X7 C4 l" r
- #define IS_FSMC_DATASETUP_TIME(TIME) (((TIME) > 0) && ((TIME) <= 0xFF))
9 z# i' T! _+ @1 q( B( f - /**2 c A# `- T3 R7 g2 O6 C
- * @}
1 K. g- Z- B: ~" a% z G; b - */
$ c: t2 I2 f* }1 i) j+ |3 ^ - ( j+ Y4 n0 n. Z# ?8 M! c3 v: t
- /** @defgroup FSMC_Bus_Turn_around_Duration + {! S( J( P5 ]' M; O Z
- * @{
# n1 P! k% o/ B. V - */
7 Z! o0 J: M+ m. ~4 C9 L" J, T - #define IS_FSMC_TURNAROUND_TIME(TIME) ((TIME) <= 0xF)
% p) K7 f# U6 C6 F - /**! v& t5 G" E& V6 j; r+ D. n
- * @}% G9 X2 f8 I0 N
- */
. d( q6 Q" j5 U9 J- ^ - # z' ]5 ]$ p) l/ [) x; v2 T( n
- /** @defgroup FSMC_CLK_Division 1 `) P; u) x2 r, P% ?, _# [8 l! K
- * @{
9 M0 l) ]3 E& H& W5 `/ l5 L! J - */
3 Y* H: S) x* K/ X+ K! T7 X - #define IS_FSMC_CLK_DIV(DIV) ((DIV) <= 0xF)
w8 a1 o8 e" k* o* `$ A) S, g - /**
& o% E& h* K. }8 Q8 S' I7 N - * @}1 I& F4 J5 d% U: S) ]1 ?
- */4 B% [3 K/ y3 B0 p
& f- P) x# `, Y' I! L- /** @defgroup FSMC_Data_Latency . ^7 L0 `$ k' x/ ^2 u
- * @{# z1 c4 p( ], H
- */
/ T8 B$ S% v* Z& ?2 {6 P - #define IS_FSMC_DATA_LATENCY(LATENCY) ((LATENCY) <= 0xF)" [6 H1 Y6 x: s/ s
- /**
: w: U7 b+ j; X4 b - * @}
6 G; d/ z$ {' e8 S( S" K - */" W' T3 J X& }; S, y7 S6 ^( d! s5 |3 f8 h
+ C3 @- t' f8 N/ s3 o& J- /** @defgroup FSMC_Access_Mode
( @$ A3 S3 Y% ^% A) B - * @{# b! h' k; x9 z1 u: b
- */& A7 }; B# F' W% U4 t! i
- #define FSMC_AccessMode_A ((uint32_t)0x00000000)6 \: M h5 B4 X. F; F
- #define FSMC_AccessMode_B ((uint32_t)0x10000000)
l9 @: a9 Z; l - #define FSMC_AccessMode_C ((uint32_t)0x20000000)
: T2 S2 m, K0 m( G% G# ] - #define FSMC_AccessMode_D ((uint32_t)0x30000000)
" u, z' c( j U4 Z0 M$ g; { - #define IS_FSMC_ACCESS_MODE(MODE) (((MODE) == FSMC_AccessMode_A) || \& } ^7 P5 R. M4 p7 a' d
- ((MODE) == FSMC_AccessMode_B) || \
2 l2 r) G Z6 [1 q4 }# j1 r, i - ((MODE) == FSMC_AccessMode_C) || \ \+ }# Z# q2 a$ ^! r6 }
- ((MODE) == FSMC_AccessMode_D))" }2 m& N" l s$ T3 t" D
- /**
4 N4 P# H/ z" V$ C# I2 k - * @}
2 W6 F( V" A3 V$ i! t# `2 j - */4 Z6 t* l% B9 E# Z; h9 z+ @
- 2 z* e( p7 |/ o2 O
- /**
1 ?# f- @) K7 y5 s& C - * @}( U- I( p' @, {. }
- */) x6 Q/ v3 H# a; d
- 3 K8 i& I" P; e5 b# g3 D
- /** @defgroup FSMC_NAND_PCCARD_Controller
9 J3 c/ C6 t: u8 C# I& q& y - * @{3 U* w2 F% v3 B! ~1 `6 d5 W Q
- */
4 o+ R) M: _5 A( \; S/ f - ! Y/ S8 N5 i0 N# `& R
- /** @defgroup FSMC_Wait_feature
+ ~0 F! C% n; `4 D - * @{8 |; |9 B& P3 o
- */# j9 `( ~5 G- }$ i
- #define FSMC_Waitfeature_Disable ((uint32_t)0x00000000)# l$ q& w2 s0 R
- #define FSMC_Waitfeature_Enable ((uint32_t)0x00000002)
& x/ k7 \' m/ u5 I# y! P - #define IS_FSMC_WAIT_FEATURE(FEATURE) (((FEATURE) == FSMC_Waitfeature_Disable) || \9 ~& I9 K7 o3 s" y4 Q K+ z
- ((FEATURE) == FSMC_Waitfeature_Enable))$ G- n& x+ O) g* ?' _4 g: _' I( u
- /**. ~, ]' C+ x" G$ Z3 g& \
- * @}
$ {# Z7 Q8 W* d% J$ E6 k - */
) ]" j' P# d' ^$ u9 W8 ?1 r X1 B. f - 9 R! @8 N6 L7 w4 @2 m4 @
- % H4 @" g) R' V p2 `* U$ f
- /** @defgroup FSMC_ECC - C. Y' ?) L* ^; M9 F& h
- * @{" }0 \4 k( U8 l- v { a! j" t g
- */5 P7 n4 _5 U. f& B; |1 A& K, N9 g
- #define FSMC_ECC_Disable ((uint32_t)0x00000000)* A; y- T: g- f7 U0 j% s6 d
- #define FSMC_ECC_Enable ((uint32_t)0x00000040)9 \% r8 o: g: M( w9 e% E
- #define IS_FSMC_ECC_STATE(STATE) (((STATE) == FSMC_ECC_Disable) || \' @# ~9 V) c4 P/ L j
- ((STATE) == FSMC_ECC_Enable))
, Q" [) f1 b: h+ Q, S0 ?7 J - /**
- p: \# B* g q! D, M - * @}
! b) A+ }' ^3 Q) q2 @3 J7 } - */4 L) O" w' f* T% B) Q( p
- 4 `5 N) P6 l p) |2 Q
- /** @defgroup FSMC_ECC_Page_Size & T8 W: a; Z7 j* h1 ~1 `* A
- * @{
& i- u; _$ V% F5 u4 b( U" Y% O# v - */
/ Y2 v1 B* B+ g. {" n% y9 K6 Q - #define FSMC_ECCPageSize_256Bytes ((uint32_t)0x00000000)' m! Z+ I$ ~8 f# C
- #define FSMC_ECCPageSize_512Bytes ((uint32_t)0x00020000)
4 x# S2 j; Y5 c( a# [8 x - #define FSMC_ECCPageSize_1024Bytes ((uint32_t)0x00040000)
! P4 B: G: @$ ^2 j& { - #define FSMC_ECCPageSize_2048Bytes ((uint32_t)0x00060000)
+ z' {5 U* T) r& k$ i - #define FSMC_ECCPageSize_4096Bytes ((uint32_t)0x00080000)
! h2 u0 J3 \4 }$ {) \: h - #define FSMC_ECCPageSize_8192Bytes ((uint32_t)0x000A0000)7 u, g6 b" U9 \ ~- }8 s6 [: d
- #define IS_FSMC_ECCPAGE_SIZE(SIZE) (((SIZE) == FSMC_ECCPageSize_256Bytes) || \
& n( F& H4 _% W( C- s - ((SIZE) == FSMC_ECCPageSize_512Bytes) || \
7 l5 G0 G( q A" t - ((SIZE) == FSMC_ECCPageSize_1024Bytes) || \
4 V0 }7 _" V; m- ~4 ?' q; r - ((SIZE) == FSMC_ECCPageSize_2048Bytes) || \
) l- ~3 w2 n& I; I - ((SIZE) == FSMC_ECCPageSize_4096Bytes) || \
) d' t" o7 e( C - ((SIZE) == FSMC_ECCPageSize_8192Bytes))7 m& s( H- p# d: `
- /**& B! q& ^3 O; E
- * @}8 a& \1 L. ~" W3 V" h
- */ e$ H8 O3 Y5 u- r- m
- " Q3 |, x& k' t
- /** @defgroup FSMC_TCLR_Setup_Time 9 w! x' e! J6 m$ L
- * @{
% h6 k2 C( }6 k) D( Z( {3 F7 |# d - */
: K+ n$ h. f a) p. w Z6 C - #define IS_FSMC_TCLR_TIME(TIME) ((TIME) <= 0xFF)
( X) J$ {6 e N8 A, p7 x6 L! b8 m - /**
+ g2 z! U6 R" y' |! i - * @}6 k1 N+ `; N4 R9 U8 c6 u
- */. j: F4 n( ]& t( r+ i. a" U
- g, X2 j" u1 q2 @
- /** @defgroup FSMC_TAR_Setup_Time
5 O, n. q$ y$ o6 [ - * @{/ C' R4 t9 k6 d# L" J; {3 p
- */! [* {. O. n/ r; b5 r
- #define IS_FSMC_TAR_TIME(TIME) ((TIME) <= 0xFF), @- ?; R- z, S4 \, Y; a4 v) K& C" P
- /**! Y K8 N5 c9 K
- * @}
6 Q& S7 x/ z1 n- o) ?* ?2 a - */
, `1 y0 `1 ]5 u9 z% k5 U
1 [4 R# L! Q9 w; k7 \- /** @defgroup FSMC_Setup_Time ' A- i) E1 l# i' F: u- v
- * @{5 S) U+ p+ d3 w$ K
- */$ \7 M# u- C1 F1 B; P9 I5 `* r
- #define IS_FSMC_SETUP_TIME(TIME) ((TIME) <= 0xFF)
+ `# A Q' {0 N1 @' x - /**/ h' l% v/ \# y3 {$ ]9 [4 q! F
- * @}: x8 w- F, n2 C7 T7 b" V: S" {
- */3 W& F4 s4 W, i) N) w: b
7 {& O% W# |# u4 r! b- /** @defgroup FSMC_Wait_Setup_Time
) I B* t, ^- E, ^1 @- g4 H- x - * @{2 L0 `. x! h1 D. Q4 B5 r& s
- */3 y6 V4 B6 P6 U' R/ V
- #define IS_FSMC_WAIT_TIME(TIME) ((TIME) <= 0xFF)* ?# E3 x* Y. d9 J/ [( j4 |
- /**
. P' B, W I1 ^# ~) b - * @}
' o0 }( U- Y5 X- d, P8 g7 g - */
5 ~1 H C5 D' z6 c9 ~
/ r4 F- H% Z( B- R# ?5 h- /** @defgroup FSMC_Hold_Setup_Time
; s i, [. z/ [& Z' ? - * @{
, Q- ?" S9 s# j5 H - */8 Z: t0 C3 K( z O5 _0 X
- #define IS_FSMC_HOLD_TIME(TIME) ((TIME) <= 0xFF)3 k% [7 i( _$ P+ S. e5 C
- /**9 d) Z& L k6 y. |+ ?
- * @}7 a/ Q( D% }& e' ?
- */& l L3 ]% G) I
- : {) p4 \( y2 @- ?2 J
- /** @defgroup FSMC_HiZ_Setup_Time ) v! k+ [7 x0 Y7 v
- * @{
: a& F8 k$ l" ?/ c4 f$ o, m5 r# G - */5 c$ G3 L8 d0 w1 A5 ^- Z H1 J8 N
- #define IS_FSMC_HIZ_TIME(TIME) ((TIME) <= 0xFF)
0 _0 t/ G) b, P- F7 ^; A( B' Y" g - /**! b! w. x q1 \+ P! u
- * @}
* P1 ]6 d6 ~: E3 E - */
8 w, E" L( H2 t+ z/ j# N8 ^- d
. Y6 {+ {: l# g: ^' }+ X- /** @defgroup FSMC_Interrupt_sources
) W# S5 W# x. a8 A ]& h - * @{
0 s0 N: ]% T2 p& d - */: \* m3 W, y/ u1 u
- #define FSMC_IT_RisingEdge ((uint32_t)0x00000008)
& F+ y* e+ J0 { - #define FSMC_IT_Level ((uint32_t)0x00000010). w6 C6 d; f+ M7 P
- #define FSMC_IT_FallingEdge ((uint32_t)0x00000020). S" D3 x2 L; n$ ?% g' s
- #define IS_FSMC_IT(IT) ((((IT) & (uint32_t)0xFFFFFFC7) == 0x00000000) && ((IT) != 0x00000000))
% r$ h* B& ?5 M; B6 W - #define IS_FSMC_GET_IT(IT) (((IT) == FSMC_IT_RisingEdge) || \* x8 W8 o0 p3 {& t- j7 ]' B
- ((IT) == FSMC_IT_Level) || \0 \/ }) P1 `% s2 v
- ((IT) == FSMC_IT_FallingEdge)) - R( z& Q- @' s" j: p
- /**% V" Y) u+ o; @8 }
- * @}
# J+ i7 C. F! p3 h - */4 @5 c, G/ A8 A0 i
+ u9 F- ]# r2 C5 ^% |/ ^- /** @defgroup FSMC_Flags / t: Q M) B3 w% a, w7 e R
- * @{
2 o8 v2 O' Z8 F3 T0 h) [ - */
' Q0 j1 W, v) l8 o8 u- d6 [ - #define FSMC_FLAG_RisingEdge ((uint32_t)0x00000001)
) G0 f% c" A" B6 g/ c" b7 R5 p/ J' H3 o - #define FSMC_FLAG_Level ((uint32_t)0x00000002)7 q, r0 p. e* A9 k
- #define FSMC_FLAG_FallingEdge ((uint32_t)0x00000004)
! ?& M+ h5 Q& |0 \' z8 n0 S/ D/ W: h - #define FSMC_FLAG_FEMPT ((uint32_t)0x00000040)8 b: W( K) r/ m4 s. A' r
- #define IS_FSMC_GET_FLAG(FLAG) (((FLAG) == FSMC_FLAG_RisingEdge) || \
+ n5 J5 |' g+ w5 V5 R - ((FLAG) == FSMC_FLAG_Level) || \
$ `0 {% K1 x6 Y, ^) ^ - ((FLAG) == FSMC_FLAG_FallingEdge) || \
9 u+ S1 J$ z( d0 \9 g! P* t - ((FLAG) == FSMC_FLAG_FEMPT))
3 N. f8 k a4 e3 W8 h. w' i - / K6 I; ^4 N- l6 e y0 E
- #define IS_FSMC_CLEAR_FLAG(FLAG) ((((FLAG) & (uint32_t)0xFFFFFFF8) == 0x00000000) && ((FLAG) != 0x00000000))
9 \! R8 E j7 T( b9 |
复制代码 " h9 U& t0 T) G& ]& x( {! W) s! J: P
03. 相关函数; J$ f8 V/ e n& v! \5 ~
- /* NOR/SRAM Controller functions **********************************************/ p0 L7 x2 y4 k, ~2 N
- void FSMC_NORSRAMDeInit(uint32_t FSMC_Bank);
s2 y& L5 G% l" L: }# _ - void FSMC_NORSRAMInit(FSMC_NORSRAMInitTypeDef* FSMC_NORSRAMInitStruct);+ X1 H% S1 X; g/ _- }( I( T; X
- void FSMC_NORSRAMStructInit(FSMC_NORSRAMInitTypeDef* FSMC_NORSRAMInitStruct);+ t* v' |. F- j5 `+ a
- void FSMC_NORSRAMCmd(uint32_t FSMC_Bank, FunctionalState NewState);; I- r. e1 l6 d
, h9 q- w3 k Q- /* NAND Controller functions **************************************************/
4 n' y* i6 q: [2 Z5 ^- Z% D: _ - void FSMC_NANDDeInit(uint32_t FSMC_Bank);
9 ^3 G' @/ k. P) C* Q, Q2 ] - void FSMC_NANDInit(FSMC_NANDInitTypeDef* FSMC_NANDInitStruct);
" Z: K) g* ~% z* y - void FSMC_NANDStructInit(FSMC_NANDInitTypeDef* FSMC_NANDInitStruct);
* s2 ~! B% t( k" P! I4 H2 i - void FSMC_NANDCmd(uint32_t FSMC_Bank, FunctionalState NewState);7 g" }7 P# a- l4 b* K& q. h
- void FSMC_NANDECCCmd(uint32_t FSMC_Bank, FunctionalState NewState);
& ?" G4 {3 o) G$ F! A# V - uint32_t FSMC_GetECC(uint32_t FSMC_Bank);9 G0 g$ C* P- w4 S: W
- 6 s( A2 m8 `2 j5 U' X
- /* PCCARD Controller functions ************************************************/
' ]# N& X% N, }5 p2 O& g- D, \; L - void FSMC_PCCARDDeInit(void);
9 g9 L( G1 q/ A1 z* v) U$ B" h6 j - void FSMC_PCCARDInit(FSMC_PCCARDInitTypeDef* FSMC_PCCARDInitStruct);
! B i5 q2 i9 H. u# r - void FSMC_PCCARDStructInit(FSMC_PCCARDInitTypeDef* FSMC_PCCARDInitStruct);
: j; T% W& ]( e/ d - void FSMC_PCCARDCmd(FunctionalState NewState);
7 P4 o/ A; a9 K- e, E& ` - . l* \+ @' R. |
- /* Interrupts and flags management functions **********************************/1 R( j" o( @1 u! V: U* w. s1 |/ S2 D7 d" X
- void FSMC_ITConfig(uint32_t FSMC_Bank, uint32_t FSMC_IT, FunctionalState NewState);
3 B8 |# v# b3 c, ^0 U @ - FlagStatus FSMC_GetFlagStatus(uint32_t FSMC_Bank, uint32_t FSMC_FLAG);! o, J+ ^+ h& g1 M' l g
- void FSMC_ClearFlag(uint32_t FSMC_Bank, uint32_t FSMC_FLAG);, y' B% \+ u' e* v4 J
- ITStatus FSMC_GetITStatus(uint32_t FSMC_Bank, uint32_t FSMC_IT);, ^* e2 Q$ l0 g9 k0 Y3 L
- void FSMC_ClearITPendingBit(uint32_t FSMC_Bank, uint32_t FSMC_IT);
复制代码 6 V8 [5 g- Z! j1 g/ W- k
04. 结构体封装0 L- W7 r: @: f( C7 o Q3 m$ l' f
- typedef struct
- q! h5 l G- q. Q! G - {
* r* W% w( U6 D1 y. O# R - __IO uint32_t BTCR[8]; /*!< NOR/PSRAM chip-select control register(BCR) and chip-select timing register(BTR), Address offset: 0x00-1C */ 3 ?$ R( s3 a% l6 Y5 r2 G3 T; [. z
- } FSMC_Bank1_TypeDef; $ ~( \ ]. f( f) n. J
- * q# n R4 d1 s: [
- /** . I j8 E8 [" d0 }" F
- * @brief Flexible Static Memory Controller Bank1E
% D4 i* g# M* `* ? - */; h) A5 G+ c) \- a6 H+ B
. G6 H" B% y$ f& P- typedef struct
* ~; P V/ M9 N. E* D - {& B% @. w7 _# ~' T$ P
- __IO uint32_t BWTR[7]; /*!< NOR/PSRAM write timing registers, Address offset: 0x104-0x11C */. b3 Y* K9 I l& d0 T/ o- p
- } FSMC_Bank1E_TypeDef;) x' a7 e$ z! E9 C! L
5 K/ ?% { S6 H) a( `1 D* `- /**
2 e% ^' ]: n+ m+ {& z! v - * @brief Flexible Static Memory Controller Bank2 D+ r' J4 ~) | G2 o
- */+ J2 `( K+ y" y5 K" c7 z
- / [, e" x6 f. b
- typedef struct% h' P8 F' Q) A! m. Y' e1 D
- {
- R$ p& i1 H' V, J/ Z1 z - __IO uint32_t PCR2; /*!< NAND Flash control register 2, Address offset: 0x60 */$ b( s3 P$ O$ `4 G, l
- __IO uint32_t SR2; /*!< NAND Flash FIFO status and interrupt register 2, Address offset: 0x64 */
! f7 [5 u8 V( l - __IO uint32_t PMEM2; /*!< NAND Flash Common memory space timing register 2, Address offset: 0x68 */
$ E6 W4 ^/ r3 X" _' f% [ - __IO uint32_t PATT2; /*!< NAND Flash Attribute memory space timing register 2, Address offset: 0x6C */# W8 v; a* V5 w3 M2 c3 b
- uint32_t RESERVED0; /*!< Reserved, 0x70 */( H. |: J; k3 c9 X' ]
- __IO uint32_t ECCR2; /*!< NAND Flash ECC result registers 2, Address offset: 0x74 */
( K+ F/ j! C% T( K2 w0 F- z0 m - } FSMC_Bank2_TypeDef;
; P6 R1 D) M% \" K' X. C8 x6 Y
& a& ?: f/ K5 O- /** 0 }5 L; h* [* F6 b* \. h% ], L9 r- n
- * @brief Flexible Static Memory Controller Bank3
6 G2 m9 ?5 i( {5 Y. U - */
. C, c- u8 t& O - , T, m/ m3 f- _' W7 f
- typedef struct% N# p; v- W4 h4 H6 S! }' K8 A! |
- {
. {' J. h0 {" g% M. h& a - __IO uint32_t PCR3; /*!< NAND Flash control register 3, Address offset: 0x80 */& Z! E! Q: z; o2 [- d% X
- __IO uint32_t SR3; /*!< NAND Flash FIFO status and interrupt register 3, Address offset: 0x84 *// k7 e# r4 K! w( A) C
- __IO uint32_t PMEM3; /*!< NAND Flash Common memory space timing register 3, Address offset: 0x88 */3 x0 i' l2 W8 U6 E& [
- __IO uint32_t PATT3; /*!< NAND Flash Attribute memory space timing register 3, Address offset: 0x8C */1 ~! u6 |9 M% U1 Z
- uint32_t RESERVED0; /*!< Reserved, 0x90 */! h- X3 l- Z) d9 J, \0 ?
- __IO uint32_t ECCR3; /*!< NAND Flash ECC result registers 3, Address offset: 0x94 */( a. |5 f0 ]% L; Z
- } FSMC_Bank3_TypeDef;, q8 C% F8 j3 J5 W1 P
- + U3 ]* P0 ?3 h* ^+ O6 b0 N
- /** v% z, z# c- F, q3 T
- * @brief Flexible Static Memory Controller Bank4
~$ X8 ?+ s- K - */
5 V5 J, q! o8 M: X9 p - 4 i( M S' U3 ]0 \$ U
- typedef struct5 n: h# c4 f0 ~* m
- {0 U( F- |7 o p" X( U
- __IO uint32_t PCR4; /*!< PC Card control register 4, Address offset: 0xA0 */% }$ w+ u: s, [; {! S; ^
- __IO uint32_t SR4; /*!< PC Card FIFO status and interrupt register 4, Address offset: 0xA4 */) ~* E& F$ [, i- ?: }
- __IO uint32_t PMEM4; /*!< PC Card Common memory space timing register 4, Address offset: 0xA8 */8 R1 [2 f% X! L6 a* ^; b
- __IO uint32_t PATT4; /*!< PC Card Attribute memory space timing register 4, Address offset: 0xAC */2 f( ]- s% l/ m5 p9 R+ T/ I$ M5 z
- __IO uint32_t PIO4; /*!< PC Card I/O space timing register 4, Address offset: 0xB0 */
2 i* c- `# z: n0 ~* _ F - } FSMC_Bank4_TypeDef; 3 h4 m) q, }5 k Y9 w
- . B; k; _' y: `
复制代码
/ J& k. E$ t t* m, i3 N |