Bare Metal Programming Tool Kit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Types | Static Public Member Functions | List of all members
bmptk::hardware::spi_bus_sclk_mosi_miso< sclk_extern, mosi_extern, miso_extern, frequency > Struct Template Reference

bit-banged spi bus More...

#include <spi.h>

Public Types

enum  { type = type_spi_bus }
 identify this type as a spi bus
 
typedef
bmptk::hardware::pin_out_from
< sclk_extern > 
sclk
 the sck pin
 
typedef
bmptk::hardware::pin_out_from
< mosi_extern > 
mosi
 the mosi pin
 
typedef
bmptk::hardware::pin_in_from
< miso_extern > 
miso
 the miso pin
 

Static Public Member Functions

static void wait ()
 wait at least a half-period since the previous call
 
static void init ()
 initialize the pins
 

Detailed Description

template<class sclk_extern, class mosi_extern, class miso_extern, unsigned int frequency = 1 * bmptk::MHz>
struct bmptk::hardware::spi_bus_sclk_mosi_miso< sclk_extern, mosi_extern, miso_extern, frequency >

bit-banged spi bus

This class represents a simple bit-banged (software-only) spi bus master.

The SS (slave select) line is not part of this bus, it is part of a spi channel (specific to one chip on the spi bus).

The last parameter is the (maximum) frequency of the clock. For higher frequency arguments, the actual frequency will be limited by the target's bmptk::current_time() calls. On an LPC1114 at 12 MHz, the real maximum frequency is ~ 50 kHz.

Definition at line 52 of file spi.h.


The documentation for this struct was generated from the following file: