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