fsfw-hal/stm32h7/spi/spiInterrupts.h

42 lines
1.1 KiB
C
Raw Normal View History

2021-06-03 16:11:49 +02:00
#ifndef FSFW_HAL_STM32H7_SPI_INTERRUPTS_H_
#define FSFW_HAL_STM32H7_SPI_INTERRUPTS_H_
2021-06-03 15:12:34 +02:00
2021-06-03 16:11:49 +02:00
#include "../interrupts.h"
2021-06-04 16:34:38 +02:00
#include "spiDefinitions.h"
2021-06-03 15:12:34 +02:00
2021-06-03 16:11:49 +02:00
#ifdef __cplusplus
extern "C" {
#endif
2021-06-03 15:12:34 +02:00
2021-06-05 13:29:43 +02:00
namespace spi {
2021-06-10 19:09:33 +02:00
void assignSpiUserArgs(spi::SpiBus spiBus, user_args_t userArgs);
2021-06-03 16:11:49 +02:00
/**
* Assign a user interrupt handler for SPI bus 1, allowing to pass an arbitrary argument as well.
* Generally, this argument will be the related SPI handle.
* @param user_handler
* @param user_args
*/
2021-06-05 13:29:43 +02:00
void assignSpiUserHandler(spi::SpiBus spiBus, user_handler_t user_handler,
2021-06-04 16:34:38 +02:00
user_args_t user_args);
2021-06-10 19:09:33 +02:00
void getSpiUserHandler(spi::SpiBus spiBus, user_handler_t* user_handler,
user_args_t* user_args);
2021-06-03 15:12:34 +02:00
2021-06-04 15:50:02 +02:00
/**
* Generic interrupt handlers supplied for convenience. Do not call these directly! Set them
* instead with assign_dma_user_handler and assign_spi_user_handler functions.
* @param dma_handle
*/
2021-06-05 13:29:43 +02:00
void dmaRxIrqHandler(void* dma_handle);
void dmaTxIrqHandler(void* dma_handle);
2021-06-10 19:09:33 +02:00
void spiIrqHandler(void* spi_handle);
2021-06-05 13:29:43 +02:00
}
2021-06-04 15:50:02 +02:00
2021-06-03 16:11:49 +02:00
#ifdef __cplusplus
}
#endif
#endif /* FSFW_HAL_STM32H7_SPI_INTERRUPTS_H_ */