Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(PeriphDrivers)!: Add SPI v2 Implementation to MAX78002 (#632)
* QSPI initial checkpoint: - Working standard reads/writes - Working QSPI reads/writes * Checkpoint: QSPI+DMA working * Clear rx buffer between tests * Add DMA read (not working - timing issues w/ DMA overhead) * Checkpoint: register-level DMA write * Checkpoint: Working 4-wire reads/writes * Checkpoint: Fix local dummy value bug - If the value of the dummy byte was defined locally inside of the spi_transmit function, it would introduce some glitches on the SPI MOSI line. Suspected compiler optimization issue. For some reason, these glitches also corrupted the MISO line. This caused RX data to be corrupted, and ram reads would return incorrect values. * Add benchmark for DMA overhead (checkpoint: 24us) * Checkpoint: Working QSPI writes, semi-working QSPI reads (first 3 bytes are corrupted by misaligned IO1) * Checkpoint: Debugging QSPI fast read timing * Checkpoint: Working QSPI DMA reads with IPO at 24Mhz SPI, VGA write in 86us, VGA read in 65us (!!!) * Break out drivers into their own files * Add boundary cross test * Move ram reset/exit qspi to sram init * Add TODOs * Move ram reset/exit qspi to sram init * Add TODOs * Added SPI Async/Interrupt changes. * [NOT WORKING] SPI RevB: Initial commit of WIP for spi_revb to save current work in case of deletion. * SPI RevB: Organized functions. * SPI RevB: Chip Select Changes. * SPI RevB: Latest notes and changes based on review. * Pushing latest SPI changes for Jake. * Implement SPI functions with RevB version. * Renamed CS_CFG to TARGET. * Removed commented code and added target name changes. * Add comments to spi_fast functions. * Fix build errors and add target select config functions. * Lastest build state for SPI fast. * Replaced RevA/RevB naming to RevA1/RevA2 respectively * Replace spi_fast.h to spi.h * Pushing latest changes * Add spi_reva2 and _reva1 selection * Added back spi_fast_ai87.c * Correct SPI pin constants * Working state for Transaction and TransactionAsync except for 9 or 10bit wide messages * Correct DMA reinitialization * 1 byte transactions now work * Added helper functions to for DMA usage * Async/Sync Controller Transactions now work * Clean up spi_reva2 * Fix comment guards * Clean up spi_reva2 * Fix parameter names, got DMA SPI TX working * SPI RX and TX DMA now work * Rename new chip-specific SPI drivers * feat(PeriphDrivers): Add previously supported functions * feat(PeriphDrivers): Add previous implementation for backwards compatibility * revert(PeriphDrivers): Revert previously supported SPI files * fix(Examples): Pull latest QSPI example changes * feat(PeriphDrivers): Add option to build new SPI drivers * feat(PeriphDrivers): Replace RevA to RevA1 * feat(PeriphDrivers): Replace RevA to RevA1 * feat(PeriphDrivers): Add new DMA DeInit function to all parts * feat(PeriphDrivers): Replace spi_reva.h include with spi_reva1.h * clang-format bot reformatting. * style(PeriphDrivers): Fix linter errors * feat(PeriphDrivers): Check changes for spi_reva1.h * fix(PeriphDrivers): Redirect old SPI functions using new implementation * clang-format bot reformatting. * feat(PeriphDrivers): Add new SPI v2 pin definitions * style(PeriphDrivers): Fix linter errors * clang-format bot reformatting. * feat(Examples): Support new SPI v2 implementation with SPI example * style(Examples): Fix linter errors * build(PeriphDrivers): Replace spi_reva.c to spi_reva1.c * fix(PeriphDrivers): Fix pins definition for MAX32520 * revert(PeriphDrivers): Revert clang-format on certain sections in spi.h * fix(PeriphDrivers): Fix build error with MAX78002 new SPI implementation * revert(Examples): Revert QSPI * fix(Examples): Fix define for MXC_SPI_V2 in MAX78002 * fix(Examples): Add DMA Helper function in MAX78002 SPI * fix(PeriphDrivers): Remove floating braces * fix(Examples): Fix typos * fix(Examples): Remove floating braces and incomplete functions * fix(PeriphDrivers): Remove undefined SPI function * fix(PeriphDrivers): Remove new in drivers * fix(PeriphDrivers): Remove commented code * fix(PeriphDrivers): Set RX and TX Thresholds after flushing FIFOs * fix(Examples): Revert SPI example settings * feat(PeriphDrivers): Remove MXC_SPI_V2 for default and use MXC_SPI_LEGACY instead * Revert "fix(Examples): Pull latest QSPI example changes" This reverts commit 22459b4. * revert(Examples): Revert QSPI * feat(PeriphDrivers): Remove unnecessary code * clang-format bot reformatting. * feat(PeriphDrivers): Add new init struct functions * fix(PeriphDrivers): Remove target pointer * clang-format bot reformatting. * feat(Examples): Update example using SPI v2 * clang-format bot reformatting. * feat(Examples): Address different TX/RX DMA CH Interrupts * feat(Examples): Fix wording on SPI example for MAX78002 * feat(Examples,PeriphDrivers): Add porting guide to SPI README for MAX78002 * fix(PeriphDrivers): Fix build errors * fix(Examples,PeriphDrivers): Fix SPI DMA not working * feat(Examples,PeriphDrivers): Set interface mode in SPI * feat(Examples): Update SPI example to use SPI v2 * docs(Examples): Add porting guide to SPI example for MAX78002 * docs(Examples): Add porting guide to SPI example for MAX78002 * feat(PeriphDrivers): Move InitStruct functions to chip-specific library level * fix(Examples,PeriphDrivers): Address review suggesstions * clang-format bot reformatting. * feat(Examples): Add custom target feature example to SPI * feat(Examples): Fix SPI documentation * revert(PeriphDrivers): Revert accidental spi.h commits and update SPI doxygen * fix(PeriphDrivers): Fix comments * clang-format bot reformatting. * feat(Examples): Update READMEs for SPI and build previous SPI library for SPI_MasterSlave example * fix(Examples): Fix SPI library build selection * fix(Examples): Fix SPI library build selection p2 * feat(PeriphDrivers): Add overflow check for SPI TX/RX message lenngths * feat(PeriphDrivers): Set controller_done flag when TX or RX DMA transactions are finished * clang-format bot reformatting. * fix(PeriphDrivers): Remove target functions * fix(Examples): Remove deleted field from SPI README --------- Co-authored-by: Jake Carter <jake.carter@analog.com> Co-authored-by: sihyung-maxim <sihyung-maxim@users.noreply.github.com>
- Loading branch information