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

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);