WPI ECE 2049 STM32 Adafruit TFT 1.8" Shield
Loading...
Searching...
No Matches
Adafruit_TFTShield18_API.h File Reference
#include "stdint.h"
#include "Adafruit_TFTShield18_Macros.h"
#include "stm32h5xx_hal.h"

Go to the source code of this file.

Typedefs

typedef struct TFTShield18_Handle TFTShield18_Handle
 Internal handle used to store the instance of an Adafruit_TFTShield18 class for use in the C API functions. This struct is not intended to be used outside of this API and should be treated as an opaque handle. Provides a C compatible structure to store the C++ class instance for the TFT shield.

Functions

void TFTShield18_create (I2C_HandleTypeDef *i2c_handle)
 Function to create an instance of the seesaw class for the TFT shield. Must be called before any other functions in this API.
bool TFTShield18_begin ()
 Function to initialize the seesaw device on the TFT shield. Must be called before using any other functions in this API. Uses the default I2C address of 0x3E for the TFT seesaw device.
void TFTShield18_setBacklight (uint16_t value)
 Sets the backlight to a value between 0(0x0000) (off) and 65535(0xFFFF) (full brightness).
void TFTShield18_setBacklightFreq (uint16_t freq)
 Sets the frequency of the backlight PWM.
void TFTShield18_tftReset (bool rst)
 Perform a SW reset of the display and seesaw devices. Required to be called after initialization to reset the display from an unknown state. Should be called whenever a reset of the display is needed by setting rst to true and then back to false after a delay.
uint32_t TFTShield18_readButtons ()
 Function to read the state of the on board shield buttons from the seesaw chip over I2C. Returned bitmask has bits set corresponding to the TFTSHIELD_BUTTON macros defined in Adafruit_TFTShield18_Macros.h.

Typedef Documentation

◆ TFTShield18_Handle

Internal handle used to store the instance of an Adafruit_TFTShield18 class for use in the C API functions. This struct is not intended to be used outside of this API and should be treated as an opaque handle. Provides a C compatible structure to store the C++ class instance for the TFT shield.

Function Documentation

◆ TFTShield18_begin()

bool TFTShield18_begin ( )

Function to initialize the seesaw device on the TFT shield. Must be called before using any other functions in this API. Uses the default I2C address of 0x3E for the TFT seesaw device.

Returns
true if the initialization was successful
false if the initialization failed

◆ TFTShield18_create()

void TFTShield18_create ( I2C_HandleTypeDef * i2c_handle)

Function to create an instance of the seesaw class for the TFT shield. Must be called before any other functions in this API.

Parameters
i2c_handlePointer to the STM32 HAL I2C handle to use for communication with the TFT seesaw device

◆ TFTShield18_readButtons()

uint32_t TFTShield18_readButtons ( )

Function to read the state of the on board shield buttons from the seesaw chip over I2C. Returned bitmask has bits set corresponding to the TFTSHIELD_BUTTON macros defined in Adafruit_TFTShield18_Macros.h.

Returns
uint32_t Bitmask representing the state of the buttons

◆ TFTShield18_setBacklight()

void TFTShield18_setBacklight ( uint16_t value)

Sets the backlight to a value between 0(0x0000) (off) and 65535(0xFFFF) (full brightness).

Parameters
valueValue to set the backlight to (between 0 and 65535)

◆ TFTShield18_setBacklightFreq()

void TFTShield18_setBacklightFreq ( uint16_t freq)

Sets the frequency of the backlight PWM.

Parameters
freqFrequency to set the backlight PWM to

◆ TFTShield18_tftReset()

void TFTShield18_tftReset ( bool rst)

Perform a SW reset of the display and seesaw devices. Required to be called after initialization to reset the display from an unknown state. Should be called whenever a reset of the display is needed by setting rst to true and then back to false after a delay.

Parameters
rstBoolean value to trigger the reset. Set to true to initiate the reset and false to complete it.