Initial commit
This commit is contained in:
164
ide-touchgfx-gen/TouchGFX/target/TouchGFXHAL.hpp
Normal file
164
ide-touchgfx-gen/TouchGFX/target/TouchGFXHAL.hpp
Normal file
@@ -0,0 +1,164 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* File Name : TouchGFXHAL.hpp
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2021 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under Ultimate Liberty license
|
||||
* SLA0044, the "License"; You may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at:
|
||||
* www.st.com/SLA0044
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
#ifndef TouchGFXHAL_HPP
|
||||
#define TouchGFXHAL_HPP
|
||||
|
||||
/* USER CODE BEGIN TouchGFXHAL.hpp */
|
||||
|
||||
#include <TouchGFXGeneratedHAL.hpp>
|
||||
|
||||
/**
|
||||
* @class TouchGFXHAL
|
||||
*
|
||||
* @brief HAL implementation for TouchGFX.
|
||||
*
|
||||
* @sa HAL
|
||||
*/
|
||||
class TouchGFXHAL : public TouchGFXGeneratedHAL
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @fn TouchGFXHAL::TouchGFXHAL(touchgfx::DMA_Interface& dma, touchgfx::LCD& display, touchgfx::TouchController& tc, uint16_t width, uint16_t height) : TouchGFXGeneratedHAL(dma, display, tc, width, height)
|
||||
*
|
||||
* @brief Constructor.
|
||||
*
|
||||
* Constructor. Initializes members.
|
||||
*
|
||||
* @param [in,out] dma Reference to DMA interface.
|
||||
* @param [in,out] display Reference to LCD interface.
|
||||
* @param [in,out] tc Reference to Touch Controller driver.
|
||||
* @param width Width of the display.
|
||||
* @param height Height of the display.
|
||||
*/
|
||||
TouchGFXHAL(touchgfx::DMA_Interface& dma, touchgfx::LCD& display, touchgfx::TouchController& tc, uint16_t width, uint16_t height) : TouchGFXGeneratedHAL(dma, display, tc, width, height)
|
||||
{
|
||||
}
|
||||
|
||||
void initialize();
|
||||
|
||||
virtual void taskEntry();
|
||||
|
||||
/**
|
||||
* @fn virtual void TouchGFXHAL::disableInterrupts();
|
||||
*
|
||||
* @brief Disables the DMA and LCD interrupts.
|
||||
*
|
||||
* Disables the DMA and LCD interrupts.
|
||||
*/
|
||||
virtual void disableInterrupts();
|
||||
|
||||
/**
|
||||
* @fn virtual void TouchGFXHAL::enableInterrupts();
|
||||
*
|
||||
* @brief Enables the DMA and LCD interrupts.
|
||||
*
|
||||
* Enables the DMA and LCD interrupts.
|
||||
*/
|
||||
virtual void enableInterrupts();
|
||||
|
||||
/**
|
||||
* @fn virtual void TouchGFXHAL::configureInterrupts();
|
||||
*
|
||||
* @brief Sets the DMA and LCD interrupt priorities.
|
||||
*
|
||||
* Sets the DMA and LCD interrupt priorities.
|
||||
*/
|
||||
virtual void configureInterrupts();
|
||||
|
||||
/**
|
||||
* @fn virtual void TouchGFXHAL::enableLCDControllerInterrupt();
|
||||
*
|
||||
* @brief Configure the LCD controller to fire interrupts at VSYNC.
|
||||
*
|
||||
* Configure the LCD controller to fire interrupts at VSYNC. Called automatically
|
||||
* once TouchGFX initialization has completed.
|
||||
*/
|
||||
virtual void enableLCDControllerInterrupt();
|
||||
|
||||
/**
|
||||
* @fn virtual void TouchGFXHAL::flushFrameBuffer();
|
||||
*
|
||||
* @brief This function is called whenever the framework has performed a complete draw.
|
||||
*
|
||||
* This specialization is only in place to keep compilers happy. Base impl. will call the
|
||||
* Rect version.
|
||||
* @see HAL::flushFrameBuffer
|
||||
*/
|
||||
virtual void flushFrameBuffer()
|
||||
{
|
||||
TouchGFXGeneratedHAL::flushFrameBuffer();
|
||||
}
|
||||
|
||||
/**
|
||||
* @fn virtual void TouchGFXHAL::flushFrameBuffer(const Rect& rect);
|
||||
*
|
||||
* @brief This function is called whenever the framework has performed a partial draw.
|
||||
*
|
||||
* This function is called whenever the framework has performed a partial draw.
|
||||
* On the STM32F7, make sure to clean and invalidate the data cache. This is to
|
||||
* ensure that LTDC sees correct data when transferring to the display.
|
||||
*
|
||||
* @param rect The area of the screen that has been drawn, expressed in absolute coordinates.
|
||||
*
|
||||
* @see flushFrameBuffer().
|
||||
*/
|
||||
virtual void flushFrameBuffer(const touchgfx::Rect& rect);
|
||||
|
||||
/**
|
||||
* @fn virtual bool TouchGFXHAL::blockCopy(void* RESTRICT dest, const void* RESTRICT src, uint32_t numBytes);
|
||||
*
|
||||
* @brief This function performs a platform-specific memcpy.
|
||||
*
|
||||
* This function performs a platform-specific memcpy, if supported by the hardware.
|
||||
*
|
||||
* @param [out] dest Pointer to destination memory.
|
||||
* @param [in] src Pointer to source memory.
|
||||
* @param numBytes Number of bytes to copy.
|
||||
*
|
||||
* @return true if the copy succeeded, false if copy was not performed.
|
||||
*/
|
||||
virtual bool blockCopy(void* RESTRICT dest, const void* RESTRICT src, uint32_t numBytes);
|
||||
|
||||
protected:
|
||||
/**
|
||||
* @fn virtual uint16_t* TouchGFXHAL::getTFTFrameBuffer() const;
|
||||
*
|
||||
* @brief Gets the frame buffer address used by the TFT controller.
|
||||
*
|
||||
* Gets the frame buffer address used by the TFT controller.
|
||||
*
|
||||
* @return The address of the frame buffer currently being displayed on the TFT.
|
||||
*/
|
||||
virtual uint16_t* getTFTFrameBuffer() const;
|
||||
|
||||
/**
|
||||
* @fn virtual void TouchGFXHAL::setTFTFrameBuffer(uint16_t* adr);
|
||||
*
|
||||
* @brief Sets the frame buffer address used by the TFT controller.
|
||||
*
|
||||
* Sets the frame buffer address used by the TFT controller.
|
||||
*
|
||||
* @param [in,out] adr New frame buffer address.
|
||||
*/
|
||||
virtual void setTFTFrameBuffer(uint16_t* adr);
|
||||
};
|
||||
|
||||
/* USER CODE END TouchGFXHAL.hpp */
|
||||
|
||||
#endif // TouchGFXHAL_HPP
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
Reference in New Issue
Block a user