Public Member Functions | Private Member Functions | Private Attributes | List of all members
SPI Class Reference

#include <spi.h>

Public Member Functions

void disable (GPIO &cs)
 
void enable (GPIO &cs)
 
void init (const spi_hardware_struct_t *conf)
 
bool is_busy ()
 
void set_divisor (uint16_t new_divisor)
 
bool transfer (uint8_t *out_data, uint32_t num_bytes, uint8_t *in_data, GPIO *cs=NULL, void(*cb)(void)=NULL)
 
uint8_t transfer_byte (uint8_t data, GPIO *cs=NULL)
 
void transfer_complete_cb ()
 
bool write (const uint8_t *out_data, uint32_t num_bytes, GPIO *cs=NULL)
 

Private Member Functions

void perform_transfer ()
 

Private Attributes

volatile bool busy_ = false
 
const spi_hardware_struct_tc_
 
GPIOcs_
 
DMA_InitTypeDef DMA_InitStructure_
 
uint32_t errors_ = 0
 
uint8_t * in_buffer_ptr_
 
GPIO miso_
 
GPIO mosi_
 
uint32_t num_bytes_
 
const uint8_t * out_buffer_ptr_
 
GPIO sck_
 
void(* transfer_cb_ )(void) = NULL
 

Detailed Description

Definition at line 38 of file spi.h.

Member Function Documentation

void SPI::disable ( GPIO cs)

Definition at line 155 of file spi.cpp.

void SPI::enable ( GPIO cs)

Definition at line 150 of file spi.cpp.

void SPI::init ( const spi_hardware_struct_t conf)

Definition at line 40 of file spi.cpp.

bool SPI::is_busy ( )
inline

Definition at line 54 of file spi.h.

void SPI::perform_transfer ( )
private

Definition at line 222 of file spi.cpp.

void SPI::set_divisor ( uint16_t  new_divisor)

Definition at line 109 of file spi.cpp.

bool SPI::transfer ( uint8_t *  out_data,
uint32_t  num_bytes,
uint8_t *  in_data,
GPIO cs = NULL,
void(*)(void)  cb = NULL 
)

Definition at line 207 of file spi.cpp.

uint8_t SPI::transfer_byte ( uint8_t  data,
GPIO cs = NULL 
)

Definition at line 160 of file spi.cpp.

void SPI::transfer_complete_cb ( )

Definition at line 257 of file spi.cpp.

bool SPI::write ( const uint8_t *  out_data,
uint32_t  num_bytes,
GPIO cs = NULL 
)

Definition at line 191 of file spi.cpp.

Member Data Documentation

volatile bool SPI::busy_ = false
private

Definition at line 75 of file spi.h.

const spi_hardware_struct_t* SPI::c_
private

Definition at line 66 of file spi.h.

GPIO* SPI::cs_
private

Definition at line 74 of file spi.h.

DMA_InitTypeDef SPI::DMA_InitStructure_
private

Definition at line 71 of file spi.h.

uint32_t SPI::errors_ = 0
private

Definition at line 73 of file spi.h.

uint8_t* SPI::in_buffer_ptr_
private

Definition at line 62 of file spi.h.

GPIO SPI::miso_
private

Definition at line 68 of file spi.h.

GPIO SPI::mosi_
private

Definition at line 67 of file spi.h.

uint32_t SPI::num_bytes_
private

Definition at line 64 of file spi.h.

const uint8_t* SPI::out_buffer_ptr_
private

Definition at line 63 of file spi.h.

GPIO SPI::sck_
private

Definition at line 69 of file spi.h.

void(* SPI::transfer_cb_) (void) = NULL
private

Definition at line 76 of file spi.h.


The documentation for this class was generated from the following files:


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Wed Jul 3 2019 19:59:31