[[ファームウェア関数一覧>ファームウェア関数一覧#udd0c846]] *FLASH_EnableWriteProtection [#r504d207] #contents **ヘッダ宣言 [#za8c5e0a] **関数プロトタイプ [#j74695fd] FLASH_Status FLASH_EnableWriteProtection(uint32_t FLASH_Pages) **動作 [#w66e600d] フラッシュメモリの指定したページに書込み保護を設定する。 **引数 [#faf52b57] -FLASH_Pages&br; --ページサイズが1KBのデバイス |FLASH_WRProt_Pages0to3|Write protection of page 0 to 3.| |FLASH_WRProt_Pages4to7|Write protection of page 4 to 7.| |FLASH_WRProt_Pages8to11|Write protection of page 8 to 11.| |FLASH_WRProt_Pages12to15|Write protection of page 12 to 15.| |FLASH_WRProt_Pages16to19|Write protection of page 16 to 19.| |FLASH_WRProt_Pages20to23|Write protection of page 20 to 23.| |FLASH_WRProt_Pages24to27|Write protection of page 24 to 27.| |FLASH_WRProt_Pages28to31|Write protection of page 28 to 31.| |FLASH_WRProt_Pages32to35|Write protection of page 32 to 35.| |FLASH_WRProt_Pages36to39|Write protection of page 36 to 39.| |FLASH_WRProt_Pages40to43|Write protection of page 40 to 43.| |FLASH_WRProt_Pages44to47|Write protection of page 44 to 47.| |FLASH_WRProt_Pages48to51|Write protection of page 48 to 51.| |FLASH_WRProt_Pages52to55|Write protection of page 52 to 55.| |FLASH_WRProt_Pages56to59|Write protection of page 56 to 59.| |FLASH_WRProt_Pages60to63|Write protection of page 60 to 63.| |FLASH_WRProt_Pages64to67|Write protection of page 64 to 67.| |FLASH_WRProt_Pages68to71|Write protection of page 68 to 71.| |FLASH_WRProt_Pages72to75|Write protection of page 72 to 75.| |FLASH_WRProt_Pages76to79|Write protection of page 76 to 79.| |FLASH_WRProt_Pages80to83|Write protection of page 80 to 83.| |FLASH_WRProt_Pages84to87|Write protection of page 84 to 87.| |FLASH_WRProt_Pages88to91|Write protection of page 88 to 91.| |FLASH_WRProt_Pages92to95|Write protection of page 92 to 95.| |FLASH_WRProt_Pages96to99|Write protection of page 96 to 99.| |FLASH_WRProt_Pages100to103|Write protection of page 100 to 103.| |FLASH_WRProt_Pages104to107|Write protection of page 104 to 107.| |FLASH_WRProt_Pages108to111|Write protection of page 108 to 111.| |FLASH_WRProt_Pages112to115|Write protection of page 112 to 115.| |FLASH_WRProt_Pages116to119|Write protection of page 115 to 119.| |FLASH_WRProt_Pages120to123|Write protection of page 120 to 123.| |FLASH_WRProt_Pages124to127|Write protection of page 124 to 127.| |FLASH_WRProt_AllPages|Write protection all Pages.| --ページサイズが2KBのデバイス |FLASH_WRProt_Pages0to1|Write protection of page 0 to 1.| |FLASH_WRProt_Pages2to3|Write protection of page 2 to 3.| |FLASH_WRProt_Pages4to5|Write protection of page 4 to 5.| |FLASH_WRProt_Pages6to7|Write protection of page 6 to 7.| |FLASH_WRProt_Pages8to9|Write protection of page 8 to 9.| |FLASH_WRProt_Pages10to11|Write protection of page 10 to 11.| |FLASH_WRProt_Pages12to13|Write protection of page 12 to 13.| |FLASH_WRProt_Pages14to15|Write protection of page 14 to 15.| |FLASH_WRProt_Pages16to17|Write protection of page 16 to 17.| |FLASH_WRProt_Pages18to19|Write protection of page 18 to 19.| |FLASH_WRProt_Pages20to21|Write protection of page 20 to 21.| |FLASH_WRProt_Pages22to23|Write protection of page 22 to 23.| |FLASH_WRProt_Pages24to25|Write protection of page 24 to 25.| |FLASH_WRProt_Pages26to27|Write protection of page 26 to 27.| |FLASH_WRProt_Pages28to29|Write protection of page 28 to 29.| |FLASH_WRProt_Pages30to31|Write protection of page 30 to 31.| |FLASH_WRProt_Pages32to33|Write protection of page 32 to 33.| |FLASH_WRProt_Pages34to35|Write protection of page 34 to 35.| |FLASH_WRProt_Pages36to37|Write protection of page 36 to 37.| |FLASH_WRProt_Pages38to39|Write protection of page 38 to 39.| |FLASH_WRProt_Pages40to41|Write protection of page 40 to 41.| |FLASH_WRProt_Pages42to43|Write protection of page 42 to 43.| |FLASH_WRProt_Pages44to45|Write protection of page 44 to 45.| |FLASH_WRProt_Pages46to47|Write protection of page 46 to 47.| |FLASH_WRProt_Pages48to49|Write protection of page 48 to 49.| |FLASH_WRProt_Pages50to51|Write protection of page 50 to 51.| |FLASH_WRProt_Pages52to53|Write protection of page 52 to 53.| |FLASH_WRProt_Pages54to55|Write protection of page 54 to 55.| |FLASH_WRProt_Pages56to57|Write protection of page 56 to 57.| |FLASH_WRProt_Pages58to59|Write protection of page 58 to 59.| |FLASH_WRProt_Pages60to61|Write protection of page 60 to 61.| |FLASH_WRProt_Pages62to255|Write protection of page 62 to 255.| |FLASH_WRProt_AllPages|Write protection all Pages.| --ページサイズが1KBのデバイス&br; &br; #include(Macro/FLASH_Pages1KB,notitle) &br; --ページサイズが2KBのデバイス&br; &br; #include(Macro/FLASH_Pages2KB,notitle) &br; **戻り値 [#iffd0b3f] -FLASH_Status&br; 処理結果を返します |FLASH_BUSY|ビジー(処理中)状態| |FLASH_ERROR_PG|プログラムエラー| |FLASH_ERROR_WRP|書き込み保護状態| |FLASH_COMPLETE|処理完了| |FLASH_TIMEOUT|タイムアウト(時間切れ)| 処理結果を返します&br; &br; #include(Macro/FLASH_Status,notitle) &br; **サンプル [#gbbfcaaf] /* Protects the Pages0to3 and Pages108to111 */ FLASH_Status status = FLASH_COMPLETE; status = FLASH_EnableWriteProtection (FLASH_WRProt_Pages0to3|FLASH_WRProt_Pages108to111); **参照 [#c2f2338f] -初期化([[RCC_Configuration]])&br; [[FLASH_PrefetchBufferCmd]]→[[FLASH_SetLatency]] -一般的な書き込み方法&br; [[FLASH_Unlock]]→[[FLASH_ClearFlag]]→[[FLASH_ErasePage]]→[[FLASH_ProgramWord]]→[[FLASH_Lock]]