-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(spi_nand_flash): Add SIO (full-duplex) and DIO mode support #476
base: master
Are you sure you want to change the base?
feat(spi_nand_flash): Add SIO (full-duplex) and DIO mode support #476
Conversation
b733e37
to
ba1fae0
Compare
@@ -24,6 +24,7 @@ struct spi_nand_flash_config_t { | |||
spi_device_handle_t device_handle; ///< SPI Device for this nand chip. | |||
uint8_t gc_factor; ///< The gc factor controls the number of blocks to spare block ratio. | |||
///< Lower values will reduce the available space but increase performance | |||
uint8_t flags; ///< set flag with SPI_DEVICE_HALFDUPLEX for half duplex communcation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this can be replaced with an enum (SIO/DIO/DOUT/QIO/QOUT) defined in this component, so that there is less dependency on the way SPI master driver defines its flags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually this flag is not used to define the mode (SIO/DIO/QIO) but rather to indicate half or full duplex in the case of SIO. For other modes, I believe half-duplex is mandatory. As mentioned above, if IO mode will be replaced with enum instead of Kconfig, then we will need io_mode config setting along with this flag.
We could introduce a separate flag or enum for configuring half/full duplex, but that would require the application to ensure synchronisation between the SPI driver and the NAND flash driver. To avoid this complexity, I have used the same flag as in spi_master to inform the NAND flash driver whether communication is full-duplex or half-duplex.
This was my thought behind adding this flag. Please let me know your thoughts.
19e9346
to
3030c3d
Compare
Change description
spi_nand_flash: Added standard (full-duplex), DIO, DOUT spi mode support.
QIO mode support will be added in another PR