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
@@ -0,0 +1,211 @@
|
||||
<!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 BSP Common Components 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.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-bsp-common-components-drivers"><small>Release Notes for</small> <mark>BSP Common Components Drivers</mark></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>
|
||||
<p>Licensed by ST under BSD 3-Clause license (the "License"). You may not use this package except in compliance with the License. You may obtain a copy of the License at:</p>
|
||||
<p><a href="https://opensource.org/licenses/BSD-3-Clause">https://opensource.org/licenses/BSD-3-Clause</a></p>
|
||||
<h1 id="purpose">Purpose</h1>
|
||||
<p>This directory contains the BSP Common components 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-section16" checked aria-hidden="true"> <label for="collapse-section16" aria-hidden="true">V7.0.0 / 25-February-2020</label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<h3 id="component-release">Component release</h3>
|
||||
<ul>
|
||||
<li>Rename GUI_Drv_t structure into UTILS_LCD_Drv_t</li>
|
||||
</ul>
|
||||
<h2 id="backward-compatibility">Backward Compatibility</h2>
|
||||
<ul>
|
||||
<li>This release breaks compatibility with previous versions.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section15" aria-hidden="true"> <label for="collapse-section15" aria-hidden="true">V6.0.1 / 15-October-2019</label>
|
||||
<div>
|
||||
<h2 id="main-changes-1">Main Changes</h2>
|
||||
<h3 id="component-release-1">Component release</h3>
|
||||
<ul>
|
||||
<li>Update st_logo.png inclusion path in Release notes.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section14" aria-hidden="true"> <label for="collapse-section14" aria-hidden="true">V6.0.0 / 12-April-2019</label>
|
||||
<div>
|
||||
<h2 id="main-changes-2">Main Changes</h2>
|
||||
<h3 id="component-release-2">Component release</h3>
|
||||
<p>Official release of BSP Common components drivers in line with STM32Cube BSP drivers development guidelines (UM2298).</p>
|
||||
<h2 id="backward-compatibility-1">Backward Compatibility</h2>
|
||||
<p>This release breaks compatibility with previous versions.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section13" aria-hidden="true"> <label for="collapse-section13" aria-hidden="true">V5.1.1 / 31-August-2018</label>
|
||||
<div>
|
||||
<h2 id="main-changes-3">Main Changes</h2>
|
||||
<p>Reformat the BSD 3-Clause license declaration in the files header (replace license terms by a web reference to OSI website where those terms lie)<br />
|
||||
Correct sensor names in headers files hsensor.h and psensor.h</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section12" aria-hidden="true"> <label for="collapse-section12" aria-hidden="true">V5.1.0 / 21-November-2017</label>
|
||||
<div>
|
||||
<h2 id="main-changes-4">Main Changes</h2>
|
||||
<p>Add dpredriver.h: support of DP redriver class<br />
|
||||
Add pwrmon.h: support of power monitor class<br />
|
||||
Add usbtypecswitch.h: support of USB type C switch class</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section11" aria-hidden="true"> <label for="collapse-section11" aria-hidden="true">V5.0.0 / 01-March-2017</label>
|
||||
<div>
|
||||
<h2 id="main-changes-5">Main Changes</h2>
|
||||
<p>Add hsensor.h: support of humidity class<br />
|
||||
Add psensor.h: support of pressure class<br />
|
||||
Update tsensor.h: Temperature can be negative<br />
|
||||
Update accelero.h: LowPower API can enable or disable the low power mode<br />
|
||||
Update magneto.h: LowPower API can enable or disable the low power mode</p>
|
||||
<h2 id="backward-compatibility-2">Backward Compatibility</h2>
|
||||
<p>This release breaks compatibility with previous versions.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section10" aria-hidden="true"> <label for="collapse-section10" aria-hidden="true">V4.0.1 / 21-July-2015</label>
|
||||
<div>
|
||||
<h2 id="main-changes-6">Main Changes</h2>
|
||||
<p>tsensor.h: Fix compilation issue on <em>TSENSOR_InitTypeDef</em></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section9" aria-hidden="true"> <label for="collapse-section9" aria-hidden="true">V4.0.0 / 22-June-2015</label>
|
||||
<div>
|
||||
<h2 id="main-changes-7">Main Changes</h2>
|
||||
<p>accelero.h: add <em>DeInit</em> field in <em>ACCELERO_DrvTypeDef</em> structure<br />
|
||||
audio.h: add <em>DeInit</em> field in <em>AUDIO_DrvTypeDef</em> structure<br />
|
||||
idd.h:</p>
|
||||
<ul>
|
||||
<li>add <em>Shunt0StabDelay</em>, <em>Shunt1StabDelay</em>, <em>Shunt2StabDelay</em>, <em>Shunt3StabDelay</em>, <em>Shunt4StabDelay</em> and <em>ShuntNbOnBoard</em> fields in <em>IDD_ConfigTypeDef</em> structure<br />
|
||||
</li>
|
||||
<li>rename <em>ShuntNumber</em> field to <em>ShuntNbUsed</em> in <em>IDD_ConfigTypeDef</em> structure</li>
|
||||
</ul>
|
||||
<p>magneto.h: add <em>DeInit</em> field in <em>MAGNETO_DrvTypeDef</em> structure</p>
|
||||
<h2 id="backward-compatibility-3">Backward Compatibility</h2>
|
||||
<p>This release breaks compatibility with previous versions.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section8" aria-hidden="true"> <label for="collapse-section8" aria-hidden="true">V3.0.0 / 28-April-2015</label>
|
||||
<div>
|
||||
<h2 id="main-changes-8">Main Changes</h2>
|
||||
<p>accelero.h: add <em>LowPower</em> field in <em>ACCELERO_DrvTypeDef</em> structure<br />
|
||||
magneto.h: add <em>LowPower</em> field in <em>MAGNETO_DrvTypeDef</em> structure<br />
|
||||
gyro.h: add <em>DeInit</em> and <em>LowPower</em> fields in <em>GYRO_DrvTypeDef</em> structure<br />
|
||||
camera.h: add CAMERA_COLOR_EFFECT_NONE define<br />
|
||||
idd.h:</p>
|
||||
<ul>
|
||||
<li>add <em>MeasureNb</em>, <em>DeltaDelayUnit</em> and <em>DeltaDelayValue</em> fields in <em>IDD_ConfigTypeDef</em> structure<br />
|
||||
</li>
|
||||
<li>rename <em>PreDelay</em> field to <em>PreDelayUnit</em> in <em>IDD_ConfigTypeDef</em> structure</li>
|
||||
</ul>
|
||||
<h2 id="backward-compatibility-4">Backward Compatibility</h2>
|
||||
<p>This release breaks compatibility with previous versions.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section7" aria-hidden="true"> <label for="collapse-section7" aria-hidden="true">V2.2.0 / 09-February-2015</label>
|
||||
<div>
|
||||
<h2 id="main-changes-9">Main Changes</h2>
|
||||
<p>Magnetometer driver function prototypes added (magneto.h file)<br />
|
||||
Update “idd.h” file to provide DeInit() and WakeUp() services in IDD current measurement driver</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section6" aria-hidden="true"> <label for="collapse-section6" aria-hidden="true">V2.1.0 / 06-February-2015</label>
|
||||
<div>
|
||||
<h2 id="main-changes-10">Main Changes</h2>
|
||||
<p>IDD current measurement driver function prototypes added (idd.h file)<br />
|
||||
io.h: add new typedef enum IO_PinState with IO_PIN_RESET and IO_PIN_SET values</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section5" aria-hidden="true"> <label for="collapse-section5" aria-hidden="true">V2.0.0 / 15-December-2014</label>
|
||||
<div>
|
||||
<h2 id="main-changes-11">Main Changes</h2>
|
||||
<p>Update “io.h” file to support MFX (Multi Function eXpander) device available on some STM32 boards</p>
|
||||
<ul>
|
||||
<li>add new entries for <em>IO_ModeTypedef</em> enumeration structure</li>
|
||||
<li>update the <em>IO_DrvTypeDef</em> structure</li>
|
||||
<li>Update all return values and function parameters to uint32_t</li>
|
||||
<li>Add a return value for <em>Config</em> field</li>
|
||||
</ul>
|
||||
<h2 id="backward-compatibility-5">Backward Compatibility</h2>
|
||||
<p>This release breaks compatibility with previous versions.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section4" aria-hidden="true"> <label for="collapse-section4" aria-hidden="true">V1.2.1 / 02-December-2014</label>
|
||||
<div>
|
||||
<h2 id="main-changes-12">Main Changes</h2>
|
||||
<p>gyro.h: change “__GIRO_H” by “__GYRO_H” to fix compilation issue under Mac OS</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section3" aria-hidden="true"> <label for="collapse-section3" aria-hidden="true">V1.2.0 / 18-June-2014</label>
|
||||
<div>
|
||||
<h2 id="main-changes-13">Main Changes</h2>
|
||||
<p>EPD (E Paper Display) driver function prototype added (epd.h file)</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section2" aria-hidden="true"> <label for="collapse-section2" aria-hidden="true">V1.1.0 / 21-March-2014</label>
|
||||
<div>
|
||||
<h2 id="main-changes-14">Main Changes</h2>
|
||||
<p>Temperature Sensor driver function prototype added</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section1" aria-hidden="true"> <label for="collapse-section1" aria-hidden="true">V1.0.0 / 18-February-2014</label>
|
||||
<div>
|
||||
<h2 id="main-changes-15">Main Changes</h2>
|
||||
<p>First official release with Accelerometer, Audio, Camera, Gyroscope, IO, LCD and Touch Screen drivers function prototypes</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="sticky">
|
||||
For complete documentation on <mark>STM32 Microcontrollers</mark> , visit: <a href="http://www.st.com/STM32">http://www.st.com/STM32</a>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,285 @@
|
||||
---
|
||||
pagetitle: Release Notes for BSP Common Components Drivers
|
||||
lang: en
|
||||
---
|
||||
|
||||
::: {.row}
|
||||
::: {.col-sm-12 .col-lg-4}
|
||||
|
||||
::: {.card .fluid}
|
||||
::: {.sectione .dark}
|
||||
<center>
|
||||
# <small>Release Notes for</small> <mark>BSP Common Components Drivers</mark>
|
||||
Copyright © 2014 STMicroelectronics\
|
||||
|
||||
[](https://www.st.com){.logo}
|
||||
</center>
|
||||
:::
|
||||
:::
|
||||
|
||||
# License
|
||||
|
||||
Licensed by ST under BSD 3-Clause license (the \"License\"). You may
|
||||
not use this package except in compliance with the License. You may
|
||||
obtain a copy of the License at:
|
||||
|
||||
[https://opensource.org/licenses/BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause)
|
||||
|
||||
# Purpose
|
||||
|
||||
This directory contains the BSP Common components drivers.
|
||||
|
||||
:::
|
||||
|
||||
::: {.col-sm-12 .col-lg-8}
|
||||
# Update History
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section16" checked aria-hidden="true">
|
||||
<label for="collapse-section16" aria-hidden="true">V7.0.0 / 25-February-2020</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
### Component release
|
||||
|
||||
- Rename GUI_Drv_t structure into UTILS_LCD_Drv_t
|
||||
|
||||
## Backward Compatibility
|
||||
|
||||
- This release breaks compatibility with previous versions.
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section15" aria-hidden="true">
|
||||
<label for="collapse-section15" aria-hidden="true">V6.0.1 / 15-October-2019</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
### Component release
|
||||
|
||||
- Update st_logo.png inclusion path in Release notes.
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section14" aria-hidden="true">
|
||||
<label for="collapse-section14" aria-hidden="true">V6.0.0 / 12-April-2019</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
### Component release
|
||||
|
||||
Official release of BSP Common components drivers in line with STM32Cube BSP drivers development guidelines (UM2298).
|
||||
|
||||
## Backward Compatibility
|
||||
|
||||
This release breaks compatibility with previous versions.
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section13" aria-hidden="true">
|
||||
<label for="collapse-section13" aria-hidden="true">V5.1.1 / 31-August-2018</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
Reformat the BSD 3-Clause license declaration in the files header (replace license terms by a web reference to OSI website where those terms lie)
|
||||
Correct sensor names in headers files hsensor.h and psensor.h
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section12" aria-hidden="true">
|
||||
<label for="collapse-section12" aria-hidden="true">V5.1.0 / 21-November-2017</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
Add dpredriver.h: support of DP redriver class
|
||||
Add pwrmon.h: support of power monitor class
|
||||
Add usbtypecswitch.h: support of USB type C switch class
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section11" aria-hidden="true">
|
||||
<label for="collapse-section11" aria-hidden="true">V5.0.0 / 01-March-2017</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
Add hsensor.h: support of humidity class
|
||||
Add psensor.h: support of pressure class
|
||||
Update tsensor.h: Temperature can be negative
|
||||
Update accelero.h: LowPower API can enable or disable the low power mode
|
||||
Update magneto.h: LowPower API can enable or disable the low power mode
|
||||
|
||||
## Backward Compatibility
|
||||
|
||||
This release breaks compatibility with previous versions.
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section10" aria-hidden="true">
|
||||
<label for="collapse-section10" aria-hidden="true">V4.0.1 / 21-July-2015</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
tsensor.h: Fix compilation issue on *TSENSOR_InitTypeDef*
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section9" aria-hidden="true">
|
||||
<label for="collapse-section9" aria-hidden="true">V4.0.0 / 22-June-2015</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
accelero.h: add *DeInit* field in *ACCELERO_DrvTypeDef* structure
|
||||
audio.h: add *DeInit* field in *AUDIO_DrvTypeDef* structure
|
||||
idd.h:
|
||||
|
||||
- add *Shunt0StabDelay*, *Shunt1StabDelay*, *Shunt2StabDelay*, *Shunt3StabDelay*, *Shunt4StabDelay* and *ShuntNbOnBoard* fields in *IDD_ConfigTypeDef* structure
|
||||
- rename *ShuntNumber* field to *ShuntNbUsed* in *IDD_ConfigTypeDef* structure
|
||||
|
||||
magneto.h: add *DeInit* field in *MAGNETO_DrvTypeDef* structure
|
||||
|
||||
## Backward Compatibility
|
||||
|
||||
This release breaks compatibility with previous versions.
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section8" aria-hidden="true">
|
||||
<label for="collapse-section8" aria-hidden="true">V3.0.0 / 28-April-2015</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
accelero.h: add *LowPower* field in *ACCELERO_DrvTypeDef* structure
|
||||
magneto.h: add *LowPower* field in *MAGNETO_DrvTypeDef* structure
|
||||
gyro.h: add *DeInit* and *LowPower* fields in *GYRO_DrvTypeDef* structure
|
||||
camera.h: add CAMERA_COLOR_EFFECT_NONE define
|
||||
idd.h:
|
||||
|
||||
- add *MeasureNb*, *DeltaDelayUnit* and *DeltaDelayValue* fields in *IDD_ConfigTypeDef* structure
|
||||
- rename *PreDelay* field to *PreDelayUnit* in *IDD_ConfigTypeDef* structure
|
||||
|
||||
## Backward Compatibility
|
||||
|
||||
This release breaks compatibility with previous versions.
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section7" aria-hidden="true">
|
||||
<label for="collapse-section7" aria-hidden="true">V2.2.0 / 09-February-2015</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
Magnetometer driver function prototypes added (magneto.h file)
|
||||
Update "idd.h" file to provide DeInit() and WakeUp() services in IDD current measurement driver
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section6" aria-hidden="true">
|
||||
<label for="collapse-section6" aria-hidden="true">V2.1.0 / 06-February-2015</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
IDD current measurement driver function prototypes added (idd.h file)
|
||||
io.h: add new typedef enum IO_PinState with IO_PIN_RESET and IO_PIN_SET values
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section5" aria-hidden="true">
|
||||
<label for="collapse-section5" aria-hidden="true">V2.0.0 / 15-December-2014</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
Update "io.h" file to support MFX (Multi Function eXpander) device available on some STM32 boards
|
||||
|
||||
- add new entries for *IO_ModeTypedef* enumeration structure
|
||||
- update the *IO_DrvTypeDef* structure
|
||||
- Update all return values and function parameters to uint32_t
|
||||
- Add a return value for *Config* field
|
||||
|
||||
## Backward Compatibility
|
||||
|
||||
This release breaks compatibility with previous versions.
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section4" aria-hidden="true">
|
||||
<label for="collapse-section4" aria-hidden="true">V1.2.1 / 02-December-2014</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
gyro.h: change “__GIRO_H” by “__GYRO_H” to fix compilation issue under Mac OS
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section3" aria-hidden="true">
|
||||
<label for="collapse-section3" aria-hidden="true">V1.2.0 / 18-June-2014</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
EPD (E Paper Display) driver function prototype added (epd.h file)
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section2" aria-hidden="true">
|
||||
<label for="collapse-section2" aria-hidden="true">V1.1.0 / 21-March-2014</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
Temperature Sensor driver function prototype added
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section1" aria-hidden="true">
|
||||
<label for="collapse-section1" aria-hidden="true">V1.0.0 / 18-February-2014</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
First official release with Accelerometer, Audio, Camera, Gyroscope, IO, LCD and Touch Screen drivers function prototypes
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
:::
|
||||
:::
|
||||
|
||||
<footer class="sticky">
|
||||
For complete documentation on <mark>STM32 Microcontrollers</mark> ,
|
||||
visit: [http://www.st.com/STM32](http://www.st.com/STM32)
|
||||
</footer>
|
||||
|
After Width: | Height: | Size: 18 KiB |
@@ -0,0 +1,108 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file audio.h
|
||||
* @author MCD Application Team
|
||||
* @brief This header file contains the common defines and functions prototypes
|
||||
* for the Audio driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 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 AUDIO_H
|
||||
#define AUDIO_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup AUDIO
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup AUDIO_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup AUDIO_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/** @defgroup AUDIO_Driver_structure Audio Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
int32_t (*Init )(void*, void*);
|
||||
int32_t (*DeInit )(void*);
|
||||
int32_t (*ReadID )(void*, uint32_t*);
|
||||
int32_t (*Play )(void*);
|
||||
int32_t (*Pause )(void*);
|
||||
int32_t (*Resume )(void*);
|
||||
int32_t (*Stop )(void*, uint32_t);
|
||||
int32_t (*SetFrequency )(void*, uint32_t);
|
||||
int32_t (*GetFrequency )(void*);
|
||||
int32_t (*SetVolume )(void*, uint32_t, uint8_t);
|
||||
int32_t (*GetVolume )(void*, uint32_t, uint8_t*);
|
||||
int32_t (*SetMute )(void*, uint32_t);
|
||||
int32_t (*SetOutputMode )(void*, uint32_t);
|
||||
int32_t (*SetResolution )(void*, uint32_t);
|
||||
int32_t (*GetResolution )(void*, uint32_t*);
|
||||
int32_t (*SetProtocol )(void*, uint32_t);
|
||||
int32_t (*GetProtocol )(void*, uint32_t*);
|
||||
int32_t (*Reset )(void*);
|
||||
}AUDIO_Drv_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* AUDIO_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,106 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file camera.h
|
||||
* @author MCD Application Team
|
||||
* @brief This header file contains the common defines and functions prototypes
|
||||
* for the camera driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 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 CAMERA_H
|
||||
#define CAMERA_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup CAMERA
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/** @defgroup CAMERA_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup CAMERA_Driver_structure Camera Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
int32_t (*Init )(void*, uint32_t, uint32_t);
|
||||
int32_t (*DeInit )(void*);
|
||||
int32_t (*ReadID )(void*, uint32_t*);
|
||||
int32_t (*GetCapabilities )(void*, void*);
|
||||
int32_t (*SetLightMode )(void*, uint32_t);
|
||||
int32_t (*SetColorEffect )(void*, uint32_t);
|
||||
int32_t (*SetBrightness )(void*, int32_t);
|
||||
int32_t (*SetSaturation )(void*, int32_t);
|
||||
int32_t (*SetContrast )(void*, int32_t);
|
||||
int32_t (*SetHueDegree )(void*, int32_t);
|
||||
int32_t (*MirrorFlipConfig )(void*, uint32_t);
|
||||
int32_t (*ZoomConfig )(void*, uint32_t);
|
||||
int32_t (*SetResolution )(void*, uint32_t);
|
||||
int32_t (*GetResolution )(void*, uint32_t*);
|
||||
int32_t (*SetPixelFormat )(void*, uint32_t);
|
||||
int32_t (*GetPixelFormat )(void*, uint32_t*);
|
||||
int32_t (*NightModeConfig )(void*, uint32_t);
|
||||
}CAMERA_Drv_t;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup CAMERA_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CAMERA_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,104 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file dpredriver.h
|
||||
* @author MCD Application Team
|
||||
* @brief This header file contains the functions prototypes for the
|
||||
* DisplayPort Linear Redriver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 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 __DPREDRIVER_H
|
||||
#define __DPREDRIVER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup DPREDRIVER
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup DPREDRIVER_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup DPREDRIVER_Channel_Identifier Channel Identifier
|
||||
* @{
|
||||
*/
|
||||
typedef enum {
|
||||
CHANNEL_DP0 = 0,
|
||||
CHANNEL_DP1,
|
||||
CHANNEL_DP2,
|
||||
CHANNEL_DP3,
|
||||
CHANNEL_RX1,
|
||||
CHANNEL_RX2,
|
||||
CHANNEL_SSTX
|
||||
} DPREDRIVER_ChannelId_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup DPREDRIVER_Driver_structure DisplayPort Linear Redriver Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t (*Init)(uint16_t);
|
||||
void (*DeInit)(uint16_t);
|
||||
uint32_t (*PowerOn)(uint16_t);
|
||||
uint32_t (*PowerOff)(uint16_t);
|
||||
uint32_t (*SetEQGain)(uint16_t, DPREDRIVER_ChannelId_t, uint8_t);
|
||||
uint32_t (*EnableChannel)(uint16_t, DPREDRIVER_ChannelId_t);
|
||||
uint32_t (*DisableChannel)(uint16_t, DPREDRIVER_ChannelId_t);
|
||||
}DPREDRIVER_Drv_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __DPREDRIVER_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,100 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file env_sensor.h
|
||||
* @author MCD Application Team
|
||||
* @brief This header file contains the functions prototypes for the
|
||||
* temperature driver
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2017 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 ENV_SENSORS_H
|
||||
#define ENV_SENSORS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup COMPONENTS COMPONENTS
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup COMMON COMMON
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ENV_SENSORS ENV_SENSORS
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ENV_SENSORS_Public_Types ENV_SENSORS Public types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief ENV_SENSORS driver structure definition
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
int32_t ( *Init ) ( void * );
|
||||
int32_t ( *DeInit ) ( void * );
|
||||
int32_t ( *ReadID ) ( void *, uint8_t * );
|
||||
int32_t ( *GetCapabilities ) ( void *, void * );
|
||||
} ENV_SENSOR_CommonDrv_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t ( *Enable ) ( void * );
|
||||
int32_t ( *Disable ) ( void * );
|
||||
int32_t ( *GetOutputDataRate ) ( void *, float * );
|
||||
int32_t ( *SetOutputDataRate ) ( void *, float );
|
||||
int32_t ( *GetValue ) ( void *, float * );
|
||||
} ENV_SENSOR_FuncDrv_t;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ENV_SENSORS_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,97 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file epd.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the functions prototypes for the
|
||||
* EPD (E Paper Display) driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2015 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 __EPD_H
|
||||
#define __EPD_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Common
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup EPD
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup EPD_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup EPD_Driver_structure E Paper Display Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
void (*Init)(void);
|
||||
void (*WritePixel)(uint8_t);
|
||||
|
||||
/* Optimized operation */
|
||||
void (*SetDisplayWindow)(uint16_t, uint16_t, uint16_t, uint16_t);
|
||||
void (*RefreshDisplay)(void);
|
||||
void (*CloseChargePump)(void);
|
||||
|
||||
uint16_t (*GetEpdPixelWidth)(void);
|
||||
uint16_t (*GetEpdPixelHeight)(void);
|
||||
void (*DrawImage)(uint16_t, uint16_t, uint16_t, uint16_t, uint8_t*);
|
||||
}
|
||||
EPD_DrvTypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* EPD_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,98 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file idd.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the functions prototypes for the IDD driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 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 IDD_H
|
||||
#define IDD_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup IDD
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup IDD_Exported_Types IDD Exported Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup IDD_Driver_structure IDD Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
int32_t (*Init )(void*);
|
||||
int32_t (*DeInit )(void*);
|
||||
int32_t (*ReadID )(void*, uint32_t*);
|
||||
int32_t (*Reset )(void*);
|
||||
int32_t (*LowPower )(void*);
|
||||
int32_t (*WakeUp )(void*);
|
||||
int32_t (*Start )(void*);
|
||||
int32_t (*Config )(void*, void*);
|
||||
int32_t (*GetValue )(void*, uint32_t*);
|
||||
int32_t (*EnableIT )(void*);
|
||||
int32_t (*DisableIT )(void*);
|
||||
int32_t (*ITStatus )(void*);
|
||||
int32_t (*ClearIT )(void*);
|
||||
int32_t (*ErrorEnableIT )(void*);
|
||||
int32_t (*ErrorClearIT )(void*);
|
||||
int32_t (*ErrorGetITStatus)(void*);
|
||||
int32_t (*ErrorDisableIT )(void*);
|
||||
int32_t (*ErrorGetSrc )(void*);
|
||||
int32_t (*ErrorGetCode )(void*);
|
||||
}IDD_Drv_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* IDD_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,90 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file io.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the functions prototypes for the IO driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 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 IO_H
|
||||
#define IO_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup IO
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup IO_Exported_Types IO Exported Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup IO_Driver_structure IO Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
int32_t (*Init )(void*, void*);
|
||||
int32_t (*DeInit )(void*);
|
||||
int32_t (*ReadID )(void*, uint32_t*);
|
||||
int32_t (*Reset )(void*);
|
||||
int32_t (*Start )(void*, uint32_t);
|
||||
int32_t (*WritePin )(void*, uint32_t, uint8_t);
|
||||
int32_t (*ReadPin )(void*, uint32_t);
|
||||
int32_t (*EnableIT )(void*);
|
||||
int32_t (*DisableIT )(void*);
|
||||
int32_t (*ITStatus )(void*, uint32_t);
|
||||
int32_t (*ClearIT )(void*, uint32_t);
|
||||
}IO_Drv_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* IO_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,133 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file lcd.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the functions prototypes for the LCD driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 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 LCD_H
|
||||
#define LCD_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup LCD
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup LCD_Exported_Constants LCD Exported Constants
|
||||
* @{
|
||||
*/
|
||||
#define LCD_PIXEL_FORMAT_ARGB8888 0x00000000U /*!< ARGB8888 LTDC pixel format */
|
||||
#define LCD_PIXEL_FORMAT_RGB888 0x00000001U /*!< RGB888 LTDC pixel format */
|
||||
#define LCD_PIXEL_FORMAT_RGB565 0x00000002U /*!< RGB565 LTDC pixel format */
|
||||
#define LCD_PIXEL_FORMAT_ARGB1555 0x00000003U /*!< ARGB1555 LTDC pixel format */
|
||||
#define LCD_PIXEL_FORMAT_ARGB4444 0x00000004U /*!< ARGB4444 LTDC pixel format */
|
||||
#define LCD_PIXEL_FORMAT_L8 0x00000005U /*!< L8 LTDC pixel format */
|
||||
#define LCD_PIXEL_FORMAT_AL44 0x00000006U /*!< AL44 LTDC pixel format */
|
||||
#define LCD_PIXEL_FORMAT_AL88 0x00000007U /*!< AL88 LTDC pixel format */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LCD_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup LCD_Driver_structure LCD Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
int32_t ( *DrawBitmap ) (uint32_t, uint32_t, uint32_t, uint8_t *);
|
||||
int32_t ( *FillRGBRect ) (uint32_t, uint32_t, uint32_t, uint8_t*, uint32_t, uint32_t);
|
||||
int32_t ( *DrawHLine ) (uint32_t, uint32_t, uint32_t, uint32_t, uint32_t);
|
||||
int32_t ( *DrawVLine ) (uint32_t, uint32_t, uint32_t, uint32_t, uint32_t);
|
||||
int32_t ( *FillRect ) (uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t);
|
||||
int32_t ( *GetPixel ) (uint32_t, uint32_t, uint32_t, uint32_t*);
|
||||
int32_t ( *SetPixel ) (uint32_t, uint32_t, uint32_t, uint32_t);
|
||||
int32_t ( *GetXSize ) (uint32_t, uint32_t *);
|
||||
int32_t ( *GetYSize ) (uint32_t, uint32_t *);
|
||||
int32_t ( *SetLayer ) (uint32_t, uint32_t);
|
||||
int32_t ( *GetFormat ) (uint32_t, uint32_t *);
|
||||
} LCD_UTILS_Drv_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* Control functions */
|
||||
int32_t (*Init )(void*, uint32_t, uint32_t);
|
||||
int32_t (*DeInit )(void*);
|
||||
int32_t (*ReadID )(void*, uint32_t*);
|
||||
int32_t (*DisplayOn )(void*);
|
||||
int32_t (*DisplayOff )(void*);
|
||||
int32_t (*SetBrightness )(void*, uint32_t);
|
||||
int32_t (*GetBrightness )(void*, uint32_t*);
|
||||
int32_t (*SetOrientation )(void*, uint32_t);
|
||||
int32_t (*GetOrientation )(void*, uint32_t*);
|
||||
|
||||
/* Drawing functions*/
|
||||
int32_t ( *SetCursor ) (void*, uint32_t, uint32_t);
|
||||
int32_t ( *DrawBitmap ) (void*, uint32_t, uint32_t, uint8_t *);
|
||||
int32_t ( *FillRGBRect ) (void*, uint32_t, uint32_t, uint8_t*, uint32_t, uint32_t);
|
||||
int32_t ( *DrawHLine ) (void*, uint32_t, uint32_t, uint32_t, uint32_t);
|
||||
int32_t ( *DrawVLine ) (void*, uint32_t, uint32_t, uint32_t, uint32_t);
|
||||
int32_t ( *FillRect ) (void*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t);
|
||||
int32_t ( *GetPixel ) (void*, uint32_t, uint32_t, uint32_t*);
|
||||
int32_t ( *SetPixel ) (void*, uint32_t, uint32_t, uint32_t);
|
||||
int32_t ( *GetXSize ) (void*, uint32_t *);
|
||||
int32_t ( *GetYSize ) (void*, uint32_t *);
|
||||
}LCD_Drv_t;
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LCD_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,104 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file motion_sensor.h
|
||||
* @author MCD Application Team
|
||||
* @brief This header file contains the functions prototypes for the
|
||||
* accelerometer driver
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2017 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 MOTION_SENSOR_H
|
||||
#define MOTION_SENSOR_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup COMPONENTS COMPONENTS
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup COMMON COMMON
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup MOTION_SENSOR MOTION SENSOR
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup MOTION_SENSOR_Public_Types MOTION SENSOR Public types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief MOTION_SENSOR driver structure definition
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
int32_t ( *Init ) ( void * );
|
||||
int32_t ( *DeInit ) ( void * );
|
||||
int32_t ( *ReadID ) ( void *, uint8_t * );
|
||||
int32_t ( *GetCapabilities ) ( void *, void * );
|
||||
} MOTION_SENSOR_CommonDrv_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t ( *Enable ) ( void * );
|
||||
int32_t ( *Disable ) ( void * );
|
||||
int32_t ( *GetSensitivity ) ( void *, float * );
|
||||
int32_t ( *GetOutputDataRate ) ( void *, float * );
|
||||
int32_t ( *SetOutputDataRate ) ( void *, float );
|
||||
int32_t ( *GetFullScale ) ( void *, int32_t * );
|
||||
int32_t ( *SetFullScale ) ( void *, int32_t );
|
||||
int32_t ( *GetAxes ) ( void *, void * );
|
||||
int32_t ( *GetAxesRaw ) ( void *, void * );
|
||||
} MOTION_SENSOR_FuncDrv_t;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MOTION_SENSOR_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,246 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file pwrmon.h
|
||||
* @author MCD Application Team
|
||||
* @brief This header file contains the functions prototypes for the
|
||||
* Current/Power Monitor device driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 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 __PWRMON_H
|
||||
#define __PWRMON_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup PWRMON
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Operating_Mode_enum Power Monitor Operating Mode enums
|
||||
* @{
|
||||
*/
|
||||
typedef enum {
|
||||
OPERATING_MODE_TRIGGERED = 0,
|
||||
OPERATING_MODE_CONTINUOUS,
|
||||
OPERATING_MODE_NB
|
||||
} PWRMON_OperatingMode_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Conversion_Time_enum Power Monitor Conversion_Time enums
|
||||
* @{
|
||||
*/
|
||||
typedef enum {
|
||||
CONVERT_TIME_140 = 0,
|
||||
CONVERT_TIME_204,
|
||||
CONVERT_TIME_332,
|
||||
CONVERT_TIME_588,
|
||||
CONVERT_TIME_1100,
|
||||
CONVERT_TIME_2116,
|
||||
CONVERT_TIME_4156,
|
||||
CONVERT_TIME_8244,
|
||||
CONVERT_TIME_NB
|
||||
} PWRMON_ConvertTime_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Conversion_Time_enum Power Monitor Conversion_Time enums
|
||||
* @{
|
||||
*/
|
||||
typedef enum {
|
||||
AVERAGING_MODE_1 = 0,
|
||||
AVERAGING_MODE_4,
|
||||
AVERAGING_MODE_16,
|
||||
AVERAGING_MODE_64,
|
||||
AVERAGING_MODE_128,
|
||||
AVERAGING_MODE_256,
|
||||
AVERAGING_MODE_512,
|
||||
AVERAGING_MODE_1024,
|
||||
AVERAGING_MODE_NB
|
||||
} PWRMON_AveragingMode_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Device_Configuration_structure Power Monitor Device Configuration structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
PWRMON_ConvertTime_t ShuntConvertTime;
|
||||
PWRMON_ConvertTime_t BusConvertTime;
|
||||
PWRMON_AveragingMode_t AveragingMode;
|
||||
} PWRMON_Config_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Alert_Polarity_enum Power Monitor Alert Polarity enums
|
||||
* @{
|
||||
*/
|
||||
typedef enum {
|
||||
ALERT_POLARITY_NORMAL = 0,
|
||||
ALERT_POLARITY_INVERTED,
|
||||
ALERT_POLARITY_NB
|
||||
} PWRMON_AlertPolarity_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Alert_Latch_Enable_enum Power Monitor Alert Latch Enable enums
|
||||
* @{
|
||||
*/
|
||||
typedef enum {
|
||||
ALERT_LATCH_DISABLE = 0,
|
||||
ALERT_LATCH_ENABLE,
|
||||
ALERT_LATCH_NB
|
||||
} PWRMON_AlertLatchEnable_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Alert_Function_enum Power Monitor Alert Function enums
|
||||
* @{
|
||||
*/
|
||||
typedef enum {
|
||||
ALERT_FUNCTION_NONE = 0,
|
||||
ALERT_FUNCTION_SOL,
|
||||
ALERT_FUNCTION_SUL,
|
||||
ALERT_FUNCTION_BOL,
|
||||
ALERT_FUNCTION_BUL,
|
||||
ALERT_FUNCTION_POL,
|
||||
ALERT_FUNCTION_NB,
|
||||
} PWRMON_AlertFunction_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Alert_Configuration_structure Power Monitor Alert Configuration structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
PWRMON_AlertPolarity_t Polarity;
|
||||
PWRMON_AlertLatchEnable_t LatchEnable;
|
||||
} PWRMON_AlertPinConfig_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Voltage_Input_enum Power Monitor Voltage Input enums
|
||||
* @{
|
||||
*/
|
||||
typedef enum {
|
||||
VOLTAGE_INPUT_SHUNT = 0,
|
||||
VOLTAGE_INPUT_BUS,
|
||||
VOLTAGE_INPUT_ALL,
|
||||
VOLTAGE_INPUT_NB
|
||||
} PWRMON_InputSignal_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Flag_enum Power Monitor Flag enums
|
||||
* @{
|
||||
*/
|
||||
typedef enum {
|
||||
FLAG_ALERT_FUNCTION = 0,
|
||||
FLAG_CONVERSION_READY,
|
||||
FLAG_MATH_OVERFLOW,
|
||||
FLAG_NB
|
||||
} PWRMON_Flag_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup PWRMON_Driver_structure Power Monitor Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
void (*Init)(uint16_t, PWRMON_Config_t *);
|
||||
void (*DeInit)(uint16_t);
|
||||
uint16_t (*ReadId)(uint16_t);
|
||||
void (*Reset)(uint16_t);
|
||||
void (*SetCalibration)(uint16_t, uint16_t);
|
||||
uint16_t (*GetCalibration)(uint16_t);
|
||||
void (*SetAlertFunction)(uint16_t, PWRMON_AlertFunction_t);
|
||||
PWRMON_AlertFunction_t (*GetAlertFunction)(uint16_t);
|
||||
void (*AlertPinConfig)(uint16_t, PWRMON_AlertPinConfig_t *);
|
||||
void (*SetVBusThreshold)(uint16_t, uint16_t);
|
||||
uint16_t (*GetVBusThreshold)(uint16_t);
|
||||
void (*SetVShuntThreshold)(uint16_t, int16_t);
|
||||
int16_t (*GetVShuntThreshold)(uint16_t);
|
||||
void (*SetPowerThreshold)(uint16_t, uint32_t);
|
||||
uint32_t (*GetPowerThreshold)(uint16_t);
|
||||
void (*AlertThresholdEnableIT)(uint16_t);
|
||||
void (*AlertThresholdDisableIT)(uint16_t);
|
||||
void (*ConversionReadyEnableIT)(uint16_t);
|
||||
void (*ConversionReadyDisableIT)(uint16_t);
|
||||
void (*StartConversion)(uint16_t, PWRMON_InputSignal_t, PWRMON_OperatingMode_t);
|
||||
void (*StopConversion)(uint16_t);
|
||||
uint16_t (*GetVBus)(uint16_t);
|
||||
int16_t (*GetVShunt)(uint16_t);
|
||||
uint16_t (*GetPower)(uint16_t);
|
||||
int16_t (*GetCurrent)(uint16_t);
|
||||
uint8_t (*GetFlag)(uint16_t, PWRMON_Flag_t);
|
||||
} PWRMON_Drv_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __PWRMON_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,93 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file ts.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the functions prototypes for the Touch Screen driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 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 TS_H
|
||||
#define TS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup TS
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup TS_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup TS_Driver_structure Touch Sensor Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
int32_t ( *Init ) (void *);
|
||||
int32_t ( *DeInit ) (void *);
|
||||
int32_t ( *GestureConfig ) (void *, void*);
|
||||
int32_t ( *ReadID ) (void *, uint32_t *);
|
||||
int32_t ( *GetState ) (void *, void*);
|
||||
int32_t ( *GetMultiTouchState ) (void *, void*);
|
||||
int32_t ( *GetGesture ) (void *, void*);
|
||||
int32_t ( *GetCapabilities ) (void *, void*);
|
||||
int32_t ( *EnableIT ) (void *);
|
||||
int32_t ( *DisableIT ) (void *);
|
||||
int32_t ( *ClearIT ) (void *);
|
||||
int32_t ( *ITStatus ) (void *);
|
||||
}TS_Drv_t;
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* TS_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,114 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file usbtypecswitch.h
|
||||
* @author MCD Application Team
|
||||
* @brief This header file contains the functions prototypes for the
|
||||
* crossbar switch device for USB Type-C systems.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 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 __USBTYPECSWITCH_H
|
||||
#define __USBTYPECSWITCH_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup TYPECSWITCH
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup TYPECSWITCH_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
typedef enum {
|
||||
USB_NORMAL = 0,
|
||||
USB_FLIPPED,
|
||||
DFP_D_PIN_ASSIGNMENT_A_NORMAL,
|
||||
DFP_D_PIN_ASSIGNMENT_A_FLIPPED,
|
||||
DFP_D_PIN_ASSIGNMENT_B_NORMAL,
|
||||
DFP_D_PIN_ASSIGNMENT_B_FLIPPED,
|
||||
DFP_D_PIN_ASSIGNMENT_C_NORMAL,
|
||||
DFP_D_PIN_ASSIGNMENT_C_FLIPPED,
|
||||
DFP_D_PIN_ASSIGNMENT_D_NORMAL,
|
||||
DFP_D_PIN_ASSIGNMENT_D_FLIPPED,
|
||||
DFP_D_PIN_ASSIGNMENT_E_NORMAL,
|
||||
DFP_D_PIN_ASSIGNMENT_E_FLIPPED,
|
||||
DFP_D_PIN_ASSIGNMENT_F_NORMAL,
|
||||
DFP_D_PIN_ASSIGNMENT_F_FLIPPED,
|
||||
UFP_D_PIN_ASSIGNMENT_A_NORMAL,
|
||||
UFP_D_PIN_ASSIGNMENT_A_FLIPPED,
|
||||
UFP_D_PIN_ASSIGNMENT_B_NORMAL,
|
||||
UFP_D_PIN_ASSIGNMENT_B_FLIPPED,
|
||||
UFP_D_PIN_ASSIGNMENT_C_NORMAL,
|
||||
UFP_D_PIN_ASSIGNMENT_C_FLIPPED,
|
||||
UFP_D_PIN_ASSIGNMENT_D_NORMAL,
|
||||
UFP_D_PIN_ASSIGNMENT_D_FLIPPED,
|
||||
UFP_D_PIN_ASSIGNMENT_E_NORMAL,
|
||||
UFP_D_PIN_ASSIGNMENT_E_FLIPPED,
|
||||
UFP_D_PIN_ASSIGNMENT_F_NORMAL,
|
||||
UFP_D_PIN_ASSIGNMENT_F_FLIPPED
|
||||
} TYPECSWITCH_Mode_t;
|
||||
|
||||
/** @defgroup TYPECSWITCH_Driver_structure USB Type-C Crossbar Switch Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t (*Init)(uint16_t);
|
||||
void (*DeInit)(uint16_t);
|
||||
uint32_t (*PowerOn)(uint16_t);
|
||||
uint32_t (*PowerOff)(uint16_t);
|
||||
uint32_t (*SetMode)(uint16_t, TYPECSWITCH_Mode_t);
|
||||
uint32_t (*IsSupportedMode)(TYPECSWITCH_Mode_t);
|
||||
} TYPECSWITCH_Drv_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __USBTYPECSWITCH_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,89 @@
|
||||
<!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 ADV7533 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-adv7533-component-driver"><strong>Release Notes for ADV7533 Component Driver</strong></h1>
|
||||
<p>Copyright © 2016 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 HDMI(audio and display) functions offered by ADV7533 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-section3" checked aria-hidden="true"> <label for="collapse-section3" aria-hidden="true"><strong>V2.0.1 / 23-November-2019</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Update st_logo.png inclusion path in Release notes</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section2" checked aria-hidden="true"> <label for="collapse-section2" aria-hidden="true"><strong>V2.0.0 / 14-October-2019</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-1">Main Changes</h2>
|
||||
<ul>
|
||||
<li>First Official release of ADV7533 BSP drivers in line with STM32Cube BSP drivers development guidelines (UM2298)</li>
|
||||
<li>The component drivers are composed of
|
||||
<ul>
|
||||
<li>component core drivers files: adv7533.h/.c</li>
|
||||
<li>component register drivers files: adv7533_reg.h/.c</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<h2 id="backward-compatibility">Backward Compatibility</h2>
|
||||
<ul>
|
||||
<li>This version breaks the compatibility with previous version</li>
|
||||
</ul>
|
||||
<h2 id="dependencies">Dependencies</h2>
|
||||
<p>This software release is compatible with:</p>
|
||||
<ul>
|
||||
<li>BSP Common v6.0.1 or above</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section1" checked aria-hidden="true"> <label for="collapse-section1" aria-hidden="true"><strong>V1.0.0 / 26-August-2016</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-2">Main Changes</h2>
|
||||
<ul>
|
||||
<li>First official release of ADV7533 HDMI component 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,92 @@
|
||||
---
|
||||
pagetitle: Release Notes for ADV7533 Component Driver
|
||||
lang: en
|
||||
---
|
||||
|
||||
::: {.row}
|
||||
::: {.col-sm-12 .col-lg-4}
|
||||
|
||||
::: {.card .fluid}
|
||||
::: {.sectione .dark}
|
||||
<center>
|
||||
# **Release Notes for ADV7533 Component Driver**
|
||||
Copyright © 2016 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 HDMI(audio and display) functions offered by ADV7533 component
|
||||
|
||||
:::
|
||||
|
||||
::: {.col-sm-12 .col-lg-8}
|
||||
# Update History
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section3" checked aria-hidden="true">
|
||||
<label for="collapse-section3" aria-hidden="true">__V2.0.1 / 23-November-2019__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- Update st_logo.png inclusion path in Release notes
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section2" checked aria-hidden="true">
|
||||
<label for="collapse-section2" aria-hidden="true">__V2.0.0 / 14-October-2019__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- First Official release of ADV7533 BSP drivers in line with STM32Cube BSP drivers development guidelines (UM2298)
|
||||
- The component drivers are composed of
|
||||
- component core drivers files: adv7533.h/.c
|
||||
- component register drivers files: adv7533_reg.h/.c
|
||||
|
||||
## Backward Compatibility
|
||||
|
||||
- This version breaks the compatibility with previous version
|
||||
|
||||
## Dependencies
|
||||
|
||||
This software release is compatible with:
|
||||
|
||||
- BSP Common v6.0.1 or above
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section1" checked aria-hidden="true">
|
||||
<label for="collapse-section1" aria-hidden="true">__V1.0.0 / 26-August-2016__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- First official release of ADV7533 HDMI component 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>
|
||||
|
After Width: | Height: | Size: 18 KiB |
@@ -0,0 +1,272 @@
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file adv7533.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the constants parameters for the ADV7533
|
||||
* which is the HDMI bridge between DSI and HDMI
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2016 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 ADV7533_H
|
||||
#define ADV7533_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "adv7533_reg.h"
|
||||
#include <stddef.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ADV7533
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup ADV7533_Exported_Types Exported Types
|
||||
* @{
|
||||
*/
|
||||
typedef int32_t (*ADV7533_Init_Func) (void);
|
||||
typedef int32_t (*ADV7533_DeInit_Func) (void);
|
||||
typedef int32_t (*ADV7533_GetTick_Func) (void);
|
||||
typedef int32_t (*ADV7533_Delay_Func) (uint32_t);
|
||||
typedef int32_t (*ADV7533_WriteReg_Func)(uint16_t, uint16_t, uint8_t*, uint16_t);
|
||||
typedef int32_t (*ADV7533_ReadReg_Func) (uint16_t, uint16_t, uint8_t*, uint16_t);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t Frequency;
|
||||
} ADV7533_Init_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
ADV7533_Init_Func Init;
|
||||
ADV7533_DeInit_Func DeInit;
|
||||
uint16_t Address;
|
||||
ADV7533_WriteReg_Func WriteReg;
|
||||
ADV7533_ReadReg_Func ReadReg;
|
||||
ADV7533_GetTick_Func GetTick;
|
||||
} ADV7533_IO_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
ADV7533_IO_t IO;
|
||||
adv7533_ctx_t Ctx;
|
||||
uint8_t IsInitialized;
|
||||
} ADV7533_Object_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t ( *Init ) ( ADV7533_Object_t *, ADV7533_Init_t* );
|
||||
int32_t ( *DeInit ) ( ADV7533_Object_t * );
|
||||
int32_t ( *ReadID ) ( ADV7533_Object_t *, uint32_t *);
|
||||
int32_t ( *Play ) ( ADV7533_Object_t * );
|
||||
int32_t ( *Pause ) ( ADV7533_Object_t * );
|
||||
int32_t ( *Resume ) ( ADV7533_Object_t * );
|
||||
int32_t ( *Stop ) ( ADV7533_Object_t *, uint32_t );
|
||||
int32_t ( *SetFrequency ) ( ADV7533_Object_t *, uint32_t );
|
||||
int32_t ( *GetFrequency ) ( ADV7533_Object_t *, uint32_t* );
|
||||
int32_t ( *SetVolume ) ( ADV7533_Object_t *, uint8_t, uint8_t );
|
||||
int32_t ( *GetVolume ) ( ADV7533_Object_t *, uint8_t );
|
||||
int32_t ( *SetMute ) ( ADV7533_Object_t *, uint16_t );
|
||||
int32_t ( *SetOutputMode ) ( ADV7533_Object_t *, uint16_t );
|
||||
int32_t ( *SetResolution ) ( ADV7533_Object_t *, uint32_t );
|
||||
int32_t ( *GetResolution ) ( ADV7533_Object_t *, uint32_t *);
|
||||
int32_t ( *SetProtocol ) ( ADV7533_Object_t *, uint16_t );
|
||||
int32_t ( *GetProtocol ) ( ADV7533_Object_t *);
|
||||
int32_t ( *Reset ) ( ADV7533_Object_t * );
|
||||
} ADV7533_Drv_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* Control functions */
|
||||
int32_t (*Init )(ADV7533_Object_t*, uint32_t, uint32_t);
|
||||
int32_t (*DeInit )(ADV7533_Object_t*);
|
||||
int32_t (*ReadID )(ADV7533_Object_t*, uint32_t*);
|
||||
int32_t (*DisplayOn )(ADV7533_Object_t*);
|
||||
int32_t (*DisplayOff )(ADV7533_Object_t*);
|
||||
int32_t (*SetBrightness )(ADV7533_Object_t*, uint32_t);
|
||||
int32_t (*GetBrightness )(ADV7533_Object_t*, uint32_t*);
|
||||
int32_t (*SetOrientation )(ADV7533_Object_t*, uint32_t);
|
||||
int32_t (*GetOrientation )(ADV7533_Object_t*, uint32_t*);
|
||||
|
||||
/* Drawing functions*/
|
||||
int32_t ( *SetCursor ) (ADV7533_Object_t*, uint32_t, uint32_t);
|
||||
int32_t ( *DrawBitmap ) (ADV7533_Object_t*, uint32_t, uint32_t, uint8_t *);
|
||||
int32_t (*FillRGBRect ) (ADV7533_Object_t*, uint32_t, uint32_t, uint8_t *, uint32_t, uint32_t);
|
||||
int32_t ( *DrawHLine ) (ADV7533_Object_t*, uint32_t, uint32_t, uint32_t, uint32_t);
|
||||
int32_t ( *DrawVLine ) (ADV7533_Object_t*, uint32_t, uint32_t, uint32_t, uint32_t);
|
||||
int32_t ( *FillRect ) (ADV7533_Object_t*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t);
|
||||
int32_t ( *GetPixel ) (ADV7533_Object_t*, uint32_t, uint32_t, uint32_t*);
|
||||
int32_t ( *SetPixel ) (ADV7533_Object_t*, uint32_t, uint32_t, uint32_t);
|
||||
int32_t ( *GetXSize ) (ADV7533_Object_t*, uint32_t *);
|
||||
int32_t ( *GetYSize ) (ADV7533_Object_t*, uint32_t *);
|
||||
} ADV7533_LcdDrv_t;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup ADV7533_Exported_Constants Exported Constants
|
||||
* @{
|
||||
*/
|
||||
#define ADV7533_OK (0)
|
||||
#define ADV7533_ERROR (-1)
|
||||
|
||||
/**
|
||||
* @brief AUDIO FREQUENCY
|
||||
*/
|
||||
#define ADV7533_FREQUENCY_192K 192000
|
||||
#define ADV7533_FREQUENCY_176K 176400
|
||||
#define ADV7533_FREQUENCY_96K 96000
|
||||
#define ADV7533_FREQUENCY_88K 88200
|
||||
#define ADV7533_FREQUENCY_48K 48000
|
||||
#define ADV7533_FREQUENCY_44K 44100
|
||||
#define ADV7533_FREQUENCY_32K 32000
|
||||
#define ADV7533_FREQUENCY_22K 22050
|
||||
#define ADV7533_FREQUENCY_16K 16000
|
||||
#define ADV7533_FREQUENCY_11K 11025
|
||||
#define ADV7533_FREQUENCY_8K 8000
|
||||
|
||||
/**
|
||||
* @brief HDMI audio output DEVICE
|
||||
*/
|
||||
#define OUTPUT_DEVICE_ADV7533_HDMI 0x1000U
|
||||
|
||||
/**
|
||||
* @brief ADV7533 I2C Addresses 0x7A / 0x78
|
||||
*/
|
||||
#define ADV7533_MAIN_I2C_ADDR 0x7AU
|
||||
#define ADV7533_CEC_DSI_I2C_ADDR 0x78U
|
||||
|
||||
/**
|
||||
* @brief ADV7533 Aspect ratio
|
||||
*/
|
||||
#define ADV7533_ASPECT_RATIO_16_9 00U
|
||||
#define ADV7533_ASPECT_RATIO_4_3 01U
|
||||
|
||||
/**
|
||||
* @brief ADV7533 Aspect ratio
|
||||
*/
|
||||
#define ADV7533_MODE_HDMI 00U
|
||||
#define ADV7533_MODE_DVI 01U
|
||||
|
||||
/**
|
||||
* @brief ADV7533 Main Features Parameters
|
||||
*/
|
||||
|
||||
/** @Brief adv7533 ID
|
||||
*/
|
||||
#define ADV7533_ID 0x7533U
|
||||
|
||||
/* MUTE commands */
|
||||
#define ADV7533_MUTE_ON 1U
|
||||
#define ADV7533_MUTE_OFF 0U
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
|
||||
/** @defgroup ADV7533_Exported_Macros ADV7533 Exported Macros
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup ADV7533_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
int32_t ADV7533_RegisterBusIO (ADV7533_Object_t *pObj, ADV7533_IO_t *pIO);
|
||||
/*------------------------------------------------------------------------------
|
||||
HDMI video functions
|
||||
------------------------------------------------------------------------------*/
|
||||
int32_t ADV7533_Init(ADV7533_Object_t *pObj, uint32_t ColorCoding, uint32_t Orientation);
|
||||
int32_t ADV7533_DisplayOn(ADV7533_Object_t *pObj);
|
||||
int32_t ADV7533_DisplayOff(ADV7533_Object_t *pObj);
|
||||
int32_t ADV7533_Configure(ADV7533_Object_t *pObj, uint8_t LaneNumber);
|
||||
int32_t ADV7533_PatternEnable(ADV7533_Object_t *pObj);
|
||||
int32_t ADV7533_PatternDisable(ADV7533_Object_t *pObj);
|
||||
|
||||
int32_t ADV7533_SetBrightness(ADV7533_Object_t *pObj, uint32_t Brightness);
|
||||
int32_t ADV7533_GetBrightness(ADV7533_Object_t *pObj, uint32_t *Brightness);
|
||||
int32_t ADV7533_SetOrientation(ADV7533_Object_t *pObj, uint32_t Orientation);
|
||||
int32_t ADV7533_GetOrientation(ADV7533_Object_t *pObj, uint32_t *Orientation);
|
||||
|
||||
|
||||
int32_t ADV7533_SetCursor(ADV7533_Object_t *pObj, uint32_t Xpos, uint32_t Ypos);
|
||||
int32_t ADV7533_DrawBitmap(ADV7533_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint8_t *pBmp);
|
||||
int32_t ADV7533_FillRGBRect(ADV7533_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint8_t *pData, uint32_t Width, uint32_t Height);
|
||||
int32_t ADV7533_DrawHLine(ADV7533_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color);
|
||||
int32_t ADV7533_DrawVLine(ADV7533_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color);
|
||||
int32_t ADV7533_FillRect(ADV7533_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Width, uint32_t Height, uint32_t Color);
|
||||
int32_t ADV7533_SetPixel(ADV7533_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Color);
|
||||
int32_t ADV7533_GetPixel(ADV7533_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t *Color);
|
||||
int32_t ADV7533_GetXSize(ADV7533_Object_t *pObj, uint32_t *XSize);
|
||||
int32_t ADV7533_GetYSize(ADV7533_Object_t *pObj, uint32_t *YSize);
|
||||
/*------------------------------------------------------------------------------
|
||||
HDMI Audio functions
|
||||
------------------------------------------------------------------------------*/
|
||||
int32_t ADV7533_AudioInit(ADV7533_Object_t *pObj, ADV7533_Init_t *pInit);
|
||||
int32_t ADV7533_DeInit(ADV7533_Object_t *pObj);
|
||||
int32_t ADV7533_ReadID(ADV7533_Object_t *pObj, uint32_t *Id);
|
||||
int32_t ADV7533_Play(ADV7533_Object_t *pObj);
|
||||
int32_t ADV7533_Pause(ADV7533_Object_t *pObj);
|
||||
int32_t ADV7533_Resume(ADV7533_Object_t *pObj);
|
||||
int32_t ADV7533_Stop(ADV7533_Object_t *pObj, uint32_t CodecPdwnMode);
|
||||
int32_t ADV7533_SetVolume(ADV7533_Object_t *pObj, uint8_t Volume, uint8_t InputOutput);
|
||||
int32_t ADV7533_GetVolume(ADV7533_Object_t *pObj, uint8_t InputOutput);
|
||||
int32_t ADV7533_SetMute(ADV7533_Object_t *pObj, uint16_t Cmd);
|
||||
int32_t ADV7533_SetOutputMode(ADV7533_Object_t *pObj, uint16_t Output);
|
||||
int32_t ADV7533_SetResolution(ADV7533_Object_t *pObj, uint32_t Resolution);
|
||||
int32_t ADV7533_GetResolution(ADV7533_Object_t *pObj, uint32_t *Resolution);
|
||||
int32_t ADV7533_SetProtocol(ADV7533_Object_t *pObj, uint16_t Protocol);
|
||||
int32_t ADV7533_GetProtocol(ADV7533_Object_t *pObj);
|
||||
int32_t ADV7533_SetFrequency(ADV7533_Object_t *pObj, uint32_t AudioFreq);
|
||||
int32_t ADV7533_GetFrequency(ADV7533_Object_t *pObj, uint32_t *Frequency);
|
||||
int32_t ADV7533_Reset(ADV7533_Object_t *pObj);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Audio driver structure */
|
||||
extern ADV7533_Drv_t ADV7533_Driver;
|
||||
/* LCD driver structure */
|
||||
extern ADV7533_LcdDrv_t ADV7533_LCD_Driver;
|
||||
#endif /* ADV7533_H */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,94 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file adv7533_reg.c
|
||||
* @author MCD Application Team
|
||||
* @brief This file provides the ADV7533 DSI to HDMI bridge driver
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2016 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 "adv7533_reg.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ADV7533
|
||||
* @brief This file provides a set of functions needed to drive the
|
||||
* adv7533 DSI-HDMI bridge.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Private types -------------------------------------------------------------*/
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
/* Private constants ---------------------------------------------------------*/
|
||||
/** @defgroup ADV7533_Private_Constants ADV7533 Private Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup ADV7533_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
/* Private functions ---------------------------------------------------------*/
|
||||
|
||||
/************** Generic Function *******************/
|
||||
/*******************************************************************************
|
||||
* Function Name : adv7533_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 adv7533_read_reg(adv7533_ctx_t *ctx, uint16_t reg, uint8_t *pdata, uint16_t length)
|
||||
{
|
||||
return ctx->ReadReg(ctx->handle, reg, pdata, length);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : adv7533_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 adv7533_write_reg(adv7533_ctx_t *ctx, uint16_t reg, uint8_t *pdata, uint16_t length)
|
||||
{
|
||||
return ctx->WriteReg(ctx->handle, reg, pdata, length);
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,144 @@
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file adv7533_reg.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the constants parameters for the ADV7533
|
||||
* which is the HDMI bridge between DSI and HDMI
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2016 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 ADV7533_REG_H
|
||||
#define ADV7533_REG_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ADV7533
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ADV7533_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief ADV7533 Main Registers
|
||||
*/
|
||||
#define ADV7533_MAIN_SYNC_REG 0x17U
|
||||
#define ADV7533_MAIN_POWER_DOWN_REG 0x41U
|
||||
#define ADV7533_MAIN_HPG_REG 0x42U
|
||||
|
||||
/**
|
||||
* @brief ADV7533 Main Features Parameters
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief ADV7533 CEC DSI Registers
|
||||
*/
|
||||
#define ADV7533_CEC_DSI_INTERNAL_TIMING_REG 0x27U
|
||||
#define ADV7533_CEC_DSI_TOTAL_WIDTH_H_REG 0x28U
|
||||
#define ADV7533_CEC_DSI_TOTAL_WIDTH_L_REG 0x29U
|
||||
#define ADV7533_CEC_DSI_HSYNC_H_REG 0x2AU
|
||||
#define ADV7533_CEC_DSI_HSYNC_L_REG 0x2BU
|
||||
#define ADV7533_CEC_DSI_HFP_H_REG 0x2CU
|
||||
#define ADV7533_CEC_DSI_HFP_L_REG 0x2DU
|
||||
#define ADV7533_CEC_DSI_HBP_H_REG 0x2EU
|
||||
#define ADV7533_CEC_DSI_HBP_L_REG 0x2FU
|
||||
|
||||
#define ADV7533_CEC_DSI_TOTAL_HEIGHT_H_REG 0x30U
|
||||
#define ADV7533_CEC_DSI_TOTAL_HEIGHT_L_REG 0x31U
|
||||
#define ADV7533_CEC_DSI_VSYNC_H_REG 0x32U
|
||||
#define ADV7533_CEC_DSI_VSYNC_L_REG 0x33U
|
||||
#define ADV7533_CEC_DSI_VFP_H_REG 0x34U
|
||||
#define ADV7533_CEC_DSI_VFP_L_REG 0x35U
|
||||
#define ADV7533_CEC_DSI_VBP_H_REG 0x36U
|
||||
#define ADV7533_CEC_DSI_VBP_L_REG 0x37U
|
||||
|
||||
/** @Brief device ID register
|
||||
*/
|
||||
#define ADV7533_CHIPID_ADDR0 0x00U
|
||||
#define ADV7533_CHIPID_ADDR1 0x01U
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
|
||||
/** @defgroup ADV7533_Exported_Macros ADV7533 Exported Macros
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/** @addtogroup ADV7533_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
typedef int32_t (*ADV7533_Write_Func)(void *, uint16_t, uint8_t*, uint16_t);
|
||||
typedef int32_t (*ADV7533_Read_Func) (void *, uint16_t, uint8_t*, uint16_t);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
ADV7533_Write_Func WriteReg;
|
||||
ADV7533_Read_Func ReadReg;
|
||||
void *handle;
|
||||
} adv7533_ctx_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup ADV7533_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
int32_t adv7533_write_reg(adv7533_ctx_t *ctx, uint16_t reg, uint8_t *pdata, uint16_t length );
|
||||
int32_t adv7533_read_reg(adv7533_ctx_t *ctx, uint16_t reg, uint8_t *pdata, uint16_t length );
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ADV7533_REG_H */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,84 @@
|
||||
<!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 AMPIRE480272 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-ampire480272-component-driver"><strong>Release Notes for AMPIRE480272 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 timings required for Ampire480272 LCD 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-section4" checked aria-hidden="true"> <label for="collapse-section4" aria-hidden="true"><strong>V1.0.3 / 23-November-2019</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Update st_logo.png inclusion path in Release notes.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section3" checked aria-hidden="true"> <label for="collapse-section3" aria-hidden="true"><strong>V1.0.2 / 14-October-2019</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-1">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Update Release_Notes generation sources</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section2" checked aria-hidden="true"> <label for="collapse-section2" aria-hidden="true"><strong>V1.0.1 / 07-April-2017</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-2">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-section1" checked aria-hidden="true"> <label for="collapse-section1" aria-hidden="true"><strong>V1.0.0 / 18-February-2014</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-3">Main Changes</h2>
|
||||
<ul>
|
||||
<li>First official release of ampire480272 LCD component 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,91 @@
|
||||
---
|
||||
pagetitle: Release Notes for AMPIRE480272 Component Driver
|
||||
lang: en
|
||||
---
|
||||
|
||||
::: {.row}
|
||||
::: {.col-sm-12 .col-lg-4}
|
||||
|
||||
::: {.card .fluid}
|
||||
::: {.sectione .dark}
|
||||
<center>
|
||||
# **Release Notes for AMPIRE480272 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 timings required for Ampire480272 LCD component
|
||||
|
||||
:::
|
||||
|
||||
::: {.col-sm-12 .col-lg-8}
|
||||
# Update History
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section4" checked aria-hidden="true">
|
||||
<label for="collapse-section4" aria-hidden="true">__V1.0.3 / 23-November-2019__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- Update st_logo.png inclusion path in Release notes.
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section3" checked aria-hidden="true">
|
||||
<label for="collapse-section3" aria-hidden="true">__V1.0.2 / 14-October-2019__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- Update Release_Notes generation sources
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section2" checked aria-hidden="true">
|
||||
<label for="collapse-section2" aria-hidden="true">__V1.0.1 / 07-April-2017__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- Update comments to be used for PDSC generation
|
||||
|
||||
</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 ampire480272 LCD component 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>
|
||||
|
After Width: | Height: | Size: 18 KiB |
@@ -0,0 +1,119 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file ampire480272.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the constants parameters for the ampire480272
|
||||
* LCD component.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
|
||||
*
|
||||
* 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 STMicroelectronics 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.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __AMPIRE480272_H
|
||||
#define __AMPIRE480272_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ampire480272
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup AMPIRE480272_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup AMPIRE480272_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief AMPIRE480272 Size
|
||||
*/
|
||||
#define AMPIRE480272_WIDTH ((uint16_t)480) /* LCD PIXEL WIDTH */
|
||||
#define AMPIRE480272_HEIGHT ((uint16_t)272) /* LCD PIXEL HEIGHT */
|
||||
|
||||
/**
|
||||
* @brief AMPIRE480272 Timing
|
||||
*/
|
||||
#define AMPIRE480272_HSYNC ((uint16_t)41) /* Horizontal synchronization */
|
||||
#define AMPIRE480272_HBP ((uint16_t)2) /* Horizontal back porch */
|
||||
#define AMPIRE480272_HFP ((uint16_t)2) /* Horizontal front porch */
|
||||
#define AMPIRE480272_VSYNC ((uint16_t)10) /* Vertical synchronization */
|
||||
#define AMPIRE480272_VBP ((uint16_t)2) /* Vertical back porch */
|
||||
#define AMPIRE480272_VFP ((uint16_t)2) /* Vertical front porch */
|
||||
|
||||
/**
|
||||
* @brief AMPIRE480272 frequency divider
|
||||
*/
|
||||
#define AMPIRE480272_FREQUENCY_DIVIDER 5 /* LCD Frequency divider */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup AMPIRE480272_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __AMPIRE480272_H */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,84 @@
|
||||
<!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 AMPIRE640480 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-ampire640480-component-driver"><strong>Release Notes for AMPIRE640480 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 timings required for Ampire640480 LCD 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-section4" checked aria-hidden="true"> <label for="collapse-section4" aria-hidden="true"><strong>V1.0.3 / 23-November-2019</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Update st_logo.png inclusion path in Release notes.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section3" checked aria-hidden="true"> <label for="collapse-section3" aria-hidden="true"><strong>V1.0.2 / 14-October-2019</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-1">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Update Release_Notes generation sources</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section2" checked aria-hidden="true"> <label for="collapse-section2" aria-hidden="true"><strong>V1.0.1 / 07-April-2017</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-2">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-section1" checked aria-hidden="true"> <label for="collapse-section1" aria-hidden="true"><strong>V1.0.0 / 18-February-2014</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-3">Main Changes</h2>
|
||||
<ul>
|
||||
<li>First official release of ampire640480 LCD component 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,91 @@
|
||||
---
|
||||
pagetitle: Release Notes for AMPIRE640480 Component Driver
|
||||
lang: en
|
||||
---
|
||||
|
||||
::: {.row}
|
||||
::: {.col-sm-12 .col-lg-4}
|
||||
|
||||
::: {.card .fluid}
|
||||
::: {.sectione .dark}
|
||||
<center>
|
||||
# **Release Notes for AMPIRE640480 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 timings required for Ampire640480 LCD component
|
||||
|
||||
:::
|
||||
|
||||
::: {.col-sm-12 .col-lg-8}
|
||||
# Update History
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section4" checked aria-hidden="true">
|
||||
<label for="collapse-section4" aria-hidden="true">__V1.0.3 / 23-November-2019__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- Update st_logo.png inclusion path in Release notes.
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section3" checked aria-hidden="true">
|
||||
<label for="collapse-section3" aria-hidden="true">__V1.0.2 / 14-October-2019__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- Update Release_Notes generation sources
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section2" checked aria-hidden="true">
|
||||
<label for="collapse-section2" aria-hidden="true">__V1.0.1 / 07-April-2017__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- Update comments to be used for PDSC generation
|
||||
|
||||
</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 ampire640480 LCD component 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>
|
||||
|
After Width: | Height: | Size: 18 KiB |
@@ -0,0 +1,119 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file ampire640480.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the constants parameters for the ampire640480
|
||||
* LCD component.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
|
||||
*
|
||||
* 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 STMicroelectronics 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.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __AMPIRE640480_H
|
||||
#define __AMPIRE640480_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ampire640480
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup AMPIRE640480_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup AMPIRE640480_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief AMPIRE640480 Size
|
||||
*/
|
||||
#define AMPIRE640480_WIDTH ((uint16_t)640) /* LCD PIXEL WIDTH */
|
||||
#define AMPIRE640480_HEIGHT ((uint16_t)480) /* LCD PIXEL HEIGHT */
|
||||
|
||||
/**
|
||||
* @brief AMPIRE640480 Timing
|
||||
*/
|
||||
#define AMPIRE640480_HSYNC ((uint16_t)30) /* Horizontal synchronization */
|
||||
#define AMPIRE640480_HBP ((uint16_t)114) /* Horizontal back porch */
|
||||
#define AMPIRE640480_HFP ((uint16_t)16) /* Horizontal front porch */
|
||||
#define AMPIRE640480_VSYNC ((uint16_t)3) /* Vertical synchronization */
|
||||
#define AMPIRE640480_VBP ((uint16_t)32) /* Vertical back porch */
|
||||
#define AMPIRE640480_VFP ((uint16_t)10) /* Vertical front porch */
|
||||
|
||||
/**
|
||||
* @brief AMPIRE640480 frequency divider
|
||||
*/
|
||||
#define AMPIRE640480_FREQUENCY_DIVIDER 3 /* LCD Frequency divider */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup AMPIRE640480_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __AMPIRE640480_H */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,91 @@
|
||||
<!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 CS42L51 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-cs42l51-component-driver"><strong>Release Notes for CS42L51 Component Driver</strong></h1>
|
||||
<p>Copyright © 2017 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 audio functions offered by CS42L51 codec 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-section3" checked aria-hidden="true"> <label for="collapse-section3" aria-hidden="true"><strong>V2.0.1 / 30-October-2019</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Update st_logo.png inclusion path in Release notes.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section2" checked aria-hidden="true"> <label for="collapse-section2" aria-hidden="true"><strong>V2.0.0 / 14-October-2019</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-1">Main Changes</h2>
|
||||
<ul>
|
||||
<li>First Official release of CS42L51 BSP drivers in line with STM32Cube BSP drivers development guidelines (UM2298)</li>
|
||||
<li>The component drivers are composed of
|
||||
<ul>
|
||||
<li>component core drivers files: cs42l51.h/.c</li>
|
||||
<li>component register drivers files: cs42l51_regs.h/.c</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><p>This software release is compatible with:</p>
|
||||
<ul>
|
||||
<li>BSP Common v6.0.1 or above</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section1" checked aria-hidden="true"> <label for="collapse-section1" aria-hidden="true"><strong>V1.0.0 / 17-February-2017</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-2">Main Changes</h2>
|
||||
<ul>
|
||||
<li>First official release of <strong>CS42L51</strong> Audio codec Component drivers</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,92 @@
|
||||
---
|
||||
pagetitle: Release Notes for CS42L51 Component Driver
|
||||
lang: en
|
||||
---
|
||||
|
||||
::: {.row}
|
||||
::: {.col-sm-12 .col-lg-4}
|
||||
|
||||
::: {.card .fluid}
|
||||
::: {.sectione .dark}
|
||||
<center>
|
||||
# **Release Notes for CS42L51 Component Driver**
|
||||
Copyright © 2017 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 audio functions offered by CS42L51 codec component
|
||||
|
||||
:::
|
||||
|
||||
::: {.col-sm-12 .col-lg-8}
|
||||
# Update History
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section3" checked aria-hidden="true">
|
||||
<label for="collapse-section3" aria-hidden="true">__V2.0.1 / 30-October-2019__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- Update st_logo.png inclusion path in Release notes.
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section2" checked aria-hidden="true">
|
||||
<label for="collapse-section2" aria-hidden="true">__V2.0.0 / 14-October-2019__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- First Official release of CS42L51 BSP drivers in line with STM32Cube BSP drivers development guidelines (UM2298)
|
||||
- The component drivers are composed of
|
||||
- component core drivers files: cs42l51.h/.c
|
||||
- component register drivers files: cs42l51_regs.h/.c
|
||||
|
||||
## Backward Compatibility
|
||||
|
||||
- This version breaks the compatibility with previous versions
|
||||
|
||||
## Dependencies
|
||||
|
||||
- This software release is compatible with:
|
||||
|
||||
- BSP Common v6.0.1 or above
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section1" checked aria-hidden="true">
|
||||
<label for="collapse-section1" aria-hidden="true">__V1.0.0 / 17-February-2017__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- First official release of **CS42L51** Audio codec Component drivers
|
||||
|
||||
</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>
|
||||
|
After Width: | Height: | Size: 18 KiB |
@@ -0,0 +1,722 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file cs42l51.c
|
||||
* @author MCD Application Team
|
||||
* @brief This file provides the CS42L51 Audio Codec driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 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 "cs42l51.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup cs42l51
|
||||
* @brief This file provides a set of functions needed to drive the
|
||||
* CS42L51 audio codec.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup CS42L51_Private_Types Private Types
|
||||
* @{
|
||||
*/
|
||||
/* Audio codec driver structure initialization */
|
||||
CS42L51_Drv_t CS42L51_Driver =
|
||||
{
|
||||
CS42L51_Init,
|
||||
CS42L51_DeInit,
|
||||
CS42L51_ReadID,
|
||||
CS42L51_Play,
|
||||
CS42L51_Pause,
|
||||
CS42L51_Resume,
|
||||
CS42L51_Stop,
|
||||
CS42L51_SetFrequency,
|
||||
CS42L51_GetFrequency,
|
||||
CS42L51_SetVolume,
|
||||
CS42L51_GetVolume,
|
||||
CS42L51_SetMute,
|
||||
CS42L51_SetOutputMode,
|
||||
CS42L51_SetResolution,
|
||||
CS42L51_GetResolution,
|
||||
CS42L51_SetProtocol,
|
||||
CS42L51_GetProtocol,
|
||||
CS42L51_Reset
|
||||
};
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup CS42L51_Private_Variables Private Variables
|
||||
* @{
|
||||
*/
|
||||
static uint32_t CS42L51_CurrentDevices = CS42L51_OUT_NONE;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup CS42L51_Function_Prototypes Function Prototypes
|
||||
* @{
|
||||
*/
|
||||
static int32_t CS42L51_ReadRegWrap(void *handle, uint16_t Reg, uint8_t* Data, uint16_t Length);
|
||||
static int32_t CS42L51_WriteRegWrap(void *handle, uint16_t Reg, uint8_t* Data, uint16_t Length);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup CS42L51_Private_Functions Private Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Initializes the audio codec and the control interface.
|
||||
* @param pObj pointer to component object
|
||||
* @param pInit pointer de component init structure
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_Init(CS42L51_Object_t *pObj, CS42L51_Init_t *pInit)
|
||||
{
|
||||
int32_t ret = 0;
|
||||
uint8_t tmp;
|
||||
|
||||
if(pObj->IsInitialized == 0U)
|
||||
{
|
||||
/* Set the device in standby mode */
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
tmp |= 0x01U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
|
||||
/* Set all power down bits to 1 */
|
||||
tmp = 0x7FU;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_MIC_PWR_SPEED_CTRL, &tmp, 1);
|
||||
tmp |= 0x0EU;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_MIC_PWR_SPEED_CTRL, &tmp, 1);
|
||||
|
||||
pObj->IsInitialized = 1U;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Set all power down bits to 1 exept PDN to mute ADCs and DACs*/
|
||||
tmp = 0x7EU;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_MIC_PWR_SPEED_CTRL, &tmp, 1);
|
||||
tmp |= 0x0EU;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_MIC_PWR_SPEED_CTRL, &tmp, 1);
|
||||
|
||||
/* Disable zero cross and soft ramp */
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_DAC_CTRL, &tmp, 1);
|
||||
tmp &= 0xFCU;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_DAC_CTRL, &tmp, 1);
|
||||
|
||||
/* Power control : Enter standby (PDN = 1) */
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
tmp |= 0x01U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
}
|
||||
|
||||
|
||||
/* Mic Power and Speed Control : Auto detect on, Speed mode SSM, tri state off, MCLK divide by 2 off */
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_MIC_PWR_SPEED_CTRL, &tmp, 1);
|
||||
tmp = ((tmp & 0x0EU) | 0xA0U);
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_MIC_PWR_SPEED_CTRL, &tmp, 1);
|
||||
|
||||
/* Interface control : Loopback off, Slave, I2S (SDIN and SOUT), Digital mix off, Mic mix off */
|
||||
tmp = 0x0CU;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_INTERFACE_CTRL, &tmp, 1);
|
||||
|
||||
/* Mic control : ADC single volume off, ADCB boost off, ADCA boost off, MicBias on AIN3B/MICIN2 pin, MicBias level 0.8xVA, MICB boost 32db, MICA boost 32dB */
|
||||
tmp = 0x03U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_MIC_CTRL, &tmp, 1);
|
||||
|
||||
/* ADC control : ADCB HPF on, ADCB HPF freeze off, ADCA HPF on, ADCA HPF freeze off, Soft ramp B on, Zero cross B on, Soft ramp A on, Zero cross A on */
|
||||
tmp = 0xAFU;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_ADC_CTRL, &tmp, 1);
|
||||
|
||||
/* DAC output control : HP Gain to 1, Single volume control off, PCM invert signals polarity off, DAC channels mute on */
|
||||
tmp = 0xC3U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_DAC_OUTPUT_CTRL, &tmp, 1);
|
||||
|
||||
/* DAC control : Signal processing to DAC, Freeze off, De-emphasis off, Analog output auto mute off, DAC soft ramp */
|
||||
tmp = 0x42U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_DAC_CTRL, &tmp, 1);
|
||||
|
||||
/* ALCA and PGAA Control : ALCA soft ramp disable on, ALCA zero cross disable on, PGA A Gain +8dB */
|
||||
tmp = 0xD0U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_ALCA_PGAA_CTRL, &tmp, 1);
|
||||
|
||||
/* ALCB and PGAB Control : ALCB soft ramp disable on, ALCB zero cross disable on, PGA B Gain +8dB */
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_ALCB_PGAB_CTRL, &tmp, 1);
|
||||
|
||||
/* ADCA Attenuator : 0dB */
|
||||
tmp = 0x00U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_ADCA_ATTENUATOR, &tmp, 1);
|
||||
|
||||
/* ADCB Attenuator : 0dB */
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_ADCB_ATTENUATOR, &tmp, 1);
|
||||
|
||||
/* ADCA mixer volume control : ADCA mixer channel mute on, ADCA mixer volume 0dB */
|
||||
tmp = 0x80U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_ADCA_MIXER_VOL_CTRL, &tmp, 1);
|
||||
|
||||
/* ADCB mixer volume control : ADCB mixer channel mute on, ADCB mixer volume 0dB */
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_ADCB_MIXER_VOL_CTRL, &tmp, 1);
|
||||
|
||||
/* PCMA mixer volume control : PCMA mixer channel mute off, PCMA mixer volume 0dB */
|
||||
tmp = 0x00U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_PCMA_MIXER_VOL_CTRL, &tmp, 1);
|
||||
|
||||
/* PCMB mixer volume control : PCMB mixer channel mute off, PCMB mixer volume 0dB */
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_PCMB_MIXER_VOL_CTRL, &tmp, 1);
|
||||
|
||||
/* PCM channel mixer : AOUTA Left, AOUTB Right */
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_ADC_PCM_CHANNEL_MIXER, &tmp, 1);
|
||||
|
||||
if((pInit->OutputDevice & CS42L51_OUT_HEADPHONE) == CS42L51_OUT_HEADPHONE)
|
||||
{
|
||||
tmp = VOLUME_CONVERT(pInit->Volume);
|
||||
/* AOUTA volume control : AOUTA volume */
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_AOUTA_VOL_CTRL, &tmp, 1);
|
||||
/* AOUTB volume control : AOUTB volume */
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_AOUTB_VOL_CTRL, &tmp, 1);
|
||||
}
|
||||
|
||||
/* ALC enable and attack rate : ALCB and ALCA enable, fastest attack */
|
||||
tmp = 0x40U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_ALC_ENABLE_AND_ATTACK_RATE, &tmp, 1);
|
||||
|
||||
/* Store current devices */
|
||||
CS42L51_CurrentDevices = (pInit->OutputDevice | pInit->InputDevice);
|
||||
|
||||
if(ret != CS42L51_OK)
|
||||
{
|
||||
ret = CS42L51_ERROR;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Deinitializes the audio codec.
|
||||
* @param pObj pointer to component object
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_DeInit(CS42L51_Object_t *pObj)
|
||||
{
|
||||
if(pObj->IsInitialized == 1U)
|
||||
{
|
||||
pObj->IsInitialized = 0U;
|
||||
}
|
||||
|
||||
return CS42L51_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the CS42L51 ID.
|
||||
* @param pObj pointer to component object
|
||||
* @param Id component ID
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_ReadID(CS42L51_Object_t *pObj, uint32_t *Id)
|
||||
{
|
||||
int32_t ret;
|
||||
uint8_t cs42l51_id;
|
||||
|
||||
/* Initialize the Control interface of the Audio Codec */
|
||||
pObj->IO.Init();
|
||||
|
||||
/* Get ID from component */
|
||||
ret = cs42l51_read_reg(&pObj->Ctx, CS42L51_CHIP_ID, &cs42l51_id, 1);
|
||||
|
||||
*Id = cs42l51_id;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Start the audio Codec play feature.
|
||||
* @note For this codec no Play options are required.
|
||||
* @param pObj pointer to component object
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_Play(CS42L51_Object_t *pObj)
|
||||
{
|
||||
int32_t ret = 0;
|
||||
uint8_t tmp;
|
||||
|
||||
if((CS42L51_CurrentDevices & CS42L51_OUT_HEADPHONE) == CS42L51_OUT_HEADPHONE)
|
||||
{
|
||||
/* Unmute the output first */
|
||||
ret += CS42L51_SetMute(pObj, CS42L51_MUTE_OFF);
|
||||
|
||||
/* DAC control : Signal processing to DAC, Freeze off, De-emphasis off, Analog output auto mute off, DAC soft ramp */
|
||||
tmp = 0x42U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_DAC_CTRL, &tmp, 1);
|
||||
|
||||
/* Power control 1 : PDN_DACA, PDN_DACB disable. */
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
tmp &= 0x9FU;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
}
|
||||
|
||||
if((CS42L51_CurrentDevices & CS42L51_IN_LINE1) == CS42L51_IN_LINE1)
|
||||
{
|
||||
/* ADC Input Select, Invert and Mute : AIN1B to PGAB, AIN1A to PGAA, ADCB invert off, ADCA invert off, ADCB mute off, ADCA mute off */
|
||||
tmp = 0x00U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_ADCX_INPUT_SELECT, &tmp, 1);
|
||||
|
||||
/* Power control 1 : PDN_PGAA, PDN_PGAA, PDN_ADCB, PDN_ADCA disable. */
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
tmp &= 0xF9U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
|
||||
/* Mic Power and Speed Control : PDN_MICA, PDN_MICB, PDN_MIC_BIAS disable. */
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_MIC_PWR_SPEED_CTRL, &tmp, 1);
|
||||
tmp &= 0xFFU;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_MIC_PWR_SPEED_CTRL, &tmp, 1);
|
||||
}
|
||||
|
||||
if((CS42L51_CurrentDevices & CS42L51_IN_MIC1) == CS42L51_IN_MIC1)
|
||||
{
|
||||
/* ADC Input Select, Invert and Mute : AIN1B to PGAB, AIN3A to PreAmp to PGAA, ADCB invert off, ADCA invert off, ADCB mute on, ADCA mute off */
|
||||
tmp = 0x32U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_ADCX_INPUT_SELECT, &tmp, 1);
|
||||
|
||||
/* Power control 1 : PDN_PGAA, PDN_ADCA disable. */
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
tmp &= 0xF5U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
|
||||
/* Mic Power and Speed Control : PDN_MICA, PDN_MIC_BIAS disable. */
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_MIC_PWR_SPEED_CTRL, &tmp, 1);
|
||||
tmp &= 0xF9U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_MIC_PWR_SPEED_CTRL, &tmp, 1);
|
||||
}
|
||||
|
||||
if((CS42L51_CurrentDevices & CS42L51_IN_MIC2) == CS42L51_IN_MIC2)
|
||||
{
|
||||
/* Power control 1 : PDN_PGAB, PDN_ADCB disable. */
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
tmp &= 0xEBU;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
|
||||
/* Mic Power and Speed Control : PDN_MICB, PDN_MIC_BIAS disable. */
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_MIC_PWR_SPEED_CTRL, &tmp, 1);
|
||||
tmp &= 0xF5U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_MIC_PWR_SPEED_CTRL, &tmp, 1);
|
||||
}
|
||||
|
||||
/* Power control : Exit standby (PDN = 0) */
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
tmp &= 0xFEU;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pauses playing on the audio codec.
|
||||
* @param pObj pointer to component object
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_Pause(CS42L51_Object_t *pObj)
|
||||
{
|
||||
/* Pause the audio file playing */
|
||||
if(CS42L51_SetMute(pObj, CS42L51_MUTE_ON) != CS42L51_OK)
|
||||
{
|
||||
return CS42L51_ERROR;
|
||||
}
|
||||
|
||||
return CS42L51_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Resumes playing on the audio codec.
|
||||
* @param pObj pointer to component object
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_Resume(CS42L51_Object_t *pObj)
|
||||
{
|
||||
/* Resumes the audio file playing */
|
||||
return CS42L51_SetMute(pObj, CS42L51_MUTE_OFF);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Stops audio Codec playing. It powers down the codec.
|
||||
* @param pObj pointer to component object
|
||||
* @param CodecPdwnMode selects the power down mode.
|
||||
* - CS42L51_PDWN_SW: only mutes the audio codec. When resuming from this
|
||||
* mode the codec keeps the previous initialization
|
||||
* (no need to re-Initialize the codec registers).
|
||||
* - CS42L51_PDWN_HW: Physically power down the codec. When resuming from this
|
||||
* mode, the codec is set to default configuration
|
||||
* (user should re-Initialize the codec in order to
|
||||
* play again the audio stream).
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_Stop(CS42L51_Object_t *pObj, uint32_t CodecPdwnMode)
|
||||
{
|
||||
int32_t ret;
|
||||
uint8_t tmp;
|
||||
|
||||
/* Mute the output first */
|
||||
ret = CS42L51_SetMute(pObj, CS42L51_MUTE_ON);
|
||||
|
||||
if (CodecPdwnMode == CS42L51_PDWN_SW)
|
||||
{
|
||||
/* Only output mute required*/
|
||||
}
|
||||
else /* CS42L51_PDWN_HW */
|
||||
{
|
||||
/* Set all power down bits to 1 exept PDN to mute ADCs and DACs*/
|
||||
tmp = 0x7EU;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_MIC_PWR_SPEED_CTRL, &tmp, 1);
|
||||
tmp |= 0x0EU;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_MIC_PWR_SPEED_CTRL, &tmp, 1);
|
||||
|
||||
/* Disable zero cross and soft ramp */
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_DAC_CTRL, &tmp, 1);
|
||||
tmp &= 0xFCU;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_DAC_CTRL, &tmp, 1);
|
||||
|
||||
/* Power control : Enter standby (PDN = 1) */
|
||||
ret += cs42l51_read_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
tmp |= 0x01U;
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_PWR_CTRL_1, &tmp, 1);
|
||||
}
|
||||
|
||||
if(ret != CS42L51_OK)
|
||||
{
|
||||
ret = CS42L51_ERROR;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set higher or lower the codec volume level.
|
||||
* @param pObj pointer to component object
|
||||
* @param InputOutput Input or Output volume
|
||||
* @param Volume a byte value from 0 to 255
|
||||
* (refer to codec registers description for more details).
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_SetVolume(CS42L51_Object_t *pObj, uint32_t InputOutput, uint8_t Volume)
|
||||
{
|
||||
int32_t ret;
|
||||
uint8_t convertedvol;
|
||||
|
||||
if(InputOutput != VOLUME_OUTPUT)
|
||||
{
|
||||
ret = CS42L51_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
convertedvol = VOLUME_CONVERT(Volume);
|
||||
|
||||
/* AOUTA volume control : AOUTA volume */
|
||||
ret = cs42l51_write_reg(&pObj->Ctx, CS42L51_AOUTA_VOL_CTRL, &convertedvol, 1);
|
||||
/* AOUTB volume control : AOUTB volume */
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_AOUTB_VOL_CTRL, &convertedvol, 1);
|
||||
}
|
||||
|
||||
if(ret != CS42L51_OK)
|
||||
{
|
||||
ret = CS42L51_ERROR;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get higher or lower the codec volume level.
|
||||
* @param pObj pointer to component object
|
||||
* @param InputOutput Input or Output volume
|
||||
* @param Volume audio volume
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_GetVolume(CS42L51_Object_t *pObj, uint32_t InputOutput, uint8_t *Volume)
|
||||
{
|
||||
int32_t ret;
|
||||
uint8_t tmp;
|
||||
|
||||
if(InputOutput != VOLUME_OUTPUT)
|
||||
{
|
||||
ret = CS42L51_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = cs42l51_read_reg(&pObj->Ctx, CS42L51_AOUTA_VOL_CTRL, &tmp, 1);
|
||||
*Volume = VOLUME_INVERT(tmp);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enables or disables the mute feature on the audio codec.
|
||||
* @param pObj pointer to component object
|
||||
* @param Cmd CS42L51_MUTE_ON to enable the mute or CS42L51_MUTE_OFF to disable the
|
||||
* mute mode.
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_SetMute(CS42L51_Object_t *pObj, uint32_t Cmd)
|
||||
{
|
||||
int32_t ret;
|
||||
uint8_t tmp;
|
||||
|
||||
ret = cs42l51_read_reg(&pObj->Ctx, CS42L51_DAC_OUTPUT_CTRL, &tmp, 1);
|
||||
|
||||
/* Set the Mute mode */
|
||||
if(Cmd == CS42L51_MUTE_ON)
|
||||
{
|
||||
tmp |= 0x03U;
|
||||
}
|
||||
else /* CS42L51_MUTE_OFF Disable the Mute */
|
||||
{
|
||||
tmp &= 0xFCU;
|
||||
}
|
||||
|
||||
ret += cs42l51_write_reg(&pObj->Ctx, CS42L51_DAC_OUTPUT_CTRL, &tmp, 1);
|
||||
|
||||
if(ret != CS42L51_OK)
|
||||
{
|
||||
ret = CS42L51_ERROR;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Switch dynamically (while audio file is played) the output target
|
||||
* (speaker or headphone).
|
||||
* @param pObj pointer to component object
|
||||
* @param Output Only CS42L51_OUT_HEADPHONE output is supported
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_SetOutputMode(CS42L51_Object_t *pObj, uint32_t Output)
|
||||
{
|
||||
(void)(pObj);
|
||||
(void)(Output);
|
||||
|
||||
/* This feature is not supported */
|
||||
return CS42L51_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set Audio resolution.
|
||||
* @param pObj pointer to component object
|
||||
* @param Resolution Audio resolution. Can be:
|
||||
* CS42L51_RESOLUTION_16b, CS42L51_RESOLUTION_18b,
|
||||
* CS42L51_RESOLUTION_20b or CS42L51_RESOLUTION_24b
|
||||
* @note This is applicable only for CS42L51_PROTOCOL_R_JUSTIFIED protocol
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_SetResolution(CS42L51_Object_t *pObj, uint32_t Resolution)
|
||||
{
|
||||
(void)(pObj);
|
||||
(void)(Resolution);
|
||||
|
||||
/* This feature is not supported */
|
||||
return CS42L51_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get Audio resolution.
|
||||
* @param pObj pointer to component object
|
||||
* @retval Audio resolution
|
||||
*/
|
||||
int32_t CS42L51_GetResolution(CS42L51_Object_t *pObj, uint32_t *Resolution)
|
||||
{
|
||||
(void)(pObj);
|
||||
(void)(Resolution);
|
||||
|
||||
/* This feature is not supported */
|
||||
return CS42L51_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set Audio Protocol.
|
||||
* @param pObj pointer to component object
|
||||
* @param Protocol Audio Protocol. Can be:
|
||||
* CS42L51_PROTOCOL_R_JUSTIFIED, CS42L51_PROTOCOL_L_JUSTIFIED
|
||||
* or CS42L51_PROTOCOL_I2S
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_SetProtocol(CS42L51_Object_t *pObj, uint32_t Protocol)
|
||||
{
|
||||
(void)(pObj);
|
||||
(void)(Protocol);
|
||||
|
||||
/* This feature is not supported */
|
||||
return CS42L51_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get Audio Protocol.
|
||||
* @param pObj pointer to component object
|
||||
* @param Protocol pointer to protocol value
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_GetProtocol(CS42L51_Object_t *pObj, uint32_t *Protocol)
|
||||
{
|
||||
(void)(pObj);
|
||||
(void)(Protocol);
|
||||
|
||||
/* This feature is not supported */
|
||||
return CS42L51_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Sets new frequency.
|
||||
* @param pObj pointer to component object
|
||||
* @param AudioFreq Audio frequency
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_SetFrequency(CS42L51_Object_t *pObj, uint32_t AudioFreq)
|
||||
{
|
||||
(void)(pObj);
|
||||
(void)(AudioFreq);
|
||||
|
||||
/* This feature is not supported */
|
||||
return CS42L51_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get frequency.
|
||||
* @param pObj pointer to component object
|
||||
* @param AudioFreq Audio frequency
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_GetFrequency(CS42L51_Object_t *pObj, uint32_t *AudioFreq)
|
||||
{
|
||||
(void)(pObj);
|
||||
(void)(AudioFreq);
|
||||
|
||||
/* This feature is not supported */
|
||||
return CS42L51_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Resets cs42l51 registers.
|
||||
* @param pObj pointer to component object
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t CS42L51_Reset(CS42L51_Object_t *pObj)
|
||||
{
|
||||
/* De-Initialize Audio Codec interface */
|
||||
pObj->IO.DeInit();
|
||||
|
||||
/* Initialize Audio Codec interface */
|
||||
pObj->IO.Init();
|
||||
|
||||
return CS42L51_OK;
|
||||
}
|
||||
|
||||
/******************** Static functions ****************************************/
|
||||
/**
|
||||
* @brief Function
|
||||
* @param Component object pointer
|
||||
* @retval error status
|
||||
*/
|
||||
int32_t CS42L51_RegisterBusIO (CS42L51_Object_t *pObj, CS42L51_IO_t *pIO)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
if (pObj == NULL)
|
||||
{
|
||||
ret = CS42L51_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
pObj->IO.Init = pIO->Init;
|
||||
pObj->IO.DeInit = pIO->DeInit;
|
||||
pObj->IO.Address = pIO->Address;
|
||||
pObj->IO.WriteReg = pIO->WriteReg;
|
||||
pObj->IO.ReadReg = pIO->ReadReg;
|
||||
pObj->IO.GetTick = pIO->GetTick;
|
||||
|
||||
pObj->Ctx.ReadReg = CS42L51_ReadRegWrap;
|
||||
pObj->Ctx.WriteReg = CS42L51_WriteRegWrap;
|
||||
pObj->Ctx.handle = pObj;
|
||||
|
||||
if(pObj->IO.Init != NULL)
|
||||
{
|
||||
ret = pObj->IO.Init();
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = CS42L51_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 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 CS42L51_ReadRegWrap(void *handle, uint16_t Reg, uint8_t* pData, uint16_t Length)
|
||||
{
|
||||
CS42L51_Object_t *pObj = (CS42L51_Object_t *)handle;
|
||||
|
||||
return pObj->IO.ReadReg(pObj->IO.Address, Reg, pData, Length);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 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 CS42L51_WriteRegWrap(void *handle, uint16_t Reg, uint8_t* pData, uint16_t Length)
|
||||
{
|
||||
CS42L51_Object_t *pObj = (CS42L51_Object_t *)handle;
|
||||
|
||||
return pObj->IO.WriteReg(pObj->IO.Address, Reg, pData, Length);
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,219 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file cs42l51.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the functions prototypes for the
|
||||
* cs42l51.c driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 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 CS42L51_H
|
||||
#define CS42L51_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "cs42l51_reg.h"
|
||||
#include <stddef.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup CS42L51
|
||||
* @{
|
||||
*/
|
||||
typedef int32_t (*CS42L51_Init_Func) (void);
|
||||
typedef int32_t (*CS42L51_DeInit_Func) (void);
|
||||
typedef int32_t (*CS42L51_GetTick_Func) (void);
|
||||
typedef int32_t (*CS42L51_Delay_Func) (uint32_t);
|
||||
typedef int32_t (*CS42L51_WriteReg_Func)(uint16_t, uint16_t, uint8_t*, uint16_t);
|
||||
typedef int32_t (*CS42L51_ReadReg_Func) (uint16_t, uint16_t, uint8_t*, uint16_t);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
CS42L51_Init_Func Init;
|
||||
CS42L51_DeInit_Func DeInit;
|
||||
uint16_t Address;
|
||||
CS42L51_WriteReg_Func WriteReg;
|
||||
CS42L51_ReadReg_Func ReadReg;
|
||||
CS42L51_GetTick_Func GetTick;
|
||||
} CS42L51_IO_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
CS42L51_IO_t IO;
|
||||
cs42l51_ctx_t Ctx;
|
||||
uint8_t IsInitialized;
|
||||
} CS42L51_Object_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t InputDevice;
|
||||
uint32_t OutputDevice;
|
||||
uint32_t Frequency;
|
||||
uint32_t Resolution;
|
||||
uint32_t Volume;
|
||||
} CS42L51_Init_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t ( *Init ) ( CS42L51_Object_t *, CS42L51_Init_t* );
|
||||
int32_t ( *DeInit ) ( CS42L51_Object_t * );
|
||||
int32_t ( *ReadID ) ( CS42L51_Object_t *, uint32_t * );
|
||||
int32_t ( *Play ) ( CS42L51_Object_t * );
|
||||
int32_t ( *Pause ) ( CS42L51_Object_t * );
|
||||
int32_t ( *Resume ) ( CS42L51_Object_t * );
|
||||
int32_t ( *Stop ) ( CS42L51_Object_t *, uint32_t );
|
||||
int32_t ( *SetFrequency ) ( CS42L51_Object_t *, uint32_t );
|
||||
int32_t ( *GetFrequency ) ( CS42L51_Object_t *, uint32_t*);
|
||||
int32_t ( *SetVolume ) ( CS42L51_Object_t *, uint32_t, uint8_t );
|
||||
int32_t ( *GetVolume ) ( CS42L51_Object_t *, uint32_t, uint8_t*);
|
||||
int32_t ( *SetMute ) ( CS42L51_Object_t *, uint32_t );
|
||||
int32_t ( *SetOutputMode ) ( CS42L51_Object_t *, uint32_t );
|
||||
int32_t ( *SetResolution ) ( CS42L51_Object_t *, uint32_t );
|
||||
int32_t ( *GetResolution ) ( CS42L51_Object_t *, uint32_t*);
|
||||
int32_t ( *SetProtocol ) ( CS42L51_Object_t *, uint32_t );
|
||||
int32_t ( *GetProtocol ) ( CS42L51_Object_t *, uint32_t*);
|
||||
int32_t ( *Reset ) ( CS42L51_Object_t * );
|
||||
} CS42L51_Drv_t;
|
||||
|
||||
|
||||
/** @defgroup CS42L51_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
#define CS42L51_OK (0)
|
||||
#define CS42L51_ERROR (-1)
|
||||
|
||||
/******************************************************************************/
|
||||
/*************************** Codec User defines ******************************/
|
||||
/******************************************************************************/
|
||||
/* Audio Input Device */
|
||||
#define CS42L51_IN_NONE 0x0000U
|
||||
#define CS42L51_IN_MIC1 0x0100U
|
||||
#define CS42L51_IN_MIC2 0x0200U
|
||||
#define CS42L51_IN_LINE1 0x0400U
|
||||
#define CS42L51_IN_LINE2 0x0800U
|
||||
#define CS42L51_IN_LINE3 0x1000U
|
||||
|
||||
/* Audio Output Device */
|
||||
#define CS42L51_OUT_NONE 0x0000U
|
||||
#define CS42L51_OUT_HEADPHONE 0x0001U
|
||||
|
||||
/* AUDIO FREQUENCY */
|
||||
#define CS42L51_FREQUENCY_192K 192000
|
||||
#define CS42L51_FREQUENCY_176K 176400
|
||||
#define CS42L51_FREQUENCY_96K 96000
|
||||
#define CS42L51_FREQUENCY_88K 88200
|
||||
#define CS42L51_FREQUENCY_48K 48000
|
||||
#define CS42L51_FREQUENCY_44K 44100
|
||||
#define CS42L51_FREQUENCY_32K 32000
|
||||
#define CS42L51_FREQUENCY_22K 22050
|
||||
#define CS42L51_FREQUENCY_16K 16000
|
||||
#define CS42L51_FREQUENCY_11K 11025
|
||||
#define CS42L51_FREQUENCY_8K 8000
|
||||
|
||||
/* AUDIO RESOLUTION */
|
||||
#define CS42L51_RESOLUTION_16b 0x05U
|
||||
#define CS42L51_RESOLUTION_18b 0x04U
|
||||
#define CS42L51_RESOLUTION_20b 0x03U
|
||||
#define CS42L51_RESOLUTION_24b 0x02U
|
||||
|
||||
/* Codec stop options */
|
||||
#define CS42L51_PDWN_HW 0x00U
|
||||
#define CS42L51_PDWN_SW 0x01U
|
||||
|
||||
/* Volume Input Output selection */
|
||||
#define VOLUME_INPUT 0U
|
||||
#define VOLUME_OUTPUT 1U
|
||||
|
||||
/* MUTE commands */
|
||||
#define CS42L51_MUTE_ON 1U
|
||||
#define CS42L51_MUTE_OFF 0U
|
||||
|
||||
/* AUDIO PROTOCOL */
|
||||
#define CS42L51_PROTOCOL_L_JUSTIFIED 0U
|
||||
#define CS42L51_PROTOCOL_I2S 1U
|
||||
#define CS42L51_PROTOCOL_R_JUSTIFIED 2U
|
||||
|
||||
#define VOLUME_CONVERT(Volume) (((Volume) >= 100U) ? 0U : ((uint8_t)((((Volume) * 2U) + 56U))))
|
||||
#define VOLUME_INVERT(Volume) (((Volume) == 0U) ? 100U : ((uint8_t)(((Volume) - 56U) / 2U)))
|
||||
|
||||
/**
|
||||
* @brief CS42L51 ID
|
||||
*/
|
||||
#define CS42L51_ID 0xD8U
|
||||
#define CS42L51_ID_MASK 0xF8U
|
||||
|
||||
/** @defgroup CS42L51_Exported_Macros
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup CS42L51_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
Audio Codec functions
|
||||
------------------------------------------------------------------------------*/
|
||||
/* High Layer codec functions */
|
||||
int32_t CS42L51_RegisterBusIO (CS42L51_Object_t *pObj, CS42L51_IO_t *pIO);
|
||||
int32_t CS42L51_Init(CS42L51_Object_t *pObj, CS42L51_Init_t *pInit);
|
||||
int32_t CS42L51_DeInit(CS42L51_Object_t *pObj);
|
||||
int32_t CS42L51_ReadID(CS42L51_Object_t *pObj, uint32_t *Id);
|
||||
int32_t CS42L51_Play(CS42L51_Object_t *pObj);
|
||||
int32_t CS42L51_Pause(CS42L51_Object_t *pObj);
|
||||
int32_t CS42L51_Resume(CS42L51_Object_t *pObj);
|
||||
int32_t CS42L51_Stop(CS42L51_Object_t *pObj, uint32_t CodecPdwnMode);
|
||||
int32_t CS42L51_SetVolume(CS42L51_Object_t *pObj, uint32_t InputOutput, uint8_t Volume);
|
||||
int32_t CS42L51_GetVolume(CS42L51_Object_t *pObj, uint32_t InputOutput, uint8_t *Volume);
|
||||
int32_t CS42L51_SetMute(CS42L51_Object_t *pObj, uint32_t Cmd);
|
||||
int32_t CS42L51_SetOutputMode(CS42L51_Object_t *pObj, uint32_t Output);
|
||||
int32_t CS42L51_SetResolution(CS42L51_Object_t *pObj, uint32_t Resolution);
|
||||
int32_t CS42L51_GetResolution(CS42L51_Object_t *pObj, uint32_t *Resolution);
|
||||
int32_t CS42L51_SetProtocol(CS42L51_Object_t *pObj, uint32_t Protocol);
|
||||
int32_t CS42L51_GetProtocol(CS42L51_Object_t *pObj, uint32_t *Protocol);
|
||||
int32_t CS42L51_SetFrequency(CS42L51_Object_t *pObj, uint32_t AudioFreq);
|
||||
int32_t CS42L51_GetFrequency(CS42L51_Object_t *pObj, uint32_t *AudioFreq);
|
||||
int32_t CS42L51_Reset(CS42L51_Object_t *pObj);
|
||||
|
||||
/* Audio driver structure */
|
||||
extern CS42L51_Drv_t CS42L51_Driver;
|
||||
|
||||
#endif /* CS42L51_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,76 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file cs42l51_reg.c
|
||||
* @author MCD Application Team
|
||||
* @brief This file provides unitary register function to control the CS42L51
|
||||
* Audio Codec driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 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 "cs42l51_reg.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup cs42l51
|
||||
* @brief This file provides a set of functions needed to drive the
|
||||
* CS42L51 audio codec.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/************** Generic Function *******************/
|
||||
/*******************************************************************************
|
||||
* Function Name : cs42l51_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 cs42l51_read_reg(cs42l51_ctx_t *ctx, uint16_t reg, uint8_t* data, uint16_t length)
|
||||
{
|
||||
return ctx->ReadReg(ctx->handle, reg, data, length);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : cs42l51_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 cs42l51_write_reg(cs42l51_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,128 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file cs42l51_reg.h
|
||||
* @author MCD Application Team
|
||||
* @brief Header of cs42l51_reg.c
|
||||
*
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2018 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 CS42L51_REG_H
|
||||
#define CS42L51_REG_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup CS42L51
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/** @defgroup CS42L51_Exported_Constants CS42L51 Exported Constants
|
||||
* @{
|
||||
*/
|
||||
/******************************************************************************/
|
||||
/****************************** REGISTER MAPPING ******************************/
|
||||
/******************************************************************************/
|
||||
#define CS42L51_CHIP_ID 0x01U
|
||||
#define CS42L51_PWR_CTRL_1 0x02U
|
||||
#define CS42L51_MIC_PWR_SPEED_CTRL 0x03U
|
||||
#define CS42L51_INTERFACE_CTRL 0x04U
|
||||
#define CS42L51_MIC_CTRL 0x05U
|
||||
#define CS42L51_ADC_CTRL 0x06U
|
||||
#define CS42L51_ADCX_INPUT_SELECT 0x07U
|
||||
#define CS42L51_DAC_OUTPUT_CTRL 0x08U
|
||||
#define CS42L51_DAC_CTRL 0x09U
|
||||
#define CS42L51_ALCA_PGAA_CTRL 0x0AU
|
||||
#define CS42L51_ALCB_PGAB_CTRL 0x0BU
|
||||
#define CS42L51_ADCA_ATTENUATOR 0x0CU
|
||||
#define CS42L51_ADCB_ATTENUATOR 0x0DU
|
||||
#define CS42L51_ADCA_MIXER_VOL_CTRL 0x0EU
|
||||
#define CS42L51_ADCB_MIXER_VOL_CTRL 0x0FU
|
||||
#define CS42L51_PCMA_MIXER_VOL_CTRL 0x10U
|
||||
#define CS42L51_PCMB_MIXER_VOL_CTRL 0x11U
|
||||
#define CS42L51_BEEP_FREQ_AND_TIMING_CFG 0x12U
|
||||
#define CS42L51_BEEP_OFF_TIME_AND_VOL 0x13U
|
||||
#define CS42L51_BEEP_CFG_AND_TONE_CFG 0x14U
|
||||
#define CS42L51_TONE_CTRL 0x15U
|
||||
#define CS42L51_AOUTA_VOL_CTRL 0x16U
|
||||
#define CS42L51_AOUTB_VOL_CTRL 0x17U
|
||||
#define CS42L51_ADC_PCM_CHANNEL_MIXER 0x18U
|
||||
#define CS42L51_LIMITER_THR_SZC_DISABLE 0x19U
|
||||
#define CS42L51_LIMITER_RELEASE_RATE_REG 0x1AU
|
||||
#define CS42L51_LIMITER_ATTACK_RATE_REG 0x1BU
|
||||
#define CS42L51_ALC_ENABLE_AND_ATTACK_RATE 0x1CU
|
||||
#define CS42L51_ALC_RELEASE_RATE 0x1DU
|
||||
#define CS42L51_ALC_THR 0x1EU
|
||||
#define CS42L51_NOISE_GATE_CFG_AND_MISC 0x1FU
|
||||
#define CS42L51_STATUS 0x20U
|
||||
#define CS42L51_CHARGE_PUMP_FREQ 0x21U
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************** Generic Function *******************/
|
||||
|
||||
typedef int32_t (*CS42L51_Write_Func)(void *, uint16_t, uint8_t*, uint16_t);
|
||||
typedef int32_t (*CS42L51_Read_Func) (void *, uint16_t, uint8_t*, uint16_t);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
CS42L51_Write_Func WriteReg;
|
||||
CS42L51_Read_Func ReadReg;
|
||||
void *handle;
|
||||
} cs42l51_ctx_t;
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : Generic - All
|
||||
* Address : Generic - All
|
||||
* Bit Group Name: None
|
||||
* Permission : W
|
||||
*******************************************************************************/
|
||||
int32_t cs42l51_write_reg(cs42l51_ctx_t *ctx, uint16_t reg, uint8_t *data, uint16_t length);
|
||||
int32_t cs42l51_read_reg(cs42l51_ctx_t *ctx, uint16_t reg, uint8_t* data, uint16_t length);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CS42L51_REG_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF 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,34 @@
|
||||
# BSP STM32-ES-WIFI ES WIFI 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-es-wifi** MCU component repository is one element **common to all** STM32Cube MCU embedded software packages, providing the **ES-WIFI** BSP 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-es-wifi/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,147 @@
|
||||
<!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 ES_WIFI 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-es_wifi-component-driver"><small>Release Notes for</small> <mark>ES_WIFI Component Driver</mark></h1>
|
||||
<p>Copyright © 2017 STMicroelectronics<br />
|
||||
Microcontrollers Division - Application Team</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>
|
||||
<p>Licensed by ST under BSD 3-Clause license (the "License"). You may not use this package except in compliance with the License. You may obtain a copy of the License at:</p>
|
||||
<p><a href="https://opensource.org/licenses/BSD-3-Clause">https://opensource.org/licenses/BSD-3-Clause</a></p>
|
||||
<h1 id="purpose">Purpose</h1>
|
||||
<p>This directory contains the ES_WIFI component driver.</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-section25" checked aria-hidden="true"> <label for="collapse-section25" aria-hidden="true">V1.6.0 / 09-Apr-2020</label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Add country code definition in configuration file to allow higher WiFi channels support</li>
|
||||
<li>Replaced strtok() by strtok_r() to be thread-safe</li>
|
||||
<li>Add Sock info and Peer info functions</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section24" aria-hidden="true"> <label for="collapse-section24" aria-hidden="true">V1.5.0 / 21-Nov-2019</label>
|
||||
<div>
|
||||
<h2 id="main-changes-1">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Add partial support of new Inventek Module for Tiny Shark board</li>
|
||||
<li>Fix MISRA deviation</li>
|
||||
<li>Improve embedded TLS support API</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section23" aria-hidden="true"> <label for="collapse-section23" aria-hidden="true">V1.4.0 / 03-July-2019</label>
|
||||
<div>
|
||||
<h2 id="main-changes-2">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Set a default value to read and write time-out when non blocking</li>
|
||||
<li>Add ES_WIFI_MAX_SO_TIMEOUT</li>
|
||||
<li>Apply new template for sources</li>
|
||||
<li>New release notes format</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section22" aria-hidden="true"> <label for="collapse-section22" aria-hidden="true">V1.3.0 / 10-Sept-2018</label>
|
||||
<div>
|
||||
<h2 id="main-changes-3">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Add support of TLS connection based on internal WIFI module support</li>
|
||||
<li>Ability to list Access Point one by one from Inventek firmware version 3.5.2.5</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section20" aria-hidden="true"> <label for="collapse-section20" aria-hidden="true">V1.2.0 / 24-July-2018</label>
|
||||
<div>
|
||||
<h2 id="main-changes-4">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Add parameter to ES_WIFI_Ping() API to get the time for each ping.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section19" aria-hidden="true"> <label for="collapse-section19" aria-hidden="true">V1.1.2 / 07-June-2018</label>
|
||||
<div>
|
||||
<h2 id="main-changes-5">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Fix in UDP support along new Inventek FW versions >= C3.5.2.4.STM.RC11</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section185" aria-hidden="true"> <label for="collapse-section185" aria-hidden="true">V1.1.1 / 27-February-2018</label>
|
||||
<div>
|
||||
<h2 id="main-changes-6">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Improve TCP server command</li>
|
||||
<li>Improve Robustness on potential memory overflows</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section18" aria-hidden="true"> <label for="collapse-section18" aria-hidden="true">V1.1.0 / 05-February-2018</label>
|
||||
<div>
|
||||
<h2 id="main-changes-7">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Support for UDP sockets</li>
|
||||
<li>Spport for projects using RTOS</li>
|
||||
<li>Fix issue on never ending reads on stuffing bits</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section17" aria-hidden="true"> <label for="collapse-section17" aria-hidden="true">V1.0.1 / 31-August-2017</label>
|
||||
<div>
|
||||
<h2 id="main-changes-8">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Corrections for ES_WIFI WiFi component.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section16" aria-hidden="true"> <label for="collapse-section16" aria-hidden="true">V1.0.0 / 23-February-2017</label>
|
||||
<div>
|
||||
<h2 id="main-changes-9">Main Changes</h2>
|
||||
<ul>
|
||||
<li>First official release of ES_WIFI WiFi component.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="sticky">
|
||||
For complete documentation on <mark>STM32 Microcontrollers</mark> , visit: <a href="http://www.st.com/STM32">http://www.st.com/STM32</a>
|
||||
</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.
|
||||
@@ -0,0 +1,359 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file es_wifi.h
|
||||
* @author MCD Application Team
|
||||
* @brief header file for the es_wifi module.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2017 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 ES_WIFI_H
|
||||
#define ES_WIFI_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
/*cstat -MISRAC2012-Dir-4.10 */
|
||||
#include "stdint.h"
|
||||
#include "string.h"
|
||||
#include "stdbool.h"
|
||||
#include "stdio.h"
|
||||
#include "es_wifi_conf.h"
|
||||
/*cstat +MISRAC2012-Dir-4.10 */
|
||||
|
||||
/* Exported Constants --------------------------------------------------------*/
|
||||
#define ES_WIFI_PAYLOAD_SIZE 1200
|
||||
#define ES_WIFI_MAX_SO_TIMEOUT 30000
|
||||
|
||||
typedef int8_t (*IO_Init_Func)(uint16_t );
|
||||
typedef int8_t (*IO_DeInit_Func)( void);
|
||||
typedef void (*IO_Delay_Func)(uint32_t);
|
||||
typedef int16_t (*IO_Send_Func)( uint8_t *, uint16_t len, uint32_t);
|
||||
typedef int16_t (*IO_Receive_Func)(uint8_t *, uint16_t len, uint32_t);
|
||||
|
||||
|
||||
/* Exported typedef ----------------------------------------------------------*/
|
||||
typedef enum {
|
||||
ES_WIFI_INIT = 0,
|
||||
ES_WIFI_RESET = 1
|
||||
}
|
||||
ES_WIFI_InitMode_t;
|
||||
|
||||
|
||||
typedef enum {
|
||||
ES_WIFI_STATUS_OK = 0,
|
||||
ES_WIFI_STATUS_REQ_DATA_STAGE = 1,
|
||||
ES_WIFI_STATUS_ERROR = 2,
|
||||
ES_WIFI_STATUS_TIMEOUT = 3,
|
||||
ES_WIFI_STATUS_IO_ERROR = 4,
|
||||
ES_WIFI_STATUS_UNEXPECTED_CLOSED_SOCKET = 5,
|
||||
ES_WIFI_STATUS_MODULE_CRASH = 6
|
||||
} ES_WIFI_Status_t;
|
||||
|
||||
#define ES_WIFI_ERROR_SPI_FAILED -1
|
||||
#define ES_WIFI_ERROR_WAITING_DRDY_RISING -2
|
||||
#define ES_WIFI_ERROR_WAITING_DRDY_FALLING -3
|
||||
#define ES_WIFI_ERROR_STUFFING_FOREVER -4
|
||||
#define ES_WIFI_ERROR_SPI_INIT -5
|
||||
|
||||
typedef enum {
|
||||
ES_WIFI_MODE_SINGLE = 0,
|
||||
ES_WIFI_MODE_MULTI = 1,
|
||||
} ES_WIFI_ConnMode_t;
|
||||
|
||||
typedef enum {
|
||||
ES_WIFI_TCP_CONNECTION = 0,
|
||||
ES_WIFI_UDP_CONNECTION = 1,
|
||||
ES_WIFI_UDP_LITE_CONNECTION = 2,
|
||||
ES_WIFI_TCP_SSL_CONNECTION = 3,
|
||||
ES_WIFI_MQTT_CONNECTION = 4,
|
||||
} ES_WIFI_ConnType_t;
|
||||
|
||||
/* Security settings for wifi network */
|
||||
typedef enum {
|
||||
ES_WIFI_SEC_OPEN = 0x00, /*!< Wifi is open */
|
||||
ES_WIFI_SEC_WEP = 0x01, /*!< Wired Equivalent Privacy option for wifi security. \note This mode can't be used when setting up ES_WIFI wifi */
|
||||
ES_WIFI_SEC_WPA = 0x02, /*!< Wi-Fi Protected Access */
|
||||
ES_WIFI_SEC_WPA2 = 0x03, /*!< Wi-Fi Protected Access 2 */
|
||||
ES_WIFI_SEC_WPA_WPA2= 0x04, /*!< Wi-Fi Protected Access with both modes */
|
||||
ES_WIFI_SEC_WPA2_TKIP= 0x05, /*!< Wi-Fi Protected Access with both modes */
|
||||
ES_WIFI_SEC_UNKNOWN = 0xFF, /*!< Wi-Fi Unknown Security mode */
|
||||
} ES_WIFI_SecurityType_t;
|
||||
|
||||
typedef enum {
|
||||
ES_WIFI_IPV4 = 0x00,
|
||||
ES_WIFI_IPV6 = 0x01,
|
||||
} ES_WIFI_IPVer_t;
|
||||
|
||||
typedef enum {
|
||||
ES_WIFI_AP_NONE = 0x00,
|
||||
ES_WIFI_AP_ASSIGNED = 0x01,
|
||||
ES_WIFI_AP_JOINED = 0x02,
|
||||
ES_WIFI_AP_ERROR = 0xFF,
|
||||
} ES_WIFI_APState_t;
|
||||
|
||||
typedef enum {
|
||||
ES_WIFI_FUNCTION_TLS = 0x00,
|
||||
ES_WIFI_FUNCTION_AWS = 0x01,
|
||||
} ES_WIFI_CredsFunction_t;
|
||||
|
||||
typedef enum {
|
||||
ES_WIFI_TLS_CHECK_NOTHING = 0x00,
|
||||
ES_WIFI_TLS_CHECK_ROOTCA = 0x01,
|
||||
ES_WIFI_TLS_CHECK_DEVICE_CERTS = 0x02
|
||||
} ES_WIFI_TlsCheckCertificatMode_t;
|
||||
|
||||
|
||||
#define ES_WIFI_TLS_MULTIPLE_WRITE_SLOT 3
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t Port;
|
||||
uint32_t BaudRate;
|
||||
uint32_t DataWidth;
|
||||
uint32_t Parity;
|
||||
uint32_t StopBits;
|
||||
uint32_t Mode;
|
||||
} ES_WIFI_UARTConfig_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t Configuration;
|
||||
uint32_t WPSPin;
|
||||
uint32_t VID;
|
||||
uint32_t PID;
|
||||
uint8_t MAC[6];
|
||||
uint8_t AP_IPAddress[4];
|
||||
uint32_t PS_Mode;
|
||||
uint32_t RadioMode;
|
||||
uint32_t CurrentBeacon;
|
||||
uint32_t PrevBeacon;
|
||||
uint32_t ProductName;
|
||||
} ES_WIFI_SystemConfig_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t* Address; /*!< Pointer to domain or IP to ping */
|
||||
uint32_t Time; /*!< Time in milliseconds needed for pinging */
|
||||
uint8_t Success; /*!< Status indicates if ping was successful */
|
||||
} ES_WIFI_Ping_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t SSID[ES_WIFI_MAX_SSID_NAME_SIZE + 1]; /*!< Service Set Identifier value.Wi-Fi spot name */
|
||||
ES_WIFI_SecurityType_t Security; /*!< Security of Wi-Fi spot. */
|
||||
int16_t RSSI; /*!< Signal strength of Wi-Fi spot */
|
||||
uint8_t MAC[6]; /*!< MAC address of spot */
|
||||
uint8_t Channel; /*!< Wi-Fi channel */
|
||||
} ES_WIFI_AP_t;
|
||||
|
||||
/* Access point configuration */
|
||||
typedef struct {
|
||||
uint8_t SSID[ES_WIFI_MAX_SSID_NAME_SIZE + 1]; /*!< Network public name for ESP AP mode */
|
||||
uint8_t Pass[ES_WIFI_MAX_PSWD_NAME_SIZE + 1]; /*!< Network password for ESP AP mode */
|
||||
ES_WIFI_SecurityType_t Security; /*!< Security of Wi-Fi access point */
|
||||
uint8_t Channel; /*!< Channel Wi-Fi is operating at */
|
||||
uint8_t MaxConnections; /*!< Max number of stations that are allowed to connect to ESP AP, between 1 and 4 */
|
||||
uint8_t Hidden; /*!< Set to 1 if network is hidden (not broadcast) or zero if visible */
|
||||
} ES_WIFI_APConfig_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t SSID[ES_WIFI_MAX_SSID_NAME_SIZE + 1]; /*!< Network public name for ESP AP mode */
|
||||
uint8_t IP_Addr[4]; /*!< IP Address */
|
||||
uint8_t MAC_Addr[6]; /*!< MAC address */
|
||||
} ES_WIFI_APSettings_t;
|
||||
|
||||
typedef struct {
|
||||
ES_WIFI_AP_t AP[ES_WIFI_MAX_DETECTED_AP];
|
||||
uint8_t nbr;
|
||||
} ES_WIFI_APs_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t SSID[ES_WIFI_MAX_SSID_NAME_SIZE + 1];
|
||||
uint8_t pswd[ES_WIFI_MAX_PSWD_NAME_SIZE + 1];
|
||||
ES_WIFI_SecurityType_t Security;
|
||||
uint8_t DHCP_IsEnabled;
|
||||
uint8_t JoinRetries;
|
||||
uint8_t IsConnected;
|
||||
uint8_t AutoConnect;
|
||||
ES_WIFI_IPVer_t IP_Ver;
|
||||
uint8_t IP_Addr[4];
|
||||
uint8_t IP_Mask[4];
|
||||
uint8_t Gateway_Addr[4];
|
||||
uint8_t DNS1[4];
|
||||
uint8_t DNS2[4];
|
||||
} ES_WIFI_Network_t;
|
||||
|
||||
typedef struct {
|
||||
ES_WIFI_ConnType_t Protocol;
|
||||
uint8_t Local_IP_Addr[4];
|
||||
uint16_t Local_Port;
|
||||
uint8_t Remote_IP_Addr[4];
|
||||
uint16_t Remote_Port;
|
||||
uint8_t TCP_Server;
|
||||
uint8_t UDP_Server;
|
||||
uint8_t TCP_Backlogs;
|
||||
uint8_t Accept_Loop;
|
||||
uint8_t Read_Mode;
|
||||
} ES_WIFI_Transport_t;
|
||||
|
||||
#if (ES_WIFI_USE_AWS == 1)
|
||||
typedef struct {
|
||||
ES_WIFI_ConnType_t Type;
|
||||
uint8_t Number;
|
||||
uint16_t RemotePort;
|
||||
uint8_t RemoteIP[4];
|
||||
uint8_t *PublishTopic;
|
||||
uint8_t *SubscribeTopic;
|
||||
uint8_t *ClientID;
|
||||
uint8_t MQTTMode;
|
||||
} ES_WIFI_AWS_Conn_t;
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
ES_WIFI_ConnType_t Type;
|
||||
ES_WIFI_TlsCheckCertificatMode_t TLScheckMode;
|
||||
uint8_t Number;
|
||||
uint16_t RemotePort;
|
||||
uint16_t LocalPort;
|
||||
uint8_t RemoteIP[4];
|
||||
char* Name;
|
||||
uint8_t Backlog;
|
||||
} ES_WIFI_Conn_t;
|
||||
|
||||
typedef struct {
|
||||
IO_Init_Func IO_Init;
|
||||
IO_DeInit_Func IO_DeInit;
|
||||
IO_Delay_Func IO_Delay;
|
||||
IO_Send_Func IO_Send;
|
||||
IO_Receive_Func IO_Receive;
|
||||
} ES_WIFI_IO_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t Product_ID[ES_WIFI_PRODUCT_ID_SIZE];
|
||||
uint8_t FW_Rev[ES_WIFI_FW_REV_SIZE];
|
||||
uint8_t API_Rev[ES_WIFI_API_REV_SIZE];
|
||||
uint8_t Stack_Rev[ES_WIFI_STACK_REV_SIZE];
|
||||
uint8_t RTOS_Rev[ES_WIFI_RTOS_REV_SIZE];
|
||||
uint8_t Product_Name[ES_WIFI_PRODUCT_NAME_SIZE];
|
||||
uint32_t CPU_Clock;
|
||||
ES_WIFI_SecurityType_t Security;
|
||||
ES_WIFI_Network_t NetSettings;
|
||||
ES_WIFI_APSettings_t APSettings;
|
||||
ES_WIFI_IO_t fops;
|
||||
uint8_t CmdData[ES_WIFI_DATA_SIZE];
|
||||
uint32_t Timeout;
|
||||
uint32_t BufferSize;
|
||||
} ES_WIFIObject_t;
|
||||
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
ES_WIFI_Status_t ES_WIFI_Init(ES_WIFIObject_t *Obj);
|
||||
ES_WIFI_Status_t ES_WIFI_DeInit(ES_WIFIObject_t *Obj);
|
||||
ES_WIFI_Status_t ES_WIFI_SetTimeout(ES_WIFIObject_t *Obj, uint32_t Timeout);
|
||||
ES_WIFI_Status_t ES_WIFI_ListAccessPoints(ES_WIFIObject_t *Obj, ES_WIFI_APs_t *APs);
|
||||
ES_WIFI_Status_t ES_WIFI_Connect(ES_WIFIObject_t *Obj, const char* SSID, const char* Password,
|
||||
ES_WIFI_SecurityType_t SecType);
|
||||
ES_WIFI_Status_t ES_WIFI_Disconnect(ES_WIFIObject_t *Obj);
|
||||
uint8_t ES_WIFI_IsConnected(ES_WIFIObject_t *Obj);
|
||||
ES_WIFI_Status_t ES_WIFI_GetNetworkSettings(ES_WIFIObject_t *Obj);
|
||||
ES_WIFI_Status_t ES_WIFI_GetMACAddress(ES_WIFIObject_t *Obj, uint8_t *mac);
|
||||
ES_WIFI_Status_t ES_WIFI_GetIPAddress(ES_WIFIObject_t *Obj, uint8_t *ipaddr);
|
||||
ES_WIFI_Status_t ES_WIFI_GetProductID(ES_WIFIObject_t *Obj, uint8_t *productID);
|
||||
ES_WIFI_Status_t ES_WIFI_GetFWRevID(ES_WIFIObject_t *Obj, uint8_t *FWRev);
|
||||
ES_WIFI_Status_t ES_WIFI_GetRTOSRev(ES_WIFIObject_t *Obj, uint8_t *RTOSRev);
|
||||
ES_WIFI_Status_t ES_WIFI_GetProductName(ES_WIFIObject_t *Obj, uint8_t *productName);
|
||||
ES_WIFI_Status_t ES_WIFI_GetAPIRev(ES_WIFIObject_t *Obj, uint8_t *APIRev);
|
||||
ES_WIFI_Status_t ES_WIFI_GetStackRev(ES_WIFIObject_t *Obj, uint8_t *StackRev);
|
||||
|
||||
|
||||
ES_WIFI_Status_t ES_WIFI_SetMACAddress(ES_WIFIObject_t *Obj, uint8_t *mac);
|
||||
ES_WIFI_Status_t ES_WIFI_ResetToFactoryDefault(ES_WIFIObject_t *Obj);
|
||||
ES_WIFI_Status_t ES_WIFI_ResetModule(ES_WIFIObject_t *Obj);
|
||||
ES_WIFI_Status_t ES_WIFI_HardResetModule(ES_WIFIObject_t *Obj);
|
||||
ES_WIFI_Status_t ES_WIFI_SetProductName(ES_WIFIObject_t *Obj, uint8_t *ProductName);
|
||||
#if (ES_WIFI_USE_PING == 1)
|
||||
ES_WIFI_Status_t ES_WIFI_Ping(ES_WIFIObject_t *Obj, uint8_t *address, uint16_t count, uint16_t interval_ms, int32_t res[]);
|
||||
#endif
|
||||
ES_WIFI_Status_t ES_WIFI_DNS_LookUp(ES_WIFIObject_t *Obj, const char *url, uint8_t *ipaddress);
|
||||
ES_WIFI_Status_t ES_WIFI_StartClientConnection(ES_WIFIObject_t *Obj, ES_WIFI_Conn_t *conn);
|
||||
ES_WIFI_Status_t ES_WIFI_StopClientConnection(ES_WIFIObject_t *Obj, ES_WIFI_Conn_t *conn);
|
||||
#if (ES_WIFI_USE_AWS == 1)
|
||||
ES_WIFI_Status_t ES_WIFI_StartAWSClientConnection(ES_WIFIObject_t *Obj, ES_WIFI_AWS_Conn_t *conn);
|
||||
#endif
|
||||
ES_WIFI_Status_t ES_WIFI_StartServerSingleConn(ES_WIFIObject_t *Obj, ES_WIFI_Conn_t *conn);
|
||||
ES_WIFI_Status_t ES_WIFI_WaitServerConnection(ES_WIFIObject_t *Obj,uint32_t Timeout,ES_WIFI_Conn_t *con);
|
||||
ES_WIFI_Status_t ES_WIFI_CloseServerConnection(ES_WIFIObject_t *Obj,int socket);
|
||||
ES_WIFI_Status_t ES_WIFI_StopServerSingleConn(ES_WIFIObject_t *Obj, int socket);
|
||||
|
||||
|
||||
ES_WIFI_Status_t ES_WIFI_StartServerMultiConn(ES_WIFIObject_t *Obj, ES_WIFI_Conn_t *conn);
|
||||
ES_WIFI_Status_t ES_WIFI_StopServerMultiConn(ES_WIFIObject_t *Obj);
|
||||
ES_WIFI_Status_t ES_WIFI_SendData(ES_WIFIObject_t *Obj, uint8_t Socket, uint8_t *pdata, uint16_t Reqlen , uint16_t *SentLen, uint32_t Timeout);
|
||||
ES_WIFI_Status_t ES_WIFI_SendDataTo(ES_WIFIObject_t *Obj, uint8_t Socket, uint8_t *pdata, uint16_t Reqlen , uint16_t *SentLen, uint32_t Timeout, uint8_t *IPaddr, uint16_t Port);
|
||||
ES_WIFI_Status_t ES_WIFI_ReceiveData(ES_WIFIObject_t *Obj, uint8_t Socket, uint8_t *pdata, uint16_t Reqlen, uint16_t *Receivedlen, uint32_t Timeout);
|
||||
ES_WIFI_Status_t ES_WIFI_ReceiveDataFrom(ES_WIFIObject_t *Obj, uint8_t Socket, uint8_t *pdata, uint16_t Reqlen, uint16_t *Receivedlen, uint32_t Timeout, uint8_t *IPaddr, uint16_t *pPort);
|
||||
ES_WIFI_Status_t ES_WIFI_ActivateAP(ES_WIFIObject_t *Obj, ES_WIFI_APConfig_t *ApConfig);
|
||||
ES_WIFI_APState_t ES_WIFI_WaitAPStateChange(ES_WIFIObject_t *Obj);
|
||||
ES_WIFI_Status_t ES_WIFI_PeerInfo(ES_WIFIObject_t *Obj, uint8_t Socket, uint8_t *IPaddr, uint16_t *pPort);
|
||||
ES_WIFI_Status_t ES_WIFI_SockInfo(ES_WIFIObject_t *Obj, uint8_t Socket, uint8_t *IPaddr, uint16_t *pPort);
|
||||
|
||||
#if (ES_WIFI_USE_FIRMWAREUPDATE == 1)
|
||||
ES_WIFI_Status_t ES_WIFI_OTA_Upgrade(ES_WIFIObject_t *Obj, uint8_t *link);
|
||||
#endif
|
||||
|
||||
#if (ES_WIFI_USE_UART == 1)
|
||||
ES_WIFI_Status_t ES_WIFI_SetUARTBaudRate(ES_WIFIObject_t *Obj, uint16_t BaudRate);
|
||||
ES_WIFI_Status_t ES_WIFI_GetUARTConfig(ES_WIFIObject_t *Obj, ES_WIFI_UARTConfig_t *pconf);
|
||||
#endif
|
||||
|
||||
ES_WIFI_Status_t ES_WIFI_GetSystemConfig(ES_WIFIObject_t *Obj, ES_WIFI_SystemConfig_t *pconf);
|
||||
|
||||
ES_WIFI_Status_t ES_WIFI_RegisterBusIO(ES_WIFIObject_t *Obj, IO_Init_Func IO_Init,
|
||||
IO_DeInit_Func IO_DeInit,
|
||||
IO_Delay_Func IO_Delay,
|
||||
IO_Send_Func IO_Send,
|
||||
IO_Receive_Func IO_Receive);
|
||||
|
||||
ES_WIFI_Status_t ES_WIFI_StoreCreds( ES_WIFIObject_t *Obj,
|
||||
ES_WIFI_CredsFunction_t credsFunction, uint8_t credSet,
|
||||
uint8_t* ca, uint16_t caLength,
|
||||
uint8_t* certificate, uint16_t certificateLength,
|
||||
uint8_t* key, uint16_t keyLength );
|
||||
|
||||
ES_WIFI_Status_t ES_WIFI_StoreCA( ES_WIFIObject_t *Obj,
|
||||
ES_WIFI_CredsFunction_t credsFunction,
|
||||
uint8_t credSet,
|
||||
uint8_t* ca,
|
||||
uint16_t caLength );
|
||||
|
||||
ES_WIFI_Status_t ES_WIFI_StoreCertificate( ES_WIFIObject_t *Obj,
|
||||
ES_WIFI_CredsFunction_t credsFunction,
|
||||
uint8_t credSet,
|
||||
uint8_t* certificate,
|
||||
uint16_t certificateLength );
|
||||
|
||||
ES_WIFI_Status_t ES_WIFI_StoreKey( ES_WIFIObject_t *Obj,
|
||||
ES_WIFI_CredsFunction_t credsFunction,
|
||||
uint8_t credSet,
|
||||
uint8_t* key,
|
||||
uint16_t keyLength );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ES_WIFI_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,91 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file es_wifi_conf.h
|
||||
* @author MCD Application Team
|
||||
* @brief ES_WIFI configuration.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2017 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 ES_WIFI_CONF_H
|
||||
#define ES_WIFI_CONF_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//#define WIFI_USE_CMSIS_OS
|
||||
|
||||
#ifdef WIFI_USE_CMSIS_OS
|
||||
#include "cmsis_os.h"
|
||||
extern osMutexId es_wifi_mutex;
|
||||
|
||||
#define LOCK_SPI() osMutexWait(spi_mutex, 0)
|
||||
#define UNLOCK_SPI() osMutexRelease(spi_mutex)
|
||||
|
||||
#define LOCK_WIFI() osMutexWait(es_wifi_mutex, 0)
|
||||
#define UNLOCK_WIFI() osMutexRelease(es_wifi_mutex)
|
||||
|
||||
#define SEM_SIGNAL(a) osSemaphoreRelease(a)
|
||||
#define SEM_WAIT(a,timeout) osSemaphoreWait(a,timeout)
|
||||
|
||||
#else /* WIFI_USE_CMSIS_OS */
|
||||
|
||||
#define LOCK_SPI()
|
||||
#define LOCK_WIFI()
|
||||
#define UNLOCK_SPI()
|
||||
#define UNLOCK_WIFI()
|
||||
#define SEM_SIGNAL(a)
|
||||
#endif /* WIFI_USE_CMSIS_OS */
|
||||
|
||||
|
||||
#define ES_WIFI_MAX_SSID_NAME_SIZE 32
|
||||
#define ES_WIFI_MAX_PSWD_NAME_SIZE 32
|
||||
#define ES_WIFI_PRODUCT_ID_SIZE 32
|
||||
#define ES_WIFI_PRODUCT_NAME_SIZE 32
|
||||
#define ES_WIFI_FW_REV_SIZE 24
|
||||
#define ES_WIFI_API_REV_SIZE 16
|
||||
#define ES_WIFI_STACK_REV_SIZE 16
|
||||
#define ES_WIFI_RTOS_REV_SIZE 16
|
||||
|
||||
#define ES_WIFI_DATA_SIZE 1400
|
||||
#define ES_WIFI_MAX_DETECTED_AP 10
|
||||
|
||||
#define ES_WIFI_TIMEOUT 0xFFFF
|
||||
|
||||
#define ES_WIFI_USE_PING 1
|
||||
#define ES_WIFI_USE_AWS 0
|
||||
#define ES_WIFI_USE_FIRMWAREUPDATE 0
|
||||
#define ES_WIFI_USE_WPS 0
|
||||
|
||||
#define ES_WIFI_USE_SPI 0
|
||||
#define ES_WIFI_USE_UART (!ES_WIFI_USE_SPI)
|
||||
|
||||
/* Definitions of Country codes for "CN" AT command */
|
||||
/* Allows to change WiFi channels range */
|
||||
#define ES_WIFI_COUNTRY_FR "FR/0" /* allows WiFi channels 1-13 */
|
||||
#define ES_WIFI_COUNTRY_JP "JP/0" /* allows WiFi channels 1-14 (channel 14 low power) */
|
||||
#define ES_WIFI_COUNTRY_CA "CA/0" /* allows WiFi channels 1-12 (channel 12 low power) */
|
||||
#define ES_WIFI_COUNTRY_US "US/0" /* allows WiFi channels 1-11 (set by default) */
|
||||
/* define ES_WIFI_COUNTRY to one of ES_WIFI_COUNTRY_FR, ES_WIFI_COUNTRY_JP, ... */
|
||||
/* define it only if country is not US (US is the default setting) */
|
||||
/* #define ES_WIFI_COUNTRY ES_WIFI_COUNTRY_FR */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ES_WIFI_CONF_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,114 @@
|
||||
<!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 EXC7200 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-exc7200-component-driver"><strong>Release Notes for EXC7200 Component Driver</strong></h1>
|
||||
<p>Copyright © 2015 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 audio functions offered by EXC7200 TS 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-section5" checked aria-hidden="true"> <label for="collapse-section5" aria-hidden="true"><strong>V2.0.1 / 23-November-2019</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Update st_logo.png inclusion path in Release notes</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section4" checked aria-hidden="true"> <label for="collapse-section4" aria-hidden="true"><strong>V2.0.0 / 14-October-2019</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-1">Main Changes</h2>
|
||||
<ul>
|
||||
<li>First Official release of EXC7200 BSP drivers in line with STM32Cube BSP drivers development guidelines (UM2298)</li>
|
||||
<li>The component drivers are composed of
|
||||
<ul>
|
||||
<li>component core drivers files: exc7200.h/.c</li>
|
||||
<li>component register drivers files: exc7200_reg.h/.c</li>
|
||||
<li>component configuration files: exc7200_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><p>This software release is compatible with:</p>
|
||||
<ul>
|
||||
<li>BSP Common v6.0.1 or above</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section3" checked aria-hidden="true"> <label for="collapse-section3" aria-hidden="true"><strong>V1.0.2 / 07-April-2017</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-2">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-section2" checked aria-hidden="true"> <label for="collapse-section2" aria-hidden="true"><strong>V1.0.1 / 21-September-2015</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-3">Main Changes</h2>
|
||||
<ul>
|
||||
<li>exc7200.c:
|
||||
<ul>
|
||||
<li>Update the I2C slave read address within exc7200_TS_DetectTouch() function.</li>
|
||||
<li>Update exc7200_TS_GetXY() function to return correct Touch Screen positions.</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section1" checked aria-hidden="true"> <label for="collapse-section1" aria-hidden="true"><strong>V1.0.0 / 28-April-2015</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-4">Main Changes</h2>
|
||||
<ul>
|
||||
<li>First official release of <strong>EXC7200</strong> Toush Screen Component drivers</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,119 @@
|
||||
---
|
||||
pagetitle: Release Notes for EXC7200 Component Driver
|
||||
lang: en
|
||||
---
|
||||
|
||||
::: {.row}
|
||||
::: {.col-sm-12 .col-lg-4}
|
||||
|
||||
::: {.card .fluid}
|
||||
::: {.sectione .dark}
|
||||
<center>
|
||||
# **Release Notes for EXC7200 Component Driver**
|
||||
Copyright © 2015 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 audio functions offered by EXC7200 TS component
|
||||
|
||||
:::
|
||||
|
||||
::: {.col-sm-12 .col-lg-8}
|
||||
# Update History
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section5" checked aria-hidden="true">
|
||||
<label for="collapse-section5" aria-hidden="true">__V2.0.1 / 23-November-2019__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- Update st_logo.png inclusion path in Release notes
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section4" checked aria-hidden="true">
|
||||
<label for="collapse-section4" aria-hidden="true">__V2.0.0 / 14-October-2019__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- First Official release of EXC7200 BSP drivers in line with STM32Cube BSP drivers development guidelines (UM2298)
|
||||
- The component drivers are composed of
|
||||
- component core drivers files: exc7200.h/.c
|
||||
- component register drivers files: exc7200_reg.h/.c
|
||||
- component configuration files: exc7200_conf_template.h
|
||||
|
||||
## Backward Compatibility
|
||||
|
||||
- This version breaks the compatibility with previous versions
|
||||
|
||||
## Dependencies
|
||||
|
||||
- This software release is compatible with:
|
||||
|
||||
- BSP Common v6.0.1 or above
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section3" checked aria-hidden="true">
|
||||
<label for="collapse-section3" aria-hidden="true">__V1.0.2 / 07-April-2017__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- Update comments to be used for PDSC generation
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section2" checked aria-hidden="true">
|
||||
<label for="collapse-section2" aria-hidden="true">__V1.0.1 / 21-September-2015__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- exc7200.c:
|
||||
- Update the I2C slave read address within exc7200_TS_DetectTouch() function.
|
||||
- Update exc7200_TS_GetXY() function to return correct Touch Screen positions.
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section1" checked aria-hidden="true">
|
||||
<label for="collapse-section1" aria-hidden="true">__V1.0.0 / 28-April-2015__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- First official release of **EXC7200** Toush Screen Component drivers
|
||||
|
||||
</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>
|
||||
|
After Width: | Height: | Size: 18 KiB |
@@ -0,0 +1,408 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file exc7200.c
|
||||
* @author MCD Application Team
|
||||
* @brief This file provides a set of functions needed to manage the EXC7200
|
||||
* IO Expander devices.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2015 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 "exc7200.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup EXC7200 EXC7200
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
/* Private macro -------------------------------------------------------------*/
|
||||
/** @defgroup EXC7200_Exported_Variables EXC7200 Exported Variables
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Touch screen driver structure initialization */
|
||||
EXC7200_TS_Drv_t EXC7200_TS_Driver =
|
||||
{
|
||||
EXC7200_Init,
|
||||
EXC7200_DeInit,
|
||||
EXC7200_GestureConfig,
|
||||
EXC7200_ReadID,
|
||||
EXC7200_GetState,
|
||||
EXC7200_GetMultiTouchState,
|
||||
EXC7200_GetGesture,
|
||||
EXC7200_GetCapabilities,
|
||||
EXC7200_EnableIT,
|
||||
EXC7200_DisableIT,
|
||||
EXC7200_ClearIT,
|
||||
EXC7200_ITStatus
|
||||
};
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup EXC7200_Private_Function_Prototypes EXC7200 Private Function Prototypes
|
||||
* @{
|
||||
*/
|
||||
static int32_t EXC7200_DetectTouch(EXC7200_Object_t *pObj, uint8_t *pData, uint32_t Length);
|
||||
static int32_t ReadRegWrap(void *handle, uint8_t Reg, uint8_t* Data, uint16_t Length);
|
||||
static int32_t WriteRegWrap(void *handle, uint8_t Reg, uint8_t* Data, uint16_t Length);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup EXC7200_Exported_Functions EXC7200 Exported Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Register IO bus to component object
|
||||
* @param Component object pointer
|
||||
* @retval error status
|
||||
*/
|
||||
int32_t EXC7200_RegisterBusIO (EXC7200_Object_t *pObj, EXC7200_IO_t *pIO)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
if (pObj == NULL)
|
||||
{
|
||||
ret = EXC7200_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
pObj->IO.Init = pIO->Init;
|
||||
pObj->IO.DeInit = pIO->DeInit;
|
||||
pObj->IO.Address = pIO->Address;
|
||||
pObj->IO.WriteReg = pIO->WriteReg;
|
||||
pObj->IO.ReadReg = pIO->ReadReg;
|
||||
pObj->IO.GetTick = pIO->GetTick;
|
||||
|
||||
pObj->Ctx.ReadReg = ReadRegWrap;
|
||||
pObj->Ctx.WriteReg = WriteRegWrap;
|
||||
pObj->Ctx.handle = pObj;
|
||||
|
||||
if(pObj->IO.Init != NULL)
|
||||
{
|
||||
ret = pObj->IO.Init();
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = EXC7200_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get EXC7200 sensor capabilities
|
||||
* @param pObj Component object pointer
|
||||
* @param Capabilities pointer to EXC7200 sensor capabilities
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t EXC7200_GetCapabilities(EXC7200_Object_t *pObj, EXC7200_Capabilities_t *Capabilities)
|
||||
{
|
||||
/* Prevent unused argument(s) compilation warning */
|
||||
(void)(pObj);
|
||||
|
||||
/* Store component's capabilities */
|
||||
Capabilities->MultiTouch = 0;
|
||||
Capabilities->Gesture = 0;
|
||||
Capabilities->MaxTouch = EXC7200_MAX_NB_TOUCH;
|
||||
Capabilities->MaxXl = EXC7200_MAX_X_LENGTH;
|
||||
Capabilities->MaxYl = EXC7200_MAX_Y_LENGTH;
|
||||
|
||||
return EXC7200_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Initialize the EXC7200 communication bus
|
||||
* from MCU to EXC7200 : ie I2C channel initialization (if required).
|
||||
* @param pObj Component object pointer
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t EXC7200_Init(EXC7200_Object_t *pObj)
|
||||
{
|
||||
int32_t ret = EXC7200_OK;
|
||||
|
||||
if(pObj->IsInitialized == 0U)
|
||||
{
|
||||
/* Initialize IO BUS layer */
|
||||
if(pObj->IO.Init() != EXC7200_OK)
|
||||
{
|
||||
ret = EXC7200_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
pObj->IsInitialized = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief De-Initialize the EXC7200 communication bus
|
||||
* from MCU to EXC7200 : ie I2C channel initialization (if required).
|
||||
* @param pObj Component object pointer
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t EXC7200_DeInit(EXC7200_Object_t *pObj)
|
||||
{
|
||||
int32_t ret = EXC7200_OK;
|
||||
|
||||
if(pObj->IsInitialized == 1U)
|
||||
{
|
||||
if(pObj->IO.DeInit() != EXC7200_OK)
|
||||
{
|
||||
ret = EXC7200_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
pObj->IsInitialized = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configure the EXC7200 gesture
|
||||
* from MCU to EXC7200 : ie I2C channel initialization (if required).
|
||||
* @param pObj Component object pointer
|
||||
* @param GestureInit Gesture init structure
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t EXC7200_GestureConfig(EXC7200_Object_t *pObj, EXC7200_Gesture_Init_t *GestureInit)
|
||||
{
|
||||
/* Feature not supported */
|
||||
return EXC7200_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Read the EXC7200 device ID, pre initialize I2C in case of need to be
|
||||
* able to read the EXC7200 device ID, and verify this is a EXC7200.
|
||||
* @param pObj Component object pointer
|
||||
* @param Id Pointer to component ID value
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t EXC7200_ReadID(EXC7200_Object_t *pObj, uint32_t *Id)
|
||||
{
|
||||
int32_t ret = EXC7200_ERROR;
|
||||
uint8_t data;
|
||||
|
||||
if(exc7200_read_reg(&pObj->Ctx, EXC7200_READ_REG, &data, 1) == EXC7200_OK)
|
||||
{
|
||||
*Id = EXC7200_ID;
|
||||
ret = EXC7200_OK;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the touch screen X and Y positions values
|
||||
* @param pObj Component object pointer
|
||||
* @param State Single Touch stucture pointer
|
||||
* @retval Component status.
|
||||
*/
|
||||
int32_t EXC7200_GetState(EXC7200_Object_t *pObj, EXC7200_State_t *State)
|
||||
{
|
||||
uint8_t data[10];
|
||||
|
||||
State->TouchDetected = (uint32_t)EXC7200_DetectTouch(pObj, data, (uint32_t)sizeof(data));
|
||||
|
||||
/* Send back first ready X position to caller */
|
||||
State->TouchX = (((data[3]&0x00ff) << 4) | ((data[2]&0x00f0) >> 4)) << 1;
|
||||
/* Send back first ready Y position to caller */
|
||||
State->TouchY = (((data[5]&0x00ff) << 4) | ((data[4]&0x00f0) >> 4)) << 1;
|
||||
|
||||
/* Dummy Read to deactivate read mode */
|
||||
(void)EXC7200_DetectTouch(pObj, data, (uint32_t)sizeof(data));
|
||||
|
||||
return EXC7200_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the touch screen Xn and Yn positions values in multi-touch mode
|
||||
* @param pObj Component object pointer
|
||||
* @param State Multi Touch stucture pointer
|
||||
* @retval Component status.
|
||||
*/
|
||||
int32_t EXC7200_GetMultiTouchState(EXC7200_Object_t *pObj, EXC7200_MultiTouch_State_t *State)
|
||||
{
|
||||
/* Feature not supported */
|
||||
return EXC7200_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get Gesture ID
|
||||
* @param pObj Component object pointer
|
||||
* @param GestureId gesture ID
|
||||
* @retval Component status.
|
||||
*/
|
||||
int32_t EXC7200_GetGesture(EXC7200_Object_t *pObj, uint8_t *GestureId)
|
||||
{
|
||||
/* Feature not supported */
|
||||
return EXC7200_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configure the EXC7200 device to generate IT on given INT pin
|
||||
* connected to MCU as EXTI.
|
||||
* @param pObj Component object pointer
|
||||
* @retval Component status.
|
||||
*/
|
||||
int32_t EXC7200_EnableIT(EXC7200_Object_t *pObj)
|
||||
{
|
||||
/* Feature not supported */
|
||||
return EXC7200_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configure the EXC7200 device to stop generating IT on the given INT pin
|
||||
* connected to MCU as EXTI.
|
||||
* @param pObj Component object pointer
|
||||
* @retval Component status.
|
||||
*/
|
||||
int32_t EXC7200_DisableIT(EXC7200_Object_t *pObj)
|
||||
{
|
||||
/* Feature not supported */
|
||||
return EXC7200_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get IT status from EXC7200 interrupt status registers
|
||||
* Should be called Following an EXTI coming to the MCU to know the detailed
|
||||
* reason of the interrupt.
|
||||
* @note : This feature is not applicable to EXC7200.
|
||||
* @param pObj Component object pointer
|
||||
* @retval Component status.
|
||||
*/
|
||||
int32_t EXC7200_ITStatus(EXC7200_Object_t *pObj)
|
||||
{
|
||||
/* Feature not supported */
|
||||
return EXC7200_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clear IT status in EXC7200 interrupt status clear registers
|
||||
* Should be called Following an EXTI coming to the MCU.
|
||||
* @note : This feature is not applicable to EXC7200.
|
||||
* @param pObj Component object pointer
|
||||
* @retval Component status.
|
||||
*/
|
||||
int32_t EXC7200_ClearIT(EXC7200_Object_t *pObj)
|
||||
{
|
||||
/* Feature not supported */
|
||||
return EXC7200_ERROR;
|
||||
}
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup EXC7200_Private_Functions EXC7200 Private Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Return if there is touches detected or not.
|
||||
* Get the touch screen X and Y positions values
|
||||
* @param pObj Component object pointer
|
||||
* @param pData Pointer to data buffer
|
||||
* @param Length Number of data to read
|
||||
* @retval Number of active touches detected (can be 0 or 1) or EXC7200_ERROR
|
||||
* in case of error
|
||||
*/
|
||||
static int32_t EXC7200_DetectTouch(EXC7200_Object_t *pObj, uint8_t *pData, uint32_t Length)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
/* Read TS data */
|
||||
if(exc7200_read_reg(&pObj->Ctx, EXC7200_READ_REG, pData, Length) != EXC7200_OK)
|
||||
{
|
||||
ret = EXC7200_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(pData[1] == 0x83U)
|
||||
{
|
||||
/* Touch detected */
|
||||
ret = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* If invalid number of touch detected, set it to zero */
|
||||
ret = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Wrap IO bus read function to component register red function
|
||||
* @param handle Component object handle
|
||||
* @param Reg The target register address to read
|
||||
* @param pData The target register value to be read
|
||||
* @param Length buffer size to be read
|
||||
* @retval Component status.
|
||||
*/
|
||||
static int32_t ReadRegWrap(void *handle, uint8_t Reg, uint8_t* pData, uint16_t Length)
|
||||
{
|
||||
EXC7200_Object_t *pObj = (EXC7200_Object_t *)handle;
|
||||
|
||||
return pObj->IO.ReadReg(pObj->IO.Address, Reg, pData, Length);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Wrap IO bus write function to component register 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 Component status.
|
||||
*/
|
||||
static int32_t WriteRegWrap(void *handle, uint8_t Reg, uint8_t* pData, uint16_t Length)
|
||||
{
|
||||
EXC7200_Object_t *pObj = (EXC7200_Object_t *)handle;
|
||||
|
||||
return pObj->IO.WriteReg(pObj->IO.Address, Reg, pData, Length);
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,191 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file exc7200.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the functions prototypes for the
|
||||
* exc7200.c IO expander driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2015 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 EXC7200_H
|
||||
#define EXC7200_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "exc7200_reg.h"
|
||||
#include <stddef.h>
|
||||
#include "exc7200_conf.h"
|
||||
|
||||
/* Macros --------------------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup EXC7200
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup EXC7200_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
#define EXC7200_OK (0)
|
||||
#define EXC7200_ERROR (-1)
|
||||
|
||||
/* Max detectable simultaneous touches */
|
||||
#define EXC7200_MAX_NB_TOUCH 1U
|
||||
|
||||
/* Touch EXC7200 IDs */
|
||||
#define EXC7200_ID 0x7200U
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup EXC7200_Exported_Types EXC7200 Exported Types
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t Radian;
|
||||
uint32_t OffsetLeftRight;
|
||||
uint32_t OffsetUpDown;
|
||||
uint32_t DistanceLeftRight;
|
||||
uint32_t DistanceUpDown;
|
||||
uint32_t DistanceZoom;
|
||||
}EXC7200_Gesture_Init_t;
|
||||
|
||||
typedef int32_t (*EXC7200_Init_Func) (void);
|
||||
typedef int32_t (*EXC7200_DeInit_Func) (void);
|
||||
typedef int32_t (*EXC7200_GetTick_Func) (void);
|
||||
typedef int32_t (*EXC7200_Delay_Func) (uint32_t);
|
||||
typedef int32_t (*EXC7200_WriteReg_Func)(uint16_t, uint16_t, uint8_t*, uint16_t);
|
||||
typedef int32_t (*EXC7200_ReadReg_Func) (uint16_t, uint16_t, uint8_t*, uint16_t);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
EXC7200_Init_Func Init;
|
||||
EXC7200_DeInit_Func DeInit;
|
||||
uint16_t Address;
|
||||
EXC7200_WriteReg_Func WriteReg;
|
||||
EXC7200_ReadReg_Func ReadReg;
|
||||
EXC7200_GetTick_Func GetTick;
|
||||
} EXC7200_IO_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t TouchDetected;
|
||||
uint32_t TouchX;
|
||||
uint32_t TouchY;
|
||||
} EXC7200_State_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t TouchDetected;
|
||||
uint32_t TouchX[EXC7200_MAX_NB_TOUCH];
|
||||
uint32_t TouchY[EXC7200_MAX_NB_TOUCH];
|
||||
uint32_t TouchWeight[EXC7200_MAX_NB_TOUCH];
|
||||
uint32_t TouchEvent[EXC7200_MAX_NB_TOUCH];
|
||||
uint32_t TouchArea[EXC7200_MAX_NB_TOUCH];
|
||||
} EXC7200_MultiTouch_State_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
EXC7200_IO_t IO;
|
||||
exc7200_ctx_t Ctx;
|
||||
uint8_t IsInitialized;
|
||||
} EXC7200_Object_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t MultiTouch;
|
||||
uint8_t Gesture;
|
||||
uint8_t MaxTouch;
|
||||
uint32_t MaxXl;
|
||||
uint32_t MaxYl;
|
||||
} EXC7200_Capabilities_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t ( *Init ) ( EXC7200_Object_t *);
|
||||
int32_t ( *DeInit ) ( EXC7200_Object_t * );
|
||||
int32_t ( *GestureConfig ) ( EXC7200_Object_t *, EXC7200_Gesture_Init_t* );
|
||||
int32_t ( *ReadID ) ( EXC7200_Object_t *, uint32_t * );
|
||||
int32_t ( *GetState ) ( EXC7200_Object_t *, EXC7200_State_t* );
|
||||
int32_t ( *GetMultiTouchState ) ( EXC7200_Object_t *, EXC7200_MultiTouch_State_t* );
|
||||
int32_t ( *GetGesture ) ( EXC7200_Object_t *, uint8_t* );
|
||||
int32_t ( *GetCapabilities ) ( EXC7200_Object_t *, EXC7200_Capabilities_t * );
|
||||
int32_t ( *EnableIT ) ( EXC7200_Object_t * );
|
||||
int32_t ( *DisableIT ) ( EXC7200_Object_t * );
|
||||
int32_t ( *ClearIT ) ( EXC7200_Object_t * );
|
||||
int32_t ( *ITStatus ) ( EXC7200_Object_t * );
|
||||
} EXC7200_TS_Drv_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup EXC7200_Exported_Variables
|
||||
* @{
|
||||
*/
|
||||
extern EXC7200_TS_Drv_t EXC7200_TS_Driver;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup EXC7200_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
int32_t EXC7200_RegisterBusIO (EXC7200_Object_t *pObj, EXC7200_IO_t *pIO);
|
||||
int32_t EXC7200_Init(EXC7200_Object_t *pObj);
|
||||
int32_t EXC7200_DeInit(EXC7200_Object_t *pObj);
|
||||
int32_t EXC7200_GestureConfig(EXC7200_Object_t *pObj, EXC7200_Gesture_Init_t *GestureInit);
|
||||
int32_t EXC7200_ReadID(EXC7200_Object_t *pObj, uint32_t *Id);
|
||||
int32_t EXC7200_GetState(EXC7200_Object_t *pObj, EXC7200_State_t *State);
|
||||
int32_t EXC7200_GetMultiTouchState(EXC7200_Object_t *pObj, EXC7200_MultiTouch_State_t *State);
|
||||
int32_t EXC7200_GetGesture(EXC7200_Object_t *pObj, uint8_t *GestureId);
|
||||
int32_t EXC7200_EnableIT(EXC7200_Object_t *pObj);
|
||||
int32_t EXC7200_DisableIT(EXC7200_Object_t *pObj);
|
||||
int32_t EXC7200_ITStatus(EXC7200_Object_t *pObj);
|
||||
int32_t EXC7200_ClearIT(EXC7200_Object_t *pObj);
|
||||
int32_t EXC7200_GetCapabilities(EXC7200_Object_t *pObj, EXC7200_Capabilities_t *Capabilities);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* EXC7200_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file exc7200_conf_template.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains specific configuration for the
|
||||
* exc7200.c that can be modified by user.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2015 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 EXC7200_CONF_H
|
||||
#define EXC7200_CONF_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
/* Macros --------------------------------------------------------------------*/
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
#define EXC7200_MAX_X_LENGTH 4096U
|
||||
#define EXC7200_MAX_Y_LENGTH 4096U
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* EXC7200_CONF_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,82 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file exc7200_reg.c
|
||||
* @author MCD Application Team
|
||||
* @brief This file provides unitary register function to control the exc7200 Touch
|
||||
*
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2015 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 "exc7200_reg.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup EXC7200
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup EXC7200_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Read EXC7200 component registers
|
||||
* @param ctx component contex
|
||||
* @param reg Register to read from
|
||||
* @param pdata Pointer to data buffer
|
||||
* @param length Number of data to read
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t exc7200_read_reg(exc7200_ctx_t *ctx, uint8_t reg, uint8_t* pdata, uint16_t length)
|
||||
{
|
||||
return ctx->ReadReg(ctx->handle, reg, pdata, length);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Write EXC7200 component registers
|
||||
* @param ctx component contex
|
||||
* @param reg Register to write to
|
||||
* @param pdata Pointer to data buffer
|
||||
* @param length Number of data to write
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t exc7200_write_reg(exc7200_ctx_t *ctx, uint8_t reg, uint8_t *pdata, uint16_t length)
|
||||
{
|
||||
return ctx->WriteReg(ctx->handle, reg, pdata, length);
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,99 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file exc7200_reg.h
|
||||
* @author MCD Application Team
|
||||
* @brief Header of exc7200_regs.c
|
||||
*
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2015 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 EXC7200_REG_H
|
||||
#define EXC7200_REG_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
/* Macros --------------------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup EXC7200
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup EXC7200_Exported_Constants Exported Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* */
|
||||
#define EXC7200_READ_REG 0x09U
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup EXC7200_Exported_Types EXC7200 Exported Types
|
||||
* @{
|
||||
*/
|
||||
typedef int32_t (*EXC7200_Write_Func)(void *, uint8_t, uint8_t*, uint16_t);
|
||||
typedef int32_t (*EXC7200_Read_Func) (void *, uint8_t, uint8_t*, uint16_t);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
EXC7200_Write_Func WriteReg;
|
||||
EXC7200_Read_Func ReadReg;
|
||||
void *handle;
|
||||
} exc7200_ctx_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup EXC7200_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
int32_t exc7200_write_reg(exc7200_ctx_t *ctx, uint8_t reg, uint8_t *pbuf, uint16_t length);
|
||||
int32_t exc7200_read_reg(exc7200_ctx_t *ctx, uint8_t reg, uint8_t *pbuf, uint16_t length);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* EXC7200_REG_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,27 @@
|
||||
Copyright 2023 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,50 @@
|
||||
<!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 EXC80W32 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_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="exc80w32-component-driver"><mark>EXC80W32 Component Driver </mark></h1>
|
||||
<p>Copyright © 2024 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 driver provides a set of functions offered by EXC80W32 TS component.</p>
|
||||
</div>
|
||||
<div class="col-sm-12 col-lg-8">
|
||||
<h1 id="update-history"><strong>Update History</strong></h1>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section1_0_0" checked aria-hidden="true"> <label for="collapse-section1_0_0" aria-hidden="true"><strong>V1.0.0 / 03-July-2024</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<ul>
|
||||
<li>First official release of <strong>EXC80W32</strong> Touch Screen component 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,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><g fill="#13254a"><path d="M100 .212C44.868.212 0 44.889 0 99.788c0 55.132 44.868 100 100 100s100-44.868 100-100C200 44.889 155.132.212 100 .212zm0 181.164c-44.974 0-81.587-36.614-81.587-81.587 0-44.762 36.614-81.164 81.587-81.164 44.995 0 81.587 36.402 81.587 81.164 0 44.973-36.592 81.587-81.587 81.587z" style="fill: #e6007e;"/><path d="M141.1 88.127h-29.439V58.688c0-6.392-5.185-11.598-11.598-11.598-6.413 0-11.619 5.206-11.619 11.598v29.439H58.476c-6.392 0-11.598 5.185-11.598 11.598 0 6.413 5.206 11.619 11.598 11.619h29.968v29.968c0 6.392 5.206 11.598 11.619 11.598 6.413 0 11.598-5.206 11.598-11.598v-29.968H141.1c6.392 0 11.598-5.206 11.598-11.619 0-6.413-5.206-11.598-11.598-11.598z" style="fill: #e6007e;"/></g></svg>
|
||||
|
After Width: | Height: | Size: 830 B |
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><g fill="#03234b"><path d="M170.934 64.569l-.04-.055-29.049 40.038-.057.079h14.867a59.366 59.366 0 0 1-1.488 15.615c-1.158 5.318-3.807 13.448-9.848 21.977-2.766 4.118-6.375 7.726-9.208 10.408-3.426 2.857-7.461 6.095-12 8.376-8.121 4.568-17.881 7.138-28.225 7.432-10.907.248-20.201-2.61-26.072-5.052-8.283-3.479-14.111-7.807-16.85-10.078-1.254-.956-2.25-1.907-3.057-2.676a28.662 28.662 0 0 0-1.157-1.069 158.874 158.874 0 0 0-1.479-1.362l-4.435-3.956 3.569 4.81.183.243c.2.263.548.722 1.048 1.389.276.334.579.747.93 1.226l.008.01c.689.939 1.546 2.107 2.664 3.322 3 3.536 8.178 8.801 15.808 13.801 5.969 3.866 15.672 8.901 28.001 10.935a79.05 79.05 0 0 0 12.485.998c7.97 0 15.651-1.228 22.828-3.649 6.366-1.877 12.192-4.981 17.053-7.771 6.16-3.936 10.817-7.586 14.654-11.488 8.084-7.899 14.884-17.913 19.15-28.199 3.259-7.594 5.456-15.727 6.529-24.175l.055-.425.083-.641H200l-29.066-40.063zM58.159 99.232l-12.655.563c-.097-.881-.159-1.986-.227-3.474a59.184 59.184 0 0 1 1.446-16.56c1.157-5.316 3.804-13.444 9.848-21.977 2.168-3.228 5.009-6.44 9.208-10.415 3.41-2.849 7.432-6.08 12.005-8.375 8.114-4.568 17.87-7.138 28.213-7.432 10.9-.25 20.196 2.607 26.072 5.045 8.258 3.473 14.105 7.812 16.857 10.091 1.257.951 2.253 1.904 3.057 2.673l.017.016c.43.411.801.766 1.136 1.051.475.438.841.777 1.091 1.01l.138.128.248.229 4.04 3.613-3.165-4.456c-.058-.083-.312-.417-.73-.971l-.507-.67a28.922 28.922 0 0 1-.901-1.192l-.02-.027c-.69-.945-1.548-2.121-2.677-3.346-3.002-3.537-8.182-8.803-15.813-13.801-5.964-3.865-15.662-8.9-27.997-10.935-8.484-1.363-21.496-2.009-35.313 2.651-6.355 1.88-12.186 4.983-17.054 7.772-6.163 3.944-10.82 7.595-14.654 11.488-8.079 7.894-14.882 17.909-19.155 28.2-3.268 7.624-5.463 15.757-6.523 24.173-.436 3.281-.642 5.421-.664 6.926L0 101.831l30.683 38.727.042.053 27.38-41.298.054-.081z" style="fill: #e6007e;"/></g></svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 7.3 KiB |
@@ -0,0 +1,437 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file exc80w32.c
|
||||
* @author MCD Application Team
|
||||
* @brief This file provides a set of functions needed to manage the EXC80W32
|
||||
* devices.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2024 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 "exc80w32.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup EXC80W32 EXC80W32
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
/* Private macro -------------------------------------------------------------*/
|
||||
/** @defgroup EXC80W32_Exported_Variables EXC80W32 Exported Variables
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Touch screen driver structure initialization */
|
||||
EXC80W32_TS_Drv_t EXC80W32_TS_Driver =
|
||||
{
|
||||
EXC80W32_Init,
|
||||
EXC80W32_DeInit,
|
||||
EXC80W32_GestureConfig,
|
||||
EXC80W32_ReadID,
|
||||
EXC80W32_GetState,
|
||||
EXC80W32_GetMultiTouchState,
|
||||
EXC80W32_GetGesture,
|
||||
EXC80W32_GetCapabilities,
|
||||
EXC80W32_EnableIT,
|
||||
EXC80W32_DisableIT,
|
||||
EXC80W32_ClearIT,
|
||||
EXC80W32_ITStatus
|
||||
};
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup EXC80W32_Private_Function_Prototypes EXC80W32 Private Function Prototypes
|
||||
* @{
|
||||
*/
|
||||
static int32_t EXC80W32_DetectTouch(EXC80W32_Object_t *pObj, uint8_t *pData, uint32_t Length);
|
||||
static int32_t ReadRegWrap(void *handle, uint8_t Reg, uint8_t* Data, uint16_t Length);
|
||||
static int32_t WriteRegWrap(void *handle, uint8_t Reg, uint8_t* Data, uint16_t Length);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup EXC80W32_Exported_Functions EXC80W32 Exported Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Register IO bus to component object
|
||||
* @param Component object pointer
|
||||
* @retval error status
|
||||
*/
|
||||
int32_t EXC80W32_RegisterBusIO (EXC80W32_Object_t *pObj, EXC80W32_IO_t *pIO)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
if (pObj == NULL)
|
||||
{
|
||||
ret = EXC80W32_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
pObj->IO.Init = pIO->Init;
|
||||
pObj->IO.DeInit = pIO->DeInit;
|
||||
pObj->IO.Address = pIO->Address;
|
||||
pObj->IO.WriteReg = pIO->WriteReg;
|
||||
pObj->IO.ReadReg = pIO->ReadReg;
|
||||
pObj->IO.GetTick = pIO->GetTick;
|
||||
|
||||
pObj->Ctx.ReadReg = ReadRegWrap;
|
||||
pObj->Ctx.WriteReg = WriteRegWrap;
|
||||
pObj->Ctx.handle = pObj;
|
||||
|
||||
if(pObj->IO.Init != NULL)
|
||||
{
|
||||
ret = pObj->IO.Init();
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = EXC80W32_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get EXC80W32 sensor capabilities
|
||||
* @param pObj Component object pointer
|
||||
* @param Capabilities pointer to EXC80W32 sensor capabilities
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t EXC80W32_GetCapabilities(EXC80W32_Object_t *pObj, EXC80W32_Capabilities_t *Capabilities)
|
||||
{
|
||||
/* Prevent unused argument(s) compilation warning */
|
||||
(void)(pObj);
|
||||
|
||||
/* Store component's capabilities */
|
||||
Capabilities->MultiTouch = 0;
|
||||
Capabilities->Gesture = 0;
|
||||
Capabilities->MaxTouch = EXC80W32_MAX_NB_TOUCH;
|
||||
Capabilities->MaxXl = EXC80W32_MAX_X_LENGTH;
|
||||
Capabilities->MaxYl = EXC80W32_MAX_Y_LENGTH;
|
||||
|
||||
return EXC80W32_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Initialize the EXC80W32 communication bus
|
||||
* from MCU to EXC80W32 : ie I2C channel initialization (if required).
|
||||
* @param pObj Component object pointer
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t EXC80W32_Init(EXC80W32_Object_t *pObj)
|
||||
{
|
||||
int32_t ret = EXC80W32_OK;
|
||||
|
||||
if(pObj->IsInitialized == 0U)
|
||||
{
|
||||
/* Initialize IO BUS layer */
|
||||
if(pObj->IO.Init() != EXC80W32_OK)
|
||||
{
|
||||
ret = EXC80W32_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
pObj->IsInitialized = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief De-Initialize the EXC80W32 communication bus
|
||||
* from MCU to EXC80W32 : ie I2C channel de-initialization.
|
||||
* @param pObj Component object pointer
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t EXC80W32_DeInit(EXC80W32_Object_t *pObj)
|
||||
{
|
||||
int32_t ret = EXC80W32_OK;
|
||||
|
||||
if(pObj->IsInitialized == 1U)
|
||||
{
|
||||
if(pObj->IO.DeInit() != EXC80W32_OK)
|
||||
{
|
||||
ret = EXC80W32_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
pObj->IsInitialized = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configure the EXC80W32 gesture
|
||||
* from MCU to EXC80W32 : ie I2C channel initialization (if required).
|
||||
* @param pObj Component object pointer
|
||||
* @param GestureInit Gesture init structure
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t EXC80W32_GestureConfig(EXC80W32_Object_t *pObj, EXC80W32_Gesture_Init_t *GestureInit)
|
||||
{
|
||||
/* Feature not supported */
|
||||
return EXC80W32_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Read the EXC80W32 device ID, pre initialize I2C in case of need to be
|
||||
* able to read the EXC80W32 device ID, and verify this is a EXC80W32.
|
||||
* @param pObj Component object pointer
|
||||
* @param Id Pointer to component ID value
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t EXC80W32_ReadID(EXC80W32_Object_t *pObj, uint32_t *Id)
|
||||
{
|
||||
int32_t ret = EXC80W32_ERROR;
|
||||
uint8_t data;
|
||||
|
||||
if(exc80w32_read_reg(&pObj->Ctx, EXC80W32_READ_REG, &data, 1) == EXC80W32_OK)
|
||||
{
|
||||
*Id = EXC80W32_ID;
|
||||
ret = EXC80W32_OK;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the touch screen X and Y positions values
|
||||
* @param pObj Component object pointer
|
||||
* @param State Single Touch stucture pointer
|
||||
* @retval Component status.
|
||||
*/
|
||||
int32_t EXC80W32_GetState(EXC80W32_Object_t *pObj, EXC80W32_State_t *State)
|
||||
{
|
||||
uint8_t data[10];
|
||||
|
||||
State->TouchDetected = (uint32_t)EXC80W32_DetectTouch(pObj, data, (uint32_t)sizeof(data));
|
||||
if (State->TouchDetected == 1)
|
||||
{
|
||||
/* Send back first ready X position to caller */
|
||||
State->TouchX = (((data[6] & 0x00FFU) << 0U) | ((data[7] & 0x00FFU) << 8U)) >>2;
|
||||
/* Send back first ready Y position to caller */
|
||||
State->TouchY = (((data[8] & 0x00FFU) << 0U) | ((data[9] & 0x00FFU) << 8U)) >>2;
|
||||
}
|
||||
return EXC80W32_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the touch screen Xn and Yn positions values in multi-touch mode
|
||||
* @param pObj Component object pointer
|
||||
* @param State Multi Touch stucture pointer
|
||||
* @retval Component status.
|
||||
*/
|
||||
int32_t EXC80W32_GetMultiTouchState(EXC80W32_Object_t *pObj, EXC80W32_MultiTouch_State_t *State)
|
||||
{
|
||||
uint8_t data[54];
|
||||
uint8_t TouchNb;
|
||||
State->TouchDetected = (uint32_t)EXC80W32_DetectTouch(pObj, data, (uint32_t)sizeof(data));
|
||||
if (State->TouchDetected == 1)
|
||||
{
|
||||
if (data[2] == EXC80W32_MULTITOUCH_ID)
|
||||
{
|
||||
if (data[3] <= EXC80W32_MAX_NB_TOUCH)
|
||||
{
|
||||
for (TouchNb=0;TouchNb<=data[3];TouchNb++)
|
||||
{
|
||||
/* Send back X positions to caller */
|
||||
State->TouchX[TouchNb] = (((data[6 + 10 * TouchNb] & 0x00FFU) << 0U) |
|
||||
((data[7 + 10 * TouchNb] & 0x00FFU) << 8U)) >>2;
|
||||
/* Send back Y positions to caller */
|
||||
State->TouchY[TouchNb] = (((data[8 + 10 * TouchNb] & 0x00FFU) << 0U) |
|
||||
((data[9 + 10 * TouchNb] & 0x00FFU) << 8U)) >>2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (TouchNb=0;TouchNb<EXC80W32_MAX_NB_TOUCH;TouchNb++)
|
||||
{
|
||||
/* Send back X positions to caller */
|
||||
State->TouchX[TouchNb] = (((data[6 + 10 * TouchNb] & 0x00FFU) << 0U) |
|
||||
((data[7 + 10 * TouchNb] & 0x00FFU) << 8U)) >>2;
|
||||
/* Send back Y positions to caller */
|
||||
State->TouchY[TouchNb] = (((data[8 + 10 * TouchNb] & 0x00FFU) << 0U) |
|
||||
((data[9 + 10 * TouchNb] & 0x00FFU) << 8U)) >>2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return EXC80W32_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get Gesture ID
|
||||
* @param pObj Component object pointer
|
||||
* @param GestureId gesture ID
|
||||
* @retval Component status.
|
||||
*/
|
||||
int32_t EXC80W32_GetGesture(EXC80W32_Object_t *pObj, uint8_t *GestureId)
|
||||
{
|
||||
/* Feature not supported */
|
||||
return EXC80W32_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configure the EXC80W32 device to generate IT on given INT pin
|
||||
* connected to MCU as EXTI.
|
||||
* @param pObj Component object pointer
|
||||
* @retval Component status.
|
||||
*/
|
||||
int32_t EXC80W32_EnableIT(EXC80W32_Object_t *pObj)
|
||||
{
|
||||
/* Feature not supported */
|
||||
return EXC80W32_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configure the EXC80W32 device to stop generating IT on the given INT pin
|
||||
* connected to MCU as EXTI.
|
||||
* @param pObj Component object pointer
|
||||
* @retval Component status.
|
||||
*/
|
||||
int32_t EXC80W32_DisableIT(EXC80W32_Object_t *pObj)
|
||||
{
|
||||
/* Feature not supported */
|
||||
return EXC80W32_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get IT status from EXC80W32 interrupt status registers
|
||||
* Should be called Following an EXTI coming to the MCU to know the detailed
|
||||
* reason of the interrupt.
|
||||
* @note : This feature is not applicable to EXC80W32.
|
||||
* @param pObj Component object pointer
|
||||
* @retval Component status.
|
||||
*/
|
||||
int32_t EXC80W32_ITStatus(EXC80W32_Object_t *pObj)
|
||||
{
|
||||
/* Feature not supported */
|
||||
return EXC80W32_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clear IT status in EXC80W32 interrupt status clear registers
|
||||
* Should be called Following an EXTI coming to the MCU.
|
||||
* @note : This feature is not applicable to EXC80W32.
|
||||
* @param pObj Component object pointer
|
||||
* @retval Component status.
|
||||
*/
|
||||
int32_t EXC80W32_ClearIT(EXC80W32_Object_t *pObj)
|
||||
{
|
||||
/* Feature not supported */
|
||||
return EXC80W32_ERROR;
|
||||
}
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup EXC80W32_Private_Functions EXC80W32 Private Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Return if there is touches detected or not.
|
||||
* Get the touch screen X and Y positions values
|
||||
* @param pObj Component object pointer
|
||||
* @param pData Pointer to data buffer
|
||||
* @param Length Number of data to read
|
||||
* @retval Number of active touches detected (can be 0 or 1) or EXC80W32_ERROR
|
||||
* in case of error
|
||||
*/
|
||||
static int32_t EXC80W32_DetectTouch(EXC80W32_Object_t *pObj, uint8_t *pData, uint32_t Length)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
/* Read TS data */
|
||||
if(exc80w32_read_reg(&pObj->Ctx, EXC80W32_READ_REG, pData, Length) != EXC80W32_OK)
|
||||
{
|
||||
ret = EXC80W32_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(pData[4] != 0xFFU)
|
||||
{
|
||||
/* Touch detected */
|
||||
ret = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* If invalid number of touch detected, set it to zero */
|
||||
ret = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Wrap IO bus read function to component register read function
|
||||
* @param handle Component object handle
|
||||
* @param Reg The target register address to read
|
||||
* @param pData The target register value to be read
|
||||
* @param Length buffer size to be read
|
||||
* @retval Component status.
|
||||
*/
|
||||
static int32_t ReadRegWrap(void *handle, uint8_t Reg, uint8_t* pData, uint16_t Length)
|
||||
{
|
||||
EXC80W32_Object_t *pObj = (EXC80W32_Object_t *)handle;
|
||||
|
||||
return pObj->IO.ReadReg(pObj->IO.Address, Reg, pData, Length);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Wrap IO bus write function to component register 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 Component status.
|
||||
*/
|
||||
static int32_t WriteRegWrap(void *handle, uint8_t Reg, uint8_t* pData, uint16_t Length)
|
||||
{
|
||||
EXC80W32_Object_t *pObj = (EXC80W32_Object_t *)handle;
|
||||
|
||||
return pObj->IO.WriteReg(pObj->IO.Address, Reg, pData, Length);
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,192 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file exc80w32.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the functions prototypes for the
|
||||
* exc80w32.c driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2024 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 EXC80W32_H
|
||||
#define EXC80W32_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "exc80w32_reg.h"
|
||||
#include <stddef.h>
|
||||
#include "exc80w32_conf.h"
|
||||
|
||||
/* Macros --------------------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup EXC80W32
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup EXC80W32_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
#define EXC80W32_OK (0)
|
||||
#define EXC80W32_ERROR (-1)
|
||||
|
||||
/* Max detectable simultaneous touches */
|
||||
#define EXC80W32_MAX_NB_TOUCH 1U
|
||||
|
||||
/* Touch EXC80W32 IDs */
|
||||
#define EXC80W32_ID 0x8032U
|
||||
|
||||
/* EXC80W32 Multitouch state Report ID*/
|
||||
#define EXC80W32_MULTITOUCH_ID 0x18U
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup EXC80W32_Exported_Types EXC80W32 Exported Types
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t Radian;
|
||||
uint32_t OffsetLeftRight;
|
||||
uint32_t OffsetUpDown;
|
||||
uint32_t DistanceLeftRight;
|
||||
uint32_t DistanceUpDown;
|
||||
uint32_t DistanceZoom;
|
||||
}EXC80W32_Gesture_Init_t;
|
||||
|
||||
typedef int32_t (*EXC80W32_Init_Func) (void);
|
||||
typedef int32_t (*EXC80W32_DeInit_Func) (void);
|
||||
typedef int32_t (*EXC80W32_GetTick_Func) (void);
|
||||
typedef int32_t (*EXC80W32_Delay_Func) (uint32_t);
|
||||
typedef int32_t (*EXC80W32_WriteReg_Func)(uint16_t, uint16_t, uint8_t*, uint16_t);
|
||||
typedef int32_t (*EXC80W32_ReadReg_Func) (uint16_t, uint16_t, uint8_t*, uint16_t);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
EXC80W32_Init_Func Init;
|
||||
EXC80W32_DeInit_Func DeInit;
|
||||
uint16_t Address;
|
||||
EXC80W32_WriteReg_Func WriteReg;
|
||||
EXC80W32_ReadReg_Func ReadReg;
|
||||
EXC80W32_GetTick_Func GetTick;
|
||||
} EXC80W32_IO_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t TouchDetected;
|
||||
uint32_t TouchX;
|
||||
uint32_t TouchY;
|
||||
} EXC80W32_State_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t TouchDetected;
|
||||
uint32_t TouchX[EXC80W32_MAX_NB_TOUCH];
|
||||
uint32_t TouchY[EXC80W32_MAX_NB_TOUCH];
|
||||
uint32_t TouchWeight[EXC80W32_MAX_NB_TOUCH];
|
||||
uint32_t TouchEvent[EXC80W32_MAX_NB_TOUCH];
|
||||
uint32_t TouchArea[EXC80W32_MAX_NB_TOUCH];
|
||||
} EXC80W32_MultiTouch_State_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
EXC80W32_IO_t IO;
|
||||
exc80w32_ctx_t Ctx;
|
||||
uint8_t IsInitialized;
|
||||
} EXC80W32_Object_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t MultiTouch;
|
||||
uint8_t Gesture;
|
||||
uint8_t MaxTouch;
|
||||
uint32_t MaxXl;
|
||||
uint32_t MaxYl;
|
||||
} EXC80W32_Capabilities_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t ( *Init ) ( EXC80W32_Object_t *);
|
||||
int32_t ( *DeInit ) ( EXC80W32_Object_t * );
|
||||
int32_t ( *GestureConfig ) ( EXC80W32_Object_t *, EXC80W32_Gesture_Init_t* );
|
||||
int32_t ( *ReadID ) ( EXC80W32_Object_t *, uint32_t * );
|
||||
int32_t ( *GetState ) ( EXC80W32_Object_t *, EXC80W32_State_t* );
|
||||
int32_t ( *GetMultiTouchState ) ( EXC80W32_Object_t *, EXC80W32_MultiTouch_State_t* );
|
||||
int32_t ( *GetGesture ) ( EXC80W32_Object_t *, uint8_t* );
|
||||
int32_t ( *GetCapabilities ) ( EXC80W32_Object_t *, EXC80W32_Capabilities_t * );
|
||||
int32_t ( *EnableIT ) ( EXC80W32_Object_t * );
|
||||
int32_t ( *DisableIT ) ( EXC80W32_Object_t * );
|
||||
int32_t ( *ClearIT ) ( EXC80W32_Object_t * );
|
||||
int32_t ( *ITStatus ) ( EXC80W32_Object_t * );
|
||||
} EXC80W32_TS_Drv_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup EXC80W32_Exported_Variables
|
||||
* @{
|
||||
*/
|
||||
extern EXC80W32_TS_Drv_t EXC80W32_TS_Driver;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup EXC80W32_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
int32_t EXC80W32_RegisterBusIO (EXC80W32_Object_t *pObj, EXC80W32_IO_t *pIO);
|
||||
int32_t EXC80W32_Init(EXC80W32_Object_t *pObj);
|
||||
int32_t EXC80W32_DeInit(EXC80W32_Object_t *pObj);
|
||||
int32_t EXC80W32_GestureConfig(EXC80W32_Object_t *pObj, EXC80W32_Gesture_Init_t *GestureInit);
|
||||
int32_t EXC80W32_ReadID(EXC80W32_Object_t *pObj, uint32_t *Id);
|
||||
int32_t EXC80W32_GetState(EXC80W32_Object_t *pObj, EXC80W32_State_t *State);
|
||||
int32_t EXC80W32_GetMultiTouchState(EXC80W32_Object_t *pObj, EXC80W32_MultiTouch_State_t *State);
|
||||
int32_t EXC80W32_GetGesture(EXC80W32_Object_t *pObj, uint8_t *GestureId);
|
||||
int32_t EXC80W32_EnableIT(EXC80W32_Object_t *pObj);
|
||||
int32_t EXC80W32_DisableIT(EXC80W32_Object_t *pObj);
|
||||
int32_t EXC80W32_ITStatus(EXC80W32_Object_t *pObj);
|
||||
int32_t EXC80W32_ClearIT(EXC80W32_Object_t *pObj);
|
||||
int32_t EXC80W32_GetCapabilities(EXC80W32_Object_t *pObj, EXC80W32_Capabilities_t *Capabilities);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* EXC80W32_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file exc80w32_conf_template.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains specific configuration for the
|
||||
* exc80w32.c that can be modified by user.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2024 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 EXC80W32_CONF_H
|
||||
#define EXC80W32_CONF_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
/* Macros --------------------------------------------------------------------*/
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
#define EXC80W32_MAX_X_LENGTH 4096U
|
||||
#define EXC80W32_MAX_Y_LENGTH 4096U
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* EXC80W32_CONF_H */
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file exc80w32_reg.c
|
||||
* @author MCD Application Team
|
||||
* @brief This file provides unitary register function to control the exc80w32 Touch
|
||||
*
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2024 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 "exc80w32_reg.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup EXC80W32
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup EXC80W32_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Read EXC80W32 component registers
|
||||
* @param ctx component contex
|
||||
* @param reg Register to read from
|
||||
* @param pdata Pointer to data buffer
|
||||
* @param length Number of data to read
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t exc80w32_read_reg(exc80w32_ctx_t *ctx, uint8_t reg, uint8_t* pdata, uint16_t length)
|
||||
{
|
||||
return ctx->ReadReg(ctx->handle, reg, pdata, length);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Write EXC80W32 component registers
|
||||
* @param ctx component contex
|
||||
* @param reg Register to write to
|
||||
* @param pdata Pointer to data buffer
|
||||
* @param length Number of data to write
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t exc80w32_write_reg(exc80w32_ctx_t *ctx, uint8_t reg, uint8_t *pdata, uint16_t length)
|
||||
{
|
||||
return ctx->WriteReg(ctx->handle, reg, pdata, length);
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file exc80w32_reg.h
|
||||
* @author MCD Application Team
|
||||
* @brief Header of exc80w32_reg.c
|
||||
*
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2024 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 EXC80W32_REG_H
|
||||
#define EXC80W32_REG_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
/* Macros --------------------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup EXC80W32
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup EXC80W32_Exported_Constants Exported Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* */
|
||||
#define EXC80W32_READ_REG 0x0FU
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup EXC80W32_Exported_Types EXC80W32 Exported Types
|
||||
* @{
|
||||
*/
|
||||
typedef int32_t (*EXC80W32_Write_Func)(void *, uint8_t, uint8_t*, uint16_t);
|
||||
typedef int32_t (*EXC80W32_Read_Func) (void *, uint8_t, uint8_t*, uint16_t);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
EXC80W32_Write_Func WriteReg;
|
||||
EXC80W32_Read_Func ReadReg;
|
||||
void *handle;
|
||||
} exc80w32_ctx_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup EXC80W32_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
int32_t exc80w32_write_reg(exc80w32_ctx_t *ctx, uint8_t reg, uint8_t *pbuf, uint16_t length);
|
||||
int32_t exc80w32_read_reg(exc80w32_ctx_t *ctx, uint8_t reg, uint8_t *pbuf, uint16_t length);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* EXC80W32_REG_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
<!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 FT5336 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-ft5336-ts-component-driver"><strong>Release Notes for FT5336 TS Component Driver</strong></h1>
|
||||
<p>Copyright © 2015 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 Touch Screen functions offered by FT5336 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-section4" checked aria-hidden="true"> <label for="collapse-section4" aria-hidden="true"><strong>V2.0.1 / 30-October-2019</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Update st_logo.png inclusion path in Release notes.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section3" checked aria-hidden="true"> <label for="collapse-section3" aria-hidden="true"><strong>V2.0.0 / 14-October-2019</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-1">Main Changes</h2>
|
||||
<ul>
|
||||
<li>First Official Release of FT5336 Touch Screen Component Drivers in line with STM32Cube BSP drivers development guidelines (UM2298)</li>
|
||||
<li>The component drivers are composed of
|
||||
<ul>
|
||||
<li>component core drivers files: ft5336.h/.c</li>
|
||||
<li>component register drivers files: ft5336_regs.h/.c</li>
|
||||
<li>component configuration file ft5336_conf_template.h file</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>
|
||||
<p>This software release is compatible with:</p>
|
||||
<ul>
|
||||
<li>BSP Common v6.0.1 or above</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section2" checked aria-hidden="true"> <label for="collapse-section2" aria-hidden="true"><strong>V1.0.1 / 07-April-2017</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-2">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-section1" checked aria-hidden="true"> <label for="collapse-section1" aria-hidden="true"><strong>V1.0.0 / 25-June-2015</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-3">Main Changes</h2>
|
||||
<ul>
|
||||
<li>First official release of <strong>FT5336</strong> TS 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,104 @@
|
||||
---
|
||||
pagetitle: Release Notes for FT5336 Component Driver
|
||||
lang: en
|
||||
---
|
||||
::: {.row}
|
||||
::: {.col-sm-12 .col-lg-4}
|
||||
|
||||
::: {.card .fluid}
|
||||
::: {.sectione .dark}
|
||||
<center>
|
||||
# **Release Notes for FT5336 TS Component Driver**
|
||||
Copyright © 2015 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 Touch Screen functions offered by FT5336 component
|
||||
|
||||
:::
|
||||
|
||||
::: {.col-sm-12 .col-lg-8}
|
||||
# Update History
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section4" checked aria-hidden="true">
|
||||
<label for="collapse-section4" aria-hidden="true">__V2.0.1 / 30-October-2019__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- Update st_logo.png inclusion path in Release notes.
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section3" checked aria-hidden="true">
|
||||
<label for="collapse-section3" aria-hidden="true">__V2.0.0 / 14-October-2019__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- First Official Release of FT5336 Touch Screen Component Drivers in line with STM32Cube BSP drivers development guidelines (UM2298)
|
||||
- The component drivers are composed of
|
||||
- component core drivers files: ft5336.h/.c
|
||||
- component register drivers files: ft5336_regs.h/.c
|
||||
- component configuration file ft5336_conf_template.h file
|
||||
|
||||
## Backward Compatibility
|
||||
|
||||
- This version breaks the compatibility with previous versions
|
||||
|
||||
## Dependencies
|
||||
|
||||
This software release is compatible with:
|
||||
|
||||
- BSP Common v6.0.1 or above
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section2" checked aria-hidden="true">
|
||||
<label for="collapse-section2" aria-hidden="true">__V1.0.1 / 07-April-2017__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- Update comments to be used for PDSC generation
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section1" checked aria-hidden="true">
|
||||
<label for="collapse-section1" aria-hidden="true">__V1.0.0 / 25-June-2015__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- First official release of **FT5336** TS 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>
|
||||
|
After Width: | Height: | Size: 18 KiB |
@@ -0,0 +1,525 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file ft5336.c
|
||||
* @author MCD Application Team
|
||||
* @brief This file provides a set of functions needed to manage the FT5336
|
||||
* IO Expander devices.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2015 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 "ft5336.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup FT5336 FT5336
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
/* Private macro -------------------------------------------------------------*/
|
||||
/** @defgroup FT5336_Exported_Variables FT5336 Exported Variables
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Touch screen driver structure initialization */
|
||||
FT5336_TS_Drv_t FT5336_TS_Driver =
|
||||
{
|
||||
FT5336_Init,
|
||||
FT5336_DeInit,
|
||||
FT5336_GestureConfig,
|
||||
FT5336_ReadID,
|
||||
FT5336_GetState,
|
||||
FT5336_GetMultiTouchState,
|
||||
FT5336_GetGesture,
|
||||
FT5336_GetCapabilities,
|
||||
FT5336_EnableIT,
|
||||
FT5336_DisableIT,
|
||||
FT5336_ClearIT,
|
||||
FT5336_ITStatus
|
||||
};
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup FT5336_Private_Function_Prototypes FT5336 Private Function Prototypes
|
||||
* @{
|
||||
*/
|
||||
#if (FT5336_AUTO_CALIBRATION_ENABLED == 1)
|
||||
static int32_t FT5336_TS_Calibration(FT5336_Object_t *pObj);
|
||||
static int32_t FT5336_Delay(FT5336_Object_t *pObj, uint32_t Delay);
|
||||
#endif /* FT5336_AUTO_CALIBRATION_ENABLED == 1 */
|
||||
static int32_t FT5336_DetectTouch(FT5336_Object_t *pObj);
|
||||
static int32_t ReadRegWrap(void *handle, uint8_t Reg, uint8_t* Data, uint16_t Length);
|
||||
static int32_t WriteRegWrap(void *handle, uint8_t Reg, uint8_t* Data, uint16_t Length);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup FT5336_Exported_Functions FT5336 Exported Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Register IO bus to component object
|
||||
* @param Component object pointer
|
||||
* @retval error status
|
||||
*/
|
||||
int32_t FT5336_RegisterBusIO (FT5336_Object_t *pObj, FT5336_IO_t *pIO)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
if (pObj == NULL)
|
||||
{
|
||||
ret = FT5336_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
pObj->IO.Init = pIO->Init;
|
||||
pObj->IO.DeInit = pIO->DeInit;
|
||||
pObj->IO.Address = pIO->Address;
|
||||
pObj->IO.WriteReg = pIO->WriteReg;
|
||||
pObj->IO.ReadReg = pIO->ReadReg;
|
||||
pObj->IO.GetTick = pIO->GetTick;
|
||||
|
||||
pObj->Ctx.ReadReg = ReadRegWrap;
|
||||
pObj->Ctx.WriteReg = WriteRegWrap;
|
||||
pObj->Ctx.handle = pObj;
|
||||
|
||||
if(pObj->IO.Init != NULL)
|
||||
{
|
||||
ret = pObj->IO.Init();
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = FT5336_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get FT5336 sensor capabilities
|
||||
* @param pObj Component object pointer
|
||||
* @param Capabilities pointer to FT5336 sensor capabilities
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t FT5336_GetCapabilities(FT5336_Object_t *pObj, FT5336_Capabilities_t *Capabilities)
|
||||
{
|
||||
/* Prevent unused argument(s) compilation warning */
|
||||
(void)(pObj);
|
||||
|
||||
/* Store component's capabilities */
|
||||
Capabilities->MultiTouch = 1;
|
||||
Capabilities->Gesture = 1;
|
||||
Capabilities->MaxTouch = FT5336_MAX_NB_TOUCH;
|
||||
Capabilities->MaxXl = FT5336_MAX_X_LENGTH;
|
||||
Capabilities->MaxYl = FT5336_MAX_Y_LENGTH;
|
||||
|
||||
return FT5336_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Initialize the FT5336 communication bus
|
||||
* from MCU to FT5336 : ie I2C channel initialization (if required).
|
||||
* @param pObj Component object pointer
|
||||
* @param GestureInit: Gesture init structure
|
||||
* @retval FT5336_OK
|
||||
*/
|
||||
int32_t FT5336_Init(FT5336_Object_t *pObj)
|
||||
{
|
||||
int32_t ret = FT5336_OK;
|
||||
|
||||
if(pObj->IsInitialized == 0U)
|
||||
{
|
||||
/* Initialize IO BUS layer */
|
||||
pObj->IO.Init();
|
||||
|
||||
#if (FT5336_AUTO_CALIBRATION_ENABLED == 1)
|
||||
/* Hw Calibration sequence start : should be done once after each power up */
|
||||
/* This is called internal calibration of the touch screen */
|
||||
ret += FT5336_TS_Calibration(pObj);
|
||||
#endif /* (FT5336_AUTO_CALIBRATION_ENABLED == 1) */
|
||||
/* By default set FT5336 IC in Polling mode : no INT generation on FT5336 for new touch available */
|
||||
/* Note TS_INT is active low */
|
||||
ret += FT5336_DisableIT(pObj);
|
||||
|
||||
pObj->IsInitialized = 1;
|
||||
}
|
||||
|
||||
if(ret != FT5336_OK)
|
||||
{
|
||||
ret = FT5336_ERROR;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief De-Initialize the FT5336 communication bus
|
||||
* from MCU to FT5336 : ie I2C channel initialization (if required).
|
||||
* @param pObj Component object pointer
|
||||
* @retval FT5336_OK
|
||||
*/
|
||||
int32_t FT5336_DeInit(FT5336_Object_t *pObj)
|
||||
{
|
||||
int32_t ret = FT5336_OK;
|
||||
|
||||
if(pObj->IsInitialized == 1U)
|
||||
{
|
||||
pObj->IsInitialized = 0;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configure the FT5336 gesture
|
||||
* @param pObj Component object pointer
|
||||
* @param GestureInit Gesture init structure
|
||||
* @retval FT5336_OK
|
||||
*/
|
||||
int32_t FT5336_GestureConfig(FT5336_Object_t *pObj, FT5336_Gesture_Init_t *GestureInit)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
ret = ft5336_radian_value(&pObj->Ctx, (uint8_t)GestureInit->Radian);
|
||||
ret += ft5336_offset_left_right(&pObj->Ctx, (uint8_t)GestureInit->OffsetLeftRight);
|
||||
ret += ft5336_offset_up_down(&pObj->Ctx, (uint8_t)GestureInit->OffsetUpDown);
|
||||
ret += ft5336_disatnce_left_right(&pObj->Ctx, (uint8_t)GestureInit->DistanceLeftRight);
|
||||
ret += ft5336_distance_up_down(&pObj->Ctx, (uint8_t)GestureInit->DistanceUpDown);
|
||||
ret += ft5336_distance_zoom(&pObj->Ctx, (uint8_t)GestureInit->DistanceZoom);
|
||||
|
||||
if(ret != FT5336_OK)
|
||||
{
|
||||
ret = FT5336_ERROR;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Read the FT5336 device ID, pre initialize I2C in case of need to be
|
||||
* able to read the FT5336 device ID, and verify this is a FT5336.
|
||||
* @param pObj Component object pointer
|
||||
* @retval The Device ID (two bytes).
|
||||
*/
|
||||
int32_t FT5336_ReadID(FT5336_Object_t *pObj, uint32_t *Id)
|
||||
{
|
||||
return ft5336_chip_id(&pObj->Ctx, (uint8_t *)Id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the touch screen X and Y positions values
|
||||
* @param pObj Component object pointer
|
||||
* @param State: Single Touch stucture pointer
|
||||
* @retval FT5336_OK.
|
||||
*/
|
||||
int32_t FT5336_GetState(FT5336_Object_t *pObj, FT5336_State_t *State)
|
||||
{
|
||||
int32_t ret = FT5336_OK;
|
||||
uint8_t data[4];
|
||||
|
||||
State->TouchDetected = (uint32_t)FT5336_DetectTouch(pObj);
|
||||
if(ft5336_read_reg(&pObj->Ctx, FT5336_P1_XH_REG, data, (uint16_t)sizeof(data)) != FT5336_OK)
|
||||
{
|
||||
ret = FT5336_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Send back first ready X position to caller */
|
||||
State->TouchX = (((uint32_t)data[0] & FT5336_P1_XH_TP_BIT_MASK) << 8) | ((uint32_t)data[1] & FT5336_P1_XL_TP_BIT_MASK);
|
||||
/* Send back first ready Y position to caller */
|
||||
State->TouchY = (((uint32_t)data[2] & FT5336_P1_YH_TP_BIT_MASK) << 8) | ((uint32_t)data[3] & FT5336_P1_YL_TP_BIT_MASK);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the touch screen Xn and Yn positions values in multi-touch mode
|
||||
* @param pObj Component object pointer
|
||||
* @param State Multi Touch structure pointer
|
||||
* @retval FT5336_OK.
|
||||
*/
|
||||
int32_t FT5336_GetMultiTouchState(FT5336_Object_t *pObj, FT5336_MultiTouch_State_t *State)
|
||||
{
|
||||
int32_t ret = FT5336_OK;
|
||||
uint8_t data[30];
|
||||
uint32_t i;
|
||||
|
||||
State->TouchDetected = (uint32_t)FT5336_DetectTouch(pObj);
|
||||
|
||||
if(ft5336_read_reg(&pObj->Ctx, FT5336_P1_XH_REG, data, (uint16_t)sizeof(data)) != FT5336_OK)
|
||||
{
|
||||
ret = FT5336_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
for(i = 0; i < FT5336_MAX_NB_TOUCH; i++)
|
||||
{
|
||||
/* Send back first ready X position to caller */
|
||||
State->TouchX[i] = (((uint32_t)data[i*6U] & FT5336_P1_XH_TP_BIT_MASK) << 8U) | ((uint32_t)data[(i*6U) + 1U] & FT5336_P1_XL_TP_BIT_MASK);
|
||||
/* Send back first ready Y position to caller */
|
||||
State->TouchY[i] = (((uint32_t)data[(i*6U) + 2U] & FT5336_P1_YH_TP_BIT_MASK) << 8U) | ((uint32_t)data[(i*6U) + 3U] & FT5336_P1_YL_TP_BIT_MASK);
|
||||
/* Send back first ready Event to caller */
|
||||
State->TouchEvent[i] = (((uint32_t)data[i*6U] & FT5336_P1_XH_EF_BIT_MASK) >> FT5336_P1_XH_EF_BIT_POSITION);
|
||||
/* Send back first ready Weight to caller */
|
||||
State->TouchWeight[i] = ((uint32_t)data[(i*6U) + 4U] & FT5336_P1_WEIGHT_BIT_MASK);
|
||||
/* Send back first ready Area to caller */
|
||||
State->TouchArea[i] = ((uint32_t)data[(i*6U) + 5U] & FT5336_P1_MISC_BIT_MASK) >> FT5336_P1_MISC_BIT_POSITION;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get Gesture ID
|
||||
* @param pObj Component object pointer
|
||||
* @param GestureId: gesture ID
|
||||
* @retval Gesture ID.
|
||||
*/
|
||||
int32_t FT5336_GetGesture(FT5336_Object_t *pObj, uint8_t *GestureId)
|
||||
{
|
||||
return ft5336_gest_id(&pObj->Ctx, GestureId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configure the FT5336 device to generate IT on given INT pin
|
||||
* connected to MCU as EXTI.
|
||||
* @param pObj Component object pointer
|
||||
* @retval None
|
||||
*/
|
||||
int32_t FT5336_EnableIT(FT5336_Object_t *pObj)
|
||||
{
|
||||
return ft5336_g_mode(&pObj->Ctx, FT5336_G_MODE_INTERRUPT_TRIGGER);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configure the FT5336 device to stop generating IT on the given INT pin
|
||||
* connected to MCU as EXTI.
|
||||
* @param pObj Component object pointer
|
||||
* @retval None
|
||||
*/
|
||||
int32_t FT5336_DisableIT(FT5336_Object_t *pObj)
|
||||
{
|
||||
return ft5336_g_mode(&pObj->Ctx, FT5336_G_MODE_INTERRUPT_POLLING);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get IT status from FT5336 interrupt status registers
|
||||
* Should be called Following an EXTI coming to the MCU to know the detailed
|
||||
* reason of the interrupt.
|
||||
* @note : This feature is not applicable to FT5336.
|
||||
* @param pObj Component object pointer
|
||||
* @retval TS interrupts status : always return 0 here
|
||||
*/
|
||||
int32_t FT5336_ITStatus(FT5336_Object_t *pObj)
|
||||
{
|
||||
/* Prevent unused argument(s) compilation warning */
|
||||
(void)(pObj);
|
||||
|
||||
/* Always return FT5336_OK as feature not applicable to FT5336 */
|
||||
return FT5336_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clear IT status in FT5336 interrupt status clear registers
|
||||
* Should be called Following an EXTI coming to the MCU.
|
||||
* @note : This feature is not applicable to FT5336.
|
||||
* @param pObj Component object pointer
|
||||
* @retval None
|
||||
*/
|
||||
int32_t FT5336_ClearIT(FT5336_Object_t *pObj)
|
||||
{
|
||||
/* Prevent unused argument(s) compilation warning */
|
||||
(void)(pObj);
|
||||
|
||||
/* Always return FT5336_OK as feature not applicable to FT5336 */
|
||||
return FT5336_OK;
|
||||
}
|
||||
|
||||
/******************** Static functions ****************************************/
|
||||
#if (FT5336_AUTO_CALIBRATION_ENABLED == 1)
|
||||
/**
|
||||
* @brief This function provides accurate delay (in milliseconds)
|
||||
* @param pObj pointer to component object
|
||||
* @param Delay: specifies the delay time length, in milliseconds
|
||||
* @retval WM8994_OK
|
||||
*/
|
||||
static int32_t FT5336_Delay(FT5336_Object_t *pObj, uint32_t Delay)
|
||||
{
|
||||
uint32_t tickstart;
|
||||
tickstart = pObj->IO.GetTick();
|
||||
while((pObj->IO.GetTick() - tickstart) < Delay)
|
||||
{
|
||||
}
|
||||
return FT5336_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Start TouchScreen calibration phase
|
||||
* @param DeviceAddr: FT5336 Device address for communication on I2C Bus.
|
||||
* @retval Status FT5336_OK or FT5336_ERROR.
|
||||
*/
|
||||
static int32_t FT5336_TS_Calibration(FT5336_Object_t *pObj)
|
||||
{
|
||||
int32_t ret = FT5336_OK;
|
||||
uint32_t nbr_attempt;
|
||||
uint8_t read_data;
|
||||
uint8_t end_calibration = 0;
|
||||
|
||||
/* Switch FT5336 back to factory mode to calibrate */
|
||||
if(ft5336_dev_mode_w(&pObj->Ctx, FT5336_DEV_MODE_FACTORY) != FT5336_OK)
|
||||
{
|
||||
ret = FT5336_ERROR;
|
||||
}/* Read back the same register FT5336_DEV_MODE_REG */
|
||||
else if(ft5336_dev_mode_r(&pObj->Ctx, &read_data) != FT5336_OK)
|
||||
{
|
||||
ret = FT5336_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
(void)FT5336_Delay(pObj, 300); /* Wait 300 ms */
|
||||
|
||||
if(read_data != FT5336_DEV_MODE_FACTORY )
|
||||
{
|
||||
/* Return error to caller */
|
||||
ret = FT5336_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Start calibration command */
|
||||
read_data= 0x04;
|
||||
if(ft5336_write_reg(&pObj->Ctx, FT5336_TD_STAT_REG, &read_data, 1) != FT5336_OK)
|
||||
{
|
||||
ret = FT5336_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
(void)FT5336_Delay(pObj, 300); /* Wait 300 ms */
|
||||
|
||||
/* 100 attempts to wait switch from factory mode (calibration) to working mode */
|
||||
for (nbr_attempt=0; ((nbr_attempt < 100U) && (end_calibration == 0U)) ; nbr_attempt++)
|
||||
{
|
||||
if(ft5336_dev_mode_r(&pObj->Ctx, &read_data) != FT5336_OK)
|
||||
{
|
||||
ret = FT5336_ERROR;
|
||||
break;
|
||||
}
|
||||
if(read_data == FT5336_DEV_MODE_WORKING)
|
||||
{
|
||||
/* Auto Switch to FT5336_DEV_MODE_WORKING : means calibration have ended */
|
||||
end_calibration = 1; /* exit for loop */
|
||||
}
|
||||
|
||||
(void)FT5336_Delay(pObj, 200); /* Wait 200 ms */
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* FT5336_AUTO_CALIBRATION_ENABLED == 1 */
|
||||
|
||||
/**
|
||||
* @brief Return if there is touches detected or not.
|
||||
* Try to detect new touches and forget the old ones (reset internal global
|
||||
* variables).
|
||||
* @param pObj Component object pointer
|
||||
* @retval Number of active touches detected (can be 0, 1 or 2) or FT5336_ERROR
|
||||
* in case of error
|
||||
*/
|
||||
static int32_t FT5336_DetectTouch(FT5336_Object_t *pObj)
|
||||
{
|
||||
int32_t ret;
|
||||
uint8_t nb_touch;
|
||||
|
||||
/* Read register FT5336_TD_STAT_REG to check number of touches detection */
|
||||
if(ft5336_td_status(&pObj->Ctx, &nb_touch) != FT5336_OK)
|
||||
{
|
||||
ret = FT5336_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(nb_touch > FT5336_MAX_NB_TOUCH)
|
||||
{
|
||||
/* If invalid number of touch detected, set it to zero */
|
||||
ret = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = (int32_t)nb_touch;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 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 ReadRegWrap(void *handle, uint8_t Reg, uint8_t* pData, uint16_t Length)
|
||||
{
|
||||
FT5336_Object_t *pObj = (FT5336_Object_t *)handle;
|
||||
|
||||
return pObj->IO.ReadReg(pObj->IO.Address, Reg, pData, Length);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 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 WriteRegWrap(void *handle, uint8_t Reg, uint8_t* pData, uint16_t Length)
|
||||
{
|
||||
FT5336_Object_t *pObj = (FT5336_Object_t *)handle;
|
||||
|
||||
return pObj->IO.WriteReg(pObj->IO.Address, Reg, pData, Length);
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,220 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file ft5336.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the functions prototypes for the
|
||||
* ft5336.c IO expander driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2015 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 FT5336_H
|
||||
#define FT5336_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "ft5336_reg.h"
|
||||
#include <stddef.h>
|
||||
#include "ft5336_conf.h"
|
||||
|
||||
/* Macros --------------------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup FT5336
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup FT5336_Exported_Constants FT5336 Exported Constants
|
||||
* @{
|
||||
*/
|
||||
#define FT5336_OK (0)
|
||||
#define FT5336_ERROR (-1)
|
||||
|
||||
/* Max detectable simultaneous touches */
|
||||
#define FT5336_MAX_NB_TOUCH 5U
|
||||
|
||||
/* Touch FT5336 IDs */
|
||||
#define FT5336_ID 0x51U
|
||||
|
||||
/* Possible values of FT5336_DEV_MODE_REG */
|
||||
#define FT5336_DEV_MODE_WORKING 0x00U
|
||||
#define FT5336_DEV_MODE_FACTORY 0x04U
|
||||
|
||||
/* Possible values of FT5336_GEST_ID_REG */
|
||||
#define FT5336_GEST_ID_NO_GESTURE 0x00U
|
||||
#define FT5336_GEST_ID_MOVE_UP 0x10U
|
||||
#define FT5336_GEST_ID_MOVE_RIGHT 0x14U
|
||||
#define FT5336_GEST_ID_MOVE_DOWN 0x18U
|
||||
#define FT5336_GEST_ID_MOVE_LEFT 0x1CU
|
||||
#define FT5336_GEST_ID_ZOOM_IN 0x48U
|
||||
#define FT5336_GEST_ID_ZOOM_OUT 0x49U
|
||||
|
||||
/* Values Pn_XH and Pn_YH related */
|
||||
#define FT5336_TOUCH_EVT_FLAG_PRESS_DOWN 0x00U
|
||||
#define FT5336_TOUCH_EVT_FLAG_LIFT_UP 0x01U
|
||||
#define FT5336_TOUCH_EVT_FLAG_CONTACT 0x02U
|
||||
#define FT5336_TOUCH_EVT_FLAG_NO_EVENT 0x03U
|
||||
|
||||
/* Possible values of FT5336_GMODE_REG */
|
||||
#define FT5336_G_MODE_INTERRUPT_POLLING 0x00U
|
||||
#define FT5336_G_MODE_INTERRUPT_TRIGGER 0x01U
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
|
||||
/** @defgroup FT5336_Exported_Types FT5336 Exported Types
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t Radian;
|
||||
uint32_t OffsetLeftRight;
|
||||
uint32_t OffsetUpDown;
|
||||
uint32_t DistanceLeftRight;
|
||||
uint32_t DistanceUpDown;
|
||||
uint32_t DistanceZoom;
|
||||
}FT5336_Gesture_Init_t;
|
||||
|
||||
typedef int32_t (*FT5336_Init_Func) (void);
|
||||
typedef int32_t (*FT5336_DeInit_Func) (void);
|
||||
typedef int32_t (*FT5336_GetTick_Func) (void);
|
||||
typedef int32_t (*FT5336_Delay_Func) (uint32_t);
|
||||
typedef int32_t (*FT5336_WriteReg_Func)(uint16_t, uint16_t, uint8_t*, uint16_t);
|
||||
typedef int32_t (*FT5336_ReadReg_Func) (uint16_t, uint16_t, uint8_t*, uint16_t);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
FT5336_Init_Func Init;
|
||||
FT5336_DeInit_Func DeInit;
|
||||
uint16_t Address;
|
||||
FT5336_WriteReg_Func WriteReg;
|
||||
FT5336_ReadReg_Func ReadReg;
|
||||
FT5336_GetTick_Func GetTick;
|
||||
} FT5336_IO_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t TouchDetected;
|
||||
uint32_t TouchX;
|
||||
uint32_t TouchY;
|
||||
} FT5336_State_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t TouchDetected;
|
||||
uint32_t TouchX[FT5336_MAX_NB_TOUCH];
|
||||
uint32_t TouchY[FT5336_MAX_NB_TOUCH];
|
||||
uint32_t TouchWeight[FT5336_MAX_NB_TOUCH];
|
||||
uint32_t TouchEvent[FT5336_MAX_NB_TOUCH];
|
||||
uint32_t TouchArea[FT5336_MAX_NB_TOUCH];
|
||||
} FT5336_MultiTouch_State_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
FT5336_IO_t IO;
|
||||
ft5336_ctx_t Ctx;
|
||||
uint8_t IsInitialized;
|
||||
} FT5336_Object_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t MultiTouch;
|
||||
uint8_t Gesture;
|
||||
uint8_t MaxTouch;
|
||||
uint32_t MaxXl;
|
||||
uint32_t MaxYl;
|
||||
} FT5336_Capabilities_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t ( *Init ) ( FT5336_Object_t *);
|
||||
int32_t ( *DeInit ) ( FT5336_Object_t * );
|
||||
int32_t ( *GestureConfig ) ( FT5336_Object_t *, FT5336_Gesture_Init_t* );
|
||||
int32_t ( *ReadID ) ( FT5336_Object_t *, uint32_t * );
|
||||
int32_t ( *GetState ) ( FT5336_Object_t *, FT5336_State_t* );
|
||||
int32_t ( *GetMultiTouchState ) ( FT5336_Object_t *, FT5336_MultiTouch_State_t* );
|
||||
int32_t ( *GetGesture ) ( FT5336_Object_t *, uint8_t* );
|
||||
int32_t ( *GetCapabilities ) ( FT5336_Object_t *, FT5336_Capabilities_t * );
|
||||
int32_t ( *EnableIT ) ( FT5336_Object_t * );
|
||||
int32_t ( *DisableIT ) ( FT5336_Object_t * );
|
||||
int32_t ( *ClearIT ) ( FT5336_Object_t * );
|
||||
int32_t ( *ITStatus ) ( FT5336_Object_t * );
|
||||
} FT5336_TS_Drv_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup FT5336_Exported_Variables
|
||||
* @{
|
||||
*/
|
||||
extern FT5336_TS_Drv_t FT5336_TS_Driver;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup FT5336_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
int32_t FT5336_RegisterBusIO (FT5336_Object_t *pObj, FT5336_IO_t *pIO);
|
||||
int32_t FT5336_Init(FT5336_Object_t *pObj);
|
||||
int32_t FT5336_DeInit(FT5336_Object_t *pObj);
|
||||
int32_t FT5336_GestureConfig(FT5336_Object_t *pObj, FT5336_Gesture_Init_t *GestureInit);
|
||||
int32_t FT5336_ReadID(FT5336_Object_t *pObj, uint32_t *Id);
|
||||
int32_t FT5336_GetState(FT5336_Object_t *pObj, FT5336_State_t *State);
|
||||
int32_t FT5336_GetMultiTouchState(FT5336_Object_t *pObj, FT5336_MultiTouch_State_t *State);
|
||||
int32_t FT5336_GetGesture(FT5336_Object_t *pObj, uint8_t *GestureId);
|
||||
int32_t FT5336_EnableIT(FT5336_Object_t *pObj);
|
||||
int32_t FT5336_DisableIT(FT5336_Object_t *pObj);
|
||||
int32_t FT5336_ITStatus(FT5336_Object_t *pObj);
|
||||
int32_t FT5336_ClearIT(FT5336_Object_t *pObj);
|
||||
int32_t FT5336_GetCapabilities(FT5336_Object_t *pObj, FT5336_Capabilities_t *Capabilities);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* FT5336_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file ft5336_conf.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains specific configuration for the
|
||||
* ft5336.c that can be modified by user.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2015 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 FT5336_CONF_H
|
||||
#define FT5336_CONF_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
/* Macros --------------------------------------------------------------------*/
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
#define FT5336_AUTO_CALIBRATION_ENABLED 0U
|
||||
#define FT5336_MAX_X_LENGTH 800U
|
||||
#define FT5336_MAX_Y_LENGTH 480U
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* FT5336_CONF_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,971 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file ft5336_reg.h
|
||||
* @author MCD Application Team
|
||||
* @brief Header of ft5336_reg.c
|
||||
*
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2015 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 FT5336_REG_H
|
||||
#define FT5336_REG_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
/* Macros --------------------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup FT5336
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
|
||||
/** @defgroup FT5336_Exported_Types FT5336 Exported Types
|
||||
* @{
|
||||
*/
|
||||
/************** Generic Function *******************/
|
||||
|
||||
typedef int32_t (*FT5336_Write_Func)(void *, uint8_t, uint8_t*, uint16_t);
|
||||
typedef int32_t (*FT5336_Read_Func) (void *, uint8_t, uint8_t*, uint16_t);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup FT5336_Imported_Globals FT5336 Imported Globals
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
FT5336_Write_Func WriteReg;
|
||||
FT5336_Read_Func ReadReg;
|
||||
void *handle;
|
||||
} ft5336_ctx_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup FT5336_Exported_Constants FT5336 Exported Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Current mode register of the FT5336 (R/W) */
|
||||
#define FT5336_DEV_MODE_REG 0x00
|
||||
|
||||
/* Gesture ID register */
|
||||
#define FT5336_GEST_ID_REG 0x01
|
||||
|
||||
/* Touch Data Status register : gives number of active touch points (0..2) */
|
||||
#define FT5336_TD_STAT_REG 0x02
|
||||
|
||||
/* P1 X, Y coordinates, weight and misc registers */
|
||||
#define FT5336_P1_XH_REG 0x03U
|
||||
#define FT5336_P1_XL_REG 0x04U
|
||||
#define FT5336_P1_YH_REG 0x05U
|
||||
#define FT5336_P1_YL_REG 0x06U
|
||||
#define FT5336_P1_WEIGHT_REG 0x07U
|
||||
#define FT5336_P1_MISC_REG 0x08U
|
||||
|
||||
/* P2 X, Y coordinates, weight and misc registers */
|
||||
#define FT5336_P2_XH_REG 0x09U
|
||||
#define FT5336_P2_XL_REG 0x0AU
|
||||
#define FT5336_P2_YH_REG 0x0BU
|
||||
#define FT5336_P2_YL_REG 0x0CU
|
||||
#define FT5336_P2_WEIGHT_REG 0x0DU
|
||||
#define FT5336_P2_MISC_REG 0x0EU
|
||||
|
||||
/* P3 X, Y coordinates, weight and misc registers */
|
||||
#define FT5336_P3_XH_REG 0x0FU
|
||||
#define FT5336_P3_XL_REG 0x10U
|
||||
#define FT5336_P3_YH_REG 0x11U
|
||||
#define FT5336_P3_YL_REG 0x12U
|
||||
#define FT5336_P3_WEIGHT_REG 0x13U
|
||||
#define FT5336_P3_MISC_REG 0x14U
|
||||
|
||||
/* P4 X, Y coordinates, weight and misc registers */
|
||||
#define FT5336_P4_XH_REG 0x15U
|
||||
#define FT5336_P4_XL_REG 0x16U
|
||||
#define FT5336_P4_YH_REG 0x17U
|
||||
#define FT5336_P4_YL_REG 0x18U
|
||||
#define FT5336_P4_WEIGHT_REG 0x19U
|
||||
#define FT5336_P4_MISC_REG 0x1AU
|
||||
|
||||
/* P5 X, Y coordinates, weight and misc registers */
|
||||
#define FT5336_P5_XH_REG 0x1BU
|
||||
#define FT5336_P5_XL_REG 0x1CU
|
||||
#define FT5336_P5_YH_REG 0x1DU
|
||||
#define FT5336_P5_YL_REG 0x1EU
|
||||
#define FT5336_P5_WEIGHT_REG 0x1FU
|
||||
#define FT5336_P5_MISC_REG 0x20U
|
||||
|
||||
/* P6 X, Y coordinates, weight and misc registers */
|
||||
#define FT5336_P6_XH_REG 0x21U
|
||||
#define FT5336_P6_XL_REG 0x22U
|
||||
#define FT5336_P6_YH_REG 0x23U
|
||||
#define FT5336_P6_YL_REG 0x24U
|
||||
#define FT5336_P6_WEIGHT_REG 0x25U
|
||||
#define FT5336_P6_MISC_REG 0x26U
|
||||
|
||||
/* P7 X, Y coordinates, weight and misc registers */
|
||||
#define FT5336_P7_XH_REG 0x27U
|
||||
#define FT5336_P7_XL_REG 0x28U
|
||||
#define FT5336_P7_YH_REG 0x29U
|
||||
#define FT5336_P7_YL_REG 0x2AU
|
||||
#define FT5336_P7_WEIGHT_REG 0x2BU
|
||||
#define FT5336_P7_MISC_REG 0x2CU
|
||||
|
||||
/* P8 X, Y coordinates, weight and misc registers */
|
||||
#define FT5336_P8_XH_REG 0x2DU
|
||||
#define FT5336_P8_XL_REG 0x2EU
|
||||
#define FT5336_P8_YH_REG 0x2FU
|
||||
#define FT5336_P8_YL_REG 0x30U
|
||||
#define FT5336_P8_WEIGHT_REG 0x31U
|
||||
#define FT5336_P8_MISC_REG 0x32U
|
||||
|
||||
/* P9 X, Y coordinates, weight and misc registers */
|
||||
#define FT5336_P9_XH_REG 0x33U
|
||||
#define FT5336_P9_XL_REG 0x34U
|
||||
#define FT5336_P9_YH_REG 0x35U
|
||||
#define FT5336_P9_YL_REG 0x36U
|
||||
#define FT5336_P9_WEIGHT_REG 0x37U
|
||||
#define FT5336_P9_MISC_REG 0x38U
|
||||
|
||||
/* P10 X, Y coordinates, weight and misc registers */
|
||||
#define FT5336_P10_XH_REG 0x39U
|
||||
#define FT5336_P10_XL_REG 0x3AU
|
||||
#define FT5336_P10_YH_REG 0x3BU
|
||||
#define FT5336_P10_YL_REG 0x3CU
|
||||
#define FT5336_P10_WEIGHT_REG 0x3DU
|
||||
#define FT5336_P10_MISC_REG 0x3EU
|
||||
|
||||
/* Threshold for touch detection */
|
||||
#define FT5336_TH_GROUP_REG 0x80
|
||||
|
||||
/* Filter function coefficients */
|
||||
#define FT5336_TH_DIFF_REG 0x85
|
||||
|
||||
/* Control register */
|
||||
#define FT5336_CTRL_REG 0x86
|
||||
|
||||
/* The time period of switching from Active mode to Monitor mode when there is no touching */
|
||||
#define FT5336_TIMEENTERMONITOR_REG 0x87
|
||||
|
||||
/* Report rate in Active mode */
|
||||
#define FT5336_PERIODACTIVE_REG 0x88
|
||||
|
||||
/* Report rate in Monitor mode */
|
||||
#define FT5336_PERIODMONITOR_REG 0x89
|
||||
|
||||
/* The value of the minimum allowed angle while Rotating gesture mode */
|
||||
#define FT5336_RADIAN_VALUE_REG 0x91
|
||||
|
||||
/* Maximum offset while Moving Left and Moving Right gesture */
|
||||
#define FT5336_OFFSET_LR_REG 0x92
|
||||
|
||||
/* Maximum offset while Moving Up and Moving Down gesture */
|
||||
#define FT5336_OFFSET_UD_REG 0x93
|
||||
|
||||
/* Minimum distance while Moving Left and Moving Right gesture */
|
||||
#define FT5336_DISTANCE_LR_REG 0x94
|
||||
|
||||
/* Minimum distance while Moving Up and Moving Down gesture */
|
||||
#define FT5336_DISTANCE_UD_REG 0x95
|
||||
|
||||
/* Maximum distance while Zoom In and Zoom Out gesture */
|
||||
#define FT5336_DISTANCE_ZOOM_REG 0x96
|
||||
|
||||
/* High 8-bit of LIB Version info */
|
||||
#define FT5336_LIB_VER_H_REG 0xA1
|
||||
|
||||
/* Low 8-bit of LIB Version info */
|
||||
#define FT5336_LIB_VER_L_REG 0xA2
|
||||
|
||||
/* Chip Selecting */
|
||||
#define FT5336_CIPHER_REG 0xA3
|
||||
|
||||
/* Interrupt mode register (used when in interrupt mode) */
|
||||
#define FT5336_GMODE_REG 0xA4
|
||||
|
||||
/* Current power mode the FT5336 system is in (R) */
|
||||
#define FT5336_PWR_MODE_REG 0xA5
|
||||
|
||||
/* FT5336 firmware version */
|
||||
#define FT5336_FIRMID_REG 0xA6
|
||||
|
||||
/* FT5336 Chip identification register */
|
||||
#define FT5336_CHIP_ID_REG 0xA8
|
||||
|
||||
/* Release code version */
|
||||
#define FT5336_RELEASE_CODE_ID_REG 0xAF
|
||||
|
||||
/* Current operating mode the FT5336 system is in (R) */
|
||||
#define FT5336_STATE_REG 0xBC
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : Generic - All
|
||||
* Address : Generic - All
|
||||
* Bit Group Name: None
|
||||
* Permission : W
|
||||
*******************************************************************************/
|
||||
int32_t ft5336_write_reg(ft5336_ctx_t *ctx, uint8_t reg, uint8_t *pbuf, uint16_t length);
|
||||
int32_t ft5336_read_reg(ft5336_ctx_t *ctx, uint8_t reg, uint8_t *pbuf, uint16_t length);
|
||||
|
||||
/**************** Base Function *******************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : DEV_MODE
|
||||
* Address : 0X00
|
||||
* Bit Group Name: DEVICE_MODE
|
||||
* Permission : RW
|
||||
*******************************************************************************/
|
||||
#define FT5336_DEV_MODE_BIT_MASK 0x70U
|
||||
#define FT5336_DEV_MODE_BIT_POSITION 4
|
||||
int32_t ft5336_dev_mode_w(ft5336_ctx_t *ctx, uint8_t value);
|
||||
int32_t ft5336_dev_mode_r(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : GEST_ID
|
||||
* Address : 0X01
|
||||
* Bit Group Name: Gesture ID
|
||||
* Permission : R
|
||||
*******************************************************************************/
|
||||
#define FT5336_GEST_ID_BIT_MASK 0xFFU
|
||||
#define FT5336_GEST_ID_BIT_POSITION 0
|
||||
int32_t ft5336_gest_id(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : TD_STATUS
|
||||
* Address : 0X02
|
||||
* Bit Group Name:
|
||||
* Permission : R
|
||||
*******************************************************************************/
|
||||
#define FT5336_TD_STATUS_BIT_MASK 0x0FU
|
||||
#define FT5336_TD_STATUS_BIT_POSITION 0
|
||||
int32_t ft5336_td_status(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P1_XH
|
||||
* Address : 0X03
|
||||
* Bit Group Name: First Event Flag
|
||||
* Permission : R
|
||||
* Default value : 0xF0U
|
||||
*******************************************************************************/
|
||||
#define FT5336_P1_XH_EF_BIT_MASK 0xC0U
|
||||
#define FT5336_P1_XH_EF_BIT_POSITION 6
|
||||
int32_t ft5336_p1_xh_ef(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P1_XH
|
||||
* Address : 0X03
|
||||
* Bit Group Name: First Touch X Position
|
||||
* Permission : R
|
||||
* Default value : 0x0FU
|
||||
*******************************************************************************/
|
||||
#define FT5336_P1_XH_TP_BIT_MASK 0x0FU
|
||||
#define FT5336_P1_XH_TP_BIT_POSITION 0
|
||||
int32_t ft5336_p1_xh_tp(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P1_XL
|
||||
* Address : 0X04
|
||||
* Bit Group Name: First Touch X Position
|
||||
* Permission : R
|
||||
* Default value : 0xFFU
|
||||
*******************************************************************************/
|
||||
#define FT5336_P1_XL_TP_BIT_MASK 0xFFU
|
||||
#define FT5336_P1_XL_TP_BIT_POSITION 0
|
||||
int32_t ft5336_p1_xl_tp(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P1_YH
|
||||
* Address : 0X05
|
||||
* Bit Group Name: First Touch ID
|
||||
* Permission : R
|
||||
* Default value : 0xF0U
|
||||
*******************************************************************************/
|
||||
#define FT5336_P1_YH_TID_BIT_MASK 0xF0U
|
||||
#define FT5336_P1_YH_TID_BIT_POSITION 4
|
||||
int32_t ft5336_p1_yh_tid(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P1_YH
|
||||
* Address : 0x06
|
||||
* Bit Group Name: First Touch Y Position
|
||||
* Permission : R
|
||||
* Default value : 0x0FU
|
||||
*******************************************************************************/
|
||||
#define FT5336_P1_YH_TP_BIT_MASK 0x0FU
|
||||
#define FT5336_P1_YH_TP_BIT_POSITION 0
|
||||
int32_t ft5336_p1_yh_tp(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P1_YL
|
||||
* Address : 0X06
|
||||
* Bit Group Name: First Touch Y Position
|
||||
* Permission : R
|
||||
* Default value : 0xFFU
|
||||
*******************************************************************************/
|
||||
#define FT5336_P1_YL_TP_BIT_MASK 0xFFU
|
||||
#define FT5336_P1_YL_TP_BIT_POSITION 0
|
||||
int32_t ft5336_p1_yl_tp(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P1_WEIGHT
|
||||
* Address : 0X07
|
||||
* Bit Group Name: First Touch Weight(pressure)
|
||||
* Permission : R
|
||||
* Default value : 0xFFU
|
||||
*******************************************************************************/
|
||||
#define FT5336_P1_WEIGHT_BIT_MASK 0xFFU
|
||||
#define FT5336_P1_WEIGHT_BIT_POSITION 0
|
||||
int32_t ft5336_p1_weight(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P1_MISC
|
||||
* Address : 0X08
|
||||
* Bit Group Name: First Touch Area
|
||||
* Permission : R
|
||||
* Default value : 0xFFU
|
||||
*******************************************************************************/
|
||||
#define FT5336_P1_MISC_BIT_MASK 0xF0U
|
||||
#define FT5336_P1_MISC_BIT_POSITION 4
|
||||
int32_t ft5336_p1_misc(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P2_XH
|
||||
* Address : 0X09
|
||||
* Bit Group Name: Second Event Flag
|
||||
* Permission : R
|
||||
* Default value : 0xF0U
|
||||
*******************************************************************************/
|
||||
#define FT5336_P2_XH_EF_BIT_MASK 0xC0U
|
||||
#define FT5336_P2_XH_EF_BIT_POSITION 6
|
||||
int32_t ft5336_p2_xh_ef(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P2_XH
|
||||
* Address : 0X09
|
||||
* Bit Group Name: Second Touch X Position
|
||||
* Permission : R
|
||||
* Default value : 0x0FU
|
||||
*******************************************************************************/
|
||||
#define FT5336_P2_XH_TP_BIT_MASK 0x0FU
|
||||
#define FT5336_P2_XH_TP_BIT_POSITION 0
|
||||
int32_t ft5336_p2_xh_tp(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P2_XL
|
||||
* Address : 0X0A
|
||||
* Bit Group Name: Second Touch X Position
|
||||
* Permission : R
|
||||
* Default value : 0xFFU
|
||||
*******************************************************************************/
|
||||
#define FT5336_P2_XL_TP_BIT_MASK 0xFFU
|
||||
#define FT5336_P2_XL_TP_BIT_POSITION 0
|
||||
int32_t ft5336_p2_xl_tp(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P2_YH
|
||||
* Address : 0X0B
|
||||
* Bit Group Name: Second Touch ID
|
||||
* Permission : R
|
||||
* Default value : 0xF0U
|
||||
*******************************************************************************/
|
||||
#define FT5336_P2_YH_TID_BIT_MASK 0xF0U
|
||||
#define FT5336_P2_YH_TID_BIT_POSITION 4
|
||||
int32_t ft5336_p2_yh_tid(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P2_YH
|
||||
* Address : 0x0B
|
||||
* Bit Group Name: Second Touch Y Position
|
||||
* Permission : R
|
||||
* Default value : 0x0FU
|
||||
*******************************************************************************/
|
||||
#define FT5336_P2_YH_TP_BIT_MASK 0x0FU
|
||||
#define FT5336_P2_YH_TP_BIT_POSITION 0
|
||||
int32_t ft5336_p2_yh_tp(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P2_YL
|
||||
* Address : 0X0C
|
||||
* Bit Group Name: Second Touch Y Position
|
||||
* Permission : R
|
||||
* Default value : 0xFFU
|
||||
*******************************************************************************/
|
||||
#define FT5336_P2_YL_TP_BIT_MASK 0xFFU
|
||||
#define FT5336_P2_YL_TP_BIT_POSITION 0
|
||||
int32_t ft5336_p2_yl_tp(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P2_WEIGHT
|
||||
* Address : 0X0D
|
||||
* Bit Group Name: Second Touch Weight(pressure)
|
||||
* Permission : R
|
||||
* Default value : 0xFFU
|
||||
*******************************************************************************/
|
||||
#define FT5336_P2_WEIGHT_BIT_MASK 0xFFU
|
||||
#define FT5336_P2_WEIGHT_BIT_POSITION 0
|
||||
int32_t ft5336_p2_weight(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P2_MISC
|
||||
* Address : 0X0E
|
||||
* Bit Group Name: Second Touch Area
|
||||
* Permission : R
|
||||
* Default value : 0xFFU
|
||||
*******************************************************************************/
|
||||
#define FT5336_P2_MISC_BIT_MASK 0xF0U
|
||||
#define FT5336_P2_MISC_BIT_POSITION 4
|
||||
int32_t ft5336_p2_misc(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P3_XH
|
||||
* Address : 0X0F
|
||||
* Bit Group Name: Third Event Flag
|
||||
* Permission : R
|
||||
* Default value : 0xF0U
|
||||
*******************************************************************************/
|
||||
#define FT5336_P3_XH_EF_BIT_MASK 0xC0U
|
||||
#define FT5336_P3_XH_EF_BIT_POSITION 6
|
||||
int32_t ft5336_p3_xh_ef(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P3_XH
|
||||
* Address : 0X0F
|
||||
* Bit Group Name: Third Touch X High Position
|
||||
* Permission : R
|
||||
* Default value : 0x0FU
|
||||
*******************************************************************************/
|
||||
#define FT5336_P3_XH_TP_BIT_MASK 0x0FU
|
||||
#define FT5336_P3_XH_TP_BIT_POSITION 0
|
||||
int32_t ft5336_p3_xh_tp(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P3_XL
|
||||
* Address : 0X10
|
||||
* Bit Group Name: Third Touch X Low Position
|
||||
* Permission : R
|
||||
* Default value : 0xFFU
|
||||
*******************************************************************************/
|
||||
#define FT5336_P3_XL_TP_BIT_MASK 0xFFU
|
||||
#define FT5336_P3_XL_TP_BIT_POSITION 0
|
||||
int32_t ft5336_p3_xl_tp(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P3_YH
|
||||
* Address : 0X11
|
||||
* Bit Group Name: Third Touch ID
|
||||
* Permission : R
|
||||
* Default value : 0xF0U
|
||||
*******************************************************************************/
|
||||
#define FT5336_P3_YH_TID_BIT_MASK 0xF0U
|
||||
#define FT5336_P3_YH_TID_BIT_POSITION 4
|
||||
int32_t ft5336_p3_yh_tid(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P3_YH
|
||||
* Address : 0x11
|
||||
* Bit Group Name: Third Touch Y High Position
|
||||
* Permission : R
|
||||
* Default value : 0x0FU
|
||||
*******************************************************************************/
|
||||
#define FT5336_P3_YH_TP_BIT_MASK 0x0FU
|
||||
#define FT5336_P3_YH_TP_BIT_POSITION 0
|
||||
int32_t ft5336_p3_yh_tp(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P3_YL
|
||||
* Address : 0X12
|
||||
* Bit Group Name: Third Touch Y Low Position
|
||||
* Permission : R
|
||||
* Default value : 0xFFU
|
||||
*******************************************************************************/
|
||||
#define FT5336_P3_YL_TP_BIT_MASK 0xFFU
|
||||
#define FT5336_P3_YL_TP_BIT_POSITION 0
|
||||
int32_t ft5336_p3_yl_tp(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P3_WEIGHT
|
||||
* Address : 0X13
|
||||
* Bit Group Name: Third Touch Weight(pressure)
|
||||
* Permission : R
|
||||
* Default value : 0xFFU
|
||||
*******************************************************************************/
|
||||
#define FT5336_P3_WEIGHT_BIT_MASK 0xFFU
|
||||
#define FT5336_P3_WEIGHT_BIT_POSITION 0
|
||||
int32_t ft5336_p3_weight(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P3_MISC
|
||||
* Address : 0X14
|
||||
* Bit Group Name: Third Touch Area
|
||||
* Permission : R
|
||||
* Default value : 0xFFU
|
||||
*******************************************************************************/
|
||||
#define FT5336_P3_MISC_BIT_MASK 0xF0U
|
||||
#define FT5336_P3_MISC_BIT_POSITION 4
|
||||
int32_t ft5336_p3_misc(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P4_XH
|
||||
* Address : 0X15
|
||||
* Bit Group Name: Fourth Event Flag
|
||||
* Permission : R
|
||||
* Default value : 0xF0U
|
||||
*******************************************************************************/
|
||||
#define FT5336_P4_XH_EF_BIT_MASK 0xC0U
|
||||
#define FT5336_P4_XH_EF_BIT_POSITION 6
|
||||
int32_t ft5336_p4_xh_ef(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P4_XH
|
||||
* Address : 0X15
|
||||
* Bit Group Name: Fourth Touch X High Position
|
||||
* Permission : R
|
||||
* Default value : 0x0FU
|
||||
*******************************************************************************/
|
||||
#define FT5336_P4_XH_TP_BIT_MASK 0x0FU
|
||||
#define FT5336_P4_XH_TP_BIT_POSITION 0
|
||||
int32_t ft5336_p4_xh_tp(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P4_XL
|
||||
* Address : 0X16
|
||||
* Bit Group Name: Fourth Touch X Low Position
|
||||
* Permission : R
|
||||
* Default value : 0xFFU
|
||||
*******************************************************************************/
|
||||
#define FT5336_P4_XL_TP_BIT_MASK 0xFFU
|
||||
#define FT5336_P4_XL_TP_BIT_POSITION 0
|
||||
int32_t ft5336_p4_xl_tp(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P4_YH
|
||||
* Address : 0X17
|
||||
* Bit Group Name: Fourth Touch ID
|
||||
* Permission : R
|
||||
* Default value : 0xF0U
|
||||
*******************************************************************************/
|
||||
#define FT5336_P4_YH_TID_BIT_MASK 0xF0U
|
||||
#define FT5336_P4_YH_TID_BIT_POSITION 4
|
||||
int32_t ft5336_p4_yh_tid(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P4_YH
|
||||
* Address : 0x17
|
||||
* Bit Group Name: Fourth Touch Y High Position
|
||||
* Permission : R
|
||||
* Default value : 0x0FU
|
||||
*******************************************************************************/
|
||||
#define FT5336_P4_YH_TP_BIT_MASK 0x0FU
|
||||
#define FT5336_P4_YH_TP_BIT_POSITION 0
|
||||
int32_t ft5336_p4_yh_tp(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P4_YL
|
||||
* Address : 0X18
|
||||
* Bit Group Name: Fourth Touch Y Low Position
|
||||
* Permission : R
|
||||
* Default value : 0xFFU
|
||||
*******************************************************************************/
|
||||
#define FT5336_P4_YL_TP_BIT_MASK 0xFFU
|
||||
#define FT5336_P4_YL_TP_BIT_POSITION 0
|
||||
int32_t ft5336_p4_yl_tp(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P4_WEIGHT
|
||||
* Address : 0X19
|
||||
* Bit Group Name: Fourth Touch Weight(pressure)
|
||||
* Permission : R
|
||||
* Default value : 0xFFU
|
||||
*******************************************************************************/
|
||||
#define FT5336_P4_WEIGHT_BIT_MASK 0xFFU
|
||||
#define FT5336_P4_WEIGHT_BIT_POSITION 0
|
||||
int32_t ft5336_p4_weight(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P4_MISC
|
||||
* Address : 0X1A
|
||||
* Bit Group Name: Fourth Touch Area
|
||||
* Permission : R
|
||||
* Default value : 0xFFU
|
||||
*******************************************************************************/
|
||||
#define FT5336_P4_MISC_BIT_MASK 0xF0U
|
||||
#define FT5336_P4_MISC_BIT_POSITION 4
|
||||
int32_t ft5336_p4_misc(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P5_XH
|
||||
* Address : 0X1B
|
||||
* Bit Group Name: Fifth Event Flag
|
||||
* Permission : R
|
||||
* Default value : 0xF0U
|
||||
*******************************************************************************/
|
||||
#define FT5336_P5_XH_EF_BIT_MASK 0xC0U
|
||||
#define FT5336_P5_XH_EF_BIT_POSITION 6
|
||||
int32_t ft5336_p5_xh_ef(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P5_XH
|
||||
* Address : 0X1B
|
||||
* Bit Group Name: Fifth Touch X High Position
|
||||
* Permission : R
|
||||
* Default value : 0x0FU
|
||||
*******************************************************************************/
|
||||
#define FT5336_P5_XH_TP_BIT_MASK 0x0FU
|
||||
#define FT5336_P5_XH_TP_BIT_POSITION 0
|
||||
int32_t ft5336_p5_xh_tp(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P5_XL
|
||||
* Address : 0X1C
|
||||
* Bit Group Name: Fifth Touch X Low Position
|
||||
* Permission : R
|
||||
* Default value : 0xFFU
|
||||
*******************************************************************************/
|
||||
#define FT5336_P5_XL_TP_BIT_MASK 0xFFU
|
||||
#define FT5336_P5_XL_TP_BIT_POSITION 0
|
||||
int32_t ft5336_p5_xl_tp(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P5_YH
|
||||
* Address : 0X1D
|
||||
* Bit Group Name: Fifth Touch ID
|
||||
* Permission : R
|
||||
* Default value : 0xF0U
|
||||
*******************************************************************************/
|
||||
#define FT5336_P5_YH_TID_BIT_MASK 0xF0U
|
||||
#define FT5336_P5_YH_TID_BIT_POSITION 4
|
||||
int32_t ft5336_p5_yh_tid(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P5_YH
|
||||
* Address : 0x1D
|
||||
* Bit Group Name: Fifth Touch Y High Position
|
||||
* Permission : R
|
||||
* Default value : 0x0FU
|
||||
*******************************************************************************/
|
||||
#define FT5336_P5_YH_TP_BIT_MASK 0x0FU
|
||||
#define FT5336_P5_YH_TP_BIT_POSITION 0
|
||||
int32_t ft5336_p5_yh_tp(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P5_YL
|
||||
* Address : 0X1E
|
||||
* Bit Group Name: Fifth Touch Y Low Position
|
||||
* Permission : R
|
||||
* Default value : 0xFFU
|
||||
*******************************************************************************/
|
||||
#define FT5336_P5_YL_TP_BIT_MASK 0xFFU
|
||||
#define FT5336_P5_YL_TP_BIT_POSITION 0
|
||||
int32_t ft5336_p5_yl_tp(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P5_WEIGHT
|
||||
* Address : 0X1F
|
||||
* Bit Group Name: Fifth Touch Weight(pressure)
|
||||
* Permission : R
|
||||
* Default value : 0xFFU
|
||||
*******************************************************************************/
|
||||
#define FT5336_P5_WEIGHT_BIT_MASK 0xFFU
|
||||
#define FT5336_P5_WEIGHT_BIT_POSITION 0
|
||||
int32_t ft5336_p5_weight(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P5_MISC
|
||||
* Address : 0X20
|
||||
* Bit Group Name: Fifth Touch Area
|
||||
* Permission : R
|
||||
* Default value : 0xFFU
|
||||
*******************************************************************************/
|
||||
#define FT5336_P5_MISC_BIT_MASK 0xF0U
|
||||
#define FT5336_P5_MISC_BIT_POSITION 4
|
||||
int32_t ft5336_p5_misc(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : TH_GROUP
|
||||
* Address : 0X80
|
||||
* Bit Group Name: Threshold for touch detection
|
||||
* Permission : RW
|
||||
* Default value : None
|
||||
*******************************************************************************/
|
||||
#define FT5336_TH_GROUP_BIT_MASK 0xFFU
|
||||
#define FT5336_TH_GROUP_BIT_POSITION 0
|
||||
int32_t ft5336_th_group(ft5336_ctx_t *ctx, uint8_t value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : TH_DIFF
|
||||
* Address : 0X85
|
||||
* Bit Group Name: Filter function coefficient
|
||||
* Permission : RW
|
||||
* Default value : None
|
||||
*******************************************************************************/
|
||||
#define FT5336_TH_DIFF_BIT_MASK 0xFFU
|
||||
#define FT5336_TH_DIFF_BIT_POSITION 0
|
||||
int32_t ft5336_th_diff(ft5336_ctx_t *ctx, uint8_t value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : CTRL
|
||||
* Address : 0X86
|
||||
* Bit Group Name:
|
||||
* Permission : RW
|
||||
* Default value : 0x01
|
||||
*******************************************************************************/
|
||||
#define FT5336_CTRL_BIT_MASK 0xFFU
|
||||
#define FT5336_CTRL_BIT_POSITION 0
|
||||
int32_t ft5336_ctrl(ft5336_ctx_t *ctx, uint8_t value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : TIMEENTERMONITOR
|
||||
* Address : 0X87
|
||||
* Bit Group Name:
|
||||
* Permission : RW
|
||||
* Default value : 0x0A
|
||||
*******************************************************************************/
|
||||
#define FT5336_TIMEENTERMONITOR_BIT_MASK 0xFFU
|
||||
#define FT5336_TIMEENTERMONITOR_BIT_POSITION 0
|
||||
int32_t ft5336_time_enter_monitor(ft5336_ctx_t *ctx, uint8_t value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : PERIODACTIVE
|
||||
* Address : 0X88
|
||||
* Bit Group Name:
|
||||
* Permission : RW
|
||||
* Default value : None
|
||||
*******************************************************************************/
|
||||
#define FT5336_PERIODACTIVE_BIT_MASK 0xFFU
|
||||
#define FT5336_PERIODACTIVE_BIT_POSITION 0
|
||||
int32_t ft5336_period_active(ft5336_ctx_t *ctx, uint8_t value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : PERIODMONITOR
|
||||
* Address : 0X89
|
||||
* Bit Group Name:
|
||||
* Permission : RW
|
||||
* Default value : 0x28
|
||||
*******************************************************************************/
|
||||
#define FT5336_PERIODMONITOR_BIT_MASK 0xFFU
|
||||
#define FT5336_PERIODMONITOR_BIT_POSITION 0
|
||||
int32_t ft5336_period_monitor(ft5336_ctx_t *ctx, uint8_t value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : RADIAN_VALUE
|
||||
* Address : 0X91
|
||||
* Bit Group Name:
|
||||
* Permission : RW
|
||||
* Default value : 0x0A
|
||||
*******************************************************************************/
|
||||
#define FT5336_RADIAN_VALUE_BIT_MASK 0xFFU
|
||||
#define FT5336_RADIAN_VALUE_BIT_POSITION 0
|
||||
int32_t ft5336_radian_value(ft5336_ctx_t *ctx, uint8_t value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : OFFSET_LEFT_RIGHT
|
||||
* Address : 0X92
|
||||
* Bit Group Name:
|
||||
* Permission : RW
|
||||
* Default value : 0x19
|
||||
*******************************************************************************/
|
||||
#define FT5336_OFFSET_LR_BIT_MASK 0xFFU
|
||||
#define FT5336_OFFSET_LR_BIT_POSITION 0
|
||||
int32_t ft5336_offset_left_right(ft5336_ctx_t *ctx, uint8_t value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : OFFSET_UP_DOWN
|
||||
* Address : 0X93
|
||||
* Bit Group Name:
|
||||
* Permission : RW
|
||||
* Default value : 0x19
|
||||
*******************************************************************************/
|
||||
#define FT5336_OFFSET_UD_BIT_MASK 0xFFU
|
||||
#define FT5336_OFFSET_UD_BIT_POSITION 0
|
||||
int32_t ft5336_offset_up_down(ft5336_ctx_t *ctx, uint8_t value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : DISTANCE_LEFT_RIGHT
|
||||
* Address : 0X94
|
||||
* Bit Group Name:
|
||||
* Permission : RW
|
||||
* Default value : 0x19
|
||||
*******************************************************************************/
|
||||
#define FT5336_DISTANCE_LR_BIT_MASK 0xFFU
|
||||
#define FT5336_DISTANCE_LR_BIT_POSITION 0
|
||||
int32_t ft5336_disatnce_left_right(ft5336_ctx_t *ctx, uint8_t value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : DISTANCE_UP_DOWN
|
||||
* Address : 0X95
|
||||
* Bit Group Name:
|
||||
* Permission : RW
|
||||
* Default value : 0x19
|
||||
*******************************************************************************/
|
||||
#define FT5336_DISTANCE_UD_BIT_MASK 0xFFU
|
||||
#define FT5336_DISTANCE_UD_BIT_POSITION 0
|
||||
int32_t ft5336_distance_up_down(ft5336_ctx_t *ctx, uint8_t value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : DISTANCE_ZOOM
|
||||
* Address : 0X96
|
||||
* Bit Group Name:
|
||||
* Permission : RW
|
||||
* Default value : 0x32
|
||||
*******************************************************************************/
|
||||
#define FT5336_DISTANCE_ZOOM_BIT_MASK 0xFFU
|
||||
#define FT5336_DISTANCE_ZOOM_BIT_POSITION 0
|
||||
int32_t ft5336_distance_zoom(ft5336_ctx_t *ctx, uint8_t value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : LIB_VER_H
|
||||
* Address : 0XA1
|
||||
* Bit Group Name:
|
||||
* Permission : R
|
||||
* Default value : None
|
||||
*******************************************************************************/
|
||||
#define FT5336_LIB_VER_H_BIT_MASK 0xFFU
|
||||
#define FT5336_LIB_VER_H_BIT_POSITION 0
|
||||
int32_t ft5336_lib_ver_high(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : LIB_VER_L
|
||||
* Address : 0XA2
|
||||
* Bit Group Name:
|
||||
* Permission : R
|
||||
* Default value : None
|
||||
*******************************************************************************/
|
||||
#define FT5336_LIB_VER_L_BIT_MASK 0xFFU
|
||||
#define FT5336_LIB_VER_L_BIT_POSITION 0
|
||||
int32_t ft5336_lib_ver_low(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : CIPHER
|
||||
* Address : 0XA3
|
||||
* Bit Group Name:
|
||||
* Permission : R
|
||||
* Default value : 0x06
|
||||
*******************************************************************************/
|
||||
#define FT5336_CIPHER_BIT_MASK 0xFFU
|
||||
#define FT5336_CIPHER_BIT_POSITION 0
|
||||
int32_t ft5336_cipher(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : G_MODE
|
||||
* Address : 0XA4
|
||||
* Bit Group Name:
|
||||
* Permission : RW
|
||||
* Default value : 0x01
|
||||
*******************************************************************************/
|
||||
#define FT5336_G_MODE_BIT_MASK 0xFFU
|
||||
#define FT5336_G_MODE_BIT_POSITION 0
|
||||
int32_t ft5336_g_mode(ft5336_ctx_t *ctx, uint8_t value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : PWR_MODE
|
||||
* Address : 0XA5
|
||||
* Bit Group Name:
|
||||
* Permission : RW
|
||||
* Default value : 0x00
|
||||
*******************************************************************************/
|
||||
#define FT5336_PWR_MODE_BIT_MASK 0xFFU
|
||||
#define FT5336_PWR_MODE_BIT_POSITION 0
|
||||
int32_t ft5336_pwr_mode(ft5336_ctx_t *ctx, uint8_t value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : FIRMID
|
||||
* Address : 0XA6
|
||||
* Bit Group Name:
|
||||
* Permission : R
|
||||
* Default value : None
|
||||
*******************************************************************************/
|
||||
#define FT5336_FIRMID_BIT_MASK 0xFFU
|
||||
#define FT5336_FIRMID_BIT_POSITION 0
|
||||
int32_t ft5336_firm_id(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : FOCALTECH_ID
|
||||
* Address : 0XA8
|
||||
* Bit Group Name:
|
||||
* Permission : R
|
||||
* Default value : 0x11
|
||||
*******************************************************************************/
|
||||
#define FT5336_CHIP_ID_BIT_MASK 0xFFU
|
||||
#define FT5336_CHIP_ID_BIT_POSITION 0
|
||||
int32_t ft5336_chip_id(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : RELEASE_CODE_ID
|
||||
* Address : 0XAF
|
||||
* Bit Group Name:
|
||||
* Permission : R
|
||||
* Default value : 0x001
|
||||
*******************************************************************************/
|
||||
#define FT5336_RC_ID_BIT_MASK 0xFFU
|
||||
#define FT5336_RC_ID_BIT_POSITION 0
|
||||
int32_t ft5336_release_code_id(ft5336_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : STATE
|
||||
* Address : 0XBC
|
||||
* Bit Group Name:
|
||||
* Permission : RW
|
||||
* Default value : 0x01
|
||||
*******************************************************************************/
|
||||
#define FT5336_STATE_BIT_MASK 0xFFU
|
||||
#define FT5336_STATE_BIT_POSITION 0
|
||||
int32_t ft5336_state(ft5336_ctx_t *ctx, uint8_t value);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* FT5336_REG_H */
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,99 @@
|
||||
<!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 FT6X06 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-ft6x06-ts-component-driver"><strong>Release Notes for FT6X06 TS Component Driver</strong></h1>
|
||||
<p>Copyright © 2015 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 Touch Screen functions offered by FT6X06 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-section4" checked aria-hidden="true"> <label for="collapse-section4" aria-hidden="true"><strong>V2.0.0 / 23-November-2019</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<ul>
|
||||
<li>First Official Release of FT6X06 Touch Screen Component Drivers in line with STM32Cube BSP drivers development guidelines (UM2298)</li>
|
||||
<li>The component drivers are composed of
|
||||
<ul>
|
||||
<li>component core drivers files: ft6X06.h/.c</li>
|
||||
<li>component register drivers files: ft6X06_reg.h/.c</li>
|
||||
<li>component configuration file ft6X06_conf_template.h file</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>
|
||||
<p>This software release is compatible with:</p>
|
||||
<ul>
|
||||
<li>BSP Common v6.0.0 or above</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section3" checked aria-hidden="true"> <label for="collapse-section3" aria-hidden="true"><strong>V1.0.2 / 07-April-2017</strong></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-section2" checked aria-hidden="true"> <label for="collapse-section2" aria-hidden="true"><strong>V1.0.1 / 03-Mai-2016</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-2">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Add support of FT6x36 Touch controller</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section1" checked aria-hidden="true"> <label for="collapse-section1" aria-hidden="true"><strong>V1.0.0 / 03-August-2015</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-3">Main Changes</h2>
|
||||
<ul>
|
||||
<li>First official release of <strong>FT6X06</strong> TS 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,104 @@
|
||||
---
|
||||
pagetitle: Release Notes for FT6X06 Component Driver
|
||||
lang: en
|
||||
---
|
||||
::: {.row}
|
||||
::: {.col-sm-12 .col-lg-4}
|
||||
|
||||
::: {.card .fluid}
|
||||
::: {.sectione .dark}
|
||||
<center>
|
||||
# **Release Notes for FT6X06 TS Component Driver**
|
||||
Copyright © 2015 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 Touch Screen functions offered by FT6X06 component
|
||||
|
||||
:::
|
||||
|
||||
::: {.col-sm-12 .col-lg-8}
|
||||
# Update History
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section4" checked aria-hidden="true">
|
||||
<label for="collapse-section4" aria-hidden="true">__V2.0.0 / 23-November-2019__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- First Official Release of FT6X06 Touch Screen Component Drivers in line with STM32Cube BSP drivers development guidelines (UM2298)
|
||||
- The component drivers are composed of
|
||||
- component core drivers files: ft6X06.h/.c
|
||||
- component register drivers files: ft6X06_reg.h/.c
|
||||
- component configuration file ft6X06_conf_template.h file
|
||||
|
||||
## Backward Compatibility
|
||||
|
||||
- This version breaks the compatibility with previous versions
|
||||
|
||||
## Dependencies
|
||||
|
||||
This software release is compatible with:
|
||||
|
||||
- BSP Common v6.0.0 or above
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section3" checked aria-hidden="true">
|
||||
<label for="collapse-section3" aria-hidden="true">__V1.0.2 / 07-April-2017__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- Update comments to be used for PDSC generation
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section2" checked aria-hidden="true">
|
||||
<label for="collapse-section2" aria-hidden="true">__V1.0.1 / 03-Mai-2016__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- Add support of FT6x36 Touch controller
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section1" checked aria-hidden="true">
|
||||
<label for="collapse-section1" aria-hidden="true">__V1.0.0 / 03-August-2015__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- First official release of **FT6X06** TS 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>
|
||||
|
After Width: | Height: | Size: 18 KiB |
@@ -0,0 +1,543 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file ft6x06.c
|
||||
* @author MCD Application Team
|
||||
* @brief This file provides a set of functions needed to manage the FT6X06
|
||||
* IO Expander devices.
|
||||
******************************************************************************
|
||||
* @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 "ft6x06.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup FT6X06 FT6X06
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
/* Private macro -------------------------------------------------------------*/
|
||||
/** @defgroup FT6X06_Exported_Variables FT6X06 Exported Variables
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Touch screen driver structure initialization */
|
||||
FT6X06_TS_Drv_t FT6X06_TS_Driver =
|
||||
{
|
||||
FT6X06_Init,
|
||||
FT6X06_DeInit,
|
||||
FT6X06_GestureConfig,
|
||||
FT6X06_ReadID,
|
||||
FT6X06_GetState,
|
||||
FT6X06_GetMultiTouchState,
|
||||
FT6X06_GetGesture,
|
||||
FT6X06_GetCapabilities,
|
||||
FT6X06_EnableIT,
|
||||
FT6X06_DisableIT,
|
||||
FT6X06_ClearIT,
|
||||
FT6X06_ITStatus
|
||||
};
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup FT6X06_Private_Function_Prototypes FT6X06 Private Function Prototypes
|
||||
* @{
|
||||
*/
|
||||
#if (FT6X06_AUTO_CALIBRATION_ENABLED == 1)
|
||||
static int32_t FT6X06_TS_Calibration(FT6X06_Object_t *pObj);
|
||||
static int32_t FT6X06_Delay(FT6X06_Object_t *pObj, uint32_t Delay);
|
||||
#endif /* FT6X06_AUTO_CALIBRATION_ENABLED == 1 */
|
||||
static int32_t FT6X06_DetectTouch(FT6X06_Object_t *pObj);
|
||||
static int32_t ReadRegWrap(void *handle, uint8_t Reg, uint8_t* Data, uint16_t Length);
|
||||
static int32_t WriteRegWrap(void *handle, uint8_t Reg, uint8_t* Data, uint16_t Length);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup FT6X06_Exported_Functions FT6X06 Exported Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Register IO bus to component object
|
||||
* @param Component object pointer
|
||||
* @retval error status
|
||||
*/
|
||||
int32_t FT6X06_RegisterBusIO (FT6X06_Object_t *pObj, FT6X06_IO_t *pIO)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
if (pObj == NULL)
|
||||
{
|
||||
ret = FT6X06_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
pObj->IO.Init = pIO->Init;
|
||||
pObj->IO.DeInit = pIO->DeInit;
|
||||
pObj->IO.Address = pIO->Address;
|
||||
pObj->IO.WriteReg = pIO->WriteReg;
|
||||
pObj->IO.ReadReg = pIO->ReadReg;
|
||||
pObj->IO.GetTick = pIO->GetTick;
|
||||
|
||||
pObj->Ctx.ReadReg = ReadRegWrap;
|
||||
pObj->Ctx.WriteReg = WriteRegWrap;
|
||||
pObj->Ctx.handle = pObj;
|
||||
|
||||
if(pObj->IO.Init != NULL)
|
||||
{
|
||||
ret = pObj->IO.Init();
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = FT6X06_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get FT6X06 sensor capabilities
|
||||
* @param pObj Component object pointer
|
||||
* @param Capabilities pointer to FT6X06 sensor capabilities
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t FT6X06_GetCapabilities(FT6X06_Object_t *pObj, FT6X06_Capabilities_t *Capabilities)
|
||||
{
|
||||
/* Prevent unused argument(s) compilation warning */
|
||||
(void)(pObj);
|
||||
|
||||
/* Store component's capabilities */
|
||||
Capabilities->MultiTouch = 1;
|
||||
Capabilities->Gesture = 0; /* Gesture feature is currently not activated on FW chipset */
|
||||
Capabilities->MaxTouch = FT6X06_MAX_NB_TOUCH;
|
||||
Capabilities->MaxXl = FT6X06_MAX_X_LENGTH;
|
||||
Capabilities->MaxYl = FT6X06_MAX_Y_LENGTH;
|
||||
|
||||
return FT6X06_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Initialize the FT6X06 communication bus
|
||||
* from MCU to FT6X06 : ie I2C channel initialization (if required).
|
||||
* @param pObj Component object pointer
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t FT6X06_Init(FT6X06_Object_t *pObj)
|
||||
{
|
||||
int32_t ret = FT6X06_OK;
|
||||
|
||||
if(pObj->IsInitialized == 0U)
|
||||
{
|
||||
/* Initialize IO BUS layer */
|
||||
pObj->IO.Init();
|
||||
|
||||
#if (FT6X06_AUTO_CALIBRATION_ENABLED == 1)
|
||||
/* Hw Calibration sequence start : should be done once after each power up */
|
||||
/* This is called internal calibration of the touch screen */
|
||||
ret += FT6X06_TS_Calibration(pObj);
|
||||
#endif /* (FT6X06_AUTO_CALIBRATION_ENABLED == 1) */
|
||||
/* By default set FT6X06 IC in Polling mode : no INT generation on FT6X06 for new touch available */
|
||||
/* Note TS_INT is active low */
|
||||
ret += FT6X06_DisableIT(pObj);
|
||||
|
||||
pObj->IsInitialized = 1;
|
||||
}
|
||||
|
||||
if(ret != FT6X06_OK)
|
||||
{
|
||||
ret = FT6X06_ERROR;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief De-Initialize the FT6X06 communication bus
|
||||
* from MCU to FT6X06 : ie I2C channel initialization (if required).
|
||||
* @param pObj Component object pointer
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t FT6X06_DeInit(FT6X06_Object_t *pObj)
|
||||
{
|
||||
if(pObj->IsInitialized == 1U)
|
||||
{
|
||||
pObj->IsInitialized = 0;
|
||||
}
|
||||
|
||||
return FT6X06_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configure the FT6X06 gesture
|
||||
* from MCU to FT6X06 : ie I2C channel initialization (if required).
|
||||
* @param pObj Component object pointer
|
||||
* @param GestureInit Gesture init structure
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t FT6X06_GestureConfig(FT6X06_Object_t *pObj, FT6X06_Gesture_Init_t *GestureInit)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
ret = ft6x06_radian_value(&pObj->Ctx, (uint8_t)GestureInit->Radian);
|
||||
ret += ft6x06_offset_left_right(&pObj->Ctx, (uint8_t)GestureInit->OffsetLeftRight);
|
||||
ret += ft6x06_offset_up_down(&pObj->Ctx, (uint8_t)GestureInit->OffsetUpDown);
|
||||
ret += ft6x06_disatnce_left_right(&pObj->Ctx, (uint8_t)GestureInit->DistanceLeftRight);
|
||||
ret += ft6x06_distance_up_down(&pObj->Ctx, (uint8_t)GestureInit->DistanceUpDown);
|
||||
ret += ft6x06_distance_zoom(&pObj->Ctx, (uint8_t)GestureInit->DistanceZoom);
|
||||
|
||||
if(ret != FT6X06_OK)
|
||||
{
|
||||
ret = FT6X06_ERROR;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Read the FT6X06 device ID, pre initialize I2C in case of need to be
|
||||
* able to read the FT6X06 device ID, and verify this is a FT6X06.
|
||||
* @param pObj Component object pointer
|
||||
* @param Id Pointer to component's ID
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t FT6X06_ReadID(FT6X06_Object_t *pObj, uint32_t *Id)
|
||||
{
|
||||
int32_t ret;
|
||||
uint8_t ft6x06_id;
|
||||
|
||||
ret = ft6x06_chip_id(&pObj->Ctx, &ft6x06_id);
|
||||
*Id = (uint32_t) ft6x06_id;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the touch screen X and Y positions values
|
||||
* @param pObj Component object pointer
|
||||
* @param State Single Touch structure pointer
|
||||
* @retval Component status.
|
||||
*/
|
||||
int32_t FT6X06_GetState(FT6X06_Object_t *pObj, FT6X06_State_t *State)
|
||||
{
|
||||
int32_t ret = FT6X06_OK;
|
||||
uint8_t data[4];
|
||||
|
||||
State->TouchDetected = (uint32_t)FT6X06_DetectTouch(pObj);
|
||||
if(ft6x06_read_reg(&pObj->Ctx, FT6X06_P1_XH_REG, data, (uint16_t)sizeof(data)) != FT6X06_OK)
|
||||
{
|
||||
ret = FT6X06_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Send back first ready X position to caller */
|
||||
State->TouchX = (((uint32_t)data[0] & FT6X06_P1_XH_TP_BIT_MASK) << 8) | ((uint32_t)data[1] & FT6X06_P1_XL_TP_BIT_MASK);
|
||||
/* Send back first ready Y position to caller */
|
||||
State->TouchY = (((uint32_t)data[2] & FT6X06_P1_YH_TP_BIT_MASK) << 8) | ((uint32_t)data[3] & FT6X06_P1_YL_TP_BIT_MASK);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the touch screen Xn and Yn positions values in multi-touch mode
|
||||
* @param pObj Component object pointer
|
||||
* @param State Multi Touch structure pointer
|
||||
* @retval Component status.
|
||||
*/
|
||||
int32_t FT6X06_GetMultiTouchState(FT6X06_Object_t *pObj, FT6X06_MultiTouch_State_t *State)
|
||||
{
|
||||
int32_t ret = FT6X06_OK;
|
||||
uint8_t data[12];
|
||||
|
||||
State->TouchDetected = (uint32_t)FT6X06_DetectTouch(pObj);
|
||||
|
||||
if(ft6x06_read_reg(&pObj->Ctx, FT6X06_P1_XH_REG, data, (uint16_t)sizeof(data)) != FT6X06_OK)
|
||||
{
|
||||
ret = FT6X06_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Send back first ready X position to caller */
|
||||
State->TouchX[0] = (((uint32_t)data[0] & FT6X06_P1_XH_TP_BIT_MASK) << 8) | ((uint32_t)data[1] & FT6X06_P1_XL_TP_BIT_MASK);
|
||||
/* Send back first ready Y position to caller */
|
||||
State->TouchY[0] = (((uint32_t)data[2] & FT6X06_P1_YH_TP_BIT_MASK) << 8) | ((uint32_t)data[3] & FT6X06_P1_YL_TP_BIT_MASK);
|
||||
/* Send back first ready Event to caller */
|
||||
State->TouchEvent[0] = (((uint32_t)data[0] & FT6X06_P1_XH_EF_BIT_MASK) >> FT6X06_P1_XH_EF_BIT_POSITION);
|
||||
/* Send back first ready Weight to caller */
|
||||
State->TouchWeight[0] = ((uint32_t)data[4] & FT6X06_P1_WEIGHT_BIT_MASK);
|
||||
/* Send back first ready Area to caller */
|
||||
State->TouchArea[0] = ((uint32_t)data[5] & FT6X06_P1_MISC_BIT_MASK) >> FT6X06_P1_MISC_BIT_POSITION;
|
||||
|
||||
/* Send back first ready X position to caller */
|
||||
State->TouchX[1] = (((uint32_t)data[6] & FT6X06_P2_XH_TP_BIT_MASK) << 8) | ((uint32_t)data[7] & FT6X06_P2_XL_TP_BIT_MASK);
|
||||
/* Send back first ready Y position to caller */
|
||||
State->TouchY[1] = (((uint32_t)data[8] & FT6X06_P2_YH_TP_BIT_MASK) << 8) | ((uint32_t)data[9] & FT6X06_P2_YL_TP_BIT_MASK);
|
||||
/* Send back first ready Event to caller */
|
||||
State->TouchEvent[1] = (((uint32_t)data[6] & FT6X06_P2_XH_EF_BIT_MASK) >> FT6X06_P2_XH_EF_BIT_POSITION);
|
||||
/* Send back first ready Weight to caller */
|
||||
State->TouchWeight[1] = ((uint32_t)data[10] & FT6X06_P2_WEIGHT_BIT_MASK);
|
||||
/* Send back first ready Area to caller */
|
||||
State->TouchArea[1] = ((uint32_t)data[11] & FT6X06_P2_MISC_BIT_MASK) >> FT6X06_P2_MISC_BIT_POSITION;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get Gesture ID
|
||||
* @param pObj Component object pointer
|
||||
* @param GestureId gesture ID
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t FT6X06_GetGesture(FT6X06_Object_t *pObj, uint8_t *GestureId)
|
||||
{
|
||||
return ft6x06_gest_id(&pObj->Ctx, GestureId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configure the FT6X06 device to generate IT on given INT pin
|
||||
* connected to MCU as EXTI.
|
||||
* @param pObj Component object pointer
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t FT6X06_EnableIT(FT6X06_Object_t *pObj)
|
||||
{
|
||||
return ft6x06_g_mode(&pObj->Ctx, FT6X06_G_MODE_INTERRUPT_TRIGGER);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configure the FT6X06 device to stop generating IT on the given INT pin
|
||||
* connected to MCU as EXTI.
|
||||
* @param pObj Component object pointer
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t FT6X06_DisableIT(FT6X06_Object_t *pObj)
|
||||
{
|
||||
return ft6x06_g_mode(&pObj->Ctx, FT6X06_G_MODE_INTERRUPT_POLLING);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get IT status from FT6X06 interrupt status registers
|
||||
* Should be called Following an EXTI coming to the MCU to know the detailed
|
||||
* reason of the interrupt.
|
||||
* @note : This feature is not supported by FT6X06.
|
||||
* @param pObj Component object pointer
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t FT6X06_ITStatus(FT6X06_Object_t *pObj)
|
||||
{
|
||||
/* Prevent unused argument(s) compilation warning */
|
||||
(void)(pObj);
|
||||
|
||||
/* Always return FT6X06_OK as feature not supported by FT6X06 */
|
||||
return FT6X06_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clear IT status in FT6X06 interrupt status clear registers
|
||||
* Should be called Following an EXTI coming to the MCU.
|
||||
* @note : This feature is not supported by FT6X06.
|
||||
* @param pObj Component object pointer
|
||||
* @retval Component status
|
||||
*/
|
||||
int32_t FT6X06_ClearIT(FT6X06_Object_t *pObj)
|
||||
{
|
||||
/* Prevent unused argument(s) compilation warning */
|
||||
(void)(pObj);
|
||||
|
||||
/* Always return FT6X06_OK as feature not supported by FT6X06 */
|
||||
return FT6X06_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup FT6X06_Private_Functions FT6X06 Private Functions
|
||||
* @{
|
||||
*/
|
||||
#if (FT6X06_AUTO_CALIBRATION_ENABLED == 1)
|
||||
/**
|
||||
* @brief This function provides accurate delay (in milliseconds)
|
||||
* @param pObj pointer to component object
|
||||
* @param Delay specifies the delay time length, in milliseconds
|
||||
* @retval Component status
|
||||
*/
|
||||
static int32_t FT6X06_Delay(FT6X06_Object_t *pObj, uint32_t Delay)
|
||||
{
|
||||
uint32_t tickstart;
|
||||
tickstart = pObj->IO.GetTick();
|
||||
while((pObj->IO.GetTick() - tickstart) < Delay)
|
||||
{
|
||||
}
|
||||
return FT6X06_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Start TouchScreen calibration phase
|
||||
* @param pObj pointer to component object
|
||||
* @retval Component status
|
||||
*/
|
||||
static int32_t FT6X06_TS_Calibration(FT6X06_Object_t *pObj)
|
||||
{
|
||||
int32_t ret = FT6X06_OK;
|
||||
uint32_t nbr_attempt;
|
||||
uint8_t read_data;
|
||||
uint8_t end_calibration = 0;
|
||||
|
||||
/* Switch FT6X06 back to factory mode to calibrate */
|
||||
if(ft6x06_dev_mode_w(&pObj->Ctx, FT6X06_DEV_MODE_FACTORY) != FT6X06_OK)
|
||||
{
|
||||
ret = FT6X06_ERROR;
|
||||
}/* Read back the same register FT6X06_DEV_MODE_REG */
|
||||
else if(ft6x06_dev_mode_r(&pObj->Ctx, &read_data) != FT6X06_OK)
|
||||
{
|
||||
ret = FT6X06_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
(void)FT6X06_Delay(pObj, 300); /* Wait 300 ms */
|
||||
|
||||
if(read_data != FT6X06_DEV_MODE_FACTORY )
|
||||
{
|
||||
/* Return error to caller */
|
||||
ret = FT6X06_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Start calibration command */
|
||||
read_data= 0x04;
|
||||
if(ft6x06_write_reg(&pObj->Ctx, FT6X06_TD_STAT_REG, &read_data, 1) != FT6X06_OK)
|
||||
{
|
||||
ret = FT6X06_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
(void)FT6X06_Delay(pObj, 300); /* Wait 300 ms */
|
||||
|
||||
/* 100 attempts to wait switch from factory mode (calibration) to working mode */
|
||||
for (nbr_attempt=0; ((nbr_attempt < 100U) && (end_calibration == 0U)) ; nbr_attempt++)
|
||||
{
|
||||
if(ft6x06_dev_mode_r(&pObj->Ctx, &read_data) != FT6X06_OK)
|
||||
{
|
||||
ret = FT6X06_ERROR;
|
||||
break;
|
||||
}
|
||||
if(read_data == FT6X06_DEV_MODE_WORKING)
|
||||
{
|
||||
/* Auto Switch to FT6X06_DEV_MODE_WORKING : means calibration have ended */
|
||||
end_calibration = 1; /* exit for loop */
|
||||
}
|
||||
|
||||
(void)FT6X06_Delay(pObj, 200); /* Wait 200 ms */
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* FT6X06_AUTO_CALIBRATION_ENABLED == 1 */
|
||||
|
||||
/**
|
||||
* @brief Return if there is touches detected or not.
|
||||
* Try to detect new touches and forget the old ones (reset internal global
|
||||
* variables).
|
||||
* @param pObj Component object pointer
|
||||
* @retval Number of active touches detected (can be 0, 1 or 2) or FT6X06_ERROR
|
||||
* in case of error
|
||||
*/
|
||||
static int32_t FT6X06_DetectTouch(FT6X06_Object_t *pObj)
|
||||
{
|
||||
int32_t ret;
|
||||
uint8_t nb_touch;
|
||||
|
||||
/* Read register FT6X06_TD_STAT_REG to check number of touches detection */
|
||||
if(ft6x06_td_status(&pObj->Ctx, &nb_touch) != FT6X06_OK)
|
||||
{
|
||||
ret = FT6X06_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(nb_touch > FT6X06_MAX_NB_TOUCH)
|
||||
{
|
||||
/* If invalid number of touch detected, set it to zero */
|
||||
ret = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = (int32_t)nb_touch;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Wrap IO bus read function to component register red function
|
||||
* @param handle Component object handle
|
||||
* @param Reg The target register address to read
|
||||
* @param pData The target register value to be read
|
||||
* @param Length buffer size to be read
|
||||
* @retval Component status.
|
||||
*/
|
||||
static int32_t ReadRegWrap(void *handle, uint8_t Reg, uint8_t* pData, uint16_t Length)
|
||||
{
|
||||
FT6X06_Object_t *pObj = (FT6X06_Object_t *)handle;
|
||||
|
||||
return pObj->IO.ReadReg(pObj->IO.Address, Reg, pData, Length);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Wrap IO bus write function to component register 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 Component status.
|
||||
*/
|
||||
static int32_t WriteRegWrap(void *handle, uint8_t Reg, uint8_t* pData, uint16_t Length)
|
||||
{
|
||||
FT6X06_Object_t *pObj = (FT6X06_Object_t *)handle;
|
||||
|
||||
return pObj->IO.WriteReg(pObj->IO.Address, Reg, pData, Length);
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,221 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file ft6x06.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the functions prototypes for the
|
||||
* ft6x06.c IO expander 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 FT6X06_H
|
||||
#define FT6X06_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "ft6x06_reg.h"
|
||||
#include <stddef.h>
|
||||
#include "ft6x06_conf.h"
|
||||
|
||||
/* Macros --------------------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup FT6X06
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup FT6X06_Exported_Constants FT6X06 Exported Constants
|
||||
* @{
|
||||
*/
|
||||
#define FT6X06_OK (0)
|
||||
#define FT6X06_ERROR (-1)
|
||||
|
||||
/* Max detectable simultaneous touches */
|
||||
#define FT6X06_MAX_NB_TOUCH 2U
|
||||
|
||||
/* Touch FT6XX6 IDs */
|
||||
#define FT6X06_ID 0x11U
|
||||
#define FT6X36_ID 0xCDU
|
||||
|
||||
/* Possible values of FT6X06_DEV_MODE_REG */
|
||||
#define FT6X06_DEV_MODE_WORKING 0x00U
|
||||
#define FT6X06_DEV_MODE_FACTORY 0x04U
|
||||
|
||||
/* Possible values of FT6X06_GEST_ID_REG */
|
||||
#define FT6X06_GEST_ID_NO_GESTURE 0x00U
|
||||
#define FT6X06_GEST_ID_MOVE_UP 0x10U
|
||||
#define FT6X06_GEST_ID_MOVE_RIGHT 0x14U
|
||||
#define FT6X06_GEST_ID_MOVE_DOWN 0x18U
|
||||
#define FT6X06_GEST_ID_MOVE_LEFT 0x1CU
|
||||
#define FT6X06_GEST_ID_ZOOM_IN 0x48U
|
||||
#define FT6X06_GEST_ID_ZOOM_OUT 0x49U
|
||||
|
||||
/* Values Pn_XH and Pn_YH related */
|
||||
#define FT6X06_TOUCH_EVT_FLAG_PRESS_DOWN 0x00U
|
||||
#define FT6X06_TOUCH_EVT_FLAG_LIFT_UP 0x01U
|
||||
#define FT6X06_TOUCH_EVT_FLAG_CONTACT 0x02U
|
||||
#define FT6X06_TOUCH_EVT_FLAG_NO_EVENT 0x03U
|
||||
|
||||
/* Possible values of FT6X06_GMODE_REG */
|
||||
#define FT6X06_G_MODE_INTERRUPT_POLLING 0x00U
|
||||
#define FT6X06_G_MODE_INTERRUPT_TRIGGER 0x01U
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
|
||||
/** @defgroup FT6X06_Exported_Types FT6X06 Exported Types
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t Radian;
|
||||
uint32_t OffsetLeftRight;
|
||||
uint32_t OffsetUpDown;
|
||||
uint32_t DistanceLeftRight;
|
||||
uint32_t DistanceUpDown;
|
||||
uint32_t DistanceZoom;
|
||||
}FT6X06_Gesture_Init_t;
|
||||
|
||||
typedef int32_t (*FT6X06_Init_Func) (void);
|
||||
typedef int32_t (*FT6X06_DeInit_Func) (void);
|
||||
typedef int32_t (*FT6X06_GetTick_Func) (void);
|
||||
typedef int32_t (*FT6X06_Delay_Func) (uint32_t);
|
||||
typedef int32_t (*FT6X06_WriteReg_Func)(uint16_t, uint16_t, uint8_t*, uint16_t);
|
||||
typedef int32_t (*FT6X06_ReadReg_Func) (uint16_t, uint16_t, uint8_t*, uint16_t);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
FT6X06_Init_Func Init;
|
||||
FT6X06_DeInit_Func DeInit;
|
||||
uint16_t Address;
|
||||
FT6X06_WriteReg_Func WriteReg;
|
||||
FT6X06_ReadReg_Func ReadReg;
|
||||
FT6X06_GetTick_Func GetTick;
|
||||
} FT6X06_IO_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t TouchDetected;
|
||||
uint32_t TouchX;
|
||||
uint32_t TouchY;
|
||||
} FT6X06_State_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t TouchDetected;
|
||||
uint32_t TouchX[FT6X06_MAX_NB_TOUCH];
|
||||
uint32_t TouchY[FT6X06_MAX_NB_TOUCH];
|
||||
uint32_t TouchWeight[FT6X06_MAX_NB_TOUCH];
|
||||
uint32_t TouchEvent[FT6X06_MAX_NB_TOUCH];
|
||||
uint32_t TouchArea[FT6X06_MAX_NB_TOUCH];
|
||||
} FT6X06_MultiTouch_State_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
FT6X06_IO_t IO;
|
||||
ft6x06_ctx_t Ctx;
|
||||
uint8_t IsInitialized;
|
||||
} FT6X06_Object_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t MultiTouch;
|
||||
uint8_t Gesture;
|
||||
uint8_t MaxTouch;
|
||||
uint32_t MaxXl;
|
||||
uint32_t MaxYl;
|
||||
} FT6X06_Capabilities_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t ( *Init ) ( FT6X06_Object_t *);
|
||||
int32_t ( *DeInit ) ( FT6X06_Object_t * );
|
||||
int32_t ( *GestureConfig ) ( FT6X06_Object_t *, FT6X06_Gesture_Init_t* );
|
||||
int32_t ( *ReadID ) ( FT6X06_Object_t *, uint32_t * );
|
||||
int32_t ( *GetState ) ( FT6X06_Object_t *, FT6X06_State_t* );
|
||||
int32_t ( *GetMultiTouchState ) ( FT6X06_Object_t *, FT6X06_MultiTouch_State_t* );
|
||||
int32_t ( *GetGesture ) ( FT6X06_Object_t *, uint8_t* );
|
||||
int32_t ( *GetCapabilities ) ( FT6X06_Object_t *, FT6X06_Capabilities_t * );
|
||||
int32_t ( *EnableIT ) ( FT6X06_Object_t * );
|
||||
int32_t ( *DisableIT ) ( FT6X06_Object_t * );
|
||||
int32_t ( *ClearIT ) ( FT6X06_Object_t * );
|
||||
int32_t ( *ITStatus ) ( FT6X06_Object_t * );
|
||||
} FT6X06_TS_Drv_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup FT6X06_Exported_Variables
|
||||
* @{
|
||||
*/
|
||||
extern FT6X06_TS_Drv_t FT6X06_TS_Driver;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup FT6X06_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
int32_t FT6X06_RegisterBusIO (FT6X06_Object_t *pObj, FT6X06_IO_t *pIO);
|
||||
int32_t FT6X06_Init(FT6X06_Object_t *pObj);
|
||||
int32_t FT6X06_DeInit(FT6X06_Object_t *pObj);
|
||||
int32_t FT6X06_GestureConfig(FT6X06_Object_t *pObj, FT6X06_Gesture_Init_t *GestureInit);
|
||||
int32_t FT6X06_ReadID(FT6X06_Object_t *pObj, uint32_t *Id);
|
||||
int32_t FT6X06_GetState(FT6X06_Object_t *pObj, FT6X06_State_t *State);
|
||||
int32_t FT6X06_GetMultiTouchState(FT6X06_Object_t *pObj, FT6X06_MultiTouch_State_t *State);
|
||||
int32_t FT6X06_GetGesture(FT6X06_Object_t *pObj, uint8_t *GestureId);
|
||||
int32_t FT6X06_EnableIT(FT6X06_Object_t *pObj);
|
||||
int32_t FT6X06_DisableIT(FT6X06_Object_t *pObj);
|
||||
int32_t FT6X06_ITStatus(FT6X06_Object_t *pObj);
|
||||
int32_t FT6X06_ClearIT(FT6X06_Object_t *pObj);
|
||||
int32_t FT6X06_GetCapabilities(FT6X06_Object_t *pObj, FT6X06_Capabilities_t *Capabilities);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* FT6X06_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file ft6x06_conf.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains specific configuration for the
|
||||
* ft6x06.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 FT6X06_CONF_H
|
||||
#define FT6X06_CONF_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
/* Macros --------------------------------------------------------------------*/
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
#define FT6X06_AUTO_CALIBRATION_ENABLED 0U
|
||||
#define FT6X06_MAX_X_LENGTH 800U
|
||||
#define FT6X06_MAX_Y_LENGTH 480U
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* FT6X06_CONF_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,710 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file ft6x06_reg.c
|
||||
* @author MCD Application Team
|
||||
* @brief This file provides unitary register function to control the ft6x06 Touch
|
||||
*
|
||||
******************************************************************************
|
||||
* @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 "ft6x06_reg.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup FT6X06
|
||||
* @{
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_read_reg
|
||||
* Description : Generic Reading function. It must be full-filled with either
|
||||
* I2C or SPI reading functions
|
||||
* Input : Register Address, length of buffer
|
||||
* Output : pdata Read
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_read_reg(ft6x06_ctx_t *ctx, uint8_t reg, uint8_t* pdata, uint16_t length)
|
||||
{
|
||||
return ctx->ReadReg(ctx->handle, reg, pdata, length);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_write_reg
|
||||
* Description : Generic Writing function. It must be full-filled with either
|
||||
* I2C or SPI writing function
|
||||
* Input : Register Address, pdata to be written, length of buffer
|
||||
* Output : None
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_write_reg(ft6x06_ctx_t *ctx, uint8_t reg, uint8_t *pdata, uint16_t length)
|
||||
{
|
||||
return ctx->WriteReg(ctx->handle, reg, pdata, length);
|
||||
}
|
||||
|
||||
/**************** Base Function *******************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_dev_mode_w
|
||||
* Description : Write Device Mode
|
||||
* Input : uint8_t
|
||||
* Output : None
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_dev_mode_w(ft6x06_ctx_t *ctx, uint8_t value)
|
||||
{
|
||||
int32_t ret;
|
||||
uint8_t tmp;
|
||||
|
||||
ret = ft6x06_read_reg(ctx, FT6X06_DEV_MODE_REG, &tmp, 1);
|
||||
|
||||
if(ret == 0)
|
||||
{
|
||||
tmp &= ~FT6X06_DEV_MODE_BIT_MASK;
|
||||
tmp |= value << FT6X06_DEV_MODE_BIT_POSITION;
|
||||
|
||||
ret = ft6x06_write_reg(ctx, FT6X06_DEV_MODE_REG, &tmp, 1);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_dev_mode_r
|
||||
* Description : Read Device Mode
|
||||
* Input : Pointer to uint8_t
|
||||
* Output : None
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_dev_mode_r(ft6x06_ctx_t *ctx, uint8_t *value)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
ret = ft6x06_read_reg(ctx, FT6X06_DEV_MODE_REG, (uint8_t *)value, 1);
|
||||
|
||||
if(ret == 0)
|
||||
{
|
||||
*value &= FT6X06_DEV_MODE_BIT_MASK;
|
||||
*value = *value >> FT6X06_DEV_MODE_BIT_POSITION;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_gest_id
|
||||
* Description : Read Gesture ID
|
||||
* Input : Pointer to uint8_t
|
||||
* Output : Status of GEST_ID register
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_gest_id(ft6x06_ctx_t *ctx, uint8_t *value)
|
||||
{
|
||||
return ft6x06_read_reg(ctx, FT6X06_GEST_ID_REG, (uint8_t *)value, 1);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_td_status
|
||||
* Description : Read Number of Touch Points
|
||||
* Input : Pointer to uint8_t
|
||||
* Output : Status of TD_STATUS register
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_td_status(ft6x06_ctx_t *ctx, uint8_t *value)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
ret = ft6x06_read_reg(ctx, FT6X06_TD_STAT_REG, (uint8_t *)value, 1);
|
||||
|
||||
if(ret == 0)
|
||||
{
|
||||
*value &= FT6X06_TD_STATUS_BIT_MASK;
|
||||
*value = *value >> FT6X06_TD_STATUS_BIT_POSITION;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_p1_xh_ef
|
||||
* Description : Read First X Event Flag
|
||||
* Input : Pointer to uint8_t
|
||||
* Output : Status of FT6X06_P1_XH[7:6] bits
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_p1_xh_ef(ft6x06_ctx_t *ctx, uint8_t *value)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
ret = ft6x06_read_reg(ctx, FT6X06_P1_XH_REG, (uint8_t *)value, 1);
|
||||
|
||||
if(ret == 0)
|
||||
{
|
||||
*value &= FT6X06_P1_XH_EF_BIT_MASK;
|
||||
*value = *value >> FT6X06_P1_XH_EF_BIT_POSITION;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_p1_xh_tp
|
||||
* Description : Read First X High Touch Position
|
||||
* Input : Pointer to uint8_t
|
||||
* Output : Status of FT6X06_P1_XH[3:0] bits
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_p1_xh_tp(ft6x06_ctx_t *ctx, uint8_t *value)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
ret = ft6x06_read_reg(ctx, FT6X06_P1_XH_REG, (uint8_t *)value, 1);
|
||||
|
||||
if(ret == 0)
|
||||
{
|
||||
*value &= FT6X06_P1_XH_TP_BIT_MASK;
|
||||
*value = *value >> FT6X06_P1_XH_TP_BIT_POSITION;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_p1_xl_tp
|
||||
* Description : Read First X Low Touch Position
|
||||
* Input : Pointer to uint8_t
|
||||
* Output : Status of FT6X06_P1_XL register
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_p1_xl_tp(ft6x06_ctx_t *ctx, uint8_t *value)
|
||||
{
|
||||
return ft6x06_read_reg(ctx, FT6X06_P1_XL_REG, (uint8_t *)value, 1);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_p1_yh_tid
|
||||
* Description : Read First Touch ID
|
||||
* Input : Pointer to uint8_t
|
||||
* Output : Status of FT6X06_P1_YH[7:4] bits
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_p1_yh_tid(ft6x06_ctx_t *ctx, uint8_t *value)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
ret = ft6x06_read_reg(ctx, FT6X06_P1_YH_REG, (uint8_t *)value, 1);
|
||||
|
||||
if(ret == 0)
|
||||
{
|
||||
*value &= FT6X06_P1_YH_TID_BIT_MASK;
|
||||
*value = *value >> FT6X06_P1_YH_TID_BIT_POSITION;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_p1_yh_tp
|
||||
* Description : Read First Y High Touch Position
|
||||
* Input : Pointer to uint8_t
|
||||
* Output : Status of FT6X06_P1_YH[3:0] bits
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_p1_yh_tp(ft6x06_ctx_t *ctx, uint8_t *value)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
ret = ft6x06_read_reg(ctx, FT6X06_P1_YH_REG, (uint8_t *)value, 1);
|
||||
|
||||
if(ret == 0)
|
||||
{
|
||||
*value &= FT6X06_P1_YH_TP_BIT_MASK;
|
||||
*value = *value >> FT6X06_P1_YH_TP_BIT_POSITION;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_p1_yl_tp
|
||||
* Description : Read First Y Low Touch Position
|
||||
* Input : Pointer to uint8_t
|
||||
* Output : Status of FT6X06_P1_YL register
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_p1_yl_tp(ft6x06_ctx_t *ctx, uint8_t *value)
|
||||
{
|
||||
return ft6x06_read_reg(ctx, FT6X06_P1_YL_REG, (uint8_t *)value, 1);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_p1_weight
|
||||
* Description : Read First Touch Weight
|
||||
* Input : Pointer to uint8_t
|
||||
* Output : Status of FT6X06_P1_WEIGHT register
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_p1_weight(ft6x06_ctx_t *ctx, uint8_t *value)
|
||||
{
|
||||
return ft6x06_read_reg(ctx, FT6X06_P1_WEIGHT_REG, (uint8_t *)value, 1);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_p1_misc
|
||||
* Description : Read First Touch Area
|
||||
* Input : Pointer to uint8_t
|
||||
* Output : Status of FT6X06_P1_MISC register
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_p1_misc(ft6x06_ctx_t *ctx, uint8_t *value)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
ret = ft6x06_read_reg(ctx, FT6X06_P1_MISC_REG, (uint8_t *)value, 1);
|
||||
if(ret == 0)
|
||||
{
|
||||
*value &= FT6X06_P1_MISC_BIT_MASK;
|
||||
*value = *value >> FT6X06_P1_MISC_BIT_POSITION;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_p2_xh_ef
|
||||
* Description : Read Second X Event Flag
|
||||
* Input : Pointer to uint8_t
|
||||
* Output : Status of FT6X06_P2_XH[7:6] bits
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_p2_xh_ef(ft6x06_ctx_t *ctx, uint8_t *value)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
ret = ft6x06_read_reg(ctx, FT6X06_P2_XH_REG, (uint8_t *)value, 1);
|
||||
|
||||
if(ret == 0)
|
||||
{
|
||||
*value &= FT6X06_P2_XH_EF_BIT_MASK;
|
||||
*value = *value >> FT6X06_P2_XH_EF_BIT_POSITION;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_p2_xh_tp
|
||||
* Description : Read Second X High Touch Position
|
||||
* Input : Pointer to uint8_t
|
||||
* Output : Status of FT6X06_P2_XH[3:0] bits
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_p2_xh_tp(ft6x06_ctx_t *ctx, uint8_t *value)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
ret = ft6x06_read_reg(ctx, FT6X06_P2_XH_REG, (uint8_t *)value, 1);
|
||||
|
||||
if(ret == 0)
|
||||
{
|
||||
*value &= FT6X06_P2_XH_TP_BIT_MASK;
|
||||
*value = *value >> FT6X06_P2_XH_TP_BIT_POSITION;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_p2_xl_tp
|
||||
* Description : Read Second X Low Touch Position
|
||||
* Input : Pointer to uint8_t
|
||||
* Output : Status of FT6X06_P2_XL register
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_p2_xl_tp(ft6x06_ctx_t *ctx, uint8_t *value)
|
||||
{
|
||||
return ft6x06_read_reg(ctx, FT6X06_P2_XL_REG, (uint8_t *)value, 1);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_p2_yh_tid
|
||||
* Description : Read Second Touch ID
|
||||
* Input : Pointer to uint8_t
|
||||
* Output : Status of FT6X06_P2_YH[7:4] bits
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_p2_yh_tid(ft6x06_ctx_t *ctx, uint8_t *value)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
ret = ft6x06_read_reg(ctx, FT6X06_P2_YH_REG, (uint8_t *)value, 1);
|
||||
|
||||
if(ret == 0)
|
||||
{
|
||||
*value &= FT6X06_P2_YH_TID_BIT_MASK;
|
||||
*value = *value >> FT6X06_P2_YH_TID_BIT_POSITION;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_p2_yh_tp
|
||||
* Description : Read Second Y High Touch Position
|
||||
* Input : Pointer to uint8_t
|
||||
* Output : Status of FT6X06_P2_YH[3:0] bits
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_p2_yh_tp(ft6x06_ctx_t *ctx, uint8_t *value)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
ret = ft6x06_read_reg(ctx, FT6X06_P2_YH_REG, (uint8_t *)value, 1);
|
||||
|
||||
if(ret == 0)
|
||||
{
|
||||
*value &= FT6X06_P2_YH_TP_BIT_MASK;
|
||||
*value = *value >> FT6X06_P2_YH_TP_BIT_POSITION;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_p2_yl_tp
|
||||
* Description : Read Second Y Low Touch Position
|
||||
* Input : Pointer to uint8_t
|
||||
* Output : Status of FT6X06_P2_YL register
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_p2_yl_tp(ft6x06_ctx_t *ctx, uint8_t *value)
|
||||
{
|
||||
return ft6x06_read_reg(ctx, FT6X06_P2_YL_REG, (uint8_t *)value, 1);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_p2_weight
|
||||
* Description : Read Second Touch Weight
|
||||
* Input : Pointer to uint8_t
|
||||
* Output : Status of FT6X06_P2_WEIGHT register
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_p2_weight(ft6x06_ctx_t *ctx, uint8_t *value)
|
||||
{
|
||||
return ft6x06_read_reg(ctx, FT6X06_P2_WEIGHT_REG, (uint8_t *)value, 1);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_p2_misc
|
||||
* Description : Read Second Touch Area
|
||||
* Input : Pointer to uint8_t
|
||||
* Output : Status of FT6X06_P2_MISC register
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_p2_misc(ft6x06_ctx_t *ctx, uint8_t *value)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
ret = ft6x06_read_reg(ctx, FT6X06_P2_MISC_REG, (uint8_t *)value, 1);
|
||||
|
||||
if(ret == 0)
|
||||
{
|
||||
*value &= FT6X06_P2_MISC_BIT_MASK;
|
||||
*value = *value >> FT6X06_P2_MISC_BIT_POSITION;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_th_group
|
||||
* Description : Set Threshold for touch detection
|
||||
* Input : uint8_t
|
||||
* Output : None
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_th_group(ft6x06_ctx_t *ctx, uint8_t value)
|
||||
{
|
||||
return ft6x06_write_reg(ctx, FT6X06_TH_GROUP_REG, &value, 1);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_th_diff
|
||||
* Description : Set Filter function coefficient
|
||||
* Input : uint8_t
|
||||
* Output : None
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_th_diff(ft6x06_ctx_t *ctx, uint8_t value)
|
||||
{
|
||||
return ft6x06_write_reg(ctx, FT6X06_TH_DIFF_REG, &value, 1);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : FT6X06_CTRL
|
||||
* Description : Control the Switch between Active and Monitoring Mode
|
||||
* Input : uint8_t
|
||||
* Output : None
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_ctrl(ft6x06_ctx_t *ctx, uint8_t value)
|
||||
{
|
||||
return ft6x06_write_reg(ctx, FT6X06_CTRL_REG, &value, 1);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_time_enter_monitor
|
||||
* Description : Set the time period of switching from Active mode to Monitor
|
||||
* mode when there is no touching.
|
||||
* Input : uint8_t
|
||||
* Output : None
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_time_enter_monitor(ft6x06_ctx_t *ctx, uint8_t value)
|
||||
{
|
||||
return ft6x06_write_reg(ctx, FT6X06_TIMEENTERMONITOR_REG, &value, 1);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_period_active
|
||||
* Description : Report rate in Active mode
|
||||
* Input : uint8_t
|
||||
* Output : None
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_period_active(ft6x06_ctx_t *ctx, uint8_t value)
|
||||
{
|
||||
return ft6x06_write_reg(ctx, FT6X06_PERIODACTIVE_REG, &value, 1);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_period_monitor
|
||||
* Description : Report rate in Monitor mode
|
||||
* Input : uint8_t
|
||||
* Output : None
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_period_monitor(ft6x06_ctx_t *ctx, uint8_t value)
|
||||
{
|
||||
return ft6x06_write_reg(ctx, FT6X06_PERIODMONITOR_REG, &value, 1);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_radian_value
|
||||
* Description : Set the value of the minimum allowed angle while Rotating
|
||||
* gesture mode
|
||||
* Input : uint8_t
|
||||
* Output : None
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_radian_value(ft6x06_ctx_t *ctx, uint8_t value)
|
||||
{
|
||||
return ft6x06_write_reg(ctx, FT6X06_RADIAN_VALUE_REG, &value, 1);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_offset_left_right
|
||||
* Description : Set Maximum offset while Moving Left and Moving Right gesture
|
||||
* Input : uint8_t
|
||||
* Output : None
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_offset_left_right(ft6x06_ctx_t *ctx, uint8_t value)
|
||||
{
|
||||
return ft6x06_write_reg(ctx, FT6X06_OFFSET_LR_REG, &value, 1);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_offset_up_down
|
||||
* Description : Set Maximum offset while Moving Up and Moving Down gesture
|
||||
* Input : uint8_t
|
||||
* Output : None
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_offset_up_down(ft6x06_ctx_t *ctx, uint8_t value)
|
||||
{
|
||||
return ft6x06_write_reg(ctx, FT6X06_OFFSET_UD_REG, &value, 1);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_disatnce_left_right
|
||||
* Description : Set Minimum distance while Moving Left and Moving Right gesture
|
||||
* Input : uint8_t
|
||||
* Output : None
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_disatnce_left_right(ft6x06_ctx_t *ctx, uint8_t value)
|
||||
{
|
||||
return ft6x06_write_reg(ctx, FT6X06_DISTANCE_LR_REG, &value, 1);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_offset_up_down
|
||||
* Description : Set Minimum distance while Moving Up and Moving Down gesture
|
||||
* Input : uint8_t
|
||||
* Output : None
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_distance_up_down(ft6x06_ctx_t *ctx, uint8_t value)
|
||||
{
|
||||
return ft6x06_write_reg(ctx, FT6X06_DISTANCE_UD_REG, &value, 1);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_distance_zoom
|
||||
* Description : Set Maximum distance while Zoom In and Zoom Out gesture
|
||||
* Input : uint8_t
|
||||
* Output : None
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_distance_zoom(ft6x06_ctx_t *ctx, uint8_t value)
|
||||
{
|
||||
return ft6x06_write_reg(ctx, FT6X06_DISTANCE_ZOOM_REG, &value, 1);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_lib_ver_high
|
||||
* Description : Read High 8-bit of LIB Version info
|
||||
* Input : Pointer to uint8_t
|
||||
* Output : Status of FT6X06_LIB_VER_H register
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_lib_ver_high(ft6x06_ctx_t *ctx, uint8_t *value)
|
||||
{
|
||||
return ft6x06_read_reg(ctx, FT6X06_LIB_VER_H_REG, (uint8_t *)value, 1);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_lib_ver_low
|
||||
* Description : Read Low 8-bit of LIB Version info
|
||||
* Input : Pointer to uint8_t
|
||||
* Output : Status of FT6X06_LIB_VER_L register
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_lib_ver_low(ft6x06_ctx_t *ctx, uint8_t *value)
|
||||
{
|
||||
return ft6x06_read_reg(ctx, FT6X06_LIB_VER_L_REG, (uint8_t *)value, 1);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_cipher
|
||||
* Description : Chip Selecting
|
||||
* Input : Pointer to uint8_t
|
||||
* Output : Status of FT6X06_CIPHER register
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_cipher(ft6x06_ctx_t *ctx, uint8_t *value)
|
||||
{
|
||||
return ft6x06_read_reg(ctx, FT6X06_CIPHER_REG, (uint8_t *)value, 1);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_g_mode
|
||||
* Description : Select Interrupt (polling or trigger) mode
|
||||
* Input : uint8_t
|
||||
* Output : None
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_g_mode(ft6x06_ctx_t *ctx, uint8_t value)
|
||||
{
|
||||
return ft6x06_write_reg(ctx, FT6X06_GMODE_REG, &value, 1);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_pwd_mode
|
||||
* Description : Select Interrupt (polling or trigger) mode
|
||||
* Input : uint8_t
|
||||
* Output : None
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_pwr_mode(ft6x06_ctx_t *ctx, uint8_t value)
|
||||
{
|
||||
return ft6x06_write_reg(ctx, FT6X06_PWR_MODE_REG, &value, 1);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_firm_id
|
||||
* Description : Firmware Version
|
||||
* Input : Pointer to uint8_t
|
||||
* Output : Status of FT6X06_FIRMID register
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_firm_id(ft6x06_ctx_t *ctx, uint8_t *value)
|
||||
{
|
||||
return ft6x06_read_reg(ctx, FT6X06_FIRMID_REG, (uint8_t *)value, 1);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_chip_id
|
||||
* Description : FocalTech's Panel ID
|
||||
* Input : Pointer to uint8_t
|
||||
* Output : Status of FT6X06_CHIP_ID register
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_chip_id(ft6x06_ctx_t *ctx, uint8_t *value)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
ret = ft6x06_read_reg(ctx, FT6X06_CHIP_ID_REG, (uint8_t *)value, 1);
|
||||
|
||||
if(ret == 0)
|
||||
{
|
||||
*value &= FT6X06_CHIP_ID_BIT_MASK;
|
||||
*value = *value >> FT6X06_CHIP_ID_BIT_POSITION;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : release_code_id
|
||||
* Description : Release code version
|
||||
* Input : Pointer to uint8_t
|
||||
* Output : Status of FT6X06_RELEASE_CODE_ID register
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_release_code_id(ft6x06_ctx_t *ctx, uint8_t *value)
|
||||
{
|
||||
return ft6x06_read_reg(ctx, FT6X06_RELEASE_CODE_ID_REG, (uint8_t *)value, 1);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : ft6x06_state
|
||||
* Description : Select Current Operating mode
|
||||
* Input : uint8_t
|
||||
* Output : None
|
||||
* Return : Status [FT6X06_ERROR, FT6X06_OK]
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_state(ft6x06_ctx_t *ctx, uint8_t value)
|
||||
{
|
||||
return ft6x06_write_reg(ctx, FT6X06_STATE_REG, &value, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,643 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file ft6x06_reg.h
|
||||
* @author MCD Application Team
|
||||
* @brief Header of ft6x06_reg.c
|
||||
*
|
||||
******************************************************************************
|
||||
* @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 FT6X06_REG_H
|
||||
#define FT6X06_REG_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
/* Macros --------------------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup FT6X06
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
|
||||
/** @defgroup FT6X06_Exported_Types FT6X06 Exported Types
|
||||
* @{
|
||||
*/
|
||||
/************** Generic Function *******************/
|
||||
|
||||
typedef int32_t (*FT6X06_Write_Func)(void *, uint8_t, uint8_t*, uint16_t);
|
||||
typedef int32_t (*FT6X06_Read_Func) (void *, uint8_t, uint8_t*, uint16_t);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup FT6X06_Imported_Globals FT6X06 Imported Globals
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
FT6X06_Write_Func WriteReg;
|
||||
FT6X06_Read_Func ReadReg;
|
||||
void *handle;
|
||||
} ft6x06_ctx_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup FT6X06_Exported_Constants FT6X06 Exported Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Current mode register of the FT6X06 (R/W) */
|
||||
#define FT6X06_DEV_MODE_REG 0x00U
|
||||
|
||||
/* Gesture ID register */
|
||||
#define FT6X06_GEST_ID_REG 0x01U
|
||||
|
||||
/* Touch Data Status register : gives number of active touch points (0..2) */
|
||||
#define FT6X06_TD_STAT_REG 0x02U
|
||||
|
||||
/* P1 X, Y coordinates, weight and misc registers */
|
||||
#define FT6X06_P1_XH_REG 0x03U
|
||||
#define FT6X06_P1_XL_REG 0x04U
|
||||
#define FT6X06_P1_YH_REG 0x05U
|
||||
#define FT6X06_P1_YL_REG 0x06U
|
||||
#define FT6X06_P1_WEIGHT_REG 0x07U
|
||||
#define FT6X06_P1_MISC_REG 0x08U
|
||||
|
||||
/* P2 X, Y coordinates, weight and misc registers */
|
||||
#define FT6X06_P2_XH_REG 0x09U
|
||||
#define FT6X06_P2_XL_REG 0x0AU
|
||||
#define FT6X06_P2_YH_REG 0x0BU
|
||||
#define FT6X06_P2_YL_REG 0x0CU
|
||||
#define FT6X06_P2_WEIGHT_REG 0x0DU
|
||||
#define FT6X06_P2_MISC_REG 0x0EU
|
||||
|
||||
/* Threshold for touch detection */
|
||||
#define FT6X06_TH_GROUP_REG 0x80U
|
||||
|
||||
/* Filter function coefficients */
|
||||
#define FT6X06_TH_DIFF_REG 0x85U
|
||||
|
||||
/* Control register */
|
||||
#define FT6X06_CTRL_REG 0x86U
|
||||
|
||||
/* The time period of switching from Active mode to Monitor mode when there is no touching */
|
||||
#define FT6X06_TIMEENTERMONITOR_REG 0x87U
|
||||
|
||||
/* Report rate in Active mode */
|
||||
#define FT6X06_PERIODACTIVE_REG 0x88U
|
||||
|
||||
/* Report rate in Monitor mode */
|
||||
#define FT6X06_PERIODMONITOR_REG 0x89U
|
||||
|
||||
/* The value of the minimum allowed angle while Rotating gesture mode */
|
||||
#define FT6X06_RADIAN_VALUE_REG 0x91U
|
||||
|
||||
/* Maximum offset while Moving Left and Moving Right gesture */
|
||||
#define FT6X06_OFFSET_LR_REG 0x92U
|
||||
|
||||
/* Maximum offset while Moving Up and Moving Down gesture */
|
||||
#define FT6X06_OFFSET_UD_REG 0x93U
|
||||
|
||||
/* Minimum distance while Moving Left and Moving Right gesture */
|
||||
#define FT6X06_DISTANCE_LR_REG 0x94U
|
||||
|
||||
/* Minimum distance while Moving Up and Moving Down gesture */
|
||||
#define FT6X06_DISTANCE_UD_REG 0x95U
|
||||
|
||||
/* Maximum distance while Zoom In and Zoom Out gesture */
|
||||
#define FT6X06_DISTANCE_ZOOM_REG 0x96U
|
||||
|
||||
/* High 8-bit of LIB Version info */
|
||||
#define FT6X06_LIB_VER_H_REG 0xA1U
|
||||
|
||||
/* Low 8-bit of LIB Version info */
|
||||
#define FT6X06_LIB_VER_L_REG 0xA2U
|
||||
|
||||
/* Chip Selecting */
|
||||
#define FT6X06_CIPHER_REG 0xA3U
|
||||
|
||||
/* Interrupt mode register (used when in interrupt mode) */
|
||||
#define FT6X06_GMODE_REG 0xA4U
|
||||
|
||||
/* Current power mode the FT6X06 system is in (R) */
|
||||
#define FT6X06_PWR_MODE_REG 0xA5U
|
||||
|
||||
/* FT6X06 firmware version */
|
||||
#define FT6X06_FIRMID_REG 0xA6U
|
||||
|
||||
/* FT6X06 Chip identification register */
|
||||
#define FT6X06_CHIP_ID_REG 0xA8U
|
||||
|
||||
/* Release code version */
|
||||
#define FT6X06_RELEASE_CODE_ID_REG 0xAFU
|
||||
|
||||
/* Current operating mode the FT6X06 system is in (R) */
|
||||
#define FT6X06_STATE_REG 0xBCU
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : Generic - All
|
||||
* Address : Generic - All
|
||||
* Bit Group Name: None
|
||||
* Permission : W
|
||||
*******************************************************************************/
|
||||
int32_t ft6x06_write_reg(ft6x06_ctx_t *ctx, uint8_t reg, uint8_t *pbuf, uint16_t length);
|
||||
int32_t ft6x06_read_reg(ft6x06_ctx_t *ctx, uint8_t reg, uint8_t *pbuf, uint16_t length);
|
||||
|
||||
/**************** Base Function *******************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : DEV_MODE
|
||||
* Address : 0X00
|
||||
* Bit Group Name: DEVICE_MODE
|
||||
* Permission : RW
|
||||
*******************************************************************************/
|
||||
#define FT6X06_DEV_MODE_BIT_MASK 0x70U
|
||||
#define FT6X06_DEV_MODE_BIT_POSITION 4U
|
||||
int32_t ft6x06_dev_mode_w(ft6x06_ctx_t *ctx, uint8_t value);
|
||||
int32_t ft6x06_dev_mode_r(ft6x06_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : GEST_ID
|
||||
* Address : 0X01
|
||||
* Bit Group Name: Gesture ID
|
||||
* Permission : R
|
||||
*******************************************************************************/
|
||||
#define FT6X06_GEST_ID_BIT_MASK 0xFFU
|
||||
#define FT6X06_GEST_ID_BIT_POSITION 0U
|
||||
int32_t ft6x06_gest_id(ft6x06_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : TD_STATUS
|
||||
* Address : 0X02
|
||||
* Bit Group Name:
|
||||
* Permission : R
|
||||
*******************************************************************************/
|
||||
#define FT6X06_TD_STATUS_BIT_MASK 0x0FU
|
||||
#define FT6X06_TD_STATUS_BIT_POSITION 0U
|
||||
int32_t ft6x06_td_status(ft6x06_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P1_XH
|
||||
* Address : 0X03
|
||||
* Bit Group Name: First Event Flag
|
||||
* Permission : R
|
||||
* Default value : 0xF0U
|
||||
*******************************************************************************/
|
||||
#define FT6X06_P1_XH_EF_BIT_MASK 0xC0U
|
||||
#define FT6X06_P1_XH_EF_BIT_POSITION 6U
|
||||
int32_t ft6x06_p1_xh_ef(ft6x06_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P1_XH
|
||||
* Address : 0X03
|
||||
* Bit Group Name: First Touch X Position
|
||||
* Permission : R
|
||||
* Default value : 0x0FU
|
||||
*******************************************************************************/
|
||||
#define FT6X06_P1_XH_TP_BIT_MASK 0x0FU
|
||||
#define FT6X06_P1_XH_TP_BIT_POSITION 0U
|
||||
int32_t ft6x06_p1_xh_tp(ft6x06_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P1_XL
|
||||
* Address : 0X04
|
||||
* Bit Group Name: First Touch X Position
|
||||
* Permission : R
|
||||
* Default value : 0xFFU
|
||||
*******************************************************************************/
|
||||
#define FT6X06_P1_XL_TP_BIT_MASK 0xFFU
|
||||
#define FT6X06_P1_XL_TP_BIT_POSITION 0U
|
||||
int32_t ft6x06_p1_xl_tp(ft6x06_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P1_YH
|
||||
* Address : 0X05
|
||||
* Bit Group Name: First Touch ID
|
||||
* Permission : R
|
||||
* Default value : 0xF0U
|
||||
*******************************************************************************/
|
||||
#define FT6X06_P1_YH_TID_BIT_MASK 0xF0U
|
||||
#define FT6X06_P1_YH_TID_BIT_POSITION 4U
|
||||
int32_t ft6x06_p1_yh_tid(ft6x06_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P1_YH
|
||||
* Address : 0x06
|
||||
* Bit Group Name: First Touch Y Position
|
||||
* Permission : R
|
||||
* Default value : 0x0FU
|
||||
*******************************************************************************/
|
||||
#define FT6X06_P1_YH_TP_BIT_MASK 0x0FU
|
||||
#define FT6X06_P1_YH_TP_BIT_POSITION 0U
|
||||
int32_t ft6x06_p1_yh_tp(ft6x06_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P1_YL
|
||||
* Address : 0X06
|
||||
* Bit Group Name: First Touch Y Position
|
||||
* Permission : R
|
||||
* Default value : 0xFFU
|
||||
*******************************************************************************/
|
||||
#define FT6X06_P1_YL_TP_BIT_MASK 0xFFU
|
||||
#define FT6X06_P1_YL_TP_BIT_POSITION 0U
|
||||
int32_t ft6x06_p1_yl_tp(ft6x06_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P1_WEIGHT
|
||||
* Address : 0X07
|
||||
* Bit Group Name: First Touch Weight(pressure)
|
||||
* Permission : R
|
||||
* Default value : 0xFFU
|
||||
*******************************************************************************/
|
||||
#define FT6X06_P1_WEIGHT_BIT_MASK 0xFFU
|
||||
#define FT6X06_P1_WEIGHT_BIT_POSITION 0U
|
||||
int32_t ft6x06_p1_weight(ft6x06_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P1_MISC
|
||||
* Address : 0X08
|
||||
* Bit Group Name: First Touch Area
|
||||
* Permission : R
|
||||
* Default value : 0xFFU
|
||||
*******************************************************************************/
|
||||
#define FT6X06_P1_MISC_BIT_MASK 0xF0U
|
||||
#define FT6X06_P1_MISC_BIT_POSITION 4U
|
||||
int32_t ft6x06_p1_misc(ft6x06_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P2_XH
|
||||
* Address : 0X09
|
||||
* Bit Group Name: Second Event Flag
|
||||
* Permission : R
|
||||
* Default value : 0xF0U
|
||||
*******************************************************************************/
|
||||
#define FT6X06_P2_XH_EF_BIT_MASK 0xC0U
|
||||
#define FT6X06_P2_XH_EF_BIT_POSITION 6U
|
||||
int32_t ft6x06_p2_xh_ef(ft6x06_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P2_XH
|
||||
* Address : 0X09
|
||||
* Bit Group Name: Second Touch X Position
|
||||
* Permission : R
|
||||
* Default value : 0x0FU
|
||||
*******************************************************************************/
|
||||
#define FT6X06_P2_XH_TP_BIT_MASK 0x0FU
|
||||
#define FT6X06_P2_XH_TP_BIT_POSITION 0U
|
||||
int32_t ft6x06_p2_xh_tp(ft6x06_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P2_XL
|
||||
* Address : 0X0A
|
||||
* Bit Group Name: Second Touch X Position
|
||||
* Permission : R
|
||||
* Default value : 0xFFU
|
||||
*******************************************************************************/
|
||||
#define FT6X06_P2_XL_TP_BIT_MASK 0xFFU
|
||||
#define FT6X06_P2_XL_TP_BIT_POSITION 0U
|
||||
int32_t ft6x06_p2_xl_tp(ft6x06_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P2_YH
|
||||
* Address : 0X0B
|
||||
* Bit Group Name: Second Touch ID
|
||||
* Permission : R
|
||||
* Default value : 0xF0U
|
||||
*******************************************************************************/
|
||||
#define FT6X06_P2_YH_TID_BIT_MASK 0xF0U
|
||||
#define FT6X06_P2_YH_TID_BIT_POSITION 4U
|
||||
int32_t ft6x06_p2_yh_tid(ft6x06_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P2_YH
|
||||
* Address : 0x0B
|
||||
* Bit Group Name: Second Touch Y Position
|
||||
* Permission : R
|
||||
* Default value : 0x0FU
|
||||
*******************************************************************************/
|
||||
#define FT6X06_P2_YH_TP_BIT_MASK 0x0FU
|
||||
#define FT6X06_P2_YH_TP_BIT_POSITION 0U
|
||||
int32_t ft6x06_p2_yh_tp(ft6x06_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P2_YL
|
||||
* Address : 0X0C
|
||||
* Bit Group Name: Second Touch Y Position
|
||||
* Permission : R
|
||||
* Default value : 0xFFU
|
||||
*******************************************************************************/
|
||||
#define FT6X06_P2_YL_TP_BIT_MASK 0xFFU
|
||||
#define FT6X06_P2_YL_TP_BIT_POSITION 0U
|
||||
int32_t ft6x06_p2_yl_tp(ft6x06_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P2_WEIGHT
|
||||
* Address : 0X0D
|
||||
* Bit Group Name: Second Touch Weight(pressure)
|
||||
* Permission : R
|
||||
* Default value : 0xFFU
|
||||
*******************************************************************************/
|
||||
#define FT6X06_P2_WEIGHT_BIT_MASK 0xFFU
|
||||
#define FT6X06_P2_WEIGHT_BIT_POSITION 0U
|
||||
int32_t ft6x06_p2_weight(ft6x06_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : P2_MISC
|
||||
* Address : 0X0E
|
||||
* Bit Group Name: Second Touch Area
|
||||
* Permission : R
|
||||
* Default value : 0xFFU
|
||||
*******************************************************************************/
|
||||
#define FT6X06_P2_MISC_BIT_MASK 0xF0U
|
||||
#define FT6X06_P2_MISC_BIT_POSITION 4U
|
||||
int32_t ft6x06_p2_misc(ft6x06_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : TH_GROUP
|
||||
* Address : 0X80
|
||||
* Bit Group Name: Threshold for touch detection
|
||||
* Permission : RW
|
||||
* Default value : None
|
||||
*******************************************************************************/
|
||||
#define FT6X06_TH_GROUP_BIT_MASK 0xFFU
|
||||
#define FT6X06_TH_GROUP_BIT_POSITION 0U
|
||||
int32_t ft6x06_th_group(ft6x06_ctx_t *ctx, uint8_t value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : TH_DIFF
|
||||
* Address : 0X85
|
||||
* Bit Group Name: Filter function coefficient
|
||||
* Permission : RW
|
||||
* Default value : None
|
||||
*******************************************************************************/
|
||||
#define FT6X06_TH_DIFF_BIT_MASK 0xFFU
|
||||
#define FT6X06_TH_DIFF_BIT_POSITION 0U
|
||||
int32_t ft6x06_th_diff(ft6x06_ctx_t *ctx, uint8_t value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : CTRL
|
||||
* Address : 0X86
|
||||
* Bit Group Name:
|
||||
* Permission : RW
|
||||
* Default value : 0x01
|
||||
*******************************************************************************/
|
||||
#define FT6X06_CTRL_BIT_MASK 0xFFU
|
||||
#define FT6X06_CTRL_BIT_POSITION 0U
|
||||
int32_t ft6x06_ctrl(ft6x06_ctx_t *ctx, uint8_t value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : TIMEENTERMONITOR
|
||||
* Address : 0X87
|
||||
* Bit Group Name:
|
||||
* Permission : RW
|
||||
* Default value : 0x0A
|
||||
*******************************************************************************/
|
||||
#define FT6X06_TIMEENTERMONITOR_BIT_MASK 0xFFU
|
||||
#define FT6X06_TIMEENTERMONITOR_BIT_POSITION 0U
|
||||
int32_t ft6x06_time_enter_monitor(ft6x06_ctx_t *ctx, uint8_t value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : PERIODACTIVE
|
||||
* Address : 0X88
|
||||
* Bit Group Name:
|
||||
* Permission : RW
|
||||
* Default value : None
|
||||
*******************************************************************************/
|
||||
#define FT6X06_PERIODACTIVE_BIT_MASK 0xFFU
|
||||
#define FT6X06_PERIODACTIVE_BIT_POSITION 0U
|
||||
int32_t ft6x06_period_active(ft6x06_ctx_t *ctx, uint8_t value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : PERIODMONITOR
|
||||
* Address : 0X89
|
||||
* Bit Group Name:
|
||||
* Permission : RW
|
||||
* Default value : 0x28
|
||||
*******************************************************************************/
|
||||
#define FT6X06_PERIODMONITOR_BIT_MASK 0xFFU
|
||||
#define FT6X06_PERIODMONITOR_BIT_POSITION 0U
|
||||
int32_t ft6x06_period_monitor(ft6x06_ctx_t *ctx, uint8_t value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : RADIAN_VALUE
|
||||
* Address : 0X91
|
||||
* Bit Group Name:
|
||||
* Permission : RW
|
||||
* Default value : 0x0A
|
||||
*******************************************************************************/
|
||||
#define FT6X06_RADIAN_VALUE_BIT_MASK 0xFFU
|
||||
#define FT6X06_RADIAN_VALUE_BIT_POSITION 0U
|
||||
int32_t ft6x06_radian_value(ft6x06_ctx_t *ctx, uint8_t value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : OFFSET_LEFT_RIGHT
|
||||
* Address : 0X92
|
||||
* Bit Group Name:
|
||||
* Permission : RW
|
||||
* Default value : 0x19
|
||||
*******************************************************************************/
|
||||
#define FT6X06_OFFSET_LR_BIT_MASK 0xFFU
|
||||
#define FT6X06_OFFSET_LR_BIT_POSITION 0U
|
||||
int32_t ft6x06_offset_left_right(ft6x06_ctx_t *ctx, uint8_t value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : OFFSET_UP_DOWN
|
||||
* Address : 0X93
|
||||
* Bit Group Name:
|
||||
* Permission : RW
|
||||
* Default value : 0x19
|
||||
*******************************************************************************/
|
||||
#define FT6X06_OFFSET_UD_BIT_MASK 0xFFU
|
||||
#define FT6X06_OFFSET_UD_BIT_POSITION 0U
|
||||
int32_t ft6x06_offset_up_down(ft6x06_ctx_t *ctx, uint8_t value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : DISTANCE_LEFT_RIGHT
|
||||
* Address : 0X94
|
||||
* Bit Group Name:
|
||||
* Permission : RW
|
||||
* Default value : 0x19
|
||||
*******************************************************************************/
|
||||
#define FT6X06_DISTANCE_LR_BIT_MASK 0xFFU
|
||||
#define FT6X06_DISTANCE_LR_BIT_POSITION 0U
|
||||
int32_t ft6x06_disatnce_left_right(ft6x06_ctx_t *ctx, uint8_t value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : DISTANCE_UP_DOWN
|
||||
* Address : 0X95
|
||||
* Bit Group Name:
|
||||
* Permission : RW
|
||||
* Default value : 0x19
|
||||
*******************************************************************************/
|
||||
#define FT6X06_DISTANCE_UD_BIT_MASK 0xFFU
|
||||
#define FT6X06_DISTANCE_UD_BIT_POSITION 0U
|
||||
int32_t ft6x06_distance_up_down(ft6x06_ctx_t *ctx, uint8_t value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : DISTANCE_ZOOM
|
||||
* Address : 0X96
|
||||
* Bit Group Name:
|
||||
* Permission : RW
|
||||
* Default value : 0x32
|
||||
*******************************************************************************/
|
||||
#define FT6X06_DISTANCE_ZOOM_BIT_MASK 0xFFU
|
||||
#define FT6X06_DISTANCE_ZOOM_BIT_POSITION 0U
|
||||
int32_t ft6x06_distance_zoom(ft6x06_ctx_t *ctx, uint8_t value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : LIB_VER_H
|
||||
* Address : 0XA1
|
||||
* Bit Group Name:
|
||||
* Permission : R
|
||||
* Default value : None
|
||||
*******************************************************************************/
|
||||
#define FT6X06_LIB_VER_H_BIT_MASK 0xFFU
|
||||
#define FT6X06_LIB_VER_H_BIT_POSITION 0U
|
||||
int32_t ft6x06_lib_ver_high(ft6x06_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : LIB_VER_L
|
||||
* Address : 0XA2
|
||||
* Bit Group Name:
|
||||
* Permission : R
|
||||
* Default value : None
|
||||
*******************************************************************************/
|
||||
#define FT6X06_LIB_VER_L_BIT_MASK 0xFFU
|
||||
#define FT6X06_LIB_VER_L_BIT_POSITION 0U
|
||||
int32_t ft6x06_lib_ver_low(ft6x06_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : CIPHER
|
||||
* Address : 0XA3
|
||||
* Bit Group Name:
|
||||
* Permission : R
|
||||
* Default value : 0x06
|
||||
*******************************************************************************/
|
||||
#define FT6X06_CIPHER_BIT_MASK 0xFFU
|
||||
#define FT6X06_CIPHER_BIT_POSITION 0U
|
||||
int32_t ft6x06_cipher(ft6x06_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : G_MODE
|
||||
* Address : 0XA4
|
||||
* Bit Group Name:
|
||||
* Permission : RW
|
||||
* Default value : 0x01
|
||||
*******************************************************************************/
|
||||
#define FT6X06_G_MODE_BIT_MASK 0xFFU
|
||||
#define FT6X06_G_MODE_BIT_POSITION 0U
|
||||
int32_t ft6x06_g_mode(ft6x06_ctx_t *ctx, uint8_t value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : PWR_MODE
|
||||
* Address : 0XA5
|
||||
* Bit Group Name:
|
||||
* Permission : RW
|
||||
* Default value : 0x00
|
||||
*******************************************************************************/
|
||||
#define FT6X06_PWR_MODE_BIT_MASK 0xFFU
|
||||
#define FT6X06_PWR_MODE_BIT_POSITION 0U
|
||||
int32_t ft6x06_pwr_mode(ft6x06_ctx_t *ctx, uint8_t value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : FIRMID
|
||||
* Address : 0XA6
|
||||
* Bit Group Name:
|
||||
* Permission : R
|
||||
* Default value : None
|
||||
*******************************************************************************/
|
||||
#define FT6X06_FIRMID_BIT_MASK 0xFFU
|
||||
#define FT6X06_FIRMID_BIT_POSITION 0U
|
||||
int32_t ft6x06_firm_id(ft6x06_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : FOCALTECH_ID
|
||||
* Address : 0XA8
|
||||
* Bit Group Name:
|
||||
* Permission : R
|
||||
* Default value : 0x11
|
||||
*******************************************************************************/
|
||||
#define FT6X06_CHIP_ID_BIT_MASK 0xFFU
|
||||
#define FT6X06_CHIP_ID_BIT_POSITION 0U
|
||||
int32_t ft6x06_chip_id(ft6x06_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : RELEASE_CODE_ID
|
||||
* Address : 0XAF
|
||||
* Bit Group Name:
|
||||
* Permission : R
|
||||
* Default value : 0x001
|
||||
*******************************************************************************/
|
||||
#define FT6X06_RC_ID_BIT_MASK 0xFFU
|
||||
#define FT6X06_RC_ID_BIT_POSITION 0U
|
||||
int32_t ft6x06_release_code_id(ft6x06_ctx_t *ctx, uint8_t *value);
|
||||
|
||||
/*******************************************************************************
|
||||
* Register : STATE
|
||||
* Address : 0XBC
|
||||
* Bit Group Name:
|
||||
* Permission : RW
|
||||
* Default value : 0x01
|
||||
*******************************************************************************/
|
||||
#define FT6X06_STATE_BIT_MASK 0xFFU
|
||||
#define FT6X06_STATE_BIT_POSITION 0U
|
||||
int32_t ft6x06_state(ft6x06_ctx_t *ctx, uint8_t value);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* FT6X06_REG_H */
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,57 @@
|
||||
<!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 IS42S16800J 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-is42s16800j-component-driver"><strong>Release Notes for IS42S16800J Component Driver</strong></h1>
|
||||
<p>Copyright © 2019 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 SDRAM functions offered by IS42S16800J 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-section1" checked aria-hidden="true"> <label for="collapse-section1" aria-hidden="true"><strong>V1.0.0 / 30-October-2019</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<ul>
|
||||
<li>First official release of <strong>IS42S16800J</strong> SDRAM Component drivers in line with STM32Cube BSP drivers development guidelines (UM2298)</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,55 @@
|
||||
---
|
||||
pagetitle: Release Notes for IS42S16800J Component Driver
|
||||
lang: en
|
||||
---
|
||||
|
||||
::: {.row}
|
||||
::: {.col-sm-12 .col-lg-4}
|
||||
|
||||
::: {.card .fluid}
|
||||
::: {.sectione .dark}
|
||||
<center>
|
||||
# **Release Notes for IS42S16800J Component Driver**
|
||||
Copyright © 2019 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 SDRAM functions offered by IS42S16800J component
|
||||
|
||||
:::
|
||||
|
||||
::: {.col-sm-12 .col-lg-8}
|
||||
# Update History
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section1" checked aria-hidden="true">
|
||||
<label for="collapse-section1" aria-hidden="true">__V1.0.0 / 30-October-2019__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- First official release of **IS42S16800J** SDRAM Component drivers in line with STM32Cube BSP drivers development guidelines (UM2298)
|
||||
|
||||
</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>
|
||||
|
After Width: | Height: | Size: 18 KiB |
@@ -0,0 +1,337 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file is42s16800j.c
|
||||
* @author MCD Application Team
|
||||
* @brief is42s16800j sdram 8MBx16 driver file
|
||||
******************************************************************************
|
||||
* @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 "is42s16800j.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup IS42S16800J IS42S16800J
|
||||
* @brief This file provides a set of functions needed to drive the
|
||||
* IS42S16800J SDRAM memory.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup IS42S16800J_Private_Variables IS42S16800J Private Variables
|
||||
* @{
|
||||
*/
|
||||
static FMC_SDRAM_CommandTypeDef Command;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup IS42S16800J_Function_Prototypes IS42S16800J Function Prototypes
|
||||
* @{
|
||||
*/
|
||||
static int32_t IS42S16800J_Delay(uint32_t Delay);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup IS42S16800J_Private_Functions
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @brief Initializes the IS42S16800J SDRAm memory
|
||||
* @param Ctx Component object pointer
|
||||
* @param pRegMode: Pointer to Register Mode structure
|
||||
* @retval error status
|
||||
*/
|
||||
int32_t IS42S16800J_Init(SDRAM_HandleTypeDef *Ctx, IS42S16800J_Context_t *pRegMode)
|
||||
{
|
||||
int32_t ret = IS42S16800J_ERROR;
|
||||
|
||||
/* Step 1: Configure a clock configuration enable command */
|
||||
if(IS42S16800J_ClockEnable(Ctx, pRegMode->TargetBank) == IS42S16800J_OK)
|
||||
{
|
||||
/* Step 2: Insert 100 us minimum delay */
|
||||
/* Inserted delay is equal to 1 ms due to systick time base unit (ms) */
|
||||
(void)IS42S16800J_Delay(1);
|
||||
|
||||
/* Step 3: Configure a PALL (precharge all) command */
|
||||
if(IS42S16800J_Precharge(Ctx, pRegMode->TargetBank) == IS42S16800J_OK)
|
||||
{
|
||||
/* Step 4: Configure a Refresh command */
|
||||
if(IS42S16800J_RefreshMode(Ctx, pRegMode->TargetBank, pRegMode->RefreshMode) == IS42S16800J_OK)
|
||||
{
|
||||
/* Step 5: Program the external memory mode register */
|
||||
if(IS42S16800J_ModeRegConfig(Ctx, pRegMode) == IS42S16800J_OK)
|
||||
{
|
||||
/* Step 6: Set the refresh rate counter */
|
||||
if(IS42S16800J_RefreshRate(Ctx, pRegMode->RefreshRate) == IS42S16800J_OK)
|
||||
{
|
||||
ret = IS42S16800J_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable SDRAM clock
|
||||
* @param Ctx Component object pointer
|
||||
* @param Interface Could be FMC_SDRAM_CMD_TARGET_BANK1 or FMC_SDRAM_CMD_TARGET_BANK2
|
||||
* @retval error status
|
||||
*/
|
||||
int32_t IS42S16800J_ClockEnable(SDRAM_HandleTypeDef *Ctx, uint32_t Interface)
|
||||
{
|
||||
Command.CommandMode = IS42S16800J_CLK_ENABLE_CMD;
|
||||
Command.CommandTarget = Interface;
|
||||
Command.AutoRefreshNumber = 1;
|
||||
Command.ModeRegisterDefinition = 0;
|
||||
|
||||
/* Send the command */
|
||||
if(HAL_SDRAM_SendCommand(Ctx, &Command, IS42S16800J_TIMEOUT) != HAL_OK)
|
||||
{
|
||||
return IS42S16800J_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
return IS42S16800J_OK;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Precharge all sdram banks
|
||||
* @param Ctx Component object pointer
|
||||
* @param Interface Could be FMC_SDRAM_CMD_TARGET_BANK1 or FMC_SDRAM_CMD_TARGET_BANK2
|
||||
* @retval error status
|
||||
*/
|
||||
int32_t IS42S16800J_Precharge(SDRAM_HandleTypeDef *Ctx, uint32_t Interface)
|
||||
{
|
||||
Command.CommandMode = IS42S16800J_PALL_CMD;
|
||||
Command.CommandTarget = Interface;
|
||||
Command.AutoRefreshNumber = 1;
|
||||
Command.ModeRegisterDefinition = 0;
|
||||
|
||||
/* Send the command */
|
||||
if(HAL_SDRAM_SendCommand(Ctx, &Command, IS42S16800J_TIMEOUT) != HAL_OK)
|
||||
{
|
||||
return IS42S16800J_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
return IS42S16800J_OK;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Program the external memory mode register
|
||||
* @param Ctx Component object pointer
|
||||
* @param pRegMode: Pointer to Register Mode structure
|
||||
* @retval error status
|
||||
*/
|
||||
int32_t IS42S16800J_ModeRegConfig(SDRAM_HandleTypeDef *Ctx, IS42S16800J_Context_t *pRegMode)
|
||||
{
|
||||
uint32_t tmpmrd;
|
||||
|
||||
/* Program the external memory mode register */
|
||||
tmpmrd = (uint32_t)pRegMode->BurstLength |\
|
||||
pRegMode->BurstType |\
|
||||
pRegMode->CASLatency |\
|
||||
pRegMode->OperationMode |\
|
||||
pRegMode->WriteBurstMode;
|
||||
|
||||
Command.CommandMode = IS42S16800J_LOAD_MODE_CMD;
|
||||
Command.CommandTarget = pRegMode->TargetBank;
|
||||
Command.AutoRefreshNumber = 1;
|
||||
Command.ModeRegisterDefinition = tmpmrd;
|
||||
|
||||
/* Send the command */
|
||||
if(HAL_SDRAM_SendCommand(Ctx, &Command, IS42S16800J_TIMEOUT) != HAL_OK)
|
||||
{
|
||||
return IS42S16800J_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
return IS42S16800J_OK;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Program the SDRAM timing
|
||||
* @param Ctx Component object pointer
|
||||
* @param pTiming Pointer to SDRAM timing configuration structure
|
||||
* @retval error status
|
||||
*/
|
||||
int32_t IS42S16800J_TimingConfig(SDRAM_HandleTypeDef *Ctx, FMC_SDRAM_TimingTypeDef *pTiming)
|
||||
{
|
||||
/* Program the SDRAM timing */
|
||||
if(HAL_SDRAM_Init(Ctx, pTiming) != HAL_OK)
|
||||
{
|
||||
return IS42S16800J_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
return IS42S16800J_OK;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configure Refresh mode
|
||||
* @param Ctx Component object pointer
|
||||
* @param Interface Could be FMC_SDRAM_CMD_TARGET_BANK1 or FMC_SDRAM_CMD_TARGET_BANK2
|
||||
* @param RefreshMode Could be IS42S16800J_CMD_AUTOREFRESH_MODE or
|
||||
* IS42S16800J_CMD_SELFREFRESH_MODE
|
||||
* @retval error status
|
||||
*/
|
||||
int32_t IS42S16800J_RefreshMode(SDRAM_HandleTypeDef *Ctx, uint32_t Interface, uint32_t RefreshMode)
|
||||
{
|
||||
Command.CommandMode = RefreshMode;
|
||||
Command.CommandTarget = Interface;
|
||||
Command.AutoRefreshNumber = 8;
|
||||
Command.ModeRegisterDefinition = 0;
|
||||
|
||||
/* Send the command */
|
||||
if(HAL_SDRAM_SendCommand(Ctx, &Command, IS42S16800J_TIMEOUT) != HAL_OK)
|
||||
{
|
||||
return IS42S16800J_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
return IS42S16800J_OK;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the device refresh rate
|
||||
* @param Ctx Component object pointer
|
||||
* @param RefreshCount The refresh rate to be programmed
|
||||
* @retval error status
|
||||
*/
|
||||
int32_t IS42S16800J_RefreshRate(SDRAM_HandleTypeDef *Ctx, uint32_t RefreshCount)
|
||||
{
|
||||
/* Set the device refresh rate */
|
||||
if(HAL_SDRAM_ProgramRefreshRate(Ctx, RefreshCount) != HAL_OK)
|
||||
{
|
||||
return IS42S16800J_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
return IS42S16800J_OK;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enter Power mode
|
||||
* @param Ctx Component object pointer
|
||||
* @param Interface Could be FMC_SDRAM_CMD_TARGET_BANK1 or FMC_SDRAM_CMD_TARGET_BANK2
|
||||
* @retval error status
|
||||
*/
|
||||
int32_t IS42S16800J_EnterPowerMode(SDRAM_HandleTypeDef *Ctx, uint32_t Interface)
|
||||
{
|
||||
Command.CommandMode = IS42S16800J_POWERDOWN_MODE_CMD;
|
||||
Command.CommandTarget = Interface;
|
||||
Command.AutoRefreshNumber = 1;
|
||||
Command.ModeRegisterDefinition = 0;
|
||||
|
||||
/* Send the command */
|
||||
if(HAL_SDRAM_SendCommand(Ctx, &Command, IS42S16800J_TIMEOUT) != HAL_OK)
|
||||
{
|
||||
return IS42S16800J_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
return IS42S16800J_OK;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Exit Power mode
|
||||
* @param Ctx Component object pointer
|
||||
* @param Interface Could be FMC_SDRAM_CMD_TARGET_BANK1 or FMC_SDRAM_CMD_TARGET_BANK2
|
||||
* @retval error status
|
||||
*/
|
||||
int32_t IS42S16800J_ExitPowerMode(SDRAM_HandleTypeDef *Ctx, uint32_t Interface)
|
||||
{
|
||||
Command.CommandMode = IS42S16800J_NORMAL_MODE_CMD;
|
||||
Command.CommandTarget = Interface;
|
||||
Command.AutoRefreshNumber = 1;
|
||||
Command.ModeRegisterDefinition = 0;
|
||||
|
||||
/* Send the command */
|
||||
if(HAL_SDRAM_SendCommand(Ctx, &Command, IS42S16800J_TIMEOUT) != HAL_OK)
|
||||
{
|
||||
return IS42S16800J_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
return IS42S16800J_OK;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Sends command to the SDRAM bank.
|
||||
* @param Ctx Component object pointer
|
||||
* @param SdramCmd: Pointer to SDRAM command structure
|
||||
* @retval SDRAM status
|
||||
*/
|
||||
int32_t IS42S16800J_Sendcmd(SDRAM_HandleTypeDef *Ctx, FMC_SDRAM_CommandTypeDef *SdramCmd)
|
||||
{
|
||||
if(HAL_SDRAM_SendCommand(Ctx, SdramCmd, IS42S16800J_TIMEOUT) != HAL_OK)
|
||||
{
|
||||
return IS42S16800J_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
return IS42S16800J_OK;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief This function provides accurate delay (in milliseconds)
|
||||
* @param Delay: specifies the delay time length, in milliseconds
|
||||
* @retval IS42S16800J_OK
|
||||
*/
|
||||
static int32_t IS42S16800J_Delay(uint32_t Delay)
|
||||
{
|
||||
uint32_t tickstart;
|
||||
tickstart = HAL_GetTick();
|
||||
while((HAL_GetTick() - tickstart) < Delay)
|
||||
{
|
||||
}
|
||||
return IS42S16800J_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,125 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file is42s16800j.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the description of the IS42S16800J SDRAM
|
||||
* memory.
|
||||
*
|
||||
******************************************************************************
|
||||
* @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 IS42S16800J_H
|
||||
#define IS42S16800J_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "is42s16800j_conf.h"
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup IS42S16800J
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup IS42S16800J_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t TargetBank; /*!< Target Bank */
|
||||
uint32_t RefreshMode; /*!< Refresh Mode */
|
||||
uint32_t RefreshRate; /*!< Refresh Rate */
|
||||
uint32_t BurstLength; /*!< Burst Length */
|
||||
uint32_t BurstType; /*!< Burst Type */
|
||||
uint32_t CASLatency; /*!< CAS Latency */
|
||||
uint32_t OperationMode; /*!< Operation Mode */
|
||||
uint32_t WriteBurstMode; /*!< Write Burst Mode */
|
||||
} IS42S16800J_Context_t;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup IS42S16800J_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
#define IS42S16800J_OK (0)
|
||||
#define IS42S16800J_ERROR (-1)
|
||||
|
||||
/* Register Mode */
|
||||
#define IS42S16800J_BURST_LENGTH_1 0x00000000U
|
||||
#define IS42S16800J_BURST_LENGTH_2 0x00000001U
|
||||
#define IS42S16800J_BURST_LENGTH_4 0x00000002U
|
||||
#define IS42S16800J_BURST_LENGTH_8 0x00000004U
|
||||
#define IS42S16800J_BURST_TYPE_SEQUENTIAL 0x00000000U
|
||||
#define IS42S16800J_BURST_TYPE_INTERLEAVED 0x00000008U
|
||||
#define IS42S16800J_CAS_LATENCY_2 0x00000020U
|
||||
#define IS42S16800J_CAS_LATENCY_3 0x00000030U
|
||||
#define IS42S16800J_OPERATING_MODE_STANDARD 0x00000000U
|
||||
#define IS42S16800J_WRITEBURST_MODE_PROGRAMMED 0x00000000U
|
||||
#define IS42S16800J_WRITEBURST_MODE_SINGLE 0x00000200U
|
||||
|
||||
/* Command Mode */
|
||||
#define IS42S16800J_NORMAL_MODE_CMD 0x00000000U
|
||||
#define IS42S16800J_CLK_ENABLE_CMD 0x00000001U
|
||||
#define IS42S16800J_PALL_CMD 0x00000002U
|
||||
#define IS42S16800J_AUTOREFRESH_MODE_CMD 0x00000003U
|
||||
#define IS42S16800J_LOAD_MODE_CMD 0x00000004U
|
||||
#define IS42S16800J_SELFREFRESH_MODE_CMD 0x00000005U
|
||||
#define IS42S16800J_POWERDOWN_MODE_CMD 0x00000006U
|
||||
|
||||
|
||||
int32_t IS42S16800J_Init(SDRAM_HandleTypeDef *Ctx, IS42S16800J_Context_t *pRegMode);
|
||||
int32_t IS42S16800J_ClockEnable(SDRAM_HandleTypeDef *Ctx, uint32_t Interface);
|
||||
int32_t IS42S16800J_Precharge(SDRAM_HandleTypeDef *Ctx, uint32_t Interface);
|
||||
int32_t IS42S16800J_ModeRegConfig(SDRAM_HandleTypeDef *Ctx, IS42S16800J_Context_t *pRegMode);
|
||||
int32_t IS42S16800J_TimingConfig(SDRAM_HandleTypeDef *Ctx, FMC_SDRAM_TimingTypeDef *pTiming);
|
||||
int32_t IS42S16800J_RefreshMode(SDRAM_HandleTypeDef *Ctx, uint32_t Interface, uint32_t RefreshMode);
|
||||
int32_t IS42S16800J_RefreshRate(SDRAM_HandleTypeDef *Ctx, uint32_t RefreshCount);
|
||||
int32_t IS42S16800J_EnterPowerMode(SDRAM_HandleTypeDef *Ctx, uint32_t Interface);
|
||||
int32_t IS42S16800J_ExitPowerMode(SDRAM_HandleTypeDef *Ctx, uint32_t Interface);
|
||||
int32_t IS42S16800J_Sendcmd(SDRAM_HandleTypeDef *Ctx, FMC_SDRAM_CommandTypeDef *SdramCmd);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* IS42S16800J_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,57 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file is42s16800j_conf.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains some configurations required for the
|
||||
* IS42S16800J SDRAM memory.
|
||||
******************************************************************************
|
||||
* @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 IS42S16800J_CONF_H
|
||||
#define IS42S16800J_CONF_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32xxxx_hal.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
#define REFRESH_COUNT ((uint32_t)0x0603) /* SDRAM refresh counter (100Mhz SD clock) */
|
||||
|
||||
#define IS42S16800J_TIMEOUT ((uint32_t)0xFFFF)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* IS42S16800J_CONF_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,57 @@
|
||||
<!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 IS42S32800G 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-is42s32800g-component-driver"><strong>Release Notes for IS42S32800G Component Driver</strong></h1>
|
||||
<p>Copyright © 2019 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 SDRAM functions offered by IS42S32800G 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-section1" checked aria-hidden="true"> <label for="collapse-section1" aria-hidden="true"><strong>V1.0.0 / 23-November-2019</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<ul>
|
||||
<li>First official release of <strong>IS42S32800G</strong> SDRAM Component drivers in line with STM32Cube BSP drivers development guidelines (UM2298)</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,55 @@
|
||||
---
|
||||
pagetitle: Release Notes for IS42S32800G Component Driver
|
||||
lang: en
|
||||
---
|
||||
|
||||
::: {.row}
|
||||
::: {.col-sm-12 .col-lg-4}
|
||||
|
||||
::: {.card .fluid}
|
||||
::: {.sectione .dark}
|
||||
<center>
|
||||
# **Release Notes for IS42S32800G Component Driver**
|
||||
Copyright © 2019 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 SDRAM functions offered by IS42S32800G component
|
||||
|
||||
:::
|
||||
|
||||
::: {.col-sm-12 .col-lg-8}
|
||||
# Update History
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section1" checked aria-hidden="true">
|
||||
<label for="collapse-section1" aria-hidden="true">__V1.0.0 / 23-November-2019__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- First official release of **IS42S32800G** SDRAM Component drivers in line with STM32Cube BSP drivers development guidelines (UM2298)
|
||||
|
||||
</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>
|
||||
|
After Width: | Height: | Size: 18 KiB |