A library for interfacing with the Pixy color recognition camera

Dependents:   PixyCamera MbedOS_Robot_Team ManualControlFinal PlayBack ... more

Embed: (wiki syntax)

« Back to documentation index

PixyInterfaceSPI Class Reference

PixyInterfaceSPI Class Reference

An interface for communicating between the Pixy via an SPI interface. More...

#include <TPixyInterface.h>

Inherits TPixyInterface.

Public Member Functions

 PixyInterfaceSPI (SPI *interface)
 Constructs a PixyInterfaceSPI object.
virtual void init ()
 Initializes the PixyInterfaceSPI.
virtual uint16_t getWord ()
 Reads a word from the interface.
virtual uint8_t getByte ()
 Reads a byte from the interface.
virtual int8_t send (uint8_t *data, uint8_t len)
 Sends the given data to the Pixy with a given data length.
virtual void setArg (uint16_t arg)
 Sets an argument for the interface to use [unused].

Detailed Description

An interface for communicating between the Pixy via an SPI interface.

Definition at line 80 of file TPixyInterface.h.


Constructor & Destructor Documentation

PixyInterfaceSPI ( SPI *  interface )

Constructs a PixyInterfaceSPI object.

Parameters:
interfacethe SPI pointer

Definition at line 3 of file TPixyInterface.cpp.


Member Function Documentation

uint8_t getByte (  ) [virtual]

Reads a byte from the interface.

Returns:
the byte read from the interface

Implements TPixyInterface.

Definition at line 21 of file TPixyInterface.cpp.

uint16_t getWord (  ) [virtual]

Reads a word from the interface.

Returns:
the word read from the interface

Implements TPixyInterface.

Definition at line 10 of file TPixyInterface.cpp.

void init (  ) [virtual]

Initializes the PixyInterfaceSPI.

Implements TPixyInterface.

Definition at line 5 of file TPixyInterface.cpp.

int8_t send ( uint8_t *  data,
uint8_t  len 
) [virtual]

Sends the given data to the Pixy with a given data length.

Parameters:
datathe data to send
lenthe length of the data to send
Returns:
the interface return signal

Implements TPixyInterface.

Definition at line 27 of file TPixyInterface.cpp.

void setArg ( uint16_t  arg ) [virtual]

Sets an argument for the interface to use [unused].

Parameters:
argthe argument to use

Implements TPixyInterface.

Definition at line 41 of file TPixyInterface.cpp.