MAV'RIC
Public Member Functions
Spi_stm32 Class Reference

Implementation of spi peripheral for stm32. More...

#include <spi_stm32.hpp>

Inheritance diagram for Spi_stm32:
Inheritance graph
[legend]
Collaboration diagram for Spi_stm32:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Spi_stm32 (spi_stm32_conf_t spi_config)
 Initialises the peripheral.
bool init (void)
 Hardware initialization.
bool write (uint8_t *bytes, uint32_t nbytes=1)
 Write bytes on the spi line.
bool read (uint8_t *in_buffer, uint32_t nbytes=1)
 Read bytes from the spi line.
bool transfer (uint8_t *out_buffer, uint8_t *in_buffer, uint32_t nbytes)
 Write and Read data to/from the SPI bus.
void select_slave (void)
 Select slave.
void unselect_slave (void)
 Unselect slave.

Detailed Description

Implementation of spi peripheral for stm32.


Constructor & Destructor Documentation

Initialises the peripheral.

Parameters:
configDevice configuration

Member Function Documentation

bool Spi_stm32::init ( void  ) [virtual]

Hardware initialization.

Returns:
true Success
false Error

Implements Spi.

Here is the caller graph for this function:

bool Spi_stm32::read ( uint8_t *  in_buffer,
uint32_t  nbytes = 1 
) [virtual]

Read bytes from the spi line.

Parameters:
bytesIncoming bytes
nbytesNumber of bytes to read
Returns:
true Data successfully read
false Data not read

Implements Spi.

Here is the call graph for this function:

bool Spi_stm32::transfer ( uint8_t *  out_buffer,
uint8_t *  in_buffer,
uint32_t  nbytes 
) [virtual]

Write and Read data to/from the SPI bus.

Parameters:
out_bufferData buffer (output)
in_bufferData buffer (input)
nbytesNumber of bytes to write/read
Returns:
true Success
false Failed

Implements Spi.

Here is the caller graph for this function:

bool Spi_stm32::write ( uint8_t *  bytes,
uint32_t  nbytes = 1 
) [virtual]

Write bytes on the spi line.

Parameters:
byteOutgoing bytes
nbytesNumber of bytes to write
Returns:
true Data successfully written
false Data not written

Implements Spi.

Here is the call graph for this function:


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines