APM:Libraries
|
Go to the source code of this file.
Macros | |
#define | BR_CLEAR_MASK 0xFFC7 |
Functions | |
void | spi_init (const spi_dev *dev) |
Initialize and reset a SPI device. More... | |
void | spi_foreach (void(*fn)(const spi_dev *)) |
Call a function on each SPI port. More... | |
void | spi_gpio_master_cfg (const spi_dev *dev, const gpio_dev *comm_dev, uint8_t sck_bit, uint8_t miso_bit, uint8_t mosi_bit) |
Configure and enable a SPI device as bus master. More... | |
void | spi_gpio_slave_cfg (const spi_dev *dev, const gpio_dev *comm_dev, uint8_t sck_bit, uint8_t miso_bit, uint8_t mosi_bit) |
void | spi_reconfigure (const spi_dev *dev, uint8_t ismaster, uint16_t baudPrescaler, uint16_t bitorder, uint8_t mode) |
void | spi_set_speed (const spi_dev *dev, uint16_t baudPrescaler) |
int | spimaster_transfer (const spi_dev *dev, const uint8_t *txbuf, uint16_t txcount, uint8_t *rxbuf, uint16_t rxcount) |
static void | isr_handler (const spi_dev *dev) |
void | SPI1_IRQHandler () |
void | SPI2_IRQHandler () |
void | SPI3_IRQHandler () |
Variables | |
static spi_state spi1_state | IN_CCM |
static const spi_dev | spi1 |
const spi_dev *const | _SPI1 = &spi1 |
static const spi_dev | spi2 |
const spi_dev *const | _SPI2 = &spi2 |
static const spi_dev | spi3 |
const spi_dev *const | _SPI3 = &spi3 |
#define BR_CLEAR_MASK 0xFFC7 |
Referenced by spi_set_speed().
|
static |
Definition at line 265 of file spi.c.
Referenced by SPI1_IRQHandler(), SPI2_IRQHandler(), and SPI3_IRQHandler().
void SPI1_IRQHandler | ( | ) |
Definition at line 277 of file spi.c.
Referenced by isr_handler().
void SPI2_IRQHandler | ( | ) |
Definition at line 281 of file spi.c.
Referenced by isr_handler().
void SPI3_IRQHandler | ( | ) |
Definition at line 285 of file spi.c.
Referenced by isr_handler().
void spi_foreach | ( | void(*)(const spi_dev *) | fn | ) |
Call a function on each SPI port.
fn | Function to call. |
Definition at line 84 of file spi.c.
Referenced by spi_master_enable(), and spi_peripheral_disable_all().
void spi_gpio_master_cfg | ( | const spi_dev * | dev, |
const gpio_dev * | comm_dev, | ||
uint8_t | sck_bit, | ||
uint8_t | miso_bit, | ||
uint8_t | mosi_bit | ||
) |
Configure and enable a SPI device as bus master.
The device's peripheral will be disabled before being reconfigured.
dev | Device to configure as bus master |
baud | Bus baud rate |
mode | SPI mode |
flags | Logical OR of spi_cfg_flag values. |
Definition at line 92 of file spi.c.
Referenced by F4Light::SPIDevice::init(), and spi_master_enable().
void spi_gpio_slave_cfg | ( | const spi_dev * | dev, |
const gpio_dev * | comm_dev, | ||
uint8_t | sck_bit, | ||
uint8_t | miso_bit, | ||
uint8_t | mosi_bit | ||
) |
Definition at line 115 of file spi.c.
Referenced by spi_master_enable().
void spi_init | ( | const spi_dev * | dev | ) |
Initialize and reset a SPI device.
dev | Device to initialize and reset. |
Definition at line 57 of file spi.c.
Referenced by F4Light::SPIDevice::init(), setup(), spi_peripheral_disable(), and spi_reconfigure().
void spi_reconfigure | ( | const spi_dev * | dev, |
uint8_t | ismaster, | ||
uint16_t | baudPrescaler, | ||
uint16_t | bitorder, | ||
uint8_t | mode | ||
) |
Definition at line 132 of file spi.c.
Referenced by spi_master_enable(), and spi_peripheral_disable().
void spi_set_speed | ( | const spi_dev * | dev, |
uint16_t | baudPrescaler | ||
) |
Definition at line 205 of file spi.c.
Referenced by F4Light::SPIDevice::apply_speed(), spi_master_enable(), F4Light::SPIDevice::transfer(), and F4Light::SPIDevice::transfer_fullduplex().
int spimaster_transfer | ( | const spi_dev * | dev, |
const uint8_t * | txbuf, | ||
uint16_t | txcount, | ||
uint8_t * | rxbuf, | ||
uint16_t | rxcount | ||
) |
Definition at line 219 of file spi.c.
Referenced by spi_master_enable(), and F4Light::SPIDevice::transfer().
|
static |
|
static |