@@ -184,9 +184,7 @@ int SPIFBlockDevice::init()
184184
185185
186186 /* *************************** Parse Basic Parameters Table ***********************************/
187- if (_sfdp_parse_basic_param_table (callback (this , &SPIFBlockDevice::_spi_send_read_sfdp_command),
188- _sfdp_info.bptbl .addr ,
189- _sfdp_info.bptbl .size ) < 0 ) {
187+ if (_sfdp_parse_basic_param_table (callback (this , &SPIFBlockDevice::_spi_send_read_sfdp_command), _sfdp_info) < 0 ) {
190188 tr_error (" init - Parse Basic Param Table Failed" );
191189 status = SPIF_BD_ERROR_PARSING_FAILED;
192190 goto exit_point;
@@ -624,11 +622,11 @@ spif_bd_error SPIFBlockDevice::_spi_send_general_command(int instruction, bd_add
624622/* ********* SFDP Parsing and Detection Functions *********/
625623/* ********************************************************/
626624int SPIFBlockDevice::_sfdp_parse_basic_param_table (Callback<int (bd_addr_t , void *, bd_size_t )> sfdp_reader,
627- uint32_t basic_table_addr, size_t basic_table_size )
625+ mbed::sfdp_hdr_info &sfdp_info )
628626{
629627 uint8_t param_table[SFDP_BASIC_PARAMS_TBL_SIZE]; /* Up To 20 DWORDS = 80 Bytes */
630628
631- int status = sfdp_reader (basic_table_addr , param_table, basic_table_size );
629+ int status = sfdp_reader (sfdp_info. bptbl . addr , param_table, sfdp_info. bptbl . size );
632630 if (status != SPIF_BD_ERROR_OK) {
633631 tr_error (" init - Read SFDP First Table Failed" );
634632 return -1 ;
@@ -655,14 +653,14 @@ int SPIFBlockDevice::_sfdp_parse_basic_param_table(Callback<int(bd_addr_t, void
655653 _erase_instruction = SPIF_SE;
656654
657655 // Set Page Size (SPI write must be done on Page limits)
658- _page_size_bytes = _sfdp_detect_page_size (param_table, basic_table_size );
656+ _page_size_bytes = _sfdp_detect_page_size (param_table, sfdp_info. bptbl . size );
659657
660658 // Detect and Set Erase Types
661- _sfdp_detect_erase_types_inst_and_size (param_table, basic_table_size , _erase4k_inst, _sfdp_info .smptbl );
659+ _sfdp_detect_erase_types_inst_and_size (param_table, sfdp_info. bptbl . size , _erase4k_inst, sfdp_info .smptbl );
662660 _erase_instruction = _erase4k_inst;
663661
664662 // Detect and Set fastest Bus mode (default 1-1-1)
665- _sfdp_detect_best_bus_read_mode (param_table, basic_table_size , _read_instruction);
663+ _sfdp_detect_best_bus_read_mode (param_table, sfdp_info. bptbl . size , _read_instruction);
666664
667665 return 0 ;
668666}
0 commit comments