stm32f4xx_flash.c
Go to the documentation of this file.
1 
71 /* Includes ------------------------------------------------------------------*/
72 #include "stm32f4xx_flash.h"
73 
83 /* Private typedef -----------------------------------------------------------*/
84 /* Private define ------------------------------------------------------------*/
85 #define SECTOR_MASK ((uint32_t)0xFFFFFF07)
86 
87 /* Private macro -------------------------------------------------------------*/
88 /* Private variables ---------------------------------------------------------*/
89 /* Private function prototypes -----------------------------------------------*/
90 /* Private functions ---------------------------------------------------------*/
91 
183 void FLASH_SetLatency(uint32_t FLASH_Latency)
184 {
185  /* Check the parameters */
186  assert_param(IS_FLASH_LATENCY(FLASH_Latency));
187 
188  /* Perform Byte access to FLASH_ACR[8:0] to set the Latency value */
189  *(__IO uint8_t *)ACR_BYTE0_ADDRESS = (uint8_t)FLASH_Latency;
190 }
191 
199 {
200  /* Check the parameters */
202 
203  /* Enable or disable the Prefetch Buffer */
204  if(NewState != DISABLE)
205  {
206  FLASH->ACR |= FLASH_ACR_PRFTEN;
207  }
208  else
209  {
210  FLASH->ACR &= (~FLASH_ACR_PRFTEN);
211  }
212 }
213 
221 {
222  /* Check the parameters */
224 
225  if(NewState != DISABLE)
226  {
227  FLASH->ACR |= FLASH_ACR_ICEN;
228  }
229  else
230  {
231  FLASH->ACR &= (~FLASH_ACR_ICEN);
232  }
233 }
234 
242 {
243  /* Check the parameters */
245 
246  if(NewState != DISABLE)
247  {
248  FLASH->ACR |= FLASH_ACR_DCEN;
249  }
250  else
251  {
252  FLASH->ACR &= (~FLASH_ACR_DCEN);
253  }
254 }
255 
263 {
264  FLASH->ACR |= FLASH_ACR_ICRST;
265 }
266 
274 {
275  FLASH->ACR |= FLASH_ACR_DCRST;
276 }
277 
317 void FLASH_Unlock(void)
318 {
319  if((FLASH->CR & FLASH_CR_LOCK) != RESET)
320  {
321  /* Authorize the FLASH Registers access */
322  FLASH->KEYR = FLASH_KEY1;
323  FLASH->KEYR = FLASH_KEY2;
324  }
325 }
326 
332 void FLASH_Lock(void)
333 {
334  /* Set the LOCK Bit to lock the FLASH Registers access */
335  FLASH->CR |= FLASH_CR_LOCK;
336 }
337 
364 FLASH_Status FLASH_EraseSector(uint32_t FLASH_Sector, uint8_t VoltageRange)
365 {
366  uint32_t tmp_psize = 0x0;
368 
369  /* Check the parameters */
370  assert_param(IS_FLASH_SECTOR(FLASH_Sector));
371  assert_param(IS_VOLTAGERANGE(VoltageRange));
372 
373  if(VoltageRange == VoltageRange_1)
374  {
375  tmp_psize = FLASH_PSIZE_BYTE;
376  }
377  else if(VoltageRange == VoltageRange_2)
378  {
379  tmp_psize = FLASH_PSIZE_HALF_WORD;
380  }
381  else if(VoltageRange == VoltageRange_3)
382  {
383  tmp_psize = FLASH_PSIZE_WORD;
384  }
385  else
386  {
387  tmp_psize = FLASH_PSIZE_DOUBLE_WORD;
388  }
389  /* Wait for last operation to be completed */
390  status = FLASH_WaitForLastOperation();
391 
392  if(status == FLASH_COMPLETE)
393  {
394  /* if the previous operation is completed, proceed to erase the sector */
395  FLASH->CR &= CR_PSIZE_MASK;
396  FLASH->CR |= tmp_psize;
397  FLASH->CR &= SECTOR_MASK;
398  FLASH->CR |= FLASH_CR_SER | FLASH_Sector;
399  FLASH->CR |= FLASH_CR_STRT;
400 
401  /* Wait for last operation to be completed */
402  status = FLASH_WaitForLastOperation();
403 
404  /* if the erase operation is completed, disable the SER Bit */
405  FLASH->CR &= (~FLASH_CR_SER);
406  FLASH->CR &= SECTOR_MASK;
407  }
408  /* Return the Erase Status */
409  return status;
410 }
411 
432 FLASH_Status FLASH_EraseAllSectors(uint8_t VoltageRange)
433 {
434  uint32_t tmp_psize = 0x0;
436 
437  /* Wait for last operation to be completed */
438  status = FLASH_WaitForLastOperation();
439  assert_param(IS_VOLTAGERANGE(VoltageRange));
440 
441  if(VoltageRange == VoltageRange_1)
442  {
443  tmp_psize = FLASH_PSIZE_BYTE;
444  }
445  else if(VoltageRange == VoltageRange_2)
446  {
447  tmp_psize = FLASH_PSIZE_HALF_WORD;
448  }
449  else if(VoltageRange == VoltageRange_3)
450  {
451  tmp_psize = FLASH_PSIZE_WORD;
452  }
453  else
454  {
455  tmp_psize = FLASH_PSIZE_DOUBLE_WORD;
456  }
457  if(status == FLASH_COMPLETE)
458  {
459  /* if the previous operation is completed, proceed to erase all sectors */
460 #if defined (STM32F427X)
461  FLASH->CR &= CR_PSIZE_MASK;
462  FLASH->CR |= tmp_psize;
463  FLASH->CR |= (FLASH_CR_MER1 | FLASH_CR_MER2);
464  FLASH->CR |= FLASH_CR_STRT;
465 
466  /* Wait for last operation to be completed */
467  status = FLASH_WaitForLastOperation();
468 
469  /* if the erase operation is completed, disable the MER Bit */
470  FLASH->CR &= ~(FLASH_CR_MER1 | FLASH_CR_MER2);
471 #endif /* STM32F427X */
472 
473 #ifdef STM32F40XX
474  FLASH->CR &= CR_PSIZE_MASK;
475  FLASH->CR |= tmp_psize;
476  FLASH->CR |= FLASH_CR_MER;
477  FLASH->CR |= FLASH_CR_STRT;
478 
479  /* Wait for last operation to be completed */
480  status = FLASH_WaitForLastOperation();
481 
482  /* if the erase operation is completed, disable the MER Bit */
483  FLASH->CR &= (~FLASH_CR_MER);
484 #endif /* STM32F40XX */
485 
486  }
487  /* Return the Erase Status */
488  return status;
489 }
490 
504 FLASH_Status FLASH_ProgramDoubleWord(uint32_t Address, uint64_t Data)
505 {
507 
508  /* Check the parameters */
509  assert_param(IS_FLASH_ADDRESS(Address));
510 
511  /* Wait for last operation to be completed */
512  status = FLASH_WaitForLastOperation();
513 
514  if(status == FLASH_COMPLETE)
515  {
516  /* if the previous operation is completed, proceed to program the new data */
517  FLASH->CR &= CR_PSIZE_MASK;
519  FLASH->CR |= FLASH_CR_PG;
520 
521  *(__IO uint64_t*)Address = Data;
522 
523  /* Wait for last operation to be completed */
524  status = FLASH_WaitForLastOperation();
525 
526  /* if the program operation is completed, disable the PG Bit */
527  FLASH->CR &= (~FLASH_CR_PG);
528  }
529  /* Return the Program Status */
530  return status;
531 }
532 
547 FLASH_Status FLASH_ProgramWord(uint32_t Address, uint32_t Data)
548 {
550 
551  /* Check the parameters */
552  assert_param(IS_FLASH_ADDRESS(Address));
553 
554  /* Wait for last operation to be completed */
555  status = FLASH_WaitForLastOperation();
556 
557  if(status == FLASH_COMPLETE)
558  {
559  /* if the previous operation is completed, proceed to program the new data */
560  FLASH->CR &= CR_PSIZE_MASK;
561  FLASH->CR |= FLASH_PSIZE_WORD;
562  FLASH->CR |= FLASH_CR_PG;
563 
564  *(__IO uint32_t*)Address = Data;
565 
566  /* Wait for last operation to be completed */
567  status = FLASH_WaitForLastOperation();
568 
569  /* if the program operation is completed, disable the PG Bit */
570  FLASH->CR &= (~FLASH_CR_PG);
571  }
572  /* Return the Program Status */
573  return status;
574 }
575 
589 FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data)
590 {
592 
593  /* Check the parameters */
594  assert_param(IS_FLASH_ADDRESS(Address));
595 
596  /* Wait for last operation to be completed */
597  status = FLASH_WaitForLastOperation();
598 
599  if(status == FLASH_COMPLETE)
600  {
601  /* if the previous operation is completed, proceed to program the new data */
602  FLASH->CR &= CR_PSIZE_MASK;
604  FLASH->CR |= FLASH_CR_PG;
605 
606  *(__IO uint16_t*)Address = Data;
607 
608  /* Wait for last operation to be completed */
609  status = FLASH_WaitForLastOperation();
610 
611  /* if the program operation is completed, disable the PG Bit */
612  FLASH->CR &= (~FLASH_CR_PG);
613  }
614  /* Return the Program Status */
615  return status;
616 }
617 
631 FLASH_Status FLASH_ProgramByte(uint32_t Address, uint8_t Data)
632 {
634 
635  /* Check the parameters */
636  assert_param(IS_FLASH_ADDRESS(Address));
637 
638  /* Wait for last operation to be completed */
639  status = FLASH_WaitForLastOperation();
640 
641  if(status == FLASH_COMPLETE)
642  {
643  /* if the previous operation is completed, proceed to program the new data */
644  FLASH->CR &= CR_PSIZE_MASK;
645  FLASH->CR |= FLASH_PSIZE_BYTE;
646  FLASH->CR |= FLASH_CR_PG;
647 
648  *(__IO uint8_t*)Address = Data;
649 
650  /* Wait for last operation to be completed */
651  status = FLASH_WaitForLastOperation();
652 
653  /* if the program operation is completed, disable the PG Bit */
654  FLASH->CR &= (~FLASH_CR_PG);
655  }
656 
657  /* Return the Program Status */
658  return status;
659 }
660 
722 void FLASH_OB_Unlock(void)
723 {
724  if((FLASH->OPTCR & FLASH_OPTCR_OPTLOCK) != RESET)
725  {
726  /* Authorizes the Option Byte register programming */
727  FLASH->OPTKEYR = FLASH_OPT_KEY1;
728  FLASH->OPTKEYR = FLASH_OPT_KEY2;
729  }
730 }
731 
737 void FLASH_OB_Lock(void)
738 {
739  /* Set the OPTLOCK Bit to lock the FLASH Option Byte Registers access */
740  FLASH->OPTCR |= FLASH_OPTCR_OPTLOCK;
741 }
742 
759 void FLASH_OB_WRPConfig(uint32_t OB_WRP, FunctionalState NewState)
760 {
762 
763  /* Check the parameters */
764  assert_param(IS_OB_WRP(OB_WRP));
766 
767  status = FLASH_WaitForLastOperation();
768 
769  if(status == FLASH_COMPLETE)
770  {
771  if(NewState != DISABLE)
772  {
773  *(__IO uint16_t*)OPTCR_BYTE2_ADDRESS &= (~OB_WRP);
774  }
775  else
776  {
777  *(__IO uint16_t*)OPTCR_BYTE2_ADDRESS |= (uint16_t)OB_WRP;
778  }
779  }
780 }
781 
798 void FLASH_OB_WRP1Config(uint32_t OB_WRP, FunctionalState NewState)
799 {
801 
802  /* Check the parameters */
803  assert_param(IS_OB_WRP(OB_WRP));
805 
806  status = FLASH_WaitForLastOperation();
807 
808  if(status == FLASH_COMPLETE)
809  {
810  if(NewState != DISABLE)
811  {
812  *(__IO uint16_t*)OPTCR1_BYTE2_ADDRESS &= (~OB_WRP);
813  }
814  else
815  {
816  *(__IO uint16_t*)OPTCR1_BYTE2_ADDRESS |= (uint16_t)OB_WRP;
817  }
818  }
819 }
820 
833 void FLASH_OB_RDPConfig(uint8_t OB_RDP)
834 {
836 
837  /* Check the parameters */
838  assert_param(IS_OB_RDP(OB_RDP));
839 
840  status = FLASH_WaitForLastOperation();
841 
842  if(status == FLASH_COMPLETE)
843  {
844  *(__IO uint8_t*)OPTCR_BYTE1_ADDRESS = OB_RDP;
845 
846  }
847 }
848 
865 void FLASH_OB_UserConfig(uint8_t OB_IWDG, uint8_t OB_STOP, uint8_t OB_STDBY)
866 {
867  uint8_t optiontmp = 0xFF;
869 
870  /* Check the parameters */
873  assert_param(IS_OB_STDBY_SOURCE(OB_STDBY));
874 
875  /* Wait for last operation to be completed */
876  status = FLASH_WaitForLastOperation();
877 
878  if(status == FLASH_COMPLETE)
879  {
880  /* Mask OPTLOCK, OPTSTRT and BOR_LEV bits */
881  optiontmp = (uint8_t)((*(__IO uint8_t *)OPTCR_BYTE0_ADDRESS) & (uint8_t)0x0F);
882 
883  /* Update User Option Byte */
884  *(__IO uint8_t *)OPTCR_BYTE0_ADDRESS = OB_IWDG | (uint8_t)(OB_STDBY | (uint8_t)(OB_STOP | ((uint8_t)optiontmp)));
885  }
886 }
887 
898 void FLASH_OB_BORConfig(uint8_t OB_BOR)
899 {
900  /* Check the parameters */
901  assert_param(IS_OB_BOR(OB_BOR));
902 
903  /* Set the BOR Level */
904  *(__IO uint8_t *)OPTCR_BYTE0_ADDRESS &= (~FLASH_OPTCR_BOR_LEV);
905  *(__IO uint8_t *)OPTCR_BYTE0_ADDRESS |= OB_BOR;
906 
907 }
908 
916 {
918 
919  /* Set the OPTSTRT bit in OPTCR register */
921 
922  /* Wait for last operation to be completed */
923  status = FLASH_WaitForLastOperation();
924 
925  return status;
926 }
927 
934 uint8_t FLASH_OB_GetUser(void)
935 {
936  /* Return the User Option Byte */
937  return (uint8_t)(FLASH->OPTCR >> 5);
938 }
939 
945 uint16_t FLASH_OB_GetWRP(void)
946 {
947  /* Return the FLASH write protection Register value */
948  return (*(__IO uint16_t *)(OPTCR_BYTE2_ADDRESS));
949 }
950 
957 uint16_t FLASH_OB_GetWRP1(void)
958 {
959  /* Return the FLASH write protection Register value */
960  return (*(__IO uint16_t *)(OPTCR1_BYTE2_ADDRESS));
961 }
962 
971 {
972  FlagStatus readstatus = RESET;
973 
974  if ((*(__IO uint8_t*)(OPTCR_BYTE1_ADDRESS) != (uint8_t)OB_RDP_Level_0))
975  {
976  readstatus = SET;
977  }
978  else
979  {
980  readstatus = RESET;
981  }
982  return readstatus;
983 }
984 
994 uint8_t FLASH_OB_GetBOR(void)
995 {
996  /* Return the FLASH BOR level */
997  return (uint8_t)(*(__IO uint8_t *)(OPTCR_BYTE0_ADDRESS) & (uint8_t)0x0C);
998 }
999 
1023 void FLASH_ITConfig(uint32_t FLASH_IT, FunctionalState NewState)
1024 {
1025  /* Check the parameters */
1026  assert_param(IS_FLASH_IT(FLASH_IT));
1027  assert_param(IS_FUNCTIONAL_STATE(NewState));
1028 
1029  if(NewState != DISABLE)
1030  {
1031  /* Enable the interrupt sources */
1032  FLASH->CR |= FLASH_IT;
1033  }
1034  else
1035  {
1036  /* Disable the interrupt sources */
1037  FLASH->CR &= ~(uint32_t)FLASH_IT;
1038  }
1039 }
1040 
1054 FlagStatus FLASH_GetFlagStatus(uint32_t FLASH_FLAG)
1055 {
1056  FlagStatus bitstatus = RESET;
1057  /* Check the parameters */
1058  assert_param(IS_FLASH_GET_FLAG(FLASH_FLAG));
1059 
1060  if((FLASH->SR & FLASH_FLAG) != (uint32_t)RESET)
1061  {
1062  bitstatus = SET;
1063  }
1064  else
1065  {
1066  bitstatus = RESET;
1067  }
1068  /* Return the new state of FLASH_FLAG (SET or RESET) */
1069  return bitstatus;
1070 }
1071 
1084 void FLASH_ClearFlag(uint32_t FLASH_FLAG)
1085 {
1086  /* Check the parameters */
1087  assert_param(IS_FLASH_CLEAR_FLAG(FLASH_FLAG));
1088 
1089  /* Clear the flags */
1090  FLASH->SR = FLASH_FLAG;
1091 }
1092 
1100 {
1101  FLASH_Status flashstatus = FLASH_COMPLETE;
1102 
1103  if((FLASH->SR & FLASH_FLAG_BSY) == FLASH_FLAG_BSY)
1104  {
1105  flashstatus = FLASH_BUSY;
1106  }
1107  else
1108  {
1109  if((FLASH->SR & FLASH_FLAG_WRPERR) != (uint32_t)0x00)
1110  {
1111  flashstatus = FLASH_ERROR_WRP;
1112  }
1113  else
1114  {
1115  if((FLASH->SR & (uint32_t)0xEF) != (uint32_t)0x00)
1116  {
1117  flashstatus = FLASH_ERROR_PROGRAM;
1118  }
1119  else
1120  {
1121  if((FLASH->SR & FLASH_FLAG_OPERR) != (uint32_t)0x00)
1122  {
1123  flashstatus = FLASH_ERROR_OPERATION;
1124  }
1125  else
1126  {
1127  flashstatus = FLASH_COMPLETE;
1128  }
1129  }
1130  }
1131  }
1132  /* Return the FLASH Status */
1133  return flashstatus;
1134 }
1135 
1143 {
1145 
1146  /* Check for the FLASH Status */
1147  status = FLASH_GetStatus();
1148 
1149  /* Wait for the FLASH operation to complete by polling on BUSY flag to be reset.
1150  Even if the FLASH operation fails, the BUSY flag will be reset and an error
1151  flag will be set */
1152  while(status == FLASH_BUSY)
1153  {
1154  status = FLASH_GetStatus();
1155  }
1156  /* Return the operation status */
1157  return status;
1158 }
1159 
1176 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
FlagStatus
Definition: stm32f4xx.h:706
#define FLASH_ACR_PRFTEN
Definition: stm32f4xx.h:4552
#define IS_OB_IWDG_SOURCE(SOURCE)
#define IS_OB_STOP_SOURCE(SOURCE)
#define FLASH_KEY1
#define IS_VOLTAGERANGE(RANGE)
FunctionalState
Definition: stm32f4xx.h:708
#define FLASH_ACR_DCEN
Definition: stm32f4xx.h:4554
void FLASH_OB_Unlock(void)
Unlocks the FLASH Option Control Registers access.
FLASH_Status FLASH_OB_Launch(void)
Launch the option byte loading.
void FLASH_OB_WRP1Config(uint32_t OB_WRP, FunctionalState NewState)
Enables or disables the write protection of the desired sectors.
#define VoltageRange_3
FLASH_Status FLASH_EraseSector(uint32_t FLASH_Sector, uint8_t VoltageRange)
Erases a specified FLASH Sector.
uint16_t FLASH_OB_GetWRP(void)
Returns the FLASH Write Protection Option Bytes value.
#define IS_FLASH_GET_FLAG(FLAG)
#define FLASH_CR_PG
Definition: stm32f4xx.h:4570
void FLASH_OB_UserConfig(uint8_t OB_IWDG, uint8_t OB_STOP, uint8_t OB_STDBY)
Programs the FLASH User Option Byte: IWDG_SW / RST_STOP / RST_STDBY.
#define SECTOR_MASK
#define IS_FLASH_CLEAR_FLAG(FLAG)
void FLASH_InstructionCacheReset(void)
Resets the Instruction Cache.
FLASH_Status FLASH_GetStatus(void)
Returns the FLASH Status.
#define FLASH_OPTCR_OPTLOCK
Definition: stm32f4xx.h:4589
void FLASH_PrefetchBufferCmd(FunctionalState NewState)
Enables or disables the Prefetch Buffer.
FlagStatus FLASH_GetFlagStatus(uint32_t FLASH_FLAG)
Checks whether the specified FLASH flag is set or not.
void FLASH_DataCacheCmd(FunctionalState NewState)
Enables or disables the Data Cache feature.
void assert_param(int val)
This file contains all the functions prototypes for the FLASH firmware library.
#define IS_FUNCTIONAL_STATE(STATE)
Definition: stm32f4xx.h:709
#define FLASH_CR_STRT
Definition: stm32f4xx.h:4584
#define IS_OB_RDP(LEVEL)
#define FLASH
Definition: stm32f4xx.h:2123
static volatile uint8_t * status
Definition: drv_i2c.c:102
Definition: stm32f4xx.h:706
void FLASH_OB_BORConfig(uint8_t OB_BOR)
Sets the BOR Level.
#define VoltageRange_2
void FLASH_OB_RDPConfig(uint8_t OB_RDP)
Sets the read protection level.
#define FLASH_OPT_KEY1
#define FLASH_ACR_DCRST
Definition: stm32f4xx.h:4556
#define FLASH_CR_MER2
Definition: stm32f4xx.h:4583
#define OPTCR_BYTE1_ADDRESS
OPTCR register byte 1 (Bits[15:8]) base address.
#define CR_PSIZE_MASK
#define __IO
Definition: core_cm0.h:198
#define OB_RDP_Level_0
#define OPTCR1_BYTE2_ADDRESS
OPTCR1 register byte 0 (Bits[7:0]) base address.
void FLASH_OB_WRPConfig(uint32_t OB_WRP, FunctionalState NewState)
Enables or disables the write protection of the desired sectors.
#define ACR_BYTE0_ADDRESS
ACR register byte 0 (Bits[7:0]) base address.
#define FLASH_FLAG_BSY
#define FLASH_CR_MER1
Definition: stm32f4xx.h:4573
#define FLASH_PSIZE_WORD
void FLASH_ClearFlag(uint32_t FLASH_FLAG)
Clears the FLASH's pending flags.
void FLASH_Lock(void)
Locks the FLASH control register access.
#define FLASH_PSIZE_DOUBLE_WORD
#define IS_OB_WRP(SECTOR)
FLASH_Status FLASH_ProgramDoubleWord(uint32_t Address, uint64_t Data)
Programs a double word (64-bit) at a specified address.
#define FLASH_ACR_ICEN
Definition: stm32f4xx.h:4553
FlagStatus FLASH_OB_GetRDP(void)
Returns the FLASH Read Protection level.
#define FLASH_KEY2
#define IS_FLASH_IT(IT)
#define FLASH_ACR_ICRST
Definition: stm32f4xx.h:4555
#define FLASH_FLAG_OPERR
FLASH_Status FLASH_ProgramWord(uint32_t Address, uint32_t Data)
Programs a word (32-bit) at a specified address.
#define FLASH_OPTCR_OPTSTRT
Definition: stm32f4xx.h:4590
#define FLASH_PSIZE_HALF_WORD
FLASH_Status FLASH_EraseAllSectors(uint8_t VoltageRange)
Erases all FLASH Sectors.
#define FLASH_CR_MER
Definition: stm32f4xx.h:4572
#define FLASH_CR_LOCK
Definition: stm32f4xx.h:4586
#define IS_FLASH_LATENCY(LATENCY)
#define FLASH_OPT_KEY2
#define IS_FLASH_ADDRESS(ADDRESS)
#define FLASH_CR_SER
Definition: stm32f4xx.h:4571
#define IS_OB_STDBY_SOURCE(SOURCE)
FLASH_Status FLASH_ProgramByte(uint32_t Address, uint8_t Data)
Programs a byte (8-bit) at a specified address.
#define OPTCR_BYTE2_ADDRESS
OPTCR register byte 2 (Bits[23:16]) base address.
FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data)
Programs a half word (16-bit) at a specified address.
FLASH_Status
FLASH Status.
uint8_t FLASH_OB_GetUser(void)
Returns the FLASH User Option Bytes values.
void FLASH_OB_Lock(void)
Locks the FLASH Option Control Registers access.
#define FLASH_FLAG_WRPERR
#define VoltageRange_1
#define FLASH_OPTCR_BOR_LEV
Definition: stm32f4xx.h:4593
#define FLASH_PSIZE_BYTE
FLASH_Status FLASH_WaitForLastOperation(void)
Waits for a FLASH operation to complete.
uint8_t FLASH_OB_GetBOR(void)
Returns the FLASH BOR level.
void FLASH_SetLatency(uint32_t FLASH_Latency)
Sets the code latency value.
#define OPTCR_BYTE0_ADDRESS
OPTCR register byte 0 (Bits[7:0]) base address.
void FLASH_ITConfig(uint32_t FLASH_IT, FunctionalState NewState)
Enables or disables the specified FLASH interrupts.
void FLASH_InstructionCacheCmd(FunctionalState NewState)
Enables or disables the Instruction Cache feature.
uint16_t FLASH_OB_GetWRP1(void)
Returns the FLASH Write Protection Option Bytes value.
void FLASH_DataCacheReset(void)
Resets the Data Cache.
void FLASH_Unlock(void)
Unlocks the FLASH control register access.
#define IS_OB_BOR(LEVEL)
#define IS_FLASH_SECTOR(SECTOR)


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Thu Apr 15 2021 05:07:49