Пример #1
0
void spi_send_lsb_first(uint32_t spi)
{
	SPI_CR1(spi) |= SPI_CR1_LSBFIRST;
}
Пример #2
0
void spi_set_dff_16bit(uint32_t spi)
{
	SPI_CR1(spi) |= SPI_CR1_DFF;
}
Пример #3
0
void spi_set_nss_low(uint32_t spi)
{
	SPI_CR1(spi) &= ~SPI_CR1_SSI;
}
Пример #4
0
void spi_set_clock_phase_0(uint32_t spi)
{
	SPI_CR1(spi) &= ~SPI_CR1_CPHA;
}
Пример #5
0
void spi_set_bidirectional_mode(uint32_t spi)
{
	SPI_CR1(spi) |= SPI_CR1_BIDIMODE;
}
Пример #6
0
void spi_set_slave_mode(uint32_t spi)
{
	SPI_CR1(spi) &= ~SPI_CR1_MSTR;
}
Пример #7
0
void spi_set_clock_polarity_0(uint32_t spi)
{
	SPI_CR1(spi) &= ~SPI_CR1_CPOL;
}
Пример #8
0
void spi_set_next_tx_from_buffer(uint32_t spi)
{
	SPI_CR1(spi) &= ~SPI_CR1_CRCNEXT;
}
Пример #9
0
void spi_set_next_tx_from_crc(uint32_t spi)
{
	SPI_CR1(spi) |= SPI_CR1_CRCNEXT;
}
Пример #10
0
void spi_enable_crc(uint32_t spi)
{
	SPI_CR1(spi) |= SPI_CR1_CRCEN;
}
Пример #11
0
void spi_disable_crc(uint32_t spi)
{
	SPI_CR1(spi) &= ~SPI_CR1_CRCEN;
}
Пример #12
0
void spi_set_bidirectional_transmit_only_mode(uint32_t spi)
{
	SPI_CR1(spi) |= SPI_CR1_BIDIMODE;
	SPI_CR1(spi) |= SPI_CR1_BIDIOE;
}
Пример #13
0
void spi_set_bidirectional_receive_only_mode(uint32_t spi)
{
	SPI_CR1(spi) |= SPI_CR1_BIDIMODE;
	SPI_CR1(spi) &= ~SPI_CR1_BIDIOE;
}
Пример #14
0
void spi_enable_software_slave_management(uint32_t spi)
{
	SPI_CR1(spi) |= SPI_CR1_SSM;
}
Пример #15
0
void spi_send_msb_first(uint32_t spi)
{
	SPI_CR1(spi) &= ~SPI_CR1_LSBFIRST;
}
Пример #16
0
void spi_set_full_duplex_mode(uint32_t spi)
{
	SPI_CR1(spi) &= ~SPI_CR1_RXONLY;
}
Пример #17
0
void spi_set_master_mode(uint32_t spi)
{
	SPI_CR1(spi) |= SPI_CR1_MSTR;
}
Пример #18
0
void spi_set_receive_only_mode(uint32_t spi)
{
	SPI_CR1(spi) |= SPI_CR1_RXONLY;
}
Пример #19
0
void spi_set_clock_polarity_1(uint32_t spi)
{
	SPI_CR1(spi) |= SPI_CR1_CPOL;
}
Пример #20
0
void spi_disable_software_slave_management(uint32_t spi)
{
	SPI_CR1(spi) &= ~SPI_CR1_SSM;
}
Пример #21
0
void spi_set_clock_phase_1(uint32_t spi)
{
	SPI_CR1(spi) |= SPI_CR1_CPHA;
}
Пример #22
0
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;
}
Пример #23
0
void spi_enable(uint32_t spi)
{
	SPI_CR1(spi) |= SPI_CR1_SPE; /* Enable SPI. */
}
Пример #24
0
void spi_set_nss_high(uint32_t spi)
{
	SPI_CR1(spi) |= SPI_CR1_SSI;
}
Пример #25
0
void spi_set_unidirectional_mode(uint32_t spi)
{
	SPI_CR1(spi) &= ~SPI_CR1_BIDIMODE;
}
Пример #26
0
void spi_set_dff_8bit(uint32_t spi)
{
	SPI_CR1(spi) &= ~SPI_CR1_DFF;
}