Skip to content
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(MiscDrivers): Add APS6404 SRAM Drivers #1095

Merged
merged 9 commits into from
Aug 27, 2024

Conversation

Jake-Carter
Copy link
Contributor

Description

This PR adds APS6404 SRAM support to our MiscDrivers. The MAX78002EVKIT has an on-board APS6404 which is primarily used to buffer image data.

Previously these were local to the QSPI example project. This PR updates them to use the common fastspi implementation, configured via a "fastspi_config.h" file in the MAX78002EVKIT BSP.

It also cleans up the implementation, API, and example code.

Checklist Before Requesting Review

  • PR Title follows correct guidelines.
  • Description of changes and all other relevant information.
  • (Optional) Link any related GitHub issues using a keyword
  • (Optional) Provide info on any relevant functional testing/validation. For API changes or significant features, this is not optional.

Tests

QSPI example validation:

Initializing SRAM...
Reading ID...
RAM ID:
        MFID: 0x0d
        KGD: 0x5d
        Density: 0x02
        EID: 0x5749640d
QSPI SRAM Test:
        Test Address: 0x0
        Test size: 640 bytes
        Test count: 480 rows
        Test speed: 24000000 Hz
(Benchmark) Wrote 640 bytes to internal SRAM in 17us
Test 1: Standard SPI write...
        Done (640 bytes in 197us)
Test 2: Validate w/ standard SPI...
        Read finished (640 bytes in 198us)
        Checking for mismatches...
        Done
Test 3: Validate w/ QSPI...
        Read finished (640 bytes in 68us)
        Checking for mismatches...
        Done
Test 4: QSPI Write...
        Done (640 bytes in 88us)
Test 5: Validate w/ standard SPI...
        Read finished (640 bytes in 198us)
        Checking for mismatches...
        Done
Test 6: Validate w/ QSPI...
        Read finished (640 bytes in 68us)
        Checking for mismatches...
        Done
Test 7: QSPI Writing across page boundaries...
        Wrote 307200 bytes in 42599us
Test 8: Validating with standard SPI...
        Success
Test 9: Validating with QSPI...
        Success
Success!

@Jake-Carter Jake-Carter linked an issue Jul 29, 2024 that may be closed by this pull request
@github-actions github-actions bot added MAX78000 Related to the MAX78000 (AI85) MAX78002 Related to the MAX78002 (AI87) labels Jul 29, 2024
Comment on lines +32 to +41
// Utility macro for validating an error code. Assumes an 'err' variable
// of type int exists in the macro's context
#define ERR_CHECK(x) \
{ \
err = (x); \
if (err != E_NO_ERROR) { \
return x; \
} \
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This definition is really nice. Moving forward, maybe we can start using this to minimize all the error-if statements that are widespread across our drivers.

@Jake-Carter Jake-Carter merged commit 3fa3d21 into analogdevicesinc:main Aug 27, 2024
9 checks passed
@Jake-Carter Jake-Carter deleted the feat/aps6404 branch August 27, 2024 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MAX78000 Related to the MAX78000 (AI85) MAX78002 Related to the MAX78002 (AI87)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MAX78000: issues with external SPI RAM (aps6404l) in quad mode
2 participants