31 void error (
const PropWare::ErrorCode err,
const PropWare::SPI *spi);
43 const uint32_t
FREQ = 100000;
57 char string[] =
"Hello world!\n";
81 waitcnt(CLKFREQ/100 + CNT);
88 waitcnt(CLKFREQ/100 + CNT);
110 void error (
const PropWare::ErrorCode err,
const PropWare::SPI *spi) {
119 debugLEDs.
write(err);
120 waitcnt(100*MILLISECOND);
122 waitcnt(100*MILLISECOND);
const PropWare::SPI::Mode MODE
const PropWare::Port::Mask SCLK
Utility class to handle general purpose I/O pins.
const PropWare::Port::Mask MOSI
The PropWare::SimplePort is the recommended way to use data ports on the Propeller. All pins are consecutive, which allows for some simple shortcuts in reading, writing, and initialization.
void put_char(const char c) const
Print a single character.
void clear() const
Clear selected output port (set it to 0)
PropWare::ErrorCode set_clock(const int32_t frequency)
Change the SPI module's clock frequency.
void set_mosi(const Port::Mask mask)
Release the current MOSI pin as a floating input and set the new one as output.
void print_error_str(const Printer *printer, const ErrorCode err) const
Print through UART an error string followed by entering an infinite loop.
const PropWare::Printer pwOut
Most common use of printing in PropWare applications (not thread safe; see PropWare::pwSyncOut for mu...
void shift_out(uint8_t bits, uint32_t value) const
Send a value out to a peripheral device.
void printf(const char fmt[], const T first, const Targs...remaining) const
Similar in functionality to the C-standard function printf.
Mode
Descriptor for SPI signal as defined by Motorola modes.
const PropWare::SPI::BitMode BITMODE
const PropWare::Port::Mask MISO
const PropWare::Port::Mask CS
void write(uint32_t value) const
Allow easy writing to a port w/o destroying data elsewhere in the port; A shift is performed before w...
void set_bit_mode(const BitMode bitmode)
Set the bitmode of SPI communication.
BitMode
Determine if data is communicated with the LSB or MSB sent/received first.
void toggle() const
Toggle the output value of a port.
void set_miso(const Port::Mask mask)
Set the new pin as input.
void set() const
Set selected output port high (set all pins to 1)
void set_sclk(const Port::Mask mask)
Release the current SCLK pin as a floating input and set the new one as output.
void set_mode(const Mode mode)
Set the mode of SPI communication.
SPI serial communications library; Core functionality comes from a dedicated assembly cog...
uint32_t shift_in(const unsigned int bits) const
Read a value from the MISO line.
static SPI * get_instance()
Best way to use SPI is through here, where you can get a shared instance of the SPI module (not threa...