Структуризировано: добавлены комменты и переименованы переменные

This commit is contained in:
alexey
2024-08-12 18:09:00 +03:00
parent acaa14abdb
commit b8cb176c61
10 changed files with 640 additions and 689 deletions

View File

@@ -58,7 +58,7 @@ void SystemClock_Config(void);
/* USER CODE BEGIN 0 */
W25_HandleTypeDef hw25;
HAL_StatusTypeDef W25_RES;
W25_reProgramInitTypeDef writeInit;
W25_WriteInitTypeDef writeInit;
uint8_t read_buff[20] = {0};
uint8_t write_buff[20] = {0x14,0x13,0x12,0x11,0x10,
@@ -115,16 +115,16 @@ int main(void)
/* Infinite loop */
/* USER CODE BEGIN WHILE */
// Example for using manufactire info CMD
// Example for FLASH: using manufactire info CMD
uint32_t w25_ID = W25_CMD_Read_JEDEC_ID(&hw25);
uint64_t w25_unique_ID = W25_CMD_Read_Device_ID(&hw25);
// Example for erase/program/read functions
// Example for FLASH: erase/program/read functions
W25_RES = W25_FLASH_Erase_Sector(&hw25, 0, 1000);
W25_RES = W25_FLASH_Program_Area(&hw25, 0xf9, write_buff, 15, 100);
W25_CMD_Read_Data(&hw25, 0xf9, read_buff, 15);
// Example for write area functions
// Example for FLASH: write area functions init
writeInit.pDataPtr = write_buff;
writeInit.Data_Address = 0xfb;
writeInit.Data_Size = 1;
@@ -132,6 +132,7 @@ int main(void)
writeInit.Sector_Size = 15;
while (1)
{
// Example for FLASH: write area functions
W25_FLASH_Write_Area(&hw25, &writeInit, 1000);
HAL_Delay(10);
W25_CMD_Read_Data(&hw25, 0xf9, read_buff, 15);

View File

@@ -154,7 +154,7 @@
<Type>0</Type>
<LineNumber>135</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>134230134</Address>
<Address>134230152</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
@@ -165,6 +165,22 @@
<ExecCommand></ExecCommand>
<Expression>\\flash_eeprom_Example\../Core/Src/main.c\135</Expression>
</Bp>
<Bp>
<Number>1</Number>
<Type>0</Type>
<LineNumber>136</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>0</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>0</BreakIfRCount>
<Filename>../Core/Src/main.c</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
</Breakpoint>
<WatchWindow1>
<Ww>
@@ -312,18 +328,6 @@
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>2</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\Core\Inc\stm32f4xx_hal_conf.h</PathWithFileName>
<FilenameWithoutPath>stm32f4xx_hal_conf.h</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>3</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -335,7 +339,7 @@
</File>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>4</FileNumber>
<FileNumber>3</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -347,7 +351,7 @@
</File>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>5</FileNumber>
<FileNumber>4</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -359,7 +363,7 @@
</File>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>6</FileNumber>
<FileNumber>5</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -371,7 +375,7 @@
</File>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>7</FileNumber>
<FileNumber>6</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -383,7 +387,7 @@
</File>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>8</FileNumber>
<FileNumber>7</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
@@ -393,6 +397,18 @@
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>8</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\Core\Inc\stm32f4xx_hal_conf.h</PathWithFileName>
<FilenameWithoutPath>stm32f4xx_hal_conf.h</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
@@ -649,7 +665,7 @@
<GroupNumber>5</GroupNumber>
<FileNumber>28</FileNumber>
<FileType>1</FileType>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\spi_flash\spi_flash.c</PathWithFileName>
@@ -684,7 +700,7 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\.GENERAL\gpio_general.c</PathWithFileName>
<PathWithFileName>..\..\GENERAL\gpio_general.c</PathWithFileName>
<FilenameWithoutPath>gpio_general.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
@@ -696,7 +712,7 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\.GENERAL\gpio_general.h</PathWithFileName>
<PathWithFileName>..\..\GENERAL\gpio_general.h</PathWithFileName>
<FilenameWithoutPath>gpio_general.h</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
@@ -708,7 +724,7 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\.GENERAL\periph_general.h</PathWithFileName>
<PathWithFileName>..\..\GENERAL\periph_general.h</PathWithFileName>
<FilenameWithoutPath>periph_general.h</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>

View File

@@ -395,11 +395,6 @@
<Group>
<GroupName>Application/User/Core</GroupName>
<Files>
<File>
<FileName>stm32f4xx_hal_conf.h</FileName>
<FileType>5</FileType>
<FilePath>..\Core\Inc\stm32f4xx_hal_conf.h</FilePath>
</File>
<File>
<FileName>main.c</FileName>
<FileType>1</FileType>
@@ -430,6 +425,11 @@
<FileType>1</FileType>
<FilePath>../Core/Src/stm32f4xx_hal_msp.c</FilePath>
</File>
<File>
<FileName>stm32f4xx_hal_conf.h</FileName>
<FileType>5</FileType>
<FilePath>..\Core\Inc\stm32f4xx_hal_conf.h</FilePath>
</File>
</Files>
</Group>
<Group>
@@ -609,17 +609,17 @@
<File>
<FileName>gpio_general.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\.GENERAL\gpio_general.c</FilePath>
<FilePath>..\..\GENERAL\gpio_general.c</FilePath>
</File>
<File>
<FileName>gpio_general.h</FileName>
<FileType>5</FileType>
<FilePath>..\..\..\.GENERAL\gpio_general.h</FilePath>
<FilePath>..\..\GENERAL\gpio_general.h</FilePath>
</File>
<File>
<FileName>periph_general.h</FileName>
<FileType>5</FileType>
<FilePath>..\..\..\.GENERAL\periph_general.h</FilePath>
<FilePath>..\..\GENERAL\periph_general.h</FilePath>
</File>
</Files>
</Group>