| 56 | } |
| 57 | |
| 58 | DMABuffer SpiHw8Stub::acquireDMABuffer(size_t bytes_per_lane) FL_NOEXCEPT { |
| 59 | if (!mInitialized) { |
| 60 | return DMABuffer(SPIError::NOT_INITIALIZED); |
| 61 | } |
| 62 | |
| 63 | // Auto-wait if previous transmission still active |
| 64 | if (mBusy) { |
| 65 | waitComplete(); |
| 66 | } |
| 67 | |
| 68 | // For octal-lane SPI: num_lanes = 8 |
| 69 | constexpr size_t num_lanes = 8; |
| 70 | const size_t total_size = bytes_per_lane * num_lanes; |
| 71 | |
| 72 | // Create a new DMABuffer with the specified size |
| 73 | mCurrentBuffer = DMABuffer(total_size); |
| 74 | |
| 75 | if (!mCurrentBuffer.ok()) { |
| 76 | return mCurrentBuffer; // Return error |
| 77 | } |
| 78 | |
| 79 | mBufferAcquired = true; |
| 80 | |
| 81 | // Return a copy of the buffer (shared_ptr will be shared) |
| 82 | return mCurrentBuffer; |
| 83 | } |
| 84 | |
| 85 | bool SpiHw8Stub::transmit(TransmitMode mode) FL_NOEXCEPT { |
| 86 | (void)mode; // Unused in stub |
no test coverage detected