-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2020 ETH Zurich and University of Bologna. | ||
// Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#include <snrt.h> | ||
|
||
// Allocate a buffer in the main memory which we will use to copy data around | ||
// with the DMA. | ||
uint32_t buffer[32]; | ||
|
||
int main() { | ||
if (snrt_global_core_idx() != 8) return 0; // only DMA core | ||
|
||
// Populate source buffer. | ||
uint32_t buffer_src[32]; | ||
for (uint32_t i = 0; i < 32; i++) { | ||
buffer_src[i] = i + 1; | ||
} | ||
|
||
// Start a DMA transfer of zero size. | ||
snrt_dma_txid_t id = snrt_dma_start_1d(buffer, buffer_src, 0); | ||
snrt_dma_wait(id); | ||
|
||
// Test is successful if the previous transfer doesn't block. | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters