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,135 @@
|
||||
<!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 STMPE811 Component Driver</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.css" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-lg-4">
|
||||
<div class="card fluid">
|
||||
<div class="sectione dark">
|
||||
<center>
|
||||
<h1 id="release-notes-for-stmpe811-component-driver"><strong>Release Notes for STMPE811 Component Driver</strong></h1>
|
||||
<p>Copyright © 2014 STMicroelectronics<br />
|
||||
</p>
|
||||
<a href="https://www.st.com" class="logo"><img src="_htmresc/st_logo.png" alt="ST logo" /></a>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
<h1 id="license">License</h1>
|
||||
This software component is licensed by ST under BSD 3-Clause license, the “License”; You may not use this component except in compliance with the License. You may obtain a copy of the License at:
|
||||
<center>
|
||||
<a href="https://opensource.org/licenses/BSD-3-Clause">https://opensource.org/licenses/BSD-3-Clause</a>
|
||||
</center>
|
||||
<h1 id="purpose">Purpose</h1>
|
||||
<p>This driver provides a set of functions needed to drive STMPE811, IOExpander component</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-section6" checked aria-hidden="true"> <label for="collapse-section6" aria-hidden="true">V3.0.0 / 23-November-2019</label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<ul>
|
||||
<li>First Official release of component drivers for STMPE811 in line with STM32Cube BSP drivers development guidelines (UM2298)</li>
|
||||
<li>The component drivers are composed of
|
||||
<ul>
|
||||
<li>component core drivers files: stmpe811.h/.c</li>
|
||||
<li>component register drivers files: stmpe811_reg.h/.c</li>
|
||||
<li>component configuration file: stmpe811_conf_template.h</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<h2 id="backward-compatibility">Backward Compatibility</h2>
|
||||
<ul>
|
||||
<li>This version breaks the compatibility with previous versions</li>
|
||||
</ul>
|
||||
<h2 id="dependencies">Dependencies</h2>
|
||||
<ul>
|
||||
<li>This software release is compatible with BSP Common V6.0.0 or above</li>
|
||||
</ul>
|
||||
<h2 id="notes">Notes</h2>
|
||||
<ul>
|
||||
<li>stmpe811_conf_template.h file must be copied in user application as stmpe811_conf.h with optional configuration update</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section5" checked aria-hidden="true"> <label for="collapse-section5" aria-hidden="true">V2.0.1 / 05-June-2017</label>
|
||||
<div>
|
||||
<h2 id="main-changes-1">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Update comments to be used for PDSC generation</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section4" checked aria-hidden="true"> <label for="collapse-section4" aria-hidden="true">V2.0.0 / 15-December-2014</label>
|
||||
<div>
|
||||
<h2 id="main-changes-2">Main Changes</h2>
|
||||
<ul>
|
||||
<li>All functions:
|
||||
<ul>
|
||||
<li>update IO_Pin parameter to uint32_t instead of uint16_t</li>
|
||||
</ul></li>
|
||||
<li>Add a return value for STMPE811_IO_Config() function</li>
|
||||
</ul>
|
||||
<h2 id="backward-compatibility-1">Backward Compatibility</h2>
|
||||
<ul>
|
||||
<li>This version breaks the compatibility with previous versions</li>
|
||||
</ul>
|
||||
<h2 id="dependencies-1">Dependencies</h2>
|
||||
<ul>
|
||||
<li>This software release is compatible with BSP Common V2.0.0</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section3" checked aria-hidden="true"> <label for="collapse-section3" aria-hidden="true">V1.0.2 / 02-December-2014</label>
|
||||
<div>
|
||||
<h2 id="main-changes-3">Main Changes</h2>
|
||||
<ul>
|
||||
<li>st7735.h: change “" by”/" in the include path to fix compilation issues under Linux.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section2" checked aria-hidden="true"> <label for="collapse-section2" aria-hidden="true">V1.0.1 / 11-November-2014</label>
|
||||
<div>
|
||||
<h2 id="main-changes-4">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Fix limitation related to the selection of alternate function for TS physical IO</li>
|
||||
<li>Fix wrong pins definition of the TS</li>
|
||||
<li>Swap implementation of STMPE811_IO_EnableAF() and STMPE811_IO_DisableAF() functions</li>
|
||||
<li>Miscellaneous code cleanup of comments update</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section1" checked aria-hidden="true"> <label for="collapse-section1" aria-hidden="true">V1.0.0 / 18-February-2014</label>
|
||||
<div>
|
||||
<h2 id="main-changes-5">Main Changes</h2>
|
||||
<ul>
|
||||
<li>First official release of <strong>STMPE811</strong> IOExpander driver</li>
|
||||
</ul>
|
||||
</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</a></span>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,145 @@
|
||||
---
|
||||
pagetitle: Release Notes for STMPE811 Component Driver
|
||||
lang: en
|
||||
---
|
||||
|
||||
::: {.row}
|
||||
::: {.col-sm-12 .col-lg-4}
|
||||
|
||||
::: {.card .fluid}
|
||||
::: {.sectione .dark}
|
||||
<center>
|
||||
# **Release Notes for STMPE811 Component Driver**
|
||||
Copyright © 2014 STMicroelectronics\
|
||||
|
||||
[](https://www.st.com){.logo}
|
||||
</center>
|
||||
:::
|
||||
:::
|
||||
|
||||
# License
|
||||
|
||||
This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this component except in
|
||||
compliance with the License. You may obtain a copy of the License at:
|
||||
<center>
|
||||
[https://opensource.org/licenses/BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause)
|
||||
</center>
|
||||
|
||||
# Purpose
|
||||
|
||||
This driver provides a set of functions needed to drive STMPE811, IOExpander component
|
||||
|
||||
:::
|
||||
|
||||
::: {.col-sm-12 .col-lg-8}
|
||||
|
||||
# Update History
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section6" checked aria-hidden="true">
|
||||
<label for="collapse-section6" aria-hidden="true">V3.0.0 / 23-November-2019</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- First Official release of component drivers for STMPE811 in line with STM32Cube BSP drivers development guidelines (UM2298)
|
||||
- The component drivers are composed of
|
||||
- component core drivers files: stmpe811.h/.c
|
||||
- component register drivers files: stmpe811_reg.h/.c
|
||||
- component configuration file: stmpe811_conf_template.h
|
||||
|
||||
## Backward Compatibility
|
||||
|
||||
- This version breaks the compatibility with previous versions
|
||||
|
||||
## Dependencies
|
||||
|
||||
- This software release is compatible with BSP Common V6.0.0 or above
|
||||
|
||||
## Notes
|
||||
|
||||
- stmpe811_conf_template.h file must be copied in user application as stmpe811_conf.h with optional configuration update
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section5" checked aria-hidden="true">
|
||||
<label for="collapse-section5" aria-hidden="true">V2.0.1 / 05-June-2017</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- Update comments to be used for PDSC generation
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section4" checked aria-hidden="true">
|
||||
<label for="collapse-section4" aria-hidden="true">V2.0.0 / 15-December-2014</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- All functions:
|
||||
- update IO_Pin parameter to uint32_t instead of uint16_t
|
||||
- Add a return value for STMPE811_IO_Config() function
|
||||
|
||||
## Backward Compatibility
|
||||
|
||||
- This version breaks the compatibility with previous versions
|
||||
|
||||
## Dependencies
|
||||
|
||||
- This software release is compatible with BSP Common V2.0.0
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section3" checked aria-hidden="true">
|
||||
<label for="collapse-section3" aria-hidden="true">V1.0.2 / 02-December-2014</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- st7735.h: change "\" by "/" in the include path to fix compilation issues under Linux.
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section2" checked aria-hidden="true">
|
||||
<label for="collapse-section2" aria-hidden="true">V1.0.1 / 11-November-2014</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- Fix limitation related to the selection of alternate function for TS physical IO
|
||||
- Fix wrong pins definition of the TS
|
||||
- Swap implementation of STMPE811_IO_EnableAF() and STMPE811_IO_DisableAF() functions
|
||||
- Miscellaneous code cleanup of comments update
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section1" checked aria-hidden="true">
|
||||
<label for="collapse-section1" aria-hidden="true">V1.0.0 / 18-February-2014</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- First official release of **STMPE811** IOExpander driver
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
:::
|
||||
:::
|
||||
|
||||
<footer class="sticky">
|
||||
For complete documentation on <mark>STM32 Microcontrollers</mark> ,
|
||||
visit: [[www.st.com](http://www.st.com/STM32)]{style="font-color: blue;"}
|
||||
</footer>
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,312 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stmpe811.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the functions prototypes for the
|
||||
* stmpe811.c IO Expander component core drivers.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2014 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef STMPE811_H
|
||||
#define STMPE811_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stmpe811_reg.h"
|
||||
#include <stddef.h>
|
||||
#include "stmpe811_conf.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STMPE811
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup STMPE811_Exported_Constants Exported Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define STMPE811_OK (0)
|
||||
#define STMPE811_ERROR (-1)
|
||||
|
||||
/* Chip IDs */
|
||||
#define STMPE811_ID 0x0811U
|
||||
|
||||
/* Max detectable simultaneous touches */
|
||||
#define STMPE811_MAX_NB_TOUCH 0x01U
|
||||
|
||||
/* Global interrupt Enable bit */
|
||||
#define STMPE811_GIT_EN 0x01U
|
||||
|
||||
/* IO expander functionalities */
|
||||
#define STMPE811_ADC_FCT 0x01U
|
||||
#define STMPE811_TS_FCT 0x02U
|
||||
#define STMPE811_IO_FCT 0x04U
|
||||
#define STMPE811_TEMPSENS_FCT 0x08U
|
||||
|
||||
/* Global Interrupts definitions */
|
||||
#define STMPE811_GIT_IO 0x80U /* IO interrupt */
|
||||
#define STMPE811_GIT_ADC 0x40U /* ADC interrupt */
|
||||
#define STMPE811_GIT_TEMP 0x20U /* Not implemented */
|
||||
#define STMPE811_GIT_FE 0x10U /* FIFO empty interrupt */
|
||||
#define STMPE811_GIT_FF 0x08U /* FIFO full interrupt */
|
||||
#define STMPE811_GIT_FOV 0x04U /* FIFO overflowed interrupt */
|
||||
#define STMPE811_GIT_FTH 0x02U /* FIFO above threshold interrupt */
|
||||
#define STMPE811_GIT_TOUCH 0x01U /* Touch is detected interrupt */
|
||||
#define STMPE811_ALL_GIT 0x1FU /* All global interrupts */
|
||||
#define STMPE811_TS_IT (STMPE811_GIT_TOUCH | STMPE811_GIT_FTH | STMPE811_GIT_FOV | STMPE811_GIT_FF | STMPE811_GIT_FE) /* Touch screen interrupts */
|
||||
|
||||
/* Touch Screen Pins definition */
|
||||
#define STMPE811_TOUCH_YD STMPE811_GPIO_PIN_7
|
||||
#define STMPE811_TOUCH_XD STMPE811_GPIO_PIN_6
|
||||
#define STMPE811_TOUCH_YU STMPE811_GPIO_PIN_5
|
||||
#define STMPE811_TOUCH_XU STMPE811_GPIO_PIN_4
|
||||
#define STMPE811_TOUCH_IO_ALL (uint32_t)(STMPE811_TOUCH_YD | STMPE811_TOUCH_XD | STMPE811_TOUCH_YU | STMPE811_TOUCH_XU)
|
||||
|
||||
/* IO Pins definition */
|
||||
#define STMPE811_GPIO_PIN_0 0x01U
|
||||
#define STMPE811_GPIO_PIN_1 0x02U
|
||||
#define STMPE811_GPIO_PIN_2 0x04U
|
||||
#define STMPE811_GPIO_PIN_3 0x08U
|
||||
#define STMPE811_GPIO_PIN_4 0x10U
|
||||
#define STMPE811_GPIO_PIN_5 0x20U
|
||||
#define STMPE811_GPIO_PIN_6 0x40U
|
||||
#define STMPE811_GPIO_PIN_7 0x80U
|
||||
#define STMPE811_GPIO_PIN_ALL 0xFFU
|
||||
|
||||
/* IO Pins directions */
|
||||
#define STMPE811_GPIO_DIR_IN 0x00U
|
||||
#define STMPE811_GPIO_DIR_OUT 0x01U
|
||||
|
||||
#define STMPE811_GPIO_NOPULL 0x0U /*!< No Pull-up or Pull-down activation */
|
||||
#define STMPE811_GPIO_PULLUP 0x1U /*!< Pull-up activation */
|
||||
#define STMPE811_GPIO_PULLDOWN 0x2U /*!< Pull-down activation */
|
||||
|
||||
#define STMPE811_GPIO_MODE_OFF 0x0U /* when pin isn't used*/
|
||||
#define STMPE811_GPIO_MODE_ANALOG 0x1U /* analog mode */
|
||||
#define STMPE811_GPIO_MODE_INPUT 0x2U /* input floating */
|
||||
#define STMPE811_GPIO_MODE_OUTPUT_OD 0x3U /* Open Drain output without internal resistor */
|
||||
#define STMPE811_GPIO_MODE_OUTPUT_PP 0x4U /* PushPull output without internal resistor */
|
||||
#define STMPE811_GPIO_MODE_IT_RISING_EDGE 0x5U /* float input - irq detect on rising edge */
|
||||
#define STMPE811_GPIO_MODE_IT_FALLING_EDGE 0x6U /* float input - irq detect on falling edge */
|
||||
#define STMPE811_GPIO_MODE_IT_LOW_LEVEL 0x7U /* float input - irq detect on low level */
|
||||
#define STMPE811_GPIO_MODE_IT_HIGH_LEVEL 0x8U /* float input - irq detect on high level */
|
||||
|
||||
/* TS registers masks */
|
||||
#define STMPE811_TS_CTRL_ENABLE 0x01U
|
||||
#define STMPE811_TS_CTRL_STATUS 0x80U
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STMPE811_Exported_Types STMPE811 Exported Types
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t Pin; /*!< Specifies the GPIO pins to be configured.
|
||||
This parameter can be any value of @ref GPIO_pins_define */
|
||||
|
||||
uint32_t Mode; /*!< Specifies the operating mode for the selected pins.
|
||||
This parameter can be a value of @ref IO_ModeTypedef */
|
||||
|
||||
uint32_t Pull; /*!< Specifies the Pull-up or Pull-Down activation for the selected pins.
|
||||
This parameter can be a value of @ref GPIO_pull_define */
|
||||
}STMPE811_IO_Init_t;
|
||||
|
||||
typedef int32_t (*STMPE811_Init_Func) (void);
|
||||
typedef int32_t (*STMPE811_DeInit_Func) (void);
|
||||
typedef int32_t (*STMPE811_GetTick_Func) (void);
|
||||
typedef int32_t (*STMPE811_Delay_Func) (uint32_t);
|
||||
typedef int32_t (*STMPE811_WriteReg_Func)(uint16_t, uint16_t, uint8_t*, uint16_t);
|
||||
typedef int32_t (*STMPE811_ReadReg_Func) (uint16_t, uint16_t, uint8_t*, uint16_t);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
STMPE811_Init_Func Init;
|
||||
STMPE811_DeInit_Func DeInit;
|
||||
uint16_t Address;
|
||||
STMPE811_WriteReg_Func WriteReg;
|
||||
STMPE811_ReadReg_Func ReadReg;
|
||||
STMPE811_GetTick_Func GetTick;
|
||||
} STMPE811_IO_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
STMPE811_IO_t IO;
|
||||
stmpe811_ctx_t Ctx;
|
||||
uint8_t IsInitialized;
|
||||
} STMPE811_Object_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t Radian;
|
||||
uint32_t OffsetLeftRight;
|
||||
uint32_t OffsetUpDown;
|
||||
uint32_t DistanceLeftRight;
|
||||
uint32_t DistanceUpDown;
|
||||
uint32_t DistanceZoom;
|
||||
}STMPE811_Gesture_Init_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t TouchDetected;
|
||||
uint32_t TouchX;
|
||||
uint32_t TouchY;
|
||||
} STMPE811_State_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t TouchDetected;
|
||||
uint32_t TouchX[STMPE811_MAX_NB_TOUCH];
|
||||
uint32_t TouchY[STMPE811_MAX_NB_TOUCH];
|
||||
uint32_t TouchWeight[STMPE811_MAX_NB_TOUCH];
|
||||
uint32_t TouchEvent[STMPE811_MAX_NB_TOUCH];
|
||||
uint32_t TouchArea[STMPE811_MAX_NB_TOUCH];
|
||||
} STMPE811_MultiTouch_State_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t MultiTouch;
|
||||
uint8_t Gesture;
|
||||
uint8_t MaxTouch;
|
||||
uint32_t MaxXl;
|
||||
uint32_t MaxYl;
|
||||
} STMPE811_Capabilities_t;
|
||||
|
||||
/* Touch screen driver structure initialization */
|
||||
typedef struct
|
||||
{
|
||||
int32_t ( *Init )(STMPE811_Object_t *);
|
||||
int32_t ( *DeInit )(STMPE811_Object_t *);
|
||||
int32_t ( *TS_GestureConfig )(STMPE811_Object_t *, STMPE811_Gesture_Init_t*);
|
||||
int32_t ( *ReadID )(STMPE811_Object_t *, uint32_t *);
|
||||
int32_t ( *TS_GetState )(STMPE811_Object_t *, STMPE811_State_t*);
|
||||
int32_t ( *TS_GetMultiTouchState )(STMPE811_Object_t *, STMPE811_MultiTouch_State_t*);
|
||||
int32_t ( *TS_GetGesture )(STMPE811_Object_t *, uint8_t*);
|
||||
int32_t ( *TS_GetCapabilities )(STMPE811_Object_t *, STMPE811_Capabilities_t*);
|
||||
int32_t ( *TS_EnableIT )(STMPE811_Object_t *);
|
||||
int32_t ( *TS_DisableIT )(STMPE811_Object_t *);
|
||||
int32_t ( *TS_ClearIT )(STMPE811_Object_t *);
|
||||
int32_t ( *TS_ITStatus )(STMPE811_Object_t *);
|
||||
}STMPE811_TS_Mode_t;
|
||||
|
||||
/* IO driver structure initialization */
|
||||
typedef struct
|
||||
{
|
||||
int32_t ( *Init )(STMPE811_Object_t *, STMPE811_IO_Init_t *);
|
||||
int32_t ( *DeInit )(STMPE811_Object_t *);
|
||||
int32_t ( *ReadID )(STMPE811_Object_t *, uint32_t*);
|
||||
int32_t ( *Reset )(STMPE811_Object_t *);
|
||||
int32_t ( *IO_Start )(STMPE811_Object_t *, uint32_t);
|
||||
int32_t ( *IO_WritePin )(STMPE811_Object_t *, uint32_t, uint8_t);
|
||||
int32_t ( *IO_ReadPin )(STMPE811_Object_t *, uint32_t);
|
||||
int32_t ( *IO_EnableIT )(STMPE811_Object_t *);
|
||||
int32_t ( *IO_DisableIT )(STMPE811_Object_t *);
|
||||
int32_t ( *IO_ITStatus )(STMPE811_Object_t *, uint32_t);
|
||||
int32_t ( *IO_ClearIT )(STMPE811_Object_t *, uint32_t);
|
||||
}STMPE811_IO_Mode_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup STMPE811_Exported_Variables
|
||||
* @{
|
||||
*/
|
||||
/* Touch screen driver structure */
|
||||
extern STMPE811_TS_Mode_t STMPE811_TS_Driver;
|
||||
|
||||
/* IO driver structure */
|
||||
extern STMPE811_IO_Mode_t STMPE811_IO_Driver;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup STMPE811_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief STMPE811 Control functions
|
||||
*/
|
||||
int32_t STMPE811_RegisterBusIO (STMPE811_Object_t *pObj, STMPE811_IO_t *pIO);
|
||||
int32_t STMPE811_Init(STMPE811_Object_t *pObj);
|
||||
int32_t STMPE811_DeInit(STMPE811_Object_t *pObj);
|
||||
int32_t STMPE811_Reset(STMPE811_Object_t *pObj);
|
||||
int32_t STMPE811_ReadID(STMPE811_Object_t *pObj, uint32_t *Id);
|
||||
|
||||
/**
|
||||
* @brief STMPE811 IO functionalities functions
|
||||
*/
|
||||
int32_t STMPE811_IO_Start(STMPE811_Object_t *pObj, uint32_t IO_Pin);
|
||||
int32_t STMPE811_IO_Init(STMPE811_Object_t *pObj, STMPE811_IO_Init_t *IoInit);
|
||||
int32_t STMPE811_IO_InitPin(STMPE811_Object_t *pObj, uint32_t IO_Pin, uint8_t Direction);
|
||||
int32_t STMPE811_IO_WritePin(STMPE811_Object_t *pObj, uint32_t IO_Pin, uint8_t PinState);
|
||||
int32_t STMPE811_IO_ReadPin(STMPE811_Object_t *pObj, uint32_t IO_Pin);
|
||||
int32_t STMPE811_IO_EnableAF(STMPE811_Object_t *pObj, uint32_t IO_Pin);
|
||||
int32_t STMPE811_IO_DisableAF(STMPE811_Object_t *pObj, uint32_t IO_Pin);
|
||||
int32_t STMPE811_IO_EnableIT(STMPE811_Object_t *pObj);
|
||||
int32_t STMPE811_IO_DisableIT(STMPE811_Object_t *pObj);
|
||||
int32_t STMPE811_IO_EnablePinIT(STMPE811_Object_t *pObj, uint32_t IO_Pin);
|
||||
int32_t STMPE811_IO_DisablePinIT(STMPE811_Object_t *pObj, uint32_t IO_Pin);
|
||||
int32_t STMPE811_IO_ITStatus(STMPE811_Object_t *pObj, uint32_t IO_Pin);
|
||||
int32_t STMPE811_IO_ClearIT(STMPE811_Object_t *pObj, uint32_t IO_Pin);
|
||||
|
||||
/**
|
||||
* @brief STMPE811 Touch screen functionalities functions
|
||||
*/
|
||||
int32_t STMPE811_TS_Init(STMPE811_Object_t *pObj);
|
||||
int32_t STMPE811_TS_GestureConfig(STMPE811_Object_t *pObj, STMPE811_Gesture_Init_t *GestureInit);
|
||||
int32_t STMPE811_TS_GetState(STMPE811_Object_t *pObj, STMPE811_State_t *State);
|
||||
int32_t STMPE811_TS_GetMultiTouchState(STMPE811_Object_t *pObj, STMPE811_MultiTouch_State_t *State);
|
||||
int32_t STMPE811_TS_GetGesture(STMPE811_Object_t *pObj, uint8_t *GestureId);
|
||||
int32_t STMPE811_TS_EnableIT(STMPE811_Object_t *pObj);
|
||||
int32_t STMPE811_TS_DisableIT(STMPE811_Object_t *pObj);
|
||||
int32_t STMPE811_TS_ITStatus(STMPE811_Object_t *pObj);
|
||||
int32_t STMPE811_TS_ClearIT(STMPE811_Object_t *pObj);
|
||||
int32_t STMPE811_GetCapabilities(STMPE811_Object_t *pObj, STMPE811_Capabilities_t *Capabilities);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* STMPE811_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stmpe811_conf_template.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains specific configuration for the
|
||||
* stmpe811.c that can be modified by user.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2019 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef STMPE811_CONF_H
|
||||
#define STMPE811_CONF_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
/* Macros --------------------------------------------------------------------*/
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
#define STMPE811_MAX_X_LENGTH 4096U
|
||||
#define STMPE811_MAX_Y_LENGTH 4096U
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* STMPE811_CONF_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,80 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stmpe811_reg.c
|
||||
* @author MCD Application Team
|
||||
* @brief This file provides a set of functions needed to manage the STMPE811
|
||||
* IO Expander component registers drivers.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2019 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stmpe811_reg.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STMPE811
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STMPE811_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
/*******************************************************************************
|
||||
* Function Name : stmpe811_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 stmpe811_read_reg(stmpe811_ctx_t *ctx, uint16_t reg, uint8_t* data, uint16_t length)
|
||||
{
|
||||
return ctx->ReadReg(ctx->handle, reg, data, length);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : stmpe811_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 stmpe811_write_reg(stmpe811_ctx_t *ctx, uint16_t reg, uint8_t* data, uint16_t length)
|
||||
{
|
||||
return ctx->WriteReg(ctx->handle, reg, data, length);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,162 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stmpe811_reg.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the functions prototypes for the
|
||||
* stmpe811.c IO expander registers driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2019 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef STMPE811_REG_H
|
||||
#define STMPE811_REG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <cmsis_compiler.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STMPE811
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STMPE811_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Identification registers & System Control */
|
||||
#define STMPE811_CHP_ID_LSB_REG 0x00U
|
||||
#define STMPE811_CHP_ID_MSB_REG 0x01U
|
||||
#define STMPE811_ID_VER_REG 0x02U
|
||||
|
||||
/* General Control Registers */
|
||||
#define STMPE811_SYS_CTRL1_REG 0x03U
|
||||
#define STMPE811_SYS_CTRL2_REG 0x04U
|
||||
#define STMPE811_SPI_CFG_REG 0x08U
|
||||
|
||||
/* Interrupt system Registers */
|
||||
#define STMPE811_INT_CTRL_REG 0x09U
|
||||
#define STMPE811_INT_EN_REG 0x0AU
|
||||
#define STMPE811_INT_STA_REG 0x0BU
|
||||
#define STMPE811_IO_INT_EN_REG 0x0CU
|
||||
#define STMPE811_IO_INT_STA_REG 0x0DU
|
||||
|
||||
/* IO Registers */
|
||||
#define STMPE811_IO_SET_PIN_REG 0x10U
|
||||
#define STMPE811_IO_CLR_PIN_REG 0x11U
|
||||
#define STMPE811_IO_MP_STA_REG 0x12U
|
||||
#define STMPE811_IO_DIR_REG 0x13U
|
||||
#define STMPE811_IO_ED_REG 0x14U
|
||||
#define STMPE811_IO_RE_REG 0x15U
|
||||
#define STMPE811_IO_FE_REG 0x16U
|
||||
#define STMPE811_IO_AF_REG 0x17U
|
||||
|
||||
/* ADC Registers */
|
||||
#define STMPE811_ADC_INT_EN_REG 0x0EU
|
||||
#define STMPE811_ADC_INT_STA_REG 0x0FU
|
||||
#define STMPE811_ADC_CTRL1_REG 0x20U
|
||||
#define STMPE811_ADC_CTRL2_REG 0x21U
|
||||
#define STMPE811_ADC_CAPT_REG 0x22U
|
||||
#define STMPE811_ADC_DATA_CH0_REG 0x30U
|
||||
#define STMPE811_ADC_DATA_CH1_REG 0x32U
|
||||
#define STMPE811_ADC_DATA_CH2_REG 0x34U
|
||||
#define STMPE811_ADC_DATA_CH3_REG 0x36U
|
||||
#define STMPE811_ADC_DATA_CH4_REG 0x38U
|
||||
#define STMPE811_ADC_DATA_CH5_REG 0x3AU
|
||||
#define STMPE811_ADC_DATA_CH6_REG 0x3BU
|
||||
#define STMPE811_ADC_DATA_CH7_REG 0x3CU
|
||||
|
||||
/* Touch Screen Registers */
|
||||
#define STMPE811_TSC_CTRL_REG 0x40U
|
||||
#define STMPE811_TSC_CFG_REG 0x41U
|
||||
#define STMPE811_WDW_TR_X_REG 0x42U
|
||||
#define STMPE811_WDW_TR_Y_REG 0x44U
|
||||
#define STMPE811_WDW_BL_X_REG 0x46U
|
||||
#define STMPE811_WDW_BL_Y_REG 0x48U
|
||||
#define STMPE811_FIFO_TH_REG 0x4AU
|
||||
#define STMPE811_FIFO_STA_REG 0x4BU
|
||||
#define STMPE811_FIFO_SIZE_REG 0x4CU
|
||||
#define STMPE811_TSC_DATA_X_REG 0x4DU
|
||||
#define STMPE811_TSC_DATA_Y_REG 0x4FU
|
||||
#define STMPE811_TSC_DATA_Z_REG 0x51U
|
||||
#define STMPE811_TSC_DATA_XYZ_REG 0x52U
|
||||
#define STMPE811_TSC_FRACT_XYZ_REG 0x56U
|
||||
#define STMPE811_TSC_DATA_INC_REG 0x57U
|
||||
#define STMPE811_TSC_DATA_NON_INC_REG 0xD7U
|
||||
#define STMPE811_TSC_I_DRIVE_REG 0x58U
|
||||
#define STMPE811_TSC_SHIELD_REG 0x59U
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup STMPE811_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
typedef int32_t (*STMPE811_Write_Func)(void *, uint16_t, uint8_t*, uint16_t);
|
||||
typedef int32_t (*STMPE811_Read_Func) (void *, uint16_t, uint8_t*, uint16_t);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
STMPE811_Write_Func WriteReg;
|
||||
STMPE811_Read_Func ReadReg;
|
||||
void *handle;
|
||||
/* Internal resources */
|
||||
} stmpe811_ctx_t;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtgroup STMPE811_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
int32_t stmpe811_write_reg(stmpe811_ctx_t *ctx, uint16_t reg, uint8_t *data, uint16_t length);
|
||||
int32_t stmpe811_read_reg(stmpe811_ctx_t *ctx, uint16_t reg, uint8_t *data, uint16_t length);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* STMPE811_REG_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
Reference in New Issue
Block a user