Skip to content
Brent Seidel edited this page Feb 23, 2017 · 2 revisions

SPI Device Class

This provides an class to control the SPI device(s). There are many more options that are not yet implemented. I just implemented enough to interface with the RA8875 LCD countroller. I expect more to be added at a later time.

The following types are defined:

   type SPI_record is abstract tagged limited null record;
   type SPI_ptr is access all SPI_record'Class;

The following methods are defined:

   procedure configure(self : in out SPI_record; SPI_file : string;
                       SCL : string; SDA : string) is abstract;

Configure the SPI interface on a BeagleBone Black or other systems that have multiple functions on the SPI pins. This configureation procedure sets the pins to the SPI function.

   procedure configure(self : in out SPI_record; SPI_file : string) is abstract;

Configure the SPI interface on a Raspberry PI or other systems that have dedicated pins for the SPI interface. This would also work on a system with shared pins if the pins had already been set to the SPI function.

   procedure set(self : SPI_record; value : uint8) is abstract;

Write an 8 bit value to the SPI bus.

   function get(self : SPI_record) return uint8 is abstract;

Read an 8 bit value from the SPI bus.

The following devices are supported on the SPI bus:

  • RA8875 LCD touchscreen controller
Clone this wiki locally