@@ -389,7 +389,7 @@ int OSPIFBlockDevice::deinit()
389
389
_wait_flag = NOT_STARTED;
390
390
#endif
391
391
392
- change_mode (SPI );
392
+ change_mode (OSPIF_OPI_MODE_SPI );
393
393
394
394
// Disable Device for Writing
395
395
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)
723
723
int status = OSPIF_BD_ERROR_OK;
724
724
char config_reg2 = 0 ;
725
725
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))) {
729
729
tr_debug (" Flash does not need change mode" );
730
730
}
731
731
732
- if (mode == SOPI ) {
732
+ if (mode == OSPIF_OPI_MODE_SOPI ) {
733
733
if ((_read_instruction != OSPIF_INST_READ_4B) && (_read_instruction != OSPIF_INST_READ_DEFAULT)) { // change mode from DOPI to SPI
734
734
// Write new Status Register Setup
735
735
if (_set_write_enable () != 0 ) {
@@ -781,7 +781,7 @@ int OSPIFBlockDevice::change_mode(int mode)
781
781
782
782
_ospi.configure_format (_inst_width, _inst_size, _address_width, _address_size, OSPI_CFG_BUS_SINGLE,
783
783
0 , _data_width, 0 );
784
- } else if (mode == DOPI ) {
784
+ } else if (mode == OSPIF_OPI_MODE_DOPI ) {
785
785
if ((_read_instruction != OSPIF_INST_READ_4B) && (_read_instruction != OSPIF_INST_READ_DEFAULT)) {// chang mode from SOPI to SPI
786
786
// Write new Status Register Setup
787
787
if (_set_write_enable () != 0 ) {
@@ -833,7 +833,7 @@ int OSPIFBlockDevice::change_mode(int mode)
833
833
834
834
_ospi.configure_format (_inst_width, _inst_size, _address_width, _address_size, OSPI_CFG_BUS_SINGLE,
835
835
0 , _data_width, 0 );
836
- } else if (mode == SPI ) {
836
+ } else if (mode == OSPIF_OPI_MODE_SPI ) {
837
837
// Write new Status Register Setup
838
838
if (_set_write_enable () != 0 ) {
839
839
tr_error (" Write Enabe failed" );
@@ -996,7 +996,7 @@ int OSPIFBlockDevice::_sfdp_parse_basic_param_table(Callback<int(bd_addr_t, mbed
996
996
// Detect and Set fastest Bus mode (default 1-1-1)
997
997
_sfdp_detect_best_bus_read_mode (param_table, sfdp_info.bptbl .size , shouldSetQuadEnable, is_qpi_mode, is_opi_mode);
998
998
if (true == is_opi_mode) {
999
- change_mode (DOPI );
999
+ change_mode (OSPIF_OPI_MODE_DOPI );
1000
1000
tr_debug (" Init - Setting DOPI mode" );
1001
1001
}
1002
1002
if (true == shouldSetQuadEnable) {
0 commit comments