Sync inav to Gitea
Make sure docs are updated / settings_md (push) Canceled after 0s
Build firmware / test (push) Canceled after 0s
Build firmware / build-SITL-Windows (push) Canceled after 0s
Build firmware / build-SITL-Mac (push) Canceled after 0s
Build firmware / build-SITL-Linux (push) Canceled after 0s
Build firmware / build-SITL-Linux-arm64 (push) Canceled after 0s
Build firmware / upload-artifacts (push) Canceled after 0s
Build firmware / build-single-target (push) Canceled after 0s
Build firmware / build (9) (push) Canceled after 0s
Build firmware / build (8) (push) Canceled after 0s
Build firmware / build (7) (push) Canceled after 0s
Build firmware / build (6) (push) Canceled after 0s
Build firmware / build (5) (push) Canceled after 0s
Build firmware / build (4) (push) Canceled after 0s
Build firmware / build (3) (push) Canceled after 0s
Build firmware / build (2) (push) Canceled after 0s
Build firmware / build (14) (push) Canceled after 0s
Build firmware / build (13) (push) Canceled after 0s
Build firmware / build (12) (push) Canceled after 0s
Build firmware / build (11) (push) Canceled after 0s
Build firmware / build (10) (push) Canceled after 0s
Build firmware / build (1) (push) Canceled after 0s
Build firmware / build (0) (push) Canceled after 0s
Build firmware / detect (push) Canceled after 0s
Build pre-release / build (push) Canceled after 0s
Build pre-release / Release (push) Canceled after 0s
Make sure docs are updated / settings_md (push) Canceled after 0s
Build firmware / test (push) Canceled after 0s
Build firmware / build-SITL-Windows (push) Canceled after 0s
Build firmware / build-SITL-Mac (push) Canceled after 0s
Build firmware / build-SITL-Linux (push) Canceled after 0s
Build firmware / build-SITL-Linux-arm64 (push) Canceled after 0s
Build firmware / upload-artifacts (push) Canceled after 0s
Build firmware / build-single-target (push) Canceled after 0s
Build firmware / build (9) (push) Canceled after 0s
Build firmware / build (8) (push) Canceled after 0s
Build firmware / build (7) (push) Canceled after 0s
Build firmware / build (6) (push) Canceled after 0s
Build firmware / build (5) (push) Canceled after 0s
Build firmware / build (4) (push) Canceled after 0s
Build firmware / build (3) (push) Canceled after 0s
Build firmware / build (2) (push) Canceled after 0s
Build firmware / build (14) (push) Canceled after 0s
Build firmware / build (13) (push) Canceled after 0s
Build firmware / build (12) (push) Canceled after 0s
Build firmware / build (11) (push) Canceled after 0s
Build firmware / build (10) (push) Canceled after 0s
Build firmware / build (1) (push) Canceled after 0s
Build firmware / build (0) (push) Canceled after 0s
Build firmware / detect (push) Canceled after 0s
Build pre-release / build (push) Canceled after 0s
Build pre-release / Release (push) Canceled after 0s
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
---
|
||||
name: 'Issue report'
|
||||
about: 'Create a report to help us improve the quality of our software'
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
---
|
||||
|
||||
**Caution**
|
||||
|
||||
The Issues are strictly limited for the reporting of problem encountered with the software provided in this project.
|
||||
For any other problem related to the STM32 product, the performance, the hardware characteristics and boards, the tools the environment in general, please post your report to the **ST Community** in the STM32 MCUs dedicated [page](https://community.st.com/s/topic/0TO0X000000BSqSWAW/stm32-mcus).
|
||||
|
||||
**Describe the set-up**
|
||||
|
||||
* The board (either ST RPN reference or your custom board)
|
||||
* IDE or at least the compiler and its version
|
||||
|
||||
**Describe the bug (skip if none)**
|
||||
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**How to reproduce the bug (skip if none)**
|
||||
|
||||
1. Indicate the global behavior of your application project
|
||||
2. List the modules that you suspect to be the cause of the problem (Drivers, BSP, MW...)
|
||||
3. Describe the use case that generates the problem
|
||||
4. How we can reproduce the problem
|
||||
|
||||
|
||||
**Additional context**
|
||||
|
||||
If you have a first analysis, an enhancement, a fix or a patch, thank you to share your proposal.
|
||||
|
||||
**Screenshots**
|
||||
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
## IMPORTANT INFORMATION
|
||||
|
||||
### Contributor License Agreement (CLA)
|
||||
* The Pull Request feature will be considered by STMicroelectronics after the signature of a **Contributor License Agreement (CLA)** by the submitter.
|
||||
* If you did not sign such agreement, please follow the steps mentioned in the [CONTRIBUTING.md](https://github.com/STMicroelectronics/stm32-nt35510/blob/main/CONTRIBUTING.md) file.
|
||||
@@ -0,0 +1,73 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
||||
level of experience, education, socio-economic status, nationality, personal
|
||||
appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team via this [link](https://www.st.com/content/st_com/en/contact-us.html).
|
||||
All complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 1.4,
|
||||
available [here](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html).
|
||||
|
||||
For answers to common questions about this code of conduct, see the [FAQ section](https://www.contributor-covenant.org/faq).
|
||||
@@ -0,0 +1,40 @@
|
||||
# Contributing guide
|
||||
|
||||
This guide serves as a checklist before contributing to this repository. It mainly focuses on the steps to follow to submit an issue or a pull-request.
|
||||
|
||||
## 1. Issues
|
||||
|
||||
### 1.1 Before opening an issue
|
||||
|
||||
Please check the following points before posting an issue:
|
||||
* Make sure you are using the latest commit (major releases are tagged, but corrections are available as new commits).
|
||||
* Make sure your issue is a question/feedback/suggestions **related to** the software provided in this repository. Otherwise, please refer to section [3](CONTRIBUTING.md#3-support-requests-and-questions) below.
|
||||
* Make sure your issue is not already reported/fixed on GitHub or discussed on a previous issue. Do not forget to browse into the **closed** issues.
|
||||
|
||||
### 1.2 Posting the issue
|
||||
|
||||
When you have checked the previous points, create a new report from the **Issues** tab of this repository. A template is available [here](../../issues/new/choose) to help you report the issue you are facing or the enhancement you would like to propose.
|
||||
|
||||
## 2. Pull Requests
|
||||
|
||||
### 2.1 Before opening a pull-request
|
||||
|
||||
STMicrolectronics is happy to receive contributions from the community, based on an initial Contributor License Agreement (CLA) procedure.
|
||||
|
||||
* If you are an individual writing original source code and you are sure **you own the intellectual property**, then you need to sign an Individual [CLA](https://cla.st.com).
|
||||
* If you work for a company that wants also to allow you to contribute with your work, your company needs to provide a Corporate [CLA](https://cla.st.com) mentioning your GitHub account name.
|
||||
* If you are not sure that a CLA (Individual or Corporate) has been signed for your GitHub account you can check the [CLA](https://cla.st.com) dedicated page.
|
||||
|
||||
Please note that:
|
||||
* The Corporate CLA will always take precedence over the Individual CLA.
|
||||
* One CLA submission is sufficient, for any project proposed by STMicroelectronics.
|
||||
|
||||
### 2.2 How to proceed
|
||||
|
||||
* We recommend to engage first a communication thru an issue, in order to present your proposal, just to confirm that it corresponds to STMicroelectronics' domain or scope.
|
||||
* Then fork the project to your GitHub account to further develop your contribution. Please use the latest commit version.
|
||||
* Please, submit one pull-request per new feature or proposal. This will ease the analysis and the final merge if accepted.
|
||||
|
||||
## 3. Support requests and questions
|
||||
|
||||
For support requests or any other question related to the product, the tools, the environment, you can submit a post to the **ST Community** on the appropriate topic [page](https://community.st.com/s/topiccatalog).
|
||||
@@ -0,0 +1,11 @@
|
||||
Copyright 2019 STMicroelectronics. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -0,0 +1,34 @@
|
||||
# BSP STM32-NT35510 LCD Component
|
||||
|
||||

|
||||
|
||||
## Overview
|
||||
|
||||
**STM32Cube** is an STMicroelectronics original initiative to ease developers' life by reducing efforts, time and cost.
|
||||
|
||||
**STM32Cube** covers the overall STM32 products portfolio. It includes a comprehensive embedded software platform delivered for each STM32 series.
|
||||
* The CMSIS modules (core and device) corresponding to the ARM(tm) core implemented in this STM32 product.
|
||||
* The STM32 HAL-LL drivers, an abstraction layer offering a set of APIs ensuring maximized portability across the STM32 portfolio.
|
||||
* The BSP drivers of each evaluation, demonstration or nucleo board provided for this STM32 series.
|
||||
* A consistent set of middleware libraries such as RTOS, USB, FatFS, graphics, touch sensing library...
|
||||
* A full set of software projects (basic examples, applications, and demonstrations) for each board provided for this STM32 series.
|
||||
|
||||
Two models of publication are proposed for the STM32Cube embedded software:
|
||||
* The monolithic **MCU Package**: all STM32Cube software modules of one STM32 series are present (Drivers, Middleware, Projects, Utilities) in the repository (usual name **STM32Cubexx**, xx corresponding to the STM32 series).
|
||||
* The **MCU component**: each STM32Cube software module being part of the STM32Cube MCU Package, is delivered as an individual repository, allowing the user to select and get only the required software functions.
|
||||
|
||||
## Description
|
||||
|
||||
This **stm32-nt35510** MCU component repository is one element **common to all** STM32Cube MCU embedded software packages, providing the **NT35510** BSP LCD component part.
|
||||
|
||||
## Release note
|
||||
|
||||
Details about the content of this release are available in the release note [here](https://htmlpreview.github.io/?https://github.com/STMicroelectronics/stm32-nt35510/blob/main/Release_Notes.html).
|
||||
|
||||
## Compatibility information
|
||||
|
||||
Please refer to the repository of the BSP **board** driver you are using to know which version of this BSP component driver to use. It is **crucial** that you use a consistent set of versions as indicated.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) guide.
|
||||
@@ -0,0 +1,68 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="generator" content="pandoc" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
||||
<title>Release Notes for NT35510 Component Drivers</title>
|
||||
<style type="text/css">
|
||||
code{white-space: pre-wrap;}
|
||||
span.smallcaps{font-variant: small-caps;}
|
||||
span.underline{text-decoration: underline;}
|
||||
div.column{display: inline-block; vertical-align: top; width: 50%;}
|
||||
</style>
|
||||
<link rel="stylesheet" href="_htmresc/mini-st_2020.css" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
<link rel="icon" type="image/x-icon" href="_htmresc/favicon.png" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-lg-4">
|
||||
<center>
|
||||
<h1 id="release-notes-for">Release Notes for</h1>
|
||||
<h1 id="nt35510-component-drivers"><mark>NT35510 Component Drivers</mark></h1>
|
||||
<p>Copyright © 2020 STMicroelectronics<br />
|
||||
</p>
|
||||
<a href="https://www.st.com" class="logo"><img src="_htmresc/st_logo_2020.png" alt="ST logo" /></a>
|
||||
</center>
|
||||
<h1 id="purpose">Purpose</h1>
|
||||
<p>This directory contains the NT35510 LCD DSI component drivers.</p>
|
||||
</div>
|
||||
<div class="col-sm-12 col-lg-8">
|
||||
<h1 id="update-history">Update History</h1>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section3_0_0" checked aria-hidden="true"> <label for="collapse-section3_0_0" aria-hidden="true">V2.0.2 / 16-January-2024</label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Fix setting of DPRSLCTR register.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section2_0_0" aria-hidden="true"> <label for="collapse-section2_0_0" aria-hidden="true">V2.0.1 / 09-November-2023</label>
|
||||
<div>
|
||||
<h2 id="main-changes-1">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Update Read_ID() API to support dynamic read ID.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section1_0_0" aria-hidden="true"> <label for="collapse-section1_0_0" aria-hidden="true">V2.0.0 / 25-May-2023</label>
|
||||
<div>
|
||||
<h2 id="main-changes-2">Main Changes</h2>
|
||||
<p>Official release of component drivers for NT35510 in line with STM32Cube BSP drivers development guidelines (UM2298)</p>
|
||||
<h2 id="backward-compatibility">Backward Compatibility</h2>
|
||||
<p>This release breaks compatibility with previous versions.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="sticky">
|
||||
For complete documentation on <mark>STM32 Microcontrollers</mark> , visit: <span style="font-color: blue;"><a href="http://www.st.com/stm32">www.st.com/stm32</a></span>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,31 @@
|
||||
# Report potential product security vulnerabilities
|
||||
|
||||
ST places a high priority on security, and our Product Security Incident
|
||||
Response Team (PSIRT) is committed to rapidly addressing potential security
|
||||
vulnerabilities affecting our products. PSIRT's long history and vast experience
|
||||
in security allows ST to perform clear analyses and provide appropriate guidance
|
||||
on mitigations and solutions when applicable.
|
||||
|
||||
If you wish to report potential security vulnerabilities regarding our products,
|
||||
**please do not report them through public GitHub issues.** Instead, we
|
||||
encourage you to report them to our ST PSIRT following the process described at:
|
||||
**https://www.st.com/content/st_com/en/security/report-vulnerabilities.html**
|
||||
|
||||
### IMPORTANT - READ CAREFULLY:
|
||||
|
||||
STMicroelectronics International N.V., on behalf of itself, its affiliates and
|
||||
subsidiaries, (collectively “ST”) takes all potential security vulnerability
|
||||
reports or other related communications (“Report(s)”) seriously. In order to
|
||||
review Your Report (the terms “You” and “Yours” include your employer, and all
|
||||
affiliates, subsidiaries and related persons or entities) and take actions as
|
||||
deemed appropriate, ST requires that we have the rights and Your permission to
|
||||
do so.
|
||||
|
||||
As such, by submitting Your Report to ST, You agree that You have the right to
|
||||
do so, and You grant to ST the rights to use the Report for purposes related to
|
||||
security vulnerability analysis, testing, correction, patching, reporting and
|
||||
any other related purpose or function.
|
||||
|
||||
By submitting Your Report, You agree that ST’s
|
||||
[Privacy Policy](https://www.st.com/content/st_com/en/common/privacy-portal.html)
|
||||
applies to all related communications.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.0 KiB |
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 7.3 KiB |
@@ -0,0 +1,703 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file nt35510.c
|
||||
* @author MCD Application Team
|
||||
* @brief This file provides the LCD Driver for Frida Techshine 3K138 (WVGA)
|
||||
* DSI LCD Display NT35510.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2023 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "nt35510.h"
|
||||
#include <stddef.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup NT35510 NT35510
|
||||
* @brief This file provides a set of functions needed to drive the
|
||||
* NT35510 IC display driver.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup NT35510_Exported_Types NT35510 Exported Types
|
||||
* @{
|
||||
*/
|
||||
NT35510_LCD_Drv_t NT35510_LCD_Driver =
|
||||
{
|
||||
NT35510_Init,
|
||||
NT35510_DeInit,
|
||||
NT35510_ReadID,
|
||||
NT35510_DisplayOn,
|
||||
NT35510_DisplayOff,
|
||||
NT35510_SetBrightness,
|
||||
NT35510_GetBrightness,
|
||||
NT35510_SetOrientation,
|
||||
NT35510_GetOrientation,
|
||||
NT35510_SetCursor,
|
||||
NT35510_DrawBitmap,
|
||||
NT35510_FillRGBRect,
|
||||
NT35510_DrawHLine,
|
||||
NT35510_DrawVLine,
|
||||
NT35510_FillRect,
|
||||
NT35510_GetPixel,
|
||||
NT35510_SetPixel,
|
||||
NT35510_GetXSize,
|
||||
NT35510_GetYSize,
|
||||
};
|
||||
|
||||
static NT35510_LCD_Ctx_t NT35510Ctx;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup NT35510_Private_Constants NT35510 Private Constants
|
||||
* @{
|
||||
*/
|
||||
static const uint8_t nt35510_madctl_portrait[] = {NT35510_CMD_MADCTL ,0x00};
|
||||
static const uint8_t nt35510_caset_portrait[] = {0x00, 0x00, 0x01, 0xDF ,NT35510_CMD_CASET};
|
||||
static const uint8_t nt35510_raset_portrait[] = {0x00, 0x00, 0x03, 0x1F ,NT35510_CMD_RASET};
|
||||
static const uint8_t nt35510_madctl_landscape[] = {NT35510_CMD_MADCTL, 0x60};
|
||||
static const uint8_t nt35510_caset_landscape[] = {0x00, 0x00, 0x03, 0x1F ,NT35510_CMD_CASET};
|
||||
static const uint8_t nt35510_raset_landscape[] = {0x00, 0x00, 0x01, 0xDF ,NT35510_CMD_RASET};
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Private macros ------------------------------------------------------------*/
|
||||
/* Private functions ---------------------------------------------------------*/
|
||||
/** @defgroup NT35510_Private_FunctionsPrototyes NT35510 Private_Functions Prototyes
|
||||
* @{
|
||||
*/
|
||||
static int32_t NT35510_ReadRegWrap(void *Handle, uint16_t Reg, uint8_t* Data, uint16_t Length);
|
||||
static int32_t NT35510_WriteRegWrap(void *Handle, uint16_t Reg, uint8_t *pData, uint16_t Length);
|
||||
static int32_t NT35510_IO_Delay(NT35510_Object_t *pObj, uint32_t Delay);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup NT35510_Exported_Variables
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported functions ---------------------------------------------------------*/
|
||||
/** @defgroup NT35510_Exported_Functions NT35510 Exported Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Register component IO bus
|
||||
* @param Component object pointer
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t NT35510_RegisterBusIO (NT35510_Object_t *pObj, NT35510_IO_t *pIO)
|
||||
{
|
||||
int32_t ret = NT35510_OK;
|
||||
|
||||
if(pObj == NULL)
|
||||
{
|
||||
ret = NT35510_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
pObj->IO.WriteReg = pIO->WriteReg;
|
||||
pObj->IO.ReadReg = pIO->ReadReg;
|
||||
pObj->IO.GetTick = pIO->GetTick;
|
||||
|
||||
pObj->Ctx.ReadReg = NT35510_ReadRegWrap;
|
||||
pObj->Ctx.WriteReg = NT35510_WriteRegWrap;
|
||||
pObj->Ctx.handle = pObj;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Initializes the LCD KoD display part by communication in DSI mode in Video Mode
|
||||
* with IC Display Driver NT35510 (see IC Driver specification for more information).
|
||||
* @param pObj Component object
|
||||
* @param ColorCoding Color Code
|
||||
* @param Orientation Display orientation
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t NT35510_Init(NT35510_Object_t *pObj, uint32_t ColorCoding, uint32_t Orientation)
|
||||
{
|
||||
/* ************************************************************************** */
|
||||
/* Proprietary Initialization */
|
||||
/* ************************************************************************** */
|
||||
int32_t ret;
|
||||
static const uint8_t nt35510_reg[] = {0x55, 0xAA, 0x52, 0x08, 0x01};
|
||||
static const uint8_t nt35510_reg1[] = {0x03, 0x03, 0x03};
|
||||
static const uint8_t nt35510_reg2[] = {0x46, 0x46, 0x46};
|
||||
static const uint8_t nt35510_reg3[] = {0x03, 0x03, 0x03};
|
||||
static const uint8_t nt35510_reg4[] = {0x36, 0x36, 0x36};
|
||||
static const uint8_t nt35510_reg5[] = {0x00, 0x00, 0x02};
|
||||
static const uint8_t nt35510_reg6[] = {0x26, 0x26, 0x26};
|
||||
static const uint8_t nt35510_reg7[] = {0x01,0x01};
|
||||
static const uint8_t nt35510_reg8[] = {0x09, 0x09, 0x09};
|
||||
static const uint8_t nt35510_reg9[] = {0x36, 0x36, 0x36};
|
||||
static const uint8_t nt35510_reg10[] = {0x08, 0x08, 0x08};
|
||||
static const uint8_t nt35510_reg12[] = {0x26, 0x26, 0x26};
|
||||
static const uint8_t nt35510_reg13[] = {0x00, 0x80, 0x00};
|
||||
static const uint8_t nt35510_reg14[] = {0x00, 0x80, 0x00};
|
||||
static const uint8_t nt35510_reg15[] = {0x00, 0x50};
|
||||
static const uint8_t nt35510_reg16[] = {0x55, 0xAA, 0x52, 0x08, 0x00};
|
||||
static const uint8_t nt35510_reg17[] = {0xFC, 0x00};
|
||||
static const uint8_t nt35510_reg18[] = {0x03, 0x03};
|
||||
static const uint8_t nt35510_reg19[] = {0x50, 0x50};
|
||||
static const uint8_t nt35510_reg20[] = {0x00, 0x00};
|
||||
|
||||
static const uint8_t nt35510_reg21[] = {0x01, 0x02, 0x02, 0x02};
|
||||
static const uint8_t nt35510_reg22[] = {0x00, 0x00, 0x00};
|
||||
static const uint8_t nt35510_reg23[] = {0x03, 0x00, 0x00};
|
||||
static const uint8_t nt35510_reg24[] = {0x01, 0x01};
|
||||
|
||||
static const uint8_t nt35510_reg27[] = {NT35510_CMD_SLPOUT, 0x00}; /* Sleep out */
|
||||
static const uint8_t nt35510_reg30[] = {NT35510_CMD_DISPON, 0x00};
|
||||
|
||||
static const uint8_t nt35510_reg31[] = {NT35510_CMD_WRDISBV, 0x7F};
|
||||
static const uint8_t nt35510_reg32[] = {NT35510_CMD_WRCTRLD, 0x2C};
|
||||
static const uint8_t nt35510_reg33[] = {NT35510_CMD_WRCABC, 0x02};
|
||||
static const uint8_t nt35510_reg34[] = {NT35510_CMD_WRCABCMB, 0xFF};
|
||||
static const uint8_t nt35510_reg35[] = {NT35510_CMD_RAMWR, 0x00};
|
||||
static const uint8_t nt35510_reg36[] = {NT35510_CMD_COLMOD, NT35510_COLMOD_RGB565};
|
||||
static const uint8_t nt35510_reg37[] = {NT35510_CMD_COLMOD, NT35510_COLMOD_RGB888};
|
||||
|
||||
ret = nt35510_write_reg(&pObj->Ctx, 0xF0, nt35510_reg, 5);/* LV2: Page 1 enable */
|
||||
ret += nt35510_write_reg(&pObj->Ctx, 0xB0, nt35510_reg1, 3);/* AVDD: 5.2V */
|
||||
ret += nt35510_write_reg(&pObj->Ctx, 0xB6, nt35510_reg2, 3); /* AVDD: Ratio */
|
||||
ret += nt35510_write_reg(&pObj->Ctx, 0xB1, nt35510_reg3, 3);/* AVEE: -5.2V */
|
||||
ret += nt35510_write_reg(&pObj->Ctx, 0xB7, nt35510_reg4, 3);/* AVEE: Ratio */
|
||||
ret += nt35510_write_reg(&pObj->Ctx, 0xB2, nt35510_reg5, 3);/* VCL: -2.5V */
|
||||
ret += nt35510_write_reg(&pObj->Ctx, 0xB8, nt35510_reg6, 3);/* VCL: Ratio */
|
||||
ret += nt35510_write_reg(&pObj->Ctx, 0xBF, nt35510_reg7, 1);/* VGH: 15V (Free Pump) */
|
||||
ret += nt35510_write_reg(&pObj->Ctx, 0xB3, nt35510_reg8, 3);
|
||||
ret += nt35510_write_reg(&pObj->Ctx, 0xB9, nt35510_reg9, 3);/* VGH: Ratio */
|
||||
ret += nt35510_write_reg(&pObj->Ctx, 0xB5, nt35510_reg10, 3);/* VGL_REG: -10V */
|
||||
ret += nt35510_write_reg(&pObj->Ctx, 0xBA, nt35510_reg12, 3);/* VGLX: Ratio */
|
||||
ret += nt35510_write_reg(&pObj->Ctx, 0xBC, nt35510_reg13, 3);/* VGMP/VGSP: 4.5V/0V */
|
||||
ret += nt35510_write_reg(&pObj->Ctx, 0xBD, nt35510_reg14, 3);/* VGMN/VGSN:-4.5V/0V */
|
||||
ret += nt35510_write_reg(&pObj->Ctx, 0xBE, nt35510_reg15, 2);/* VCOM: -1.325V */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* Proprietary DCS Initialization */
|
||||
/* ************************************************************************** */
|
||||
|
||||
ret += nt35510_write_reg(&pObj->Ctx, 0xF0, nt35510_reg16, 5);/* LV2: Page 0 enable */
|
||||
ret += nt35510_write_reg(&pObj->Ctx, 0xB1, nt35510_reg17, 2);/* Display optional control */
|
||||
ret += nt35510_write_reg(&pObj->Ctx, 0xB6, nt35510_reg18, 1);/* Set source output data hold time */
|
||||
ret += nt35510_write_reg(&pObj->Ctx, 0xB5, nt35510_reg19, 1);/*Display resolution control */
|
||||
ret += nt35510_write_reg(&pObj->Ctx, 0xB7, nt35510_reg20, 2);/* Gate EQ control */
|
||||
ret += nt35510_write_reg(&pObj->Ctx, 0xB8, nt35510_reg21, 4);/* Src EQ control(Mode2) */
|
||||
ret += nt35510_write_reg(&pObj->Ctx, 0xBC, nt35510_reg22, 3);
|
||||
ret += nt35510_write_reg(&pObj->Ctx, 0xCC, nt35510_reg23, 3);
|
||||
ret += nt35510_write_reg(&pObj->Ctx, 0xBA, nt35510_reg24, 1);
|
||||
|
||||
/* Add a delay, otherwise MADCTL not taken */
|
||||
(void)NT35510_IO_Delay(pObj, 200);
|
||||
|
||||
/* Configure orientation */
|
||||
if(Orientation == NT35510_ORIENTATION_PORTRAIT)
|
||||
{
|
||||
ret += nt35510_write_reg(&pObj->Ctx, NT35510_CMD_MADCTL, &nt35510_madctl_portrait[1], 0);
|
||||
ret += nt35510_write_reg(&pObj->Ctx, NT35510_CMD_CASET, nt35510_caset_portrait, 4);
|
||||
ret += nt35510_write_reg(&pObj->Ctx, NT35510_CMD_RASET, nt35510_raset_portrait, 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret += nt35510_write_reg(&pObj->Ctx, NT35510_CMD_MADCTL, &nt35510_madctl_landscape[1], 0);
|
||||
ret += nt35510_write_reg(&pObj->Ctx, NT35510_CMD_CASET, nt35510_caset_landscape, 4);
|
||||
ret += nt35510_write_reg(&pObj->Ctx, NT35510_CMD_RASET, nt35510_raset_landscape, 4);
|
||||
}
|
||||
|
||||
ret += nt35510_write_reg(&pObj->Ctx, NT35510_CMD_SLPOUT, &nt35510_reg27[1], 0);
|
||||
|
||||
/* Wait for sleep out exit */
|
||||
(void)NT35510_IO_Delay(pObj, 20);
|
||||
|
||||
switch(ColorCoding)
|
||||
{
|
||||
case NT35510_FORMAT_RBG565 :
|
||||
/* Set Pixel color format to RGB565 */
|
||||
ret += nt35510_write_reg(&pObj->Ctx, NT35510_CMD_COLMOD, &nt35510_reg36[1], 0);
|
||||
NT35510Ctx.ColorCode = NT35510_FORMAT_RBG565;
|
||||
break;
|
||||
case NT35510_FORMAT_RGB888 :
|
||||
/* Set Pixel color format to RGB888 */
|
||||
ret += nt35510_write_reg(&pObj->Ctx, NT35510_CMD_COLMOD, &nt35510_reg37[1], 0);
|
||||
NT35510Ctx.ColorCode = NT35510_FORMAT_RGB888;
|
||||
break;
|
||||
default :
|
||||
/* Set Pixel color format to RGB888 */
|
||||
ret += nt35510_write_reg(&pObj->Ctx, NT35510_CMD_COLMOD, &nt35510_reg37[1], 0);
|
||||
NT35510Ctx.ColorCode = NT35510_FORMAT_RGB888;
|
||||
break;
|
||||
}
|
||||
|
||||
/** CABC : Content Adaptive Backlight Control section start >> */
|
||||
/* Note : defaut is 0 (lowest Brightness], 0xFF is highest Brightness, try 0x7F : intermediate value */
|
||||
ret += nt35510_write_reg(&pObj->Ctx, NT35510_CMD_WRDISBV, &nt35510_reg31[1], 0);
|
||||
|
||||
/* defaut is 0, try 0x2C - Brightness Control Block, Display Dimming & BackLight on */
|
||||
ret += nt35510_write_reg(&pObj->Ctx, NT35510_CMD_WRCTRLD, &nt35510_reg32[1], 0);
|
||||
|
||||
/* defaut is 0, try 0x02 - image Content based Adaptive Brightness [Still Picture] */
|
||||
ret += nt35510_write_reg(&pObj->Ctx, NT35510_CMD_WRCABC, &nt35510_reg33[1], 0);
|
||||
|
||||
/* defaut is 0 (lowest Brightness], 0xFF is highest Brightness */
|
||||
ret += nt35510_write_reg(&pObj->Ctx, NT35510_CMD_WRCABCMB, &nt35510_reg34[1], 0);
|
||||
|
||||
/** CABC : Content Adaptive Backlight Control section end << */
|
||||
|
||||
/* Send Command Display On */
|
||||
ret += nt35510_write_reg(&pObj->Ctx, NT35510_CMD_DISPON, &nt35510_reg30[1], 0);
|
||||
|
||||
/* Send Command GRAM memory write (no parameters) : this initiates frame write via other DSI commands sent by */
|
||||
/* DSI host from LTDC incoming pixels in video mode */
|
||||
ret += nt35510_write_reg(&pObj->Ctx, NT35510_CMD_RAMWR, &nt35510_reg35[1], 0);
|
||||
|
||||
if(ret != NT35510_OK)
|
||||
{
|
||||
ret = NT35510_ERROR;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief De-Initializes the component
|
||||
* @param pObj Component object
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t NT35510_DeInit(NT35510_Object_t *pObj)
|
||||
{
|
||||
return NT35510_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Read the component ID.
|
||||
* @param pObj Component object
|
||||
* @param Id Component ID
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t NT35510_ReadID(NT35510_Object_t *pObj, uint32_t *Id)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
if(nt35510_read_reg(&pObj->Ctx, NT35510_CMD_RDID2, (uint8_t *)Id, 1)!= NT35510_OK)
|
||||
{
|
||||
ret = NT35510_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = NT35510_OK;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the display brightness.
|
||||
* @param pObj Component object
|
||||
* @param Brightness display brightness to be set
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t NT35510_SetBrightness(NT35510_Object_t *pObj, uint32_t Brightness)
|
||||
{
|
||||
int32_t ret;
|
||||
uint8_t brightness = (uint8_t)((Brightness * 255U)/100U);
|
||||
|
||||
/* Send Display on DCS command to display */
|
||||
if(nt35510_write_reg(&pObj->Ctx, NT35510_CMD_WRDISBV, &brightness, 0) != NT35510_OK)
|
||||
{
|
||||
ret = NT35510_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
NT35510Ctx.Brightness = Brightness;
|
||||
ret = NT35510_OK;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the display brightness.
|
||||
* @param pObj Component object
|
||||
* @param Brightness display brightness to be returned
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t NT35510_GetBrightness(NT35510_Object_t *pObj, uint32_t *Brightness)
|
||||
{
|
||||
*Brightness = NT35510Ctx.Brightness;
|
||||
return NT35510_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the display On.
|
||||
* @param pObj Component object
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t NT35510_DisplayOn(NT35510_Object_t *pObj)
|
||||
{
|
||||
int32_t ret;
|
||||
uint8_t display = 0;
|
||||
|
||||
/* Send Display on DCS command to display */
|
||||
if(nt35510_write_reg(&pObj->Ctx, NT35510_CMD_DISPON, &display, 0) != NT35510_OK)
|
||||
{
|
||||
ret = NT35510_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = NT35510_OK;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the display Off.
|
||||
* @param pObj Component object
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t NT35510_DisplayOff(NT35510_Object_t *pObj)
|
||||
{
|
||||
int32_t ret;
|
||||
uint8_t display = 0;
|
||||
|
||||
/* Send Display on DCS command to display */
|
||||
if(nt35510_write_reg(&pObj->Ctx, NT35510_CMD_DISPOFF, &display, 0) != NT35510_OK)
|
||||
{
|
||||
ret = NT35510_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = NT35510_OK;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the display Orientation.
|
||||
* @param pObj Component object
|
||||
* @param Orientation display Orientation to be set
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t NT35510_SetOrientation(NT35510_Object_t *pObj, uint32_t Orientation)
|
||||
{
|
||||
int32_t ret;
|
||||
uint8_t tmp = NT35510_MADCTR_MODE_LANDSCAPE;
|
||||
uint8_t tmp1 = NT35510_MADCTR_MODE_PORTRAIT;
|
||||
|
||||
if((Orientation != NT35510_ORIENTATION_LANDSCAPE) && (Orientation != NT35510_ORIENTATION_PORTRAIT))
|
||||
{
|
||||
ret = NT35510_ERROR;
|
||||
}/* Send command to configure display orientation mode */
|
||||
else if(Orientation == NT35510_ORIENTATION_LANDSCAPE)
|
||||
{
|
||||
ret = nt35510_write_reg(&pObj->Ctx, NT35510_CMD_RDDMADCTL, &tmp, 0);
|
||||
ret += nt35510_write_reg(&pObj->Ctx, NT35510_CMD_CASET, nt35510_caset_landscape, 4);
|
||||
ret += nt35510_write_reg(&pObj->Ctx, NT35510_CMD_RASET, nt35510_raset_landscape, 4);
|
||||
|
||||
NT35510Ctx.Orientation = NT35510_ORIENTATION_LANDSCAPE;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = nt35510_write_reg(&pObj->Ctx, NT35510_CMD_MADCTL, &tmp1, 0);
|
||||
ret += nt35510_write_reg(&pObj->Ctx, NT35510_CMD_CASET, nt35510_caset_portrait, 4);
|
||||
ret += nt35510_write_reg(&pObj->Ctx, NT35510_CMD_RASET, nt35510_raset_portrait, 4);
|
||||
|
||||
NT35510Ctx.Orientation = NT35510_ORIENTATION_PORTRAIT;
|
||||
}
|
||||
|
||||
if(ret != NT35510_OK)
|
||||
{
|
||||
ret = NT35510_ERROR;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the display Orientation.
|
||||
* @param pObj Component object
|
||||
* @param Orientation display Orientation to be returned
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t NT35510_GetOrientation(NT35510_Object_t *pObj, uint32_t *Orientation)
|
||||
{
|
||||
/* Prevent unused argument(s) compilation warning */
|
||||
(void)(pObj);
|
||||
|
||||
*Orientation = NT35510Ctx.Orientation;
|
||||
|
||||
return NT35510_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the display Width.
|
||||
* @param pObj Component object
|
||||
* @param Xsize display Width to be set
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t NT35510_GetXSize(NT35510_Object_t *pObj, uint32_t *Xsize)
|
||||
{
|
||||
/* Prevent unused argument(s) compilation warning */
|
||||
(void)(pObj);
|
||||
|
||||
switch(NT35510Ctx.Orientation)
|
||||
{
|
||||
case NT35510_ORIENTATION_PORTRAIT:
|
||||
*Xsize = NT35510_480X800_WIDTH;
|
||||
break;
|
||||
case NT35510_ORIENTATION_LANDSCAPE:
|
||||
*Xsize = NT35510_800X480_WIDTH;
|
||||
break;
|
||||
default:
|
||||
*Xsize = NT35510_800X480_WIDTH;
|
||||
break;
|
||||
}
|
||||
|
||||
return NT35510_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the display Height.
|
||||
* @param pObj Component object
|
||||
* @param Ysize display Height to be set
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t NT35510_GetYSize(NT35510_Object_t *pObj, uint32_t *Ysize)
|
||||
{
|
||||
/* Prevent unused argument(s) compilation warning */
|
||||
(void)(pObj);
|
||||
|
||||
switch(NT35510Ctx.Orientation)
|
||||
{
|
||||
case NT35510_ORIENTATION_PORTRAIT:
|
||||
*Ysize = NT35510_480X800_HEIGHT;
|
||||
break;
|
||||
case NT35510_ORIENTATION_LANDSCAPE:
|
||||
*Ysize = NT35510_800X480_HEIGHT;
|
||||
break;
|
||||
default:
|
||||
*Ysize = NT35510_800X480_HEIGHT;
|
||||
break;
|
||||
}
|
||||
|
||||
return NT35510_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the display cursor.
|
||||
* @param pObj Component object
|
||||
* @param Xpos X position
|
||||
* @param Ypos Y position
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t NT35510_SetCursor(NT35510_Object_t *pObj, uint32_t Xpos, uint32_t Ypos)
|
||||
{
|
||||
/* Prevent unused argument(s) compilation warning */
|
||||
(void)(pObj);
|
||||
|
||||
return NT35510_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Draw Bitmap image
|
||||
* @param pObj Component object
|
||||
* @param Xpos X position
|
||||
* @param Ypos Y position
|
||||
* @param pBmp pointer to bmp data
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t NT35510_DrawBitmap(NT35510_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint8_t *pBmp)
|
||||
{
|
||||
/* Prevent unused argument(s) compilation warning */
|
||||
(void)(pObj);
|
||||
|
||||
return NT35510_ERROR;
|
||||
}
|
||||
|
||||
int32_t NT35510_FillRGBRect(NT35510_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint8_t *pData, uint32_t Width, uint32_t Height)
|
||||
{
|
||||
/* Prevent unused argument(s) compilation warning */
|
||||
(void)(pObj);
|
||||
|
||||
return NT35510_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Draw Horizontal Line
|
||||
* @param pObj Component object
|
||||
* @param Xpos X position
|
||||
* @param Ypos Y position
|
||||
* @param Length Line length
|
||||
* @param Color Draw color
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t NT35510_DrawHLine(NT35510_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color)
|
||||
{
|
||||
/* Prevent unused argument(s) compilation warning */
|
||||
(void)(pObj);
|
||||
|
||||
return NT35510_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Draw Vertical line
|
||||
* @param pObj Component object
|
||||
* @param Xpos X position
|
||||
* @param Ypos Y position
|
||||
* @param Length Line length
|
||||
* @param Color Draw color
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t NT35510_DrawVLine(NT35510_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color)
|
||||
{
|
||||
/* Prevent unused argument(s) compilation warning */
|
||||
(void)(pObj);
|
||||
|
||||
return NT35510_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Fill rectangle
|
||||
* @param pObj Component object
|
||||
* @param Xpos X position
|
||||
* @param Ypos Y position
|
||||
* @param Width Rectangle width
|
||||
* @param Height Rectangle height
|
||||
* @param Color Draw color
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t NT35510_FillRect(NT35510_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Width, uint32_t Height, uint32_t Color)
|
||||
{
|
||||
/* Prevent unused argument(s) compilation warning */
|
||||
(void)(pObj);
|
||||
|
||||
return NT35510_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get pixel color
|
||||
* @param pObj Component object
|
||||
* @param Xpos X position
|
||||
* @param Ypos Y position
|
||||
* @param Color Color to be returned
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t NT35510_GetPixel(NT35510_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t *Color)
|
||||
{
|
||||
/* Prevent unused argument(s) compilation warning */
|
||||
(void)(pObj);
|
||||
|
||||
return NT35510_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set pixel color
|
||||
* @param pObj Component object
|
||||
* @param Xpos X position
|
||||
* @param Ypos Y position
|
||||
* @param Color Color to be returned
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t NT35510_SetPixel(NT35510_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Color)
|
||||
{
|
||||
/* Prevent unused argument(s) compilation warning */
|
||||
(void)(pObj);
|
||||
|
||||
return NT35510_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup NT35510_Private_FunctionsPrototyes
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Wrap component ReadReg to Bus Read function
|
||||
* @param Handle Component object handle
|
||||
* @param Reg The target register address to write
|
||||
* @param pData The target register value to be written
|
||||
* @param Length buffer size to be written
|
||||
* @retval error status
|
||||
*/
|
||||
static int32_t NT35510_ReadRegWrap(void *Handle, uint16_t Reg, uint8_t* pData, uint16_t Length)
|
||||
{
|
||||
NT35510_Object_t *pObj = (NT35510_Object_t *)Handle;
|
||||
|
||||
return pObj->IO.ReadReg(pObj->IO.Address, Reg, pData, Length);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Wrap component WriteReg to Bus Write function
|
||||
* @param handle Component object handle
|
||||
* @param Reg The target register address to write
|
||||
* @param pData The target register value to be written
|
||||
* @param Length buffer size to be written
|
||||
* @retval error status
|
||||
*/
|
||||
static int32_t NT35510_WriteRegWrap(void *Handle, uint16_t Reg, uint8_t *pData, uint16_t Length)
|
||||
{
|
||||
NT35510_Object_t *pObj = (NT35510_Object_t *)Handle;
|
||||
|
||||
return pObj->IO.WriteReg(pObj->IO.Address, Reg, pData, Length);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief NT35510 delay
|
||||
* @param Delay Delay in ms
|
||||
*/
|
||||
static int32_t NT35510_IO_Delay(NT35510_Object_t *pObj, uint32_t Delay)
|
||||
{
|
||||
uint32_t tickstart;
|
||||
tickstart = pObj->IO.GetTick();
|
||||
while((pObj->IO.GetTick() - tickstart) < Delay)
|
||||
{
|
||||
}
|
||||
return NT35510_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
@@ -0,0 +1,231 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file nt35510.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the constants parameters for the NT35510
|
||||
* which is the LCD Driver for Frida Techshine 3K138 (WVGA)
|
||||
* DSI LCD Display.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2023 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __NT35510_H
|
||||
#define __NT35510_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "nt35510_reg.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup NT35510
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup NT35510_Exported_Variables
|
||||
* @{
|
||||
*/
|
||||
|
||||
typedef int32_t (*NT35510_GetTick_Func) (void);
|
||||
typedef int32_t (*NT35510_Delay_Func) (uint32_t);
|
||||
typedef int32_t (*NT35510_WriteReg_Func)(uint16_t, uint16_t, uint8_t*, uint16_t);
|
||||
typedef int32_t (*NT35510_ReadReg_Func) (uint16_t, uint16_t, uint8_t*, uint16_t);
|
||||
|
||||
/** @addtogroup NT35510_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t Orientation;
|
||||
uint32_t ColorCode;
|
||||
uint32_t Brightness;
|
||||
} NT35510_LCD_Ctx_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint16_t Address;
|
||||
NT35510_WriteReg_Func WriteReg;
|
||||
NT35510_ReadReg_Func ReadReg;
|
||||
NT35510_GetTick_Func GetTick;
|
||||
} NT35510_IO_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
NT35510_IO_t IO;
|
||||
nt35510_ctx_t Ctx;
|
||||
uint8_t IsInitialized;
|
||||
} NT35510_Object_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* Control functions */
|
||||
int32_t (*Init )(NT35510_Object_t*, uint32_t, uint32_t);
|
||||
int32_t (*DeInit )(NT35510_Object_t*);
|
||||
int32_t (*ReadID )(NT35510_Object_t*, uint32_t*);
|
||||
int32_t (*DisplayOn )(NT35510_Object_t*);
|
||||
int32_t (*DisplayOff )(NT35510_Object_t*);
|
||||
int32_t (*SetBrightness )(NT35510_Object_t*, uint32_t);
|
||||
int32_t (*GetBrightness )(NT35510_Object_t*, uint32_t*);
|
||||
int32_t (*SetOrientation )(NT35510_Object_t*, uint32_t);
|
||||
int32_t (*GetOrientation )(NT35510_Object_t*, uint32_t*);
|
||||
|
||||
/* Drawing functions*/
|
||||
int32_t (*SetCursor )(NT35510_Object_t*, uint32_t, uint32_t);
|
||||
int32_t (*DrawBitmap )(NT35510_Object_t*, uint32_t, uint32_t, uint8_t*);
|
||||
int32_t (*FillRGBRect )(NT35510_Object_t*, uint32_t, uint32_t, uint8_t*, uint32_t, uint32_t);
|
||||
int32_t (*DrawHLine )(NT35510_Object_t*, uint32_t, uint32_t, uint32_t, uint32_t);
|
||||
int32_t (*DrawVLine )(NT35510_Object_t*, uint32_t, uint32_t, uint32_t, uint32_t);
|
||||
int32_t (*FillRect )(NT35510_Object_t*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t);
|
||||
int32_t (*GetPixel )(NT35510_Object_t*, uint32_t, uint32_t, uint32_t*);
|
||||
int32_t (*SetPixel )(NT35510_Object_t*, uint32_t, uint32_t, uint32_t);
|
||||
int32_t (*GetXSize )(NT35510_Object_t*, uint32_t *);
|
||||
int32_t (*GetYSize )(NT35510_Object_t*, uint32_t *);
|
||||
|
||||
}NT35510_LCD_Drv_t;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#define NT35510_OK (0)
|
||||
#define NT35510_ERROR (-1)
|
||||
|
||||
/* NT35510 ID */
|
||||
#define NT35510_ID 0x80U
|
||||
|
||||
/**
|
||||
* @brief LCD_OrientationTypeDef
|
||||
* Possible values of Display Orientation
|
||||
*/
|
||||
#define NT35510_ORIENTATION_PORTRAIT ((uint32_t)0x00) /* Portrait orientation choice of LCD screen */
|
||||
#define NT35510_ORIENTATION_LANDSCAPE ((uint32_t)0x01) /* Landscape orientation choice of LCD screen */
|
||||
|
||||
/**
|
||||
* @brief Possible values of
|
||||
* pixel data format (ie color coding) transmitted on DSI Data lane in DSI packets
|
||||
*/
|
||||
#define NT35510_FORMAT_RGB888 ((uint32_t)0x00) /* Pixel format chosen is RGB888 : 24 bpp */
|
||||
#define NT35510_FORMAT_RBG565 ((uint32_t)0x02) /* Pixel format chosen is RGB565 : 16 bpp */
|
||||
|
||||
/**
|
||||
* @brief nt35510_480x800 Size
|
||||
*/
|
||||
|
||||
/* Width and Height in Portrait mode */
|
||||
#define NT35510_480X800_WIDTH ((uint16_t)480) /* LCD PIXEL WIDTH */
|
||||
#define NT35510_480X800_HEIGHT ((uint16_t)800) /* LCD PIXEL HEIGHT */
|
||||
|
||||
/* Width and Height in Landscape mode */
|
||||
#define NT35510_800X480_WIDTH ((uint16_t)800) /* LCD PIXEL WIDTH */
|
||||
#define NT35510_800X480_HEIGHT ((uint16_t)480) /* LCD PIXEL HEIGHT */
|
||||
|
||||
/**
|
||||
* @brief NT35510_480X800 Timing parameters for Portrait orientation mode
|
||||
*/
|
||||
#define NT35510_480X800_HSYNC ((uint16_t)2) /* Horizontal synchronization */
|
||||
#define NT35510_480X800_HBP ((uint16_t)34) /* Horizontal back porch */
|
||||
#define NT35510_480X800_HFP ((uint16_t)34) /* Horizontal front porch */
|
||||
|
||||
#define NT35510_480X800_VSYNC ((uint16_t)120) /* Vertical synchronization */
|
||||
#define NT35510_480X800_VBP ((uint16_t)150) /* Vertical back porch */
|
||||
#define NT35510_480X800_VFP ((uint16_t)150) /* Vertical front porch */
|
||||
|
||||
/**
|
||||
* @brief NT35510_800X480 Timing parameters for Landscape orientation mode
|
||||
* Same values as for Portrait mode in fact.
|
||||
*/
|
||||
#define NT35510_800X480_HSYNC NT35510_480X800_VSYNC /* Horizontal synchronization */
|
||||
#define NT35510_800X480_HBP NT35510_480X800_VBP /* Horizontal back porch */
|
||||
#define NT35510_800X480_HFP NT35510_480X800_VFP /* Horizontal front porch */
|
||||
#define NT35510_800X480_VSYNC NT35510_480X800_HSYNC /* Vertical synchronization */
|
||||
#define NT35510_800X480_VBP NT35510_480X800_HBP /* Vertical back porch */
|
||||
#define NT35510_800X480_VFP NT35510_480X800_HFP /* Vertical front porch */
|
||||
|
||||
/**
|
||||
* @brief NT35510_480X800 frequency divider
|
||||
*/
|
||||
#define NT35510_480X800_FREQUENCY_DIVIDER 2 /* LCD Frequency divider */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
|
||||
/** @defgroup NT35510_Exported_Macros NT35510 Exported Macros
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup NT35510_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
int32_t NT35510_RegisterBusIO (NT35510_Object_t *pObj, NT35510_IO_t *pIO);
|
||||
int32_t NT35510_Init(NT35510_Object_t *pObj, uint32_t ColorCoding, uint32_t Orientation);
|
||||
int32_t NT35510_DeInit(NT35510_Object_t *pObj);
|
||||
int32_t NT35510_ReadID(NT35510_Object_t *pObj, uint32_t *Id);
|
||||
int32_t NT35510_DisplayOn(NT35510_Object_t *pObj);
|
||||
int32_t NT35510_DisplayOff(NT35510_Object_t *pObj);
|
||||
int32_t NT35510_SetBrightness(NT35510_Object_t *pObj, uint32_t Brightness);
|
||||
int32_t NT35510_GetBrightness(NT35510_Object_t *pObj, uint32_t *Brightness);
|
||||
int32_t NT35510_SetOrientation(NT35510_Object_t *pObj, uint32_t Orientation);
|
||||
int32_t NT35510_GetOrientation(NT35510_Object_t *pObj, uint32_t *Orientation);
|
||||
|
||||
|
||||
int32_t NT35510_SetCursor(NT35510_Object_t *pObj, uint32_t Xpos, uint32_t Ypos);
|
||||
int32_t NT35510_DrawBitmap(NT35510_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint8_t *pBmp);
|
||||
int32_t NT35510_FillRGBRect(NT35510_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint8_t *pData, uint32_t Width, uint32_t Height);
|
||||
int32_t NT35510_DrawHLine(NT35510_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color);
|
||||
int32_t NT35510_DrawVLine(NT35510_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color);
|
||||
int32_t NT35510_FillRect(NT35510_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Width, uint32_t Height, uint32_t Color);
|
||||
int32_t NT35510_SetPixel(NT35510_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Color);
|
||||
int32_t NT35510_GetPixel(NT35510_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t *Color);
|
||||
int32_t NT35510_GetXSize(NT35510_Object_t *pObj, uint32_t *XSize);
|
||||
int32_t NT35510_GetYSize(NT35510_Object_t *pObj, uint32_t *YSize);
|
||||
|
||||
extern NT35510_LCD_Drv_t NT35510_LCD_Driver;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __NT35510_H */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
@@ -0,0 +1,84 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file nt35510_reg.c
|
||||
* @author MCD Application Team
|
||||
* @brief This file provides generic register APIs to read/write the NT35510
|
||||
* controller's registers
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2023 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "nt35510_reg.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup NT35510
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Private types -------------------------------------------------------------*/
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
/* Private constants ---------------------------------------------------------*/
|
||||
/** @defgroup NT35510_Private_Constants NT35510 Private Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Private macros ------------------------------------------------------------*/
|
||||
/* Private functions ---------------------------------------------------------*/
|
||||
|
||||
/************** Generic Function *******************/
|
||||
/*******************************************************************************
|
||||
* Function Name : nt35510_read_reg
|
||||
* Description : Generic Reading function. It must be fullfilled with either
|
||||
* I2C or SPI reading functions
|
||||
* Input : Register Address, length of buffer
|
||||
* Output : Data Read
|
||||
*******************************************************************************/
|
||||
int32_t nt35510_read_reg(nt35510_ctx_t *ctx, uint16_t reg, uint8_t *pdata, uint16_t length)
|
||||
{
|
||||
return ctx->ReadReg(ctx->handle, reg, pdata, length);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : nt35510_write_reg
|
||||
* Description : Generic Writing function. It must be fullfilled with either
|
||||
* I2C or SPI writing function
|
||||
* Input : Register Address, Data to be written, length of buffer
|
||||
* Output : None
|
||||
*******************************************************************************/
|
||||
int32_t nt35510_write_reg(nt35510_ctx_t *ctx, uint16_t reg, const uint8_t *pdata, uint16_t length)
|
||||
{
|
||||
return ctx->WriteReg(ctx->handle, reg, (uint8_t *)pdata, length);
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
@@ -0,0 +1,202 @@
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file nt35510_reg.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the constants parameters for the NT35510
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2023 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef NT35510_REG_H
|
||||
#define NT35510_REG_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <cmsis_compiler.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup NT35510
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/** @defgroup NT35510_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* List of NT35510 used commands */
|
||||
/* Detailed in NT35510 Data Sheet v0.80 */
|
||||
/* Version of 10/28/2011 */
|
||||
/* Command, NumberOfArguments */
|
||||
|
||||
#define NT35510_CMD_NOP 0x00 /* NOP */
|
||||
#define NT35510_CMD_SWRESET 0x01 /* SW reset */
|
||||
#define NT35510_CMD_RDDID 0x04 /* Read display ID */
|
||||
#define NT35510_CMD_RDNUMED 0x05 /* Read number of errors on DSI */
|
||||
#define NT35510_CMD_RDDPM 0x0A /* Read display power mode */
|
||||
#define NT35510_CMD_RDDMADCTL 0x0B /* Read display MADCTL */
|
||||
#define NT35510_CMD_RDDCOLMOD 0x0C /* Read display pixel format */
|
||||
#define NT35510_CMD_RDDIM 0x0D /* Read display image mode */
|
||||
#define NT35510_CMD_RDDSM 0x0E /* Read display signal mode */
|
||||
#define NT35510_CMD_RDDSDR 0x0F /* Read display self-diagnostics result */
|
||||
#define NT35510_CMD_SLPIN 0x10 /* Sleep in */
|
||||
#define NT35510_CMD_SLPOUT 0x11 /* Sleep out */
|
||||
#define NT35510_CMD_PTLON 0x12 /* Partial mode on */
|
||||
#define NT35510_CMD_NORON 0x13 /* Normal display mode on */
|
||||
#define NT35510_CMD_INVOFF 0x20 /* Display inversion off */
|
||||
#define NT35510_CMD_INVON 0x21 /* Display inversion on */
|
||||
#define NT35510_CMD_ALLPOFF 0x22 /* All pixel off */
|
||||
#define NT35510_CMD_ALLPON 0x23 /* All pixel on */
|
||||
#define NT35510_CMD_GAMSET 0x26 /* Gamma set */
|
||||
#define NT35510_CMD_DISPOFF 0x28 /* Display off */
|
||||
#define NT35510_CMD_DISPON 0x29 /* Display on */
|
||||
#define NT35510_CMD_CASET 0x2A /* Column address set */
|
||||
#define NT35510_CMD_RASET 0x2B /* Row address set */
|
||||
#define NT35510_CMD_RAMWR 0x2C /* Memory write */
|
||||
#define NT35510_CMD_RAMRD 0x2E /* Memory read */
|
||||
#define NT35510_CMD_PLTAR 0x30 /* Partial area */
|
||||
#define NT35510_CMD_TOPC 0x32 /* Turn On Peripheral Command */
|
||||
#define NT35510_CMD_TEOFF 0x34 /* Tearing effect line off */
|
||||
#define NT35510_CMD_TEEON 0x35 /* Tearing effect line on */
|
||||
#define NT35510_CMD_MADCTL 0x36 /* Memory data access control */
|
||||
#define NT35510_CMD_IDMOFF 0x38 /* Idle mode off */
|
||||
#define NT35510_CMD_IDMON 0x39 /* Idle mode on */
|
||||
#define NT35510_CMD_COLMOD 0x3A /* Interface pixel format */
|
||||
#define NT35510_CMD_RAMWRC 0x3C /* Memory write continue */
|
||||
#define NT35510_CMD_RAMRDC 0x3E /* Memory read continue */
|
||||
#define NT35510_CMD_STESL 0x44 /* Set tearing effect scan line */
|
||||
#define NT35510_CMD_GSL 0x45 /* Get scan line */
|
||||
|
||||
#define NT35510_CMD_DSTBON 0x4F /* Deep standby mode on */
|
||||
#define NT35510_CMD_WRPFD 0x50 /* Write profile value for display */
|
||||
#define NT35510_CMD_WRDISBV 0x51 /* Write display brightness */
|
||||
#define NT35510_CMD_RDDISBV 0x52 /* Read display brightness */
|
||||
#define NT35510_CMD_WRCTRLD 0x53 /* Write CTRL display */
|
||||
#define NT35510_CMD_RDCTRLD 0x54 /* Read CTRL display value */
|
||||
#define NT35510_CMD_WRCABC 0x55 /* Write content adaptative brightness control */
|
||||
#define NT35510_CMD_RDCABC 0x56 /* Read content adaptive brightness control */
|
||||
#define NT35510_CMD_WRHYSTE 0x57 /* Write hysteresis */
|
||||
#define NT35510_CMD_WRGAMMSET 0x58 /* Write gamme setting */
|
||||
#define NT35510_CMD_RDFSVM 0x5A /* Read FS value MSBs */
|
||||
#define NT35510_CMD_RDFSVL 0x5B /* Read FS value LSBs */
|
||||
#define NT35510_CMD_RDMFFSVM 0x5C /* Read median filter FS value MSBs */
|
||||
#define NT35510_CMD_RDMFFSVL 0x5D /* Read median filter FS value LSBs */
|
||||
#define NT35510_CMD_WRCABCMB 0x5E /* Write CABC minimum brightness */
|
||||
#define NT35510_CMD_RDCABCMB 0x5F /* Read CABC minimum brightness */
|
||||
#define NT35510_CMD_WRLSCC 0x65 /* Write light sensor compensation coefficient value */
|
||||
#define NT35510_CMD_RDLSCCM 0x66 /* Read light sensor compensation coefficient value MSBs */
|
||||
#define NT35510_CMD_RDLSCCL 0x67 /* Read light sensor compensation coefficient value LSBs */
|
||||
#define NT35510_CMD_RDBWLB 0x70 /* Read black/white low bits */
|
||||
#define NT35510_CMD_RDBKX 0x71 /* Read Bkx */
|
||||
#define NT35510_CMD_RDBKY 0x72 /* Read Bky */
|
||||
#define NT35510_CMD_RDWX 0x73 /* Read Wx */
|
||||
#define NT35510_CMD_RDWY 0x74 /* Read Wy */
|
||||
#define NT35510_CMD_RDRGLB 0x75 /* Read red/green low bits */
|
||||
#define NT35510_CMD_RDRX 0x76 /* Read Rx */
|
||||
#define NT35510_CMD_RDRY 0x77 /* Read Ry */
|
||||
#define NT35510_CMD_RDGX 0x78 /* Read Gx */
|
||||
#define NT35510_CMD_RDGY 0x79 /* Read Gy */
|
||||
#define NT35510_CMD_RDBALB 0x7A /* Read blue/acolor low bits */
|
||||
#define NT35510_CMD_RDBX 0x7B /* Read Bx */
|
||||
#define NT35510_CMD_RDBY 0x7C /* Read By */
|
||||
#define NT35510_CMD_RDAX 0x7D /* Read Ax */
|
||||
#define NT35510_CMD_RDAY 0x7E /* Read Ay */
|
||||
#define NT35510_CMD_RDDDBS 0xA1 /* Read DDB start */
|
||||
#define NT35510_CMD_RDDDBC 0xA8 /* Read DDB continue */
|
||||
#define NT35510_CMD_RDDCS 0xAA /* Read first checksum */
|
||||
#define NT35510_CMD_RDCCS 0xAF /* Read continue checksum */
|
||||
#define NT35510_CMD_RDID1 0xDA /* Read ID1 value */
|
||||
#define NT35510_CMD_RDID2 0xDB /* Read ID2 value */
|
||||
#define NT35510_CMD_RDID3 0xDC /* Read ID3 value */
|
||||
|
||||
/* Parameter TELOM : Tearing Effect Line Output Mode : possible values */
|
||||
#define NT35510_TEEON_TELOM_VBLANKING_INFO_ONLY 0x00
|
||||
#define NT35510_TEEON_TELOM_VBLANKING_AND_HBLANKING_INFO 0x01
|
||||
|
||||
/* Possible used values of MADCTR */
|
||||
#define NT35510_MADCTR_MODE_PORTRAIT 0x00
|
||||
#define NT35510_MADCTR_MODE_LANDSCAPE 0x60 /* MY = 0, MX = 1, MV = 1, ML = 0, RGB = 0 */
|
||||
|
||||
/* Possible values of COLMOD parameter corresponding to used pixel formats */
|
||||
#define NT35510_COLMOD_RGB565 0x55
|
||||
#define NT35510_COLMOD_RGB888 0x77
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
|
||||
/** @defgroup NT35510_Exported_Macros NT35510 Exported Macros
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup NT35510_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
/************** Generic Function *******************/
|
||||
|
||||
typedef int32_t (*NT35510_Write_Func)(void *, uint16_t, uint8_t*, uint16_t);
|
||||
typedef int32_t (*NT35510_Read_Func) (void *, uint16_t, uint8_t*, uint16_t);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
NT35510_Write_Func WriteReg;
|
||||
NT35510_Read_Func ReadReg;
|
||||
void *handle;
|
||||
} nt35510_ctx_t;
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : Generic - All
|
||||
* Address : Generic - All
|
||||
* Bit Group Name: None
|
||||
* Permission : W
|
||||
*******************************************************************************/
|
||||
int32_t nt35510_read_reg(nt35510_ctx_t *ctx, uint16_t reg, uint8_t *pdata, uint16_t length);
|
||||
int32_t nt35510_write_reg(nt35510_ctx_t *ctx, uint16_t reg, const uint8_t *pdata, uint16_t length);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* NT35510_REG_H */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
Reference in New Issue
Block a user