Bare Metal Programming Tool Kit
|
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 | |
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.