@@ -389,7 +389,7 @@ int OSPIFBlockDevice::deinit()
389389 _wait_flag = NOT_STARTED;
390390#endif
391391
392- change_mode (SPI );
392+ change_mode (OSPIF_OPI_MODE_SPI );
393393
394394 // Disable Device for Writing
395395 ospi_status_t status = _ospi_send_general_command (OSPIF_INST_WRDI, OSPI_NO_ADDRESS_COMMAND, NULL , 0 , NULL , 0 );
@@ -723,13 +723,13 @@ int OSPIFBlockDevice::change_mode(int mode)
723723 int status = OSPIF_BD_ERROR_OK;
724724 char config_reg2 = 0 ;
725725
726- if (((mode == SPI ) && (_read_instruction == OSPIF_INST_READ_4B)) ||
727- ((mode == SOPI ) && (_read_instruction == DTROSPIF_INST_READ_OCTA_STR)) ||
728- ((mode == DOPI ) && (_read_instruction == DTROSPIF_INST_READ_OCTA_DTR))) {
726+ if (((mode == OSPIF_OPI_MODE_SPI ) && (_read_instruction == OSPIF_INST_READ_4B)) ||
727+ ((mode == OSPIF_OPI_MODE_SOPI ) && (_read_instruction == DTROSPIF_INST_READ_OCTA_STR)) ||
728+ ((mode == OSPIF_OPI_MODE_DOPI ) && (_read_instruction == DTROSPIF_INST_READ_OCTA_DTR))) {
729729 tr_debug (" Flash does not need change mode" );
730730 }
731731
732- if (mode == SOPI ) {
732+ if (mode == OSPIF_OPI_MODE_SOPI ) {
733733 if ((_read_instruction != OSPIF_INST_READ_4B) && (_read_instruction != OSPIF_INST_READ_DEFAULT)) { // change mode from DOPI to SPI
734734 // Write new Status Register Setup
735735 if (_set_write_enable () != 0 ) {
@@ -781,7 +781,7 @@ int OSPIFBlockDevice::change_mode(int mode)
781781
782782 _ospi.configure_format (_inst_width, _inst_size, _address_width, _address_size, OSPI_CFG_BUS_SINGLE,
783783 0 , _data_width, 0 );
784- } else if (mode == DOPI ) {
784+ } else if (mode == OSPIF_OPI_MODE_DOPI ) {
785785 if ((_read_instruction != OSPIF_INST_READ_4B) && (_read_instruction != OSPIF_INST_READ_DEFAULT)) {// chang mode from SOPI to SPI
786786 // Write new Status Register Setup
787787 if (_set_write_enable () != 0 ) {
@@ -833,7 +833,7 @@ int OSPIFBlockDevice::change_mode(int mode)
833833
834834 _ospi.configure_format (_inst_width, _inst_size, _address_width, _address_size, OSPI_CFG_BUS_SINGLE,
835835 0 , _data_width, 0 );
836- } else if (mode == SPI ) {
836+ } else if (mode == OSPIF_OPI_MODE_SPI ) {
837837 // Write new Status Register Setup
838838 if (_set_write_enable () != 0 ) {
839839 tr_error (" Write Enabe failed" );
@@ -996,7 +996,7 @@ int OSPIFBlockDevice::_sfdp_parse_basic_param_table(Callback<int(bd_addr_t, mbed
996996 // Detect and Set fastest Bus mode (default 1-1-1)
997997 _sfdp_detect_best_bus_read_mode (param_table, sfdp_info.bptbl .size , shouldSetQuadEnable, is_qpi_mode, is_opi_mode);
998998 if (true == is_opi_mode) {
999- change_mode (DOPI );
999+ change_mode (OSPIF_OPI_MODE_DOPI );
10001000 tr_debug (" Init - Setting DOPI mode" );
10011001 }
10021002 if (true == shouldSetQuadEnable) {
0 commit comments