# SPI in k210_soc::spi - Rust
API documentation for the Rust `SPI` trait in crate `k210_soc`.
Keywords: rust, rustlang, rust-lang, SPI

# Trait k210_soc::spi::SPI

source · [−]

    pub trait SPI {
        fn configure(
            &self,
            work_mode: work_mode,
            frame_format: frame_format,
            data_bit_length: u8,
            endian: u32,
            instruction_length: u8,
            address_length: u8,
            wait_cycles: u8,
            instruction_address_trans_mode: aitm,
            tmod: tmod
        );
        fn set_clk_rate(&self, spi_clk: u32) -> u32;
        fn recv_data<X: TruncU32>(&self, chip_select: u32, rx: &mut [X]);
        fn recv_data_dma(
            &self,
            dmac: &DMAC,
            channel_num: dma_channel,
            chip_select: u32,
            rx: &mut [u32]
        );
        fn send_data<X: Into<u32> + Copy>(&self, chip_select: u32, tx: &[X]);
        fn send_data_dma(
            &self,
            dmac: &DMAC,
            channel_num: dma_channel,
            chip_select: u32,
            tx: &[u32]
        );
        fn fill_data(&self, chip_select: u32, value: u32, tx_len: usize);
        fn fill_data_dma(
            &self,
            dmac: &DMAC,
            channel_num: dma_channel,
            chip_select: u32,
            value: u32,
            tx_len: usize
        );
    }

## Required methods

source

#### fn configure(
&self,
work_mode: work_mode,
frame_format: frame_format,
data_bit_length: u8,
endian: u32,
instruction_length: u8,
address_length: u8,
wait_cycles: u8,
instruction_address_trans_mode: aitm,
tmod: tmod
)

source

#### fn set_clk_rate(&self, spi_clk: u32) -> u32

source

#### fn recv_data<X: TruncU32>(&self, chip_select: u32, rx: &mut [X])

source

#### fn recv_data_dma(
&self,
dmac: &DMAC,
channel_num: dma_channel,
chip_select: u32,
rx: &mut [ u32 ]
)

source

#### fn send_data<X: Into<u32> + Copy>(&self, chip_select: u32, tx: &[X])

source

#### fn send_data_dma(
&self,
dmac: &DMAC,
channel_num: dma_channel,
chip_select: u32,
tx: &[ u32 ]
)

source

#### fn fill_data(&self, chip_select: u32, value: u32, tx_len: usize)

source

#### fn fill_data_dma(
&self,
dmac: &DMAC,
channel_num: dma_channel,
chip_select: u32,
value: u32,
tx_len: usize
)

## Implementors

source

### impl<IF: SPI01> SPI for SPIImpl<IF>