void spi_disable_rx_buffer_not_empty_interrupt(uint32_t spi) { SPI_CR2(spi) &= ~SPI_CR2_RXNEIE; }
void spi_enable_error_interrupt(uint32_t spi) { SPI_CR2(spi) |= SPI_CR2_ERRIE; }
void spi_disable_tx_buffer_empty_interrupt(uint32_t spi) { SPI_CR2(spi) &= ~SPI_CR2_TXEIE; }
void spi_enable_rx_buffer_not_empty_interrupt(uint32_t spi) { SPI_CR2(spi) |= SPI_CR2_RXNEIE; }
void spi_enable_software_slave_management(uint32_t spi) { SPI_CR1(spi) |= SPI_CR1_SSM; /* allow slave select to be an input */ SPI_CR2(spi) &= ~SPI_CR2_SSOE; }
void spi_enable_tx_buffer_empty_interrupt(uint32_t spi) { SPI_CR2(spi) |= SPI_CR2_TXEIE; }
void spi_disable_rx_dma(uint32_t spi) { SPI_CR2(spi) &= ~SPI_CR2_RXDMAEN; }
void spi_enable_rx_dma(uint32_t spi) { SPI_CR2(spi) |= SPI_CR2_RXDMAEN; }
void spi_disable_ss_output(uint32_t spi) { SPI_CR2(spi) &= ~SPI_CR2_SSOE; }
void spi_enable_ss_output(uint32_t spi) { SPI_CR2(spi) |= SPI_CR2_SSOE; }
void spi_disable_error_interrupt(uint32_t spi) { SPI_CR2(spi) &= ~SPI_CR2_ERRIE; }