Ultibo API
C/C++ API for Ultibo Core
Loading...
Searching...
No Matches
pitft28.h File Reference
#include "ultibo/gpio.h"
#include "ultibo/i2c.h"
#include "ultibo/spi.h"
#include "ultibo/framebuffer.h"
#include "ultibo/touch.h"

Go to the source code of this file.

Data Structures

struct  _PITFT28LCD

Macros

#define PITFT28_FRAMEBUFFER_DESCRIPTION   "Adafruit PiTFT 2.8\" LCD"
 Description of PiTFT28 device.
#define PITFT28_SIGNATURE   0xAF000028
#define PITFT28_SCREEN_WIDTH   240
#define PITFT28_SCREEN_HEIGHT   320
#define PITFT28_LCD_DC   GPIO_PIN_25
#define PITFT28_TOUCH_IRQ   GPIO_PIN_24
#define PITFT28_LCD_BL   GPIO_PIN_2
 STMPE GPIO.

Typedefs

typedef struct _PITFT28LCD PITFT28LCD

Functions

HANDLE STDCALL pitft28_start (uint32_t rotation, char *device, uint16_t displayselect, uint16_t touchselect)
 Start the PiTFT28 driver and register the Touch, Backlight (GPIO) and Framebuffer devices associated with the display.
HANDLE STDCALL pitft28_resistive_start (uint32_t rotation, char *device, uint16_t displayselect, uint16_t touchselect)
 Start the PiTFT28 driver and register the resistive Touch, Backlight (GPIO) and Framebuffer devices associated with the display.
HANDLE STDCALL pitft28_capacitive_start (uint32_t rotation, char *spidevice, char *i2cdevice, uint16_t displayselect, uint16_t touchaddress)
 Start the PiTFT28 driver and register the capacitive Touch and Framebuffer devices associated with the display.
BOOL STDCALL pitft28_stop (HANDLE handle)
 Stop the PiTFT28 driver and deregister the Touch, Backlight (GPIO) and Framebuffer devices associated with the display.

Macro Definition Documentation

◆ PITFT28_FRAMEBUFFER_DESCRIPTION

#define PITFT28_FRAMEBUFFER_DESCRIPTION   "Adafruit PiTFT 2.8\" LCD"

Description of PiTFT28 device.

PiTFT28 specific constants

◆ PITFT28_SIGNATURE

#define PITFT28_SIGNATURE   0xAF000028

◆ PITFT28_SCREEN_WIDTH

#define PITFT28_SCREEN_WIDTH   240

◆ PITFT28_SCREEN_HEIGHT

#define PITFT28_SCREEN_HEIGHT   320

◆ PITFT28_LCD_DC

#define PITFT28_LCD_DC   GPIO_PIN_25

PiTFT28 GPIO constants

◆ PITFT28_TOUCH_IRQ

#define PITFT28_TOUCH_IRQ   GPIO_PIN_24

◆ PITFT28_LCD_BL

#define PITFT28_LCD_BL   GPIO_PIN_2

STMPE GPIO.

Typedef Documentation

◆ PITFT28LCD

typedef struct _PITFT28LCD PITFT28LCD

PiTFT28 specific types

Function Documentation

◆ pitft28_start()

HANDLE STDCALL pitft28_start ( uint32_t rotation,
char * device,
uint16_t displayselect,
uint16_t touchselect )

Start the PiTFT28 driver and register the Touch, Backlight (GPIO) and Framebuffer devices associated with the display.

PiTFT28 Functions

Parameters
RotationThe rotation of the display (eg FRAMEBUFFER_ROTATION_180)
DeviceThe SPI device that the ILI9340 and STMPE610 devices are connected to
DisplaySelectThe SPI chip select of the ILI9340 LCD controller
TouchSelectThe SPI chip select of the STMPE610 touch controller
Returns
The handle of the PiTFT28 on success or INVALID_HANDLE_VALUE on failure
Note
This function will be called during startup if the parameter PITFT28_AUTOSTART is True Can be called multiple times to support more than one PiTFT LCD display
Replaced by PiTFT28ResistiveStart to accommodate capacitive display option

◆ pitft28_resistive_start()

HANDLE STDCALL pitft28_resistive_start ( uint32_t rotation,
char * device,
uint16_t displayselect,
uint16_t touchselect )

Start the PiTFT28 driver and register the resistive Touch, Backlight (GPIO) and Framebuffer devices associated with the display.

Parameters
RotationThe rotation of the display (eg FRAMEBUFFER_ROTATION_180)
DeviceThe SPI device that the ILI9340 and STMPE610 devices are connected to
DisplaySelectThe SPI chip select of the ILI9340 LCD controller
TouchSelectThe SPI chip select of the STMPE610 touch controller
Returns
The handle of the PiTFT28 on success or INVALID_HANDLE_VALUE on failure
Note
This function will be called during startup if the parameter PITFT28_AUTOSTART is True Can be called multiple times to support more than one PiTFT LCD display

◆ pitft28_capacitive_start()

HANDLE STDCALL pitft28_capacitive_start ( uint32_t rotation,
char * spidevice,
char * i2cdevice,
uint16_t displayselect,
uint16_t touchaddress )

Start the PiTFT28 driver and register the capacitive Touch and Framebuffer devices associated with the display.

Parameters
RotationThe rotation of the display (eg FRAMEBUFFER_ROTATION_180)
SPIDeviceThe SPI device that the ILI9340 device is connected to
I2CDeviceThe I2C device that the FT6236 device is connected to
DisplaySelectThe SPI chip select of the ILI9340 LCD controller
TouchAddressThe I2C address of the FT6236 touch controller
Returns
The handle of the PiTFT28 on success or INVALID_HANDLE_VALUE on failure
Note
This function will be called during startup if the parameter PITFT28_AUTOSTART is True Can be called multiple times to support more than one PiTFT LCD display

◆ pitft28_stop()

BOOL STDCALL pitft28_stop ( HANDLE handle)

Stop the PiTFT28 driver and deregister the Touch, Backlight (GPIO) and Framebuffer devices associated with the display.

Parameters
HandleThe handle of the PiTFT28 or INVALID_HANDLE_VALUE for the default display
Returns
True if completed or False on failure