2021-07-13 19:19:25 +02:00
|
|
|
#ifndef FSFW_HAL_STM32H7_DMA_H_
|
|
|
|
#define FSFW_HAL_STM32H7_DMA_H_
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
#include "interrupts.h"
|
|
|
|
|
2021-07-13 19:19:25 +02:00
|
|
|
namespace dma {
|
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
enum DMAType { TX = 0, RX = 1 };
|
2021-07-13 19:19:25 +02:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
enum DMAIndexes : uint8_t { DMA_1 = 1, DMA_2 = 2 };
|
2021-07-13 19:19:25 +02:00
|
|
|
|
|
|
|
enum DMAStreams {
|
2022-02-02 10:29:30 +01:00
|
|
|
STREAM_0 = 0,
|
|
|
|
STREAM_1 = 1,
|
|
|
|
STREAM_2 = 2,
|
|
|
|
STREAM_3 = 3,
|
|
|
|
STREAM_4 = 4,
|
|
|
|
STREAM_5 = 5,
|
|
|
|
STREAM_6 = 6,
|
|
|
|
STREAM_7 = 7,
|
|
|
|
};
|
2021-07-13 19:19:25 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Assign user interrupt handlers for DMA streams, allowing to pass an
|
|
|
|
* arbitrary argument as well. Generally, this argument will be the related DMA handle.
|
|
|
|
* @param user_handler
|
|
|
|
* @param user_args
|
|
|
|
*/
|
2022-02-02 10:29:30 +01:00
|
|
|
void assignDmaUserHandler(DMAIndexes dma_idx, DMAStreams stream_idx, user_handler_t user_handler,
|
|
|
|
user_args_t user_args);
|
2021-07-13 19:19:25 +02:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
} // namespace dma
|
2021-07-13 19:19:25 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* FSFW_HAL_STM32H7_DMA_H_ */
|