Initial snapshot: Aliro applet, harness, Nucleo NFC10A1 reader port
Three components, all bench-validated to varying depths: - applet/: CSA Aliro v1.0 Java Card applet for J3R180. AUTH0 + AUTH1 expedited-standard flow end-to-end green via PC/SC bench reader (aliro-bench-test). Userland AES-256-GCM and HMAC-SHA-256 layered on top of J3R180's primitives because the card lacks both natively. P-256 curve params seeded explicitly per J3R180's quirk. - harness/: Python orchestrator (aliro-trustgen, aliro-personalize, aliro-bench-test) for trust-bundle generation, card personalization via PersonalizationApplet, and PC/SC AUTH0+AUTH1 transactions. 126 pytest cases passing. - reader/STM32CubeExpansion_ALIRO_V1_0_0/: ST X-CUBE-ALIRO V1.0.0 with our NFC10A1 port (NUCLEO-U545RE-Q + X-NUCLEO-NFC10A1, ST25R200 shared with NFC09A1). nfc10-only/ project, NFC10A1 BSP shim, ALIRO_TRUST_OVERRIDE include into vendor's provisioning.c, and an ALIRO_APDU_TRACE wrapper around demoTransceiveBlocking. Boots, detects the J3R180, completes SELECT + AUTH0; AUTH1 currently fails with RFAL ERR_PROTO (0xB) — under investigation, see docs/plans/2026-04-20-nucleo-nfc10a1-port.md and bench-notes/. Excluded: x-cube-aliro.zip vendor archive, harness/.venv, build dirs, generated aliro_trust.h (contains private reader scalar), all PEMs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@@ -0,0 +1,27 @@
|
||||
Copyright 2021 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,6 @@
|
||||
This software component is provided to you as part of a software package and
|
||||
applicable license terms are in the Package_license file. If you received this
|
||||
software component outside of a package or without applicable license terms,
|
||||
the terms of the BSD-3-Clause license shall apply.
|
||||
You may obtain a copy of the BSD-3-Clause at:
|
||||
https://opensource.org/licenses/BSD-3-Clause
|
||||
@@ -0,0 +1,242 @@
|
||||
<!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]-->
|
||||
<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-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>
|
||||
<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-section19" checked aria-hidden="true"> <label for="collapse-section19" aria-hidden="true">V7.2.1 / 16-November-2021</label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<h3 id="component-release">Component release</h3>
|
||||
<ul>
|
||||
<li>Update licensing</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section18" aria-hidden="true"> <label for="collapse-section18" aria-hidden="true">V7.2.0 / 11-October-2021</label>
|
||||
<div>
|
||||
<h2 id="main-changes-1">Main Changes</h2>
|
||||
<h3 id="component-release-1">Component release</h3>
|
||||
<ul>
|
||||
<li>Add hybrid_sensor.h to support hybrid (env and motion) sensors</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section17" aria-hidden="true"> <label for="collapse-section17" aria-hidden="true">V7.1.0 / 18-Juin-2021</label>
|
||||
<div>
|
||||
<h2 id="main-changes-2">Main Changes</h2>
|
||||
<h3 id="component-release-2">Component release</h3>
|
||||
<ul>
|
||||
<li>Add ranging_sensor.h to support ranging sensors</li>
|
||||
<li>Add light_sensor.h to support ambient light sensors</li>
|
||||
<li>Rename UTILS_LCD_Drv_t structure into LCD_UTILS_Drv_t</li>
|
||||
<li>Code spelling and formatting</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-section16" aria-hidden="true"> <label for="collapse-section16" aria-hidden="true">V7.0.0 / 25-February-2020</label>
|
||||
<div>
|
||||
<h2 id="main-changes-3">Main Changes</h2>
|
||||
<h3 id="component-release-3">Component release</h3>
|
||||
<ul>
|
||||
<li>Rename GUI_Drv_t structure into UTILS_LCD_Drv_t</li>
|
||||
</ul>
|
||||
<h2 id="backward-compatibility-1">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-4">Main Changes</h2>
|
||||
<h3 id="component-release-4">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-5">Main Changes</h2>
|
||||
<h3 id="component-release-5">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-2">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-6">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-7">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-8">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-3">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-9">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-10">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-4">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-11">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-5">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-12">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-13">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-14">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-6">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-15">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-16">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-17">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-18">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,323 @@
|
||||
---
|
||||
pagetitle: Release Notes for BSP Common Components Drivers
|
||||
lang: en
|
||||
header-includes: <link rel="icon" type="image/x-icon" href="_htmresc/favicon.png" />
|
||||
---
|
||||
|
||||
::: {.row}
|
||||
::: {.col-sm-12 .col-lg-4}
|
||||
|
||||
<center>
|
||||
# <small>Release Notes for</small> <mark>BSP Common Components Drivers</mark>
|
||||
Copyright © 2014 STMicroelectronics\
|
||||
|
||||
[](https://www.st.com){.logo}
|
||||
</center>
|
||||
|
||||
# Purpose
|
||||
|
||||
This directory contains the BSP Common components drivers.
|
||||
|
||||
:::
|
||||
|
||||
::: {.col-sm-12 .col-lg-8}
|
||||
# Update History
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section19" checked aria-hidden="true">
|
||||
<label for="collapse-section19" aria-hidden="true">V7.2.1 / 16-November-2021</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
### Component release
|
||||
|
||||
- Update licensing
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section18" aria-hidden="true">
|
||||
<label for="collapse-section18" aria-hidden="true">V7.2.0 / 11-October-2021</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
### Component release
|
||||
|
||||
- Add hybrid_sensor.h to support hybrid (env and motion) sensors
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section17" aria-hidden="true">
|
||||
<label for="collapse-section17" aria-hidden="true">V7.1.0 / 18-Juin-2021</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
### Component release
|
||||
|
||||
- Add ranging_sensor.h to support ranging sensors
|
||||
- Add light_sensor.h to support ambient light sensors
|
||||
- Rename UTILS_LCD_Drv_t structure into LCD_UTILS_Drv_t
|
||||
- Code spelling and formatting
|
||||
|
||||
## Backward Compatibility
|
||||
|
||||
- This release breaks compatibility with previous versions.
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section16" 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>
|
||||
@@ -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: 832 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,105 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file audio.h
|
||||
* @author MCD Application Team
|
||||
* @brief This header file contains the common defines and functions prototypes
|
||||
* for the Audio driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2018 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 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 */
|
||||
@@ -0,0 +1,103 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file camera.h
|
||||
* @author MCD Application Team
|
||||
* @brief This header file contains the common defines and functions prototypes
|
||||
* for the camera driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2018 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 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 */
|
||||
@@ -0,0 +1,102 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file dpredriver.h
|
||||
* @author MCD Application Team
|
||||
* @brief This header file contains the functions prototypes for the
|
||||
* DisplayPort Linear Redriver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2018 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 __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 */
|
||||
@@ -0,0 +1,95 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file env_sensor.h
|
||||
* @author MCD Application Team
|
||||
* @brief This header file contains the functions prototypes for the
|
||||
* environmental sensor driver
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2017 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 ENV_SENSOR_H
|
||||
#define ENV_SENSOR_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup COMPONENTS COMPONENTS
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup COMMON COMMON
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ENV_SENSOR ENV SENSOR
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ENV_SENSOR_Public_Types ENV SENSOR Public types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief ENV 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 *);
|
||||
} 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_SENSOR_H */
|
||||
@@ -0,0 +1,94 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file epd.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the functions prototypes for the
|
||||
* EPD (E Paper Display) driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2015 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 __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 */
|
||||
@@ -0,0 +1,108 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file hybrid_sensor.h
|
||||
* @author MCD Application Team
|
||||
* @brief This header file contains the functions prototypes for the
|
||||
* hybrid sensor driver
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2021 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 HYBRID_SENSOR_H
|
||||
#define HYBRID_SENSOR_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup COMPONENTS COMPONENTS
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup COMMON COMMON
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup HYBRID_SENSOR HYBRID SENSOR
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup HYBRID_SENSOR_Public_Types HYBRID SENSOR Public types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief HYBRID 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 *);
|
||||
} HYBRID_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 *);
|
||||
} HYBRID_ENV_SENSOR_FuncDrv_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 *);
|
||||
} HYBRID_MOTION_SENSOR_FuncDrv_t;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* HYBRID_SENSOR_H */
|
||||
@@ -0,0 +1,95 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file idd.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the functions prototypes for the IDD driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2018 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 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 */
|
||||
@@ -0,0 +1,87 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file io.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the functions prototypes for the IO driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2018 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 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 */
|
||||
@@ -0,0 +1,130 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file lcd.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the functions prototypes for the LCD driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2018 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 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 */
|
||||
@@ -0,0 +1,85 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file light_sensor.h
|
||||
* @author IMG SW Application Team
|
||||
* @brief This header file contains the common defines and functions prototypes
|
||||
* for the light sensor driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2021 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 LIGHT_SENSOR_H
|
||||
#define LIGHT_SENSOR_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup LIGHT_SENSOR
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup LIGHT_SENSOR_Driver_structure Ranging sensor Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
int32_t (*Init)(void *);
|
||||
int32_t (*DeInit)(void *);
|
||||
int32_t (*ReadID)(void *, uint32_t *);
|
||||
int32_t (*GetCapabilities)(void *, void *);
|
||||
int32_t (*SetExposureTime)(void *, uint32_t);
|
||||
int32_t (*GetExposureTime)(void *, uint32_t *);
|
||||
int32_t (*SetGain)(void *, uint8_t, uint32_t);
|
||||
int32_t (*GetGain)(void *, uint8_t, uint32_t *);
|
||||
int32_t (*SetInterMeasurementTime)(void *, uint32_t);
|
||||
int32_t (*GetInterMeasurementTime)(void *, uint32_t *);
|
||||
int32_t (*Start)(void *, uint32_t);
|
||||
int32_t (*Stop)(void *);
|
||||
int32_t (*StartFlicker)(void *, uint8_t, uint8_t);
|
||||
int32_t (*StopFlicker)(void *);
|
||||
int32_t (*GetValues)(void *, uint32_t *);
|
||||
int32_t (*SetControlMode)(void *, uint32_t, uint32_t);
|
||||
} LIGHT_SENSOR_Drv_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LIGHT_SENSOR_H */
|
||||
@@ -0,0 +1,99 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file motion_sensor.h
|
||||
* @author MCD Application Team
|
||||
* @brief This header file contains the functions prototypes for the
|
||||
* motion sensor driver
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2017 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 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 */
|
||||
@@ -0,0 +1,251 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file pwrmon.h
|
||||
* @author MCD Application Team
|
||||
* @brief This header file contains the functions prototypes for the
|
||||
* Current/Power Monitor device driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2018 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 __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 */
|
||||
@@ -0,0 +1,83 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file ranging_sensor.h
|
||||
* @author IMG SW Application Team
|
||||
* @brief This header file contains the common defines and functions prototypes
|
||||
* for the ranging sensor driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2021 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 RANGING_SENSOR_H
|
||||
#define RANGING_SENSOR_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup RANGING_SENSOR
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup RANGING_SENSOR_Driver_structure Ranging sensor Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
int32_t (*Init)(void *);
|
||||
int32_t (*DeInit)(void *);
|
||||
int32_t (*ReadID)(void *, uint32_t *);
|
||||
int32_t (*GetCapabilities)(void *, void *);
|
||||
int32_t (*ConfigProfile)(void *, void *);
|
||||
int32_t (*ConfigROI)(void *, void *);
|
||||
int32_t (*ConfigIT)(void *, void *);
|
||||
int32_t (*GetDistance)(void *, void *);
|
||||
int32_t (*Start)(void *, uint32_t);
|
||||
int32_t (*Stop)(void *);
|
||||
int32_t (*SetAddress)(void *, uint32_t);
|
||||
int32_t (*GetAddress)(void *, uint32_t *);
|
||||
int32_t (*SetPowerMode)(void *, uint32_t);
|
||||
int32_t (*GetPowerMode)(void *, uint32_t *);
|
||||
} RANGING_SENSOR_Drv_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* RANGING_SENSOR_H */
|
||||
@@ -0,0 +1,90 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file ts.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the functions prototypes for the Touch Screen driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2018 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 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 */
|
||||
@@ -0,0 +1,112 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @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
|
||||
*
|
||||
* Copyright (c) 2018 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 __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 */
|
||||
@@ -0,0 +1,27 @@
|
||||
Copyright 2021 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,6 @@
|
||||
This software component is provided to you as part of a software package and
|
||||
applicable license terms are in the Package_license file. If you received this
|
||||
software component outside of a package or without applicable license terms,
|
||||
the terms of the BSD-3-Clause license shall apply.
|
||||
You may obtain a copy of the BSD-3-Clause at:
|
||||
https://opensource.org/licenses/BSD-3-Clause
|
||||
@@ -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 ST25R200</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]-->
|
||||
<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-x-cube-nfc9-software-for-stm32"><small>Release Notes for</small> <strong>ST25R200 driver</strong></h1>
|
||||
<p>Copyright © 2024 STMicroelectronics<br />
|
||||
</p>
|
||||
<a href="https://www.st.com" class="logo"><img src="../../../../_htmresc/st_logo.png" alt="ST logo" /></a>
|
||||
</center>
|
||||
<h1 id="purpose">Purpose</h1>
|
||||
<p>The X-CUBE-NFC10 software package is an expansion for STM32Cube. This software provides drivers running on STM32 for ST25R200 device.</p>
|
||||
<ul>
|
||||
</ul>
|
||||
<ul>
|
||||
<ul>
|
||||
</ul></li>
|
||||
<ul>
|
||||
</ul></li>
|
||||
<ul>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<ul>
|
||||
</ul>
|
||||
</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">V1.0.0 / 7-June-2024</label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<h3 id="maintenance-release">First release</h3>
|
||||
<ul>
|
||||
<li>First official release.</li>
|
||||
</ul>
|
||||
<h2 id="known-limitations">Known Limitations</h2>
|
||||
<ul>
|
||||
<li>None</li>
|
||||
</ul>
|
||||
<h2 id="known-issues">Known Issues</h2>
|
||||
<ul>
|
||||
<li>None</li>
|
||||
</ul>
|
||||
<h2 id="important-hardware-additional-information">Important Hardware Additional Information</h2>
|
||||
<ul>
|
||||
<li>None</li>
|
||||
</ul>
|
||||
<h2 id="backward-compatibility">Backward Compatibility</h2>
|
||||
<ul>
|
||||
<li>None</li>
|
||||
</ul>
|
||||
<h2 id="dependencies">Dependencies</h2>
|
||||
<ul>
|
||||
<li>None</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="sticky">
|
||||
<p>For complete documentation on <strong>X-CUBE-NFC10</strong> , visit: <a href="https://www.st.com/en/embedded-software/x-cube-nfc10.html">www.st.com</a></p>
|
||||
This release note uses up to date web standards and, for this reason, should not be opened with Internet Explorer but preferably with popular browsers such as Google Chrome, Mozilla Firefox, Opera or Microsoft Edge.
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,482 @@
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file rfal_analogConfigTbl.h
|
||||
* @author MMY Application Team
|
||||
* @brief ST25R200 Analog Configuration Settings
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2021 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.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef ST25R200_ANALOGCONFIG_H
|
||||
#define ST25R200_ANALOGCONFIG_H
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* INCLUDES
|
||||
******************************************************************************
|
||||
*/
|
||||
#include "rfal_analogConfig.h"
|
||||
#include "st25r200_com.h"
|
||||
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* DEFINES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL MACROS
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/*! Macro for Configuration Setting with only one register-mask-value set:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1] */
|
||||
#define MODE_ENTRY_1_REG(MODE, R0, M0, V0) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 1, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0)
|
||||
|
||||
/*! Macro for Configuration Setting with only two register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1] */
|
||||
#define MODE_ENTRY_2_REG(MODE, R0, M0, V0, R1, M1, V1) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 2, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1)
|
||||
|
||||
/*! Macro for Configuration Setting with only three register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_3_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 3, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2)
|
||||
|
||||
/*! Macro for Configuration Setting with only four register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_4_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 4, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3)
|
||||
|
||||
/*! Macro for Configuration Setting with only five register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_5_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 5, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4)
|
||||
|
||||
/*! Macro for Configuration Setting with only six register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_6_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 6, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5)
|
||||
|
||||
/*! Macro for Configuration Setting with only seven register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_7_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 7, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \
|
||||
, (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6)
|
||||
|
||||
/*! Macro for Configuration Setting with only eight register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_8_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 8, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \
|
||||
, (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \
|
||||
, (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7)
|
||||
|
||||
/*! Macro for Configuration Setting with only nine register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_9_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 9, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \
|
||||
, (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \
|
||||
, (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \
|
||||
, (uint8_t)((uint16_t)(R8) >> 8U), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8)
|
||||
|
||||
/*! Macro for Configuration Setting with only ten register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_10_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU),10, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \
|
||||
, (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \
|
||||
, (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \
|
||||
, (uint8_t)((uint16_t)(R8) >> 8U), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \
|
||||
, (uint8_t)((uint16_t)(R9) >> 8U), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9)
|
||||
|
||||
/*! Macro for Configuration Setting with eleven register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_11_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU),11, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \
|
||||
, (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \
|
||||
, (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \
|
||||
, (uint8_t)((uint16_t)(R8) >> 8U), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \
|
||||
, (uint8_t)((uint16_t)(R9) >> 8U), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \
|
||||
, (uint8_t)((uint16_t)(R10) >> 8U), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10)
|
||||
|
||||
/*! Macro for Configuration Setting with twelve register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_12_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU),12, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \
|
||||
, (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \
|
||||
, (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \
|
||||
, (uint8_t)((uint16_t)(R8) >> 8U), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \
|
||||
, (uint8_t)((uint16_t)(R9) >> 8U), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \
|
||||
, (uint8_t)((uint16_t)(R10) >> 8U), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \
|
||||
, (uint8_t)((uint16_t)(R11) >> 8U), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11)
|
||||
|
||||
/*! Macro for Configuration Setting with thirteen register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_13_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11, R12, M12, V12) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU),13, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \
|
||||
, (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \
|
||||
, (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \
|
||||
, (uint8_t)((uint16_t)(R8) >> 8U), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \
|
||||
, (uint8_t)((uint16_t)(R9) >> 8U), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \
|
||||
, (uint8_t)((uint16_t)(R10) >> 8U), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \
|
||||
, (uint8_t)((uint16_t)(R11) >> 8U), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11) \
|
||||
, (uint8_t)((uint16_t)(R12) >> 8U), (uint8_t)((R12) & 0xFFU), (uint8_t)(M12), (uint8_t)(V12)
|
||||
|
||||
/*! Macro for Configuration Setting with fourteen register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_14_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11, R12, M12, V12, R13, M13, V13) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8), (uint8_t)((MODE) & 0xFFU),14, (uint8_t)((uint16_t)(R0) >> 8), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \
|
||||
, (uint8_t)((uint16_t)(R6) >> 8), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \
|
||||
, (uint8_t)((uint16_t)(R7) >> 8), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \
|
||||
, (uint8_t)((uint16_t)(R8) >> 8), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \
|
||||
, (uint8_t)((uint16_t)(R9) >> 8), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \
|
||||
, (uint8_t)((uint16_t)(R10) >> 8), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \
|
||||
, (uint8_t)((uint16_t)(R11) >> 8), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11) \
|
||||
, (uint8_t)((uint16_t)(R12) >> 8), (uint8_t)((R12) & 0xFFU), (uint8_t)(M12), (uint8_t)(V12) \
|
||||
, (uint8_t)((uint16_t)(R13) >> 8), (uint8_t)((R13) & 0xFFU), (uint8_t)(M13), (uint8_t)(V13)
|
||||
|
||||
/*! Macro for Configuration Setting with fifteen register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_15_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11, R12, M12, V12, R13, M13, V13, R14, M14, V14) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8), (uint8_t)((MODE) & 0xFFU),15, (uint8_t)((uint16_t)(R0) >> 8), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \
|
||||
, (uint8_t)((uint16_t)(R6) >> 8), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \
|
||||
, (uint8_t)((uint16_t)(R7) >> 8), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \
|
||||
, (uint8_t)((uint16_t)(R8) >> 8), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \
|
||||
, (uint8_t)((uint16_t)(R9) >> 8), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \
|
||||
, (uint8_t)((uint16_t)(R10) >> 8), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \
|
||||
, (uint8_t)((uint16_t)(R11) >> 8), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11) \
|
||||
, (uint8_t)((uint16_t)(R12) >> 8), (uint8_t)((R12) & 0xFFU), (uint8_t)(M12), (uint8_t)(V12) \
|
||||
, (uint8_t)((uint16_t)(R13) >> 8), (uint8_t)((R13) & 0xFFU), (uint8_t)(M13), (uint8_t)(V13) \
|
||||
, (uint8_t)((uint16_t)(R14) >> 8), (uint8_t)((R14) & 0xFFU), (uint8_t)(M14), (uint8_t)(V14)
|
||||
|
||||
/*! Macro for Configuration Setting with sixteen register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_16_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11, R12, M12, V12, R13, M13, V13, R14, M14, V14, R15, M15, V15) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8), (uint8_t)((MODE) & 0xFFU),16, (uint8_t)((uint16_t)(R0) >> 8), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \
|
||||
, (uint8_t)((uint16_t)(R6) >> 8), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \
|
||||
, (uint8_t)((uint16_t)(R7) >> 8), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \
|
||||
, (uint8_t)((uint16_t)(R8) >> 8), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \
|
||||
, (uint8_t)((uint16_t)(R9) >> 8), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \
|
||||
, (uint8_t)((uint16_t)(R10) >> 8), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \
|
||||
, (uint8_t)((uint16_t)(R11) >> 8), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11) \
|
||||
, (uint8_t)((uint16_t)(R12) >> 8), (uint8_t)((R12) & 0xFFU), (uint8_t)(M12), (uint8_t)(V12) \
|
||||
, (uint8_t)((uint16_t)(R13) >> 8), (uint8_t)((R13) & 0xFFU), (uint8_t)(M13), (uint8_t)(V13) \
|
||||
, (uint8_t)((uint16_t)(R14) >> 8), (uint8_t)((R14) & 0xFFU), (uint8_t)(M14), (uint8_t)(V14) \
|
||||
, (uint8_t)((uint16_t)(R15) >> 8), (uint8_t)((R15) & 0xFFU), (uint8_t)(M15), (uint8_t)(V15)
|
||||
|
||||
/*! Macro for Configuration Setting with seventeen register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_17_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11, R12, M12, V12, R13, M13, V13, R14, M14, V14, R15, M15, V15, R16, M16, V16) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8), (uint8_t)((MODE) & 0xFFU),17, (uint8_t)((uint16_t)(R0) >> 8), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \
|
||||
, (uint8_t)((uint16_t)(R6) >> 8), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \
|
||||
, (uint8_t)((uint16_t)(R7) >> 8), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \
|
||||
, (uint8_t)((uint16_t)(R8) >> 8), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \
|
||||
, (uint8_t)((uint16_t)(R9) >> 8), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \
|
||||
, (uint8_t)((uint16_t)(R10) >> 8), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \
|
||||
, (uint8_t)((uint16_t)(R11) >> 8), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11) \
|
||||
, (uint8_t)((uint16_t)(R12) >> 8), (uint8_t)((R12) & 0xFFU), (uint8_t)(M12), (uint8_t)(V12) \
|
||||
, (uint8_t)((uint16_t)(R13) >> 8), (uint8_t)((R13) & 0xFFU), (uint8_t)(M13), (uint8_t)(V13) \
|
||||
, (uint8_t)((uint16_t)(R14) >> 8), (uint8_t)((R14) & 0xFFU), (uint8_t)(M14), (uint8_t)(V14) \
|
||||
, (uint8_t)((uint16_t)(R15) >> 8), (uint8_t)((R15) & 0xFFU), (uint8_t)(M15), (uint8_t)(V15) \
|
||||
, (uint8_t)((uint16_t)(R16) >> 8), (uint8_t)((R16) & 0xFFU), (uint8_t)(M16), (uint8_t)(V16)
|
||||
|
||||
/*! Macro for Configuration Setting with seventeen register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_18_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11, R12, M12, V12, R13, M13, V13, R14, M14, V14, R15, M15, V15, R16, M16, V16, R17, M17, V17) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8), (uint8_t)((MODE) & 0xFFU),18, (uint8_t)((uint16_t)(R0) >> 8), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \
|
||||
, (uint8_t)((uint16_t)(R6) >> 8), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \
|
||||
, (uint8_t)((uint16_t)(R7) >> 8), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \
|
||||
, (uint8_t)((uint16_t)(R8) >> 8), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \
|
||||
, (uint8_t)((uint16_t)(R9) >> 8), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \
|
||||
, (uint8_t)((uint16_t)(R10) >> 8), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \
|
||||
, (uint8_t)((uint16_t)(R11) >> 8), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11) \
|
||||
, (uint8_t)((uint16_t)(R12) >> 8), (uint8_t)((R12) & 0xFFU), (uint8_t)(M12), (uint8_t)(V12) \
|
||||
, (uint8_t)((uint16_t)(R13) >> 8), (uint8_t)((R13) & 0xFFU), (uint8_t)(M13), (uint8_t)(V13) \
|
||||
, (uint8_t)((uint16_t)(R14) >> 8), (uint8_t)((R14) & 0xFFU), (uint8_t)(M14), (uint8_t)(V14) \
|
||||
, (uint8_t)((uint16_t)(R15) >> 8), (uint8_t)((R15) & 0xFFU), (uint8_t)(M15), (uint8_t)(V15) \
|
||||
, (uint8_t)((uint16_t)(R16) >> 8), (uint8_t)((R16) & 0xFFU), (uint8_t)(M16), (uint8_t)(V16) \
|
||||
, (uint8_t)((uint16_t)(R17) >> 8), (uint8_t)((R17) & 0xFFU), (uint8_t)(M17), (uint8_t)(V17)
|
||||
|
||||
/*! Macro for Configuration Setting with seventeen register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_19_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11, R12, M12, V12, R13, M13, V13, R14, M14, V14, R15, M15, V15, R16, M16, V16, R17, M17, V17, R18, M18, V18) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8), (uint8_t)((MODE) & 0xFFU),19, (uint8_t)((uint16_t)(R0) >> 8), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \
|
||||
, (uint8_t)((uint16_t)(R6) >> 8), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \
|
||||
, (uint8_t)((uint16_t)(R7) >> 8), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \
|
||||
, (uint8_t)((uint16_t)(R8) >> 8), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \
|
||||
, (uint8_t)((uint16_t)(R9) >> 8), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \
|
||||
, (uint8_t)((uint16_t)(R10) >> 8), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \
|
||||
, (uint8_t)((uint16_t)(R11) >> 8), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11) \
|
||||
, (uint8_t)((uint16_t)(R12) >> 8), (uint8_t)((R12) & 0xFFU), (uint8_t)(M12), (uint8_t)(V12) \
|
||||
, (uint8_t)((uint16_t)(R13) >> 8), (uint8_t)((R13) & 0xFFU), (uint8_t)(M13), (uint8_t)(V13) \
|
||||
, (uint8_t)((uint16_t)(R14) >> 8), (uint8_t)((R14) & 0xFFU), (uint8_t)(M14), (uint8_t)(V14) \
|
||||
, (uint8_t)((uint16_t)(R15) >> 8), (uint8_t)((R15) & 0xFFU), (uint8_t)(M15), (uint8_t)(V15) \
|
||||
, (uint8_t)((uint16_t)(R16) >> 8), (uint8_t)((R16) & 0xFFU), (uint8_t)(M16), (uint8_t)(V16) \
|
||||
, (uint8_t)((uint16_t)(R17) >> 8), (uint8_t)((R17) & 0xFFU), (uint8_t)(M17), (uint8_t)(V17) \
|
||||
, (uint8_t)((uint16_t)(R18) >> 8), (uint8_t)((R18) & 0xFFU), (uint8_t)(M18), (uint8_t)(V18)
|
||||
|
||||
/*! Macro for Configuration Setting with seventeen register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_20_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11, R12, M12, V12, R13, M13, V13, R14, M14, V14, R15, M15, V15, R16, M16, V16, R17, M17, V17, R18, M18, V18, R19, M19, V19) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8), (uint8_t)((MODE) & 0xFFU),20, (uint8_t)((uint16_t)(R0) >> 8), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \
|
||||
, (uint8_t)((uint16_t)(R6) >> 8), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \
|
||||
, (uint8_t)((uint16_t)(R7) >> 8), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \
|
||||
, (uint8_t)((uint16_t)(R8) >> 8), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \
|
||||
, (uint8_t)((uint16_t)(R9) >> 8), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \
|
||||
, (uint8_t)((uint16_t)(R10) >> 8), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \
|
||||
, (uint8_t)((uint16_t)(R11) >> 8), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11) \
|
||||
, (uint8_t)((uint16_t)(R12) >> 8), (uint8_t)((R12) & 0xFFU), (uint8_t)(M12), (uint8_t)(V12) \
|
||||
, (uint8_t)((uint16_t)(R13) >> 8), (uint8_t)((R13) & 0xFFU), (uint8_t)(M13), (uint8_t)(V13) \
|
||||
, (uint8_t)((uint16_t)(R14) >> 8), (uint8_t)((R14) & 0xFFU), (uint8_t)(M14), (uint8_t)(V14) \
|
||||
, (uint8_t)((uint16_t)(R15) >> 8), (uint8_t)((R15) & 0xFFU), (uint8_t)(M15), (uint8_t)(V15) \
|
||||
, (uint8_t)((uint16_t)(R16) >> 8), (uint8_t)((R16) & 0xFFU), (uint8_t)(M16), (uint8_t)(V16) \
|
||||
, (uint8_t)((uint16_t)(R17) >> 8), (uint8_t)((R17) & 0xFFU), (uint8_t)(M17), (uint8_t)(V17) \
|
||||
, (uint8_t)((uint16_t)(R18) >> 8), (uint8_t)((R18) & 0xFFU), (uint8_t)(M18), (uint8_t)(V18) \
|
||||
, (uint8_t)((uint16_t)(R19) >> 8), (uint8_t)((R19) & 0xFFU), (uint8_t)(M19), (uint8_t)(V19)
|
||||
|
||||
/*! Macro for Configuration Setting with seventeen register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_21_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11, R12, M12, V12, R13, M13, V13, R14, M14, V14, R15, M15, V15, R16, M16, V16, R17, M17, V17, R18, M18, V18, R19, M19, V19, R20, M20, V20) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8), (uint8_t)((MODE) & 0xFFU),21, (uint8_t)((uint16_t)(R0) >> 8), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \
|
||||
, (uint8_t)((uint16_t)(R6) >> 8), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \
|
||||
, (uint8_t)((uint16_t)(R7) >> 8), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \
|
||||
, (uint8_t)((uint16_t)(R8) >> 8), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \
|
||||
, (uint8_t)((uint16_t)(R9) >> 8), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \
|
||||
, (uint8_t)((uint16_t)(R10) >> 8), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \
|
||||
, (uint8_t)((uint16_t)(R11) >> 8), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11) \
|
||||
, (uint8_t)((uint16_t)(R12) >> 8), (uint8_t)((R12) & 0xFFU), (uint8_t)(M12), (uint8_t)(V12) \
|
||||
, (uint8_t)((uint16_t)(R13) >> 8), (uint8_t)((R13) & 0xFFU), (uint8_t)(M13), (uint8_t)(V13) \
|
||||
, (uint8_t)((uint16_t)(R14) >> 8), (uint8_t)((R14) & 0xFFU), (uint8_t)(M14), (uint8_t)(V14) \
|
||||
, (uint8_t)((uint16_t)(R15) >> 8), (uint8_t)((R15) & 0xFFU), (uint8_t)(M15), (uint8_t)(V15) \
|
||||
, (uint8_t)((uint16_t)(R16) >> 8), (uint8_t)((R16) & 0xFFU), (uint8_t)(M16), (uint8_t)(V16) \
|
||||
, (uint8_t)((uint16_t)(R17) >> 8), (uint8_t)((R17) & 0xFFU), (uint8_t)(M17), (uint8_t)(V17) \
|
||||
, (uint8_t)((uint16_t)(R18) >> 8), (uint8_t)((R18) & 0xFFU), (uint8_t)(M18), (uint8_t)(V18) \
|
||||
, (uint8_t)((uint16_t)(R19) >> 8), (uint8_t)((R19) & 0xFFU), (uint8_t)(M19), (uint8_t)(V19) \
|
||||
, (uint8_t)((uint16_t)(R20) >> 8), (uint8_t)((R20) & 0xFFU), (uint8_t)(M20), (uint8_t)(V20)
|
||||
|
||||
/*! Macro for Configuration Setting with seventeen register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_22_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11, R12, M12, V12, R13, M13, V13, R14, M14, V14, R15, M15, V15, R16, M16, V16, R17, M17, V17, R18, M18, V18, R19, M19, V19, R20, M20, V20, R21, M21, V21) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8), (uint8_t)((MODE) & 0xFFU),22, (uint8_t)((uint16_t)(R0) >> 8), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \
|
||||
, (uint8_t)((uint16_t)(R6) >> 8), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \
|
||||
, (uint8_t)((uint16_t)(R7) >> 8), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \
|
||||
, (uint8_t)((uint16_t)(R8) >> 8), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \
|
||||
, (uint8_t)((uint16_t)(R9) >> 8), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \
|
||||
, (uint8_t)((uint16_t)(R10) >> 8), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \
|
||||
, (uint8_t)((uint16_t)(R11) >> 8), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11) \
|
||||
, (uint8_t)((uint16_t)(R12) >> 8), (uint8_t)((R12) & 0xFFU), (uint8_t)(M12), (uint8_t)(V12) \
|
||||
, (uint8_t)((uint16_t)(R13) >> 8), (uint8_t)((R13) & 0xFFU), (uint8_t)(M13), (uint8_t)(V13) \
|
||||
, (uint8_t)((uint16_t)(R14) >> 8), (uint8_t)((R14) & 0xFFU), (uint8_t)(M14), (uint8_t)(V14) \
|
||||
, (uint8_t)((uint16_t)(R15) >> 8), (uint8_t)((R15) & 0xFFU), (uint8_t)(M15), (uint8_t)(V15) \
|
||||
, (uint8_t)((uint16_t)(R16) >> 8), (uint8_t)((R16) & 0xFFU), (uint8_t)(M16), (uint8_t)(V16) \
|
||||
, (uint8_t)((uint16_t)(R17) >> 8), (uint8_t)((R17) & 0xFFU), (uint8_t)(M17), (uint8_t)(V17) \
|
||||
, (uint8_t)((uint16_t)(R18) >> 8), (uint8_t)((R18) & 0xFFU), (uint8_t)(M18), (uint8_t)(V18) \
|
||||
, (uint8_t)((uint16_t)(R19) >> 8), (uint8_t)((R19) & 0xFFU), (uint8_t)(M19), (uint8_t)(V19) \
|
||||
, (uint8_t)((uint16_t)(R20) >> 8), (uint8_t)((R20) & 0xFFU), (uint8_t)(M20), (uint8_t)(V20) \
|
||||
, (uint8_t)((uint16_t)(R21) >> 8), (uint8_t)((R21) & 0xFFU), (uint8_t)(M21), (uint8_t)(V21)
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL DATA TYPES
|
||||
******************************************************************************
|
||||
*/
|
||||
/* PRQA S 3674 2 # CERT ARR02 - Flexible array will be used with sizeof, on adding elements error-prone manual update of size would be required */
|
||||
/* PRQA S 3406 1 # MISRA 8.6 - Externally generated table included by the library */ /* PRQA S 1514 1 # MISRA 8.9 - Externally generated table included by the library */
|
||||
const uint8_t rfalAnalogConfigDefaultSettings[] = {
|
||||
|
||||
/****** Default Analog Configuration for Chip-Specific Reset ******/
|
||||
MODE_ENTRY_7_REG( (RFAL_ANALOG_CONFIG_TECH_CHIP | RFAL_ANALOG_CONFIG_CHIP_INIT)
|
||||
, ST25R200_REG_GENERAL, ST25R200_REG_GENERAL_miso_pd_mask, (ST25R200_REG_GENERAL_miso_pd1 | ST25R200_REG_GENERAL_miso_pd2) /* SPI MISO Pull downs */
|
||||
, ST25R200_REG_OPERATION, ST25R200_REG_OPERATION_am_en, ST25R200_REG_OPERATION_am_en /* Enable AM Regulator */
|
||||
, ST25R200_REG_TX_MOD, (ST25R200_REG_TX_MOD_reg_am | ST25R200_REG_TX_MOD_reg_am), ST25R200_REG_TX_MOD_reg_am /* Use AM via regulator */
|
||||
, ST25R200_REG_TX_MOD, ST25R200_REG_TX_MOD_am_mod_mask, ST25R200_REG_TX_MOD_am_mod_12percent /* Set Modulation index */
|
||||
, ST25R200_REG_TX_DRIVER, ST25R200_REG_TX_DRIVER_d_res_mask, 0x00 /* Set RFO resistance Active Tx */
|
||||
, ST25R200_REG_CORR5, ST25R200_REG_CORR5_en_subc_end, ST25R200_REG_CORR5_en_subc_end /* Enable fast subcarrier end detection */
|
||||
, ST25R200_REG_RX_ANA2, ST25R200_REG_RX_ANA2_afe_gain_td_mask, 0x04 /* Increased Gain for WU mode */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-A Tx 106 ******/
|
||||
, MODE_ENTRY_1_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCA | RFAL_ANALOG_CONFIG_BITRATE_106 | RFAL_ANALOG_CONFIG_TX)
|
||||
, ST25R200_REG_PROTOCOL_TX1, ST25R200_REG_PROTOCOL_TX1_tr_am, 0x00 /* Use OOK */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-A Rx 106 ******/
|
||||
, MODE_ENTRY_4_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCA | RFAL_ANALOG_CONFIG_BITRATE_106 | RFAL_ANALOG_CONFIG_RX)
|
||||
, ST25R200_REG_RX_DIG, (ST25R200_REG_RX_DIG_lpf_coef_mask | ST25R200_REG_RX_DIG_hpf_coef_mask), 0x4C
|
||||
, ST25R200_REG_CORR1, (ST25R200_REG_CORR1_iir_coef2_mask | ST25R200_REG_CORR1_iir_coef1_mask), 0xC3
|
||||
, ST25R200_REG_CORR5, ST25R200_REG_CORR5_dec_f_mask, 0x02
|
||||
, ST25R200_REG_CORR4, (ST25R200_REG_CORR4_coll_lvl_mask | ST25R200_REG_CORR4_data_lvl_mask), 0xAA
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-A Anticolision setting ******/
|
||||
, MODE_ENTRY_1_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCA | RFAL_ANALOG_CONFIG_BITRATE_COMMON | RFAL_ANALOG_CONFIG_ANTICOL)
|
||||
, ST25R200_REG_CORR4, ST25R200_REG_CORR4_coll_lvl_mask, 0x70 /* Lower collision level during anticollision */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-B Tx 106 ******/
|
||||
, MODE_ENTRY_1_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCB | RFAL_ANALOG_CONFIG_BITRATE_106 | RFAL_ANALOG_CONFIG_TX)
|
||||
, ST25R200_REG_PROTOCOL_TX1, ST25R200_REG_PROTOCOL_TX1_tr_am, ST25R200_REG_PROTOCOL_TX1_tr_am /* Use AM */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-B Rx 106 ******/
|
||||
, MODE_ENTRY_4_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCB | RFAL_ANALOG_CONFIG_BITRATE_106 | RFAL_ANALOG_CONFIG_RX)
|
||||
, ST25R200_REG_RX_DIG, (ST25R200_REG_RX_DIG_lpf_coef_mask | ST25R200_REG_RX_DIG_hpf_coef_mask), 0x4C
|
||||
, ST25R200_REG_CORR1, (ST25R200_REG_CORR1_iir_coef2_mask | ST25R200_REG_CORR1_iir_coef1_mask), 0xC1
|
||||
, ST25R200_REG_CORR5, ST25R200_REG_CORR5_dec_f_mask, 0x03
|
||||
, ST25R200_REG_CORR4, ST25R200_REG_CORR4_data_lvl_mask, 0x07 /* Lower data level for NFC-B */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-V Tx Common ******/
|
||||
, MODE_ENTRY_1_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCV | RFAL_ANALOG_CONFIG_BITRATE_COMMON | RFAL_ANALOG_CONFIG_TX)
|
||||
, ST25R200_REG_PROTOCOL_TX1, ST25R200_REG_PROTOCOL_TX1_tr_am, 0x00 /* Use OOK */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-V Rx Common ******/
|
||||
, MODE_ENTRY_2_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCV | RFAL_ANALOG_CONFIG_BITRATE_COMMON | RFAL_ANALOG_CONFIG_RX)
|
||||
, ST25R200_REG_RX_DIG, (ST25R200_REG_RX_DIG_lpf_coef_mask | ST25R200_REG_RX_DIG_hpf_coef_mask), 0x08
|
||||
, ST25R200_REG_CORR1, (ST25R200_REG_CORR1_iir_coef2_mask | ST25R200_REG_CORR1_iir_coef1_mask), 0xC0
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-V Anticolision setting ******/
|
||||
, MODE_ENTRY_1_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCV | RFAL_ANALOG_CONFIG_BITRATE_COMMON | RFAL_ANALOG_CONFIG_ANTICOL)
|
||||
, ST25R200_REG_CORR4, ST25R200_REG_CORR4_coll_lvl_mask, 0x70 /* Lower collision level during anticollision */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-V Rx 26 ******/
|
||||
, MODE_ENTRY_2_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCV | RFAL_ANALOG_CONFIG_BITRATE_26 | RFAL_ANALOG_CONFIG_RX)
|
||||
, ST25R200_REG_CORR5, ST25R200_REG_CORR5_dec_f_mask, 0x04
|
||||
, ST25R200_REG_CORR4, (ST25R200_REG_CORR4_coll_lvl_mask | ST25R200_REG_CORR4_data_lvl_mask), 0xAA /* Restore default levels */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-V Rx 53 ******/
|
||||
, MODE_ENTRY_2_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCV | RFAL_ANALOG_CONFIG_BITRATE_53 | RFAL_ANALOG_CONFIG_RX)
|
||||
, ST25R200_REG_CORR5, ST25R200_REG_CORR5_dec_f_mask, 0x03
|
||||
, ST25R200_REG_CORR4, (ST25R200_REG_CORR4_coll_lvl_mask | ST25R200_REG_CORR4_data_lvl_mask), 0xAA /* Restore default levels */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Wake-up On ******/
|
||||
, MODE_ENTRY_1_REG( (RFAL_ANALOG_CONFIG_TECH_CHIP | RFAL_ANALOG_CONFIG_CHIP_WAKEUP_ON)
|
||||
, 0x89U, 0x01U, 0x01U /* Prevent VDD_A discharge during WU (AN5993) */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Wake-up Off ******/
|
||||
, MODE_ENTRY_2_REG( (RFAL_ANALOG_CONFIG_TECH_CHIP | RFAL_ANALOG_CONFIG_CHIP_WAKEUP_OFF)
|
||||
, ST25R200_REG_OPERATION, ST25R200_REG_OPERATION_am_en, ST25R200_REG_OPERATION_am_en /* Re-enable AM Regulator */
|
||||
, 0x89U, 0x01U, 0x00U /* Restore VDD_A config for RD mode */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Low Power Off ******/
|
||||
, MODE_ENTRY_1_REG( (RFAL_ANALOG_CONFIG_TECH_CHIP | RFAL_ANALOG_CONFIG_CHIP_LOWPOWER_OFF)
|
||||
, ST25R200_REG_OPERATION, ST25R200_REG_OPERATION_am_en, ST25R200_REG_OPERATION_am_en /* Re-enable AM Regulator */
|
||||
)
|
||||
|
||||
};
|
||||
|
||||
#endif /* ST25R200_ANALOGCONFIG_H */
|
||||
@@ -0,0 +1,46 @@
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file rfal_dpoTbl.h
|
||||
* @author MMY Application Team
|
||||
* @brief RF Dynamic Power Table default values
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2021 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.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef ST25R200_DPO_H
|
||||
#define ST25R200_DPO_H
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* INCLUDES
|
||||
******************************************************************************
|
||||
*/
|
||||
#include "rfal_dpo.h"
|
||||
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL DATA TYPES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/*! Default DPO table */
|
||||
/* PRQA S 3674 2 # CERT ARR02 - Flexible array will be used with sizeof, on adding elements error-prone manual update of size would be required */
|
||||
/* PRQA S 3406 1 # MISRA 8.6 - Externally generated table included by the library */ /* PRQA S 1514 1 # MISRA 8.9 - Externally generated table included by the library */
|
||||
const rfalDpoEntry rfalDpoDefaultSettings [] = {
|
||||
{ 0x00, 150, 100 },
|
||||
{ 0x09, 110, 50 },
|
||||
{ 0x0A, 60, 0 }
|
||||
};
|
||||
|
||||
#endif /* ST25R200_DPO_H */
|
||||
@@ -0,0 +1,211 @@
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file rfal_features.h
|
||||
* @author MMY Application Team
|
||||
* @brief RFAL Features/Capabilities Definition for ST25R200
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2021 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.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef RFAL_FEATURES_H
|
||||
#define RFAL_FEATURES_H
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* INCLUDES
|
||||
******************************************************************************
|
||||
*/
|
||||
#include "rfal_platform.h"
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL DEFINES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#define RFAL_SUPPORT_MODE_POLL_NFCA true /*!< RFAL Poll NFCA mode support switch */
|
||||
#define RFAL_SUPPORT_MODE_POLL_NFCB true /*!< RFAL Poll NFCB mode support switch */
|
||||
#define RFAL_SUPPORT_MODE_POLL_NFCF false /*!< RFAL Poll NFCF mode support switch */
|
||||
#define RFAL_SUPPORT_MODE_POLL_NFCV true /*!< RFAL Poll NFCV mode support switch */
|
||||
#define RFAL_SUPPORT_MODE_POLL_ACTIVE_P2P false /*!< RFAL Poll AP2P mode support switch */
|
||||
#define RFAL_SUPPORT_MODE_LISTEN_NFCA false /*!< RFAL Listen NFCA mode support switch */
|
||||
#define RFAL_SUPPORT_MODE_LISTEN_NFCB false /*!< RFAL Listen NFCB mode support switch */
|
||||
#define RFAL_SUPPORT_MODE_LISTEN_NFCF false /*!< RFAL Listen NFCF mode support switch */
|
||||
#define RFAL_SUPPORT_MODE_LISTEN_ACTIVE_P2P false /*!< RFAL Listen AP2P mode support switch */
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
/*! RFAL supported Card Emulation (CE) */
|
||||
#define RFAL_SUPPORT_CE ( RFAL_SUPPORT_MODE_LISTEN_NFCA || RFAL_SUPPORT_MODE_LISTEN_NFCB || RFAL_SUPPORT_MODE_LISTEN_NFCF )
|
||||
|
||||
/*! RFAL supported Reader/Writer (RW) */
|
||||
#define RFAL_SUPPORT_RW ( RFAL_SUPPORT_MODE_POLL_NFCA || RFAL_SUPPORT_MODE_POLL_NFCB || RFAL_SUPPORT_MODE_POLL_NFCF || RFAL_SUPPORT_MODE_POLL_NFCV )
|
||||
|
||||
/*! RFAL support for Active P2P (AP2P) */
|
||||
#define RFAL_SUPPORT_AP2P ( RFAL_SUPPORT_MODE_POLL_ACTIVE_P2P || RFAL_SUPPORT_MODE_LISTEN_ACTIVE_P2P )
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
#define RFAL_SUPPORT_BR_RW_26 true /*!< RFAL RW 26 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_RW_53 true /*!< RFAL RW 53 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_RW_106 true /*!< RFAL RW 106 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_RW_212 false /*!< RFAL RW 212 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_RW_424 false /*!< RFAL RW 424 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_RW_848 false /*!< RFAL RW 848 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_RW_1695 false /*!< RFAL RW 1695 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_RW_3390 false /*!< RFAL RW 3390 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_RW_6780 false /*!< RFAL RW 6780 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_RW_13560 false /*!< RFAL RW 6780 Bit Rate support switch */
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
#define RFAL_SUPPORT_BR_AP2P_106 false /*!< RFAL AP2P 106 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_AP2P_212 false /*!< RFAL AP2P 212 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_AP2P_424 false /*!< RFAL AP2P 424 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_AP2P_848 false /*!< RFAL AP2P 848 Bit Rate support switch */
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
#define RFAL_SUPPORT_BR_CE_A_106 false /*!< RFAL CE A 106 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_CE_A_212 false /*!< RFAL CE A 212 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_CE_A_424 false /*!< RFAL CE A 424 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_CE_A_848 false /*!< RFAL CE A 848 Bit Rate support switch */
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
#define RFAL_SUPPORT_BR_CE_B_106 false /*!< RFAL CE B 106 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_CE_B_212 false /*!< RFAL CE B 212 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_CE_B_424 false /*!< RFAL CE B 424 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_CE_B_848 false /*!< RFAL CE B 848 Bit Rate support switch */
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
#define RFAL_SUPPORT_BR_CE_F_212 false /*!< RFAL CE F 212 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_CE_F_424 false /*!< RFAL CE F 424 Bit Rate support switch */
|
||||
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* DEVICE SPECIFIC FEATURE DEFINITIONS
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/*! RFAL Wake-Up Period/Timer */
|
||||
typedef enum
|
||||
{
|
||||
RFAL_WUM_PERIOD_10MS = 0x00, /*!< Wake-Up timer ~9.7ms */
|
||||
RFAL_WUM_PERIOD_15MS = 0x01, /*!< Wake-Up timer ~13.3ms */
|
||||
RFAL_WUM_PERIOD_20MS = 0x02, /*!< Wake-Up timer ~19.3ms */
|
||||
RFAL_WUM_PERIOD_25MS = 0x03, /*!< Wake-Up timer ~26.6ms */
|
||||
RFAL_WUM_PERIOD_40MS = 0x04, /*!< Wake-Up timer ~38.7ms */
|
||||
RFAL_WUM_PERIOD_55MS = 0x05, /*!< Wake-Up timer ~53.2ms */
|
||||
RFAL_WUM_PERIOD_80MS = 0x06, /*!< Wake-Up timer ~77.3ms */
|
||||
RFAL_WUM_PERIOD_105MS = 0x07, /*!< Wake-Up timer ~106.3ms */
|
||||
RFAL_WUM_PERIOD_155MS = 0x08, /*!< Wake-Up timer ~154.7ms */
|
||||
RFAL_WUM_PERIOD_215MS = 0x09, /*!< Wake-Up timer ~212.7ms */
|
||||
RFAL_WUM_PERIOD_310MS = 0x0A, /*!< Wake-Up timer ~309.3ms */
|
||||
RFAL_WUM_PERIOD_425MS = 0x0B, /*!< Wake-Up timer ~425.3ms */
|
||||
RFAL_WUM_PERIOD_620MS = 0x0C, /*!< Wake-Up timer ~618.6ms */
|
||||
RFAL_WUM_PERIOD_850MS = 0x0D, /*!< Wake-Up timer ~850.6ms */
|
||||
RFAL_WUM_PERIOD_1240MS = 0x0E, /*!< Wake-Up timer ~1237.3ms */
|
||||
RFAL_WUM_PERIOD_1700MS = 0x0F, /*!< Wake-Up timer ~1701.2ms */
|
||||
} rfalWumPeriod;
|
||||
|
||||
|
||||
/*! RFAL Wake-Up Period/Timer */
|
||||
typedef enum
|
||||
{
|
||||
RFAL_WUM_AA_WEIGHT_4 = 0x00, /*!< Wake-Up Auto Average Weight 4 */
|
||||
RFAL_WUM_AA_WEIGHT_8 = 0x01, /*!< Wake-Up Auto Average Weight 8 */
|
||||
RFAL_WUM_AA_WEIGHT_16 = 0x02, /*!< Wake-Up Auto Average Weight 16 */
|
||||
RFAL_WUM_AA_WEIGHT_32 = 0x03, /*!< Wake-Up Auto Average Weight 32 */
|
||||
} rfalWumAAWeight;
|
||||
|
||||
|
||||
/*! RFAL Wake-Up mesurement duration */
|
||||
typedef enum {
|
||||
RFAL_WUM_MEAS_DUR_26_10 = 0, /*!< WU measurement duration: 26.0us (slow) / 10.6us (fast) */
|
||||
RFAL_WUM_MEAS_DUR_30_14 = 1, /*!< WU measurement duration: 29.5us (slow) / 14.2us (fast) */
|
||||
RFAL_WUM_MEAS_DUR_34_19 = 2, /*!< WU measurement duration: 34.2us (slow) / 18.9us (fast) */
|
||||
RFAL_WUM_MEAS_DUR_44_28 = 3, /*!< WU measurement duration: 43.7us (slow) / 28.3us (fast) */
|
||||
}rfalWumMeasDuration;
|
||||
|
||||
|
||||
/*! RFAL Wake-Up mesurement filter */
|
||||
typedef enum {
|
||||
RFAL_WUM_MEAS_FIL_SLOW = false, /*!< Wake-Up measurement slow filter */
|
||||
RFAL_WUM_MEAS_FIL_FAST = true, /*!< Wake-up measurement fast filter */
|
||||
}rfalWumMeasFilter;
|
||||
|
||||
|
||||
|
||||
/*! RFAL Wake-Up trigger tresholds for threshold bitmask config */
|
||||
enum {
|
||||
RFAL_WUM_TRE_ABOVE = (1U<<2), /*!< Wake-up trigger threshold: above upper limit */
|
||||
RFAL_WUM_TRE_BETWEEN = (1U<<1), /*!< Wake-up trigger threshold: between upper and lower limit */
|
||||
RFAL_WUM_TRE_BELOW = (1U<<0), /*!< Wake-up trigger threshold: below lower limit */
|
||||
};
|
||||
|
||||
|
||||
/*! RFAL Wake-Up channel configuration */
|
||||
typedef struct {
|
||||
bool enabled; /*!< Inductive Amplitude measurement enabled */
|
||||
uint8_t delta; /*!< Delta between the reference and measurement to wake-up */
|
||||
uint8_t reference; /*!< Reference to be used;RFAL_WUM_REFERENCE_AUTO sets it auto */
|
||||
uint8_t threshold; /*!< Wake-Up trigger treshold bitmask */
|
||||
bool aaInclMeas; /*!< When AutoAvg is enabled, include IRQ measurement */
|
||||
rfalWumAAWeight aaWeight; /*!< When AutoAvg is enabled, last measure weight */
|
||||
}rfalWumMeasChannel;
|
||||
|
||||
|
||||
/*! RFAL Wake-Up Mode configuration */
|
||||
typedef struct rfalWakeUpConfig
|
||||
{
|
||||
rfalWumPeriod period; /*!< Wake-Up Timer period;how often measurement(s) is performed */
|
||||
bool irqTout; /*!< IRQ at every timeout will refresh the measurement(s) */
|
||||
bool autoAvg; /*!< Use the HW Auto Averaging feature on the enabled channel(s)*/
|
||||
bool skipCal; /*!< Do not preform calibration starting WU mode */
|
||||
bool skipReCal; /*!< Do not preform recalibration during WU mode */
|
||||
bool delCal; /*!< Delay calibration step starting WU mode */
|
||||
bool delRef; /*!< Delay reference step starting WU mode */
|
||||
rfalWumMeasDuration measDur; /*!< Wake-up measurement duration config */
|
||||
rfalWumMeasFilter measFil; /*!< Wake-up measurement filter config */
|
||||
|
||||
rfalWumMeasChannel I; /*!< I channel Configuration */
|
||||
rfalWumMeasChannel Q; /*!< Q channel Configuration */
|
||||
|
||||
} rfalWakeUpConfig;
|
||||
|
||||
|
||||
/*! RFAL Wake-Up Mode information */
|
||||
typedef struct
|
||||
{
|
||||
bool irqWut; /*!< Wake-Up Timer IRQ received (cleared upon read) */
|
||||
uint8_t status; /*!< Wake-Up status */
|
||||
|
||||
struct{
|
||||
uint8_t lastMeas; /*!< Value of the latest measurement */
|
||||
uint8_t reference; /*!< Current reference value */
|
||||
uint8_t calib; /*!< Current calibration value */
|
||||
bool irqWu; /*!< Amplitude WU IRQ received (cleared upon read) */
|
||||
}I; /*!< I channel Information */
|
||||
|
||||
struct{
|
||||
uint8_t lastMeas; /*!< Value of the latest measurement */
|
||||
uint8_t reference; /*!< Current reference value */
|
||||
uint8_t calib; /*!< Current calibration value */
|
||||
bool irqWu; /*!< Phase WU IRQ received (cleared upon read) */
|
||||
}Q; /*!< Q channel Information */
|
||||
} rfalWakeUpInfo;
|
||||
|
||||
#endif /* RFAL_FEATURES_H */
|
||||
@@ -0,0 +1,731 @@
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file st25r200.c
|
||||
* @author MMY Application Team
|
||||
* @brief ST25R200 High Level interface
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2021 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 "st25r200.h"
|
||||
#include "st25r200_com.h"
|
||||
#include "st25r200_irq.h"
|
||||
#include "rfal_utils.h"
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* ENABLE SWITCH
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef ST25R200
|
||||
#error "RFAL: Missing ST25R device selection. Please globally define ST25R200."
|
||||
#endif /* ST25R200 */
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* LOCAL DEFINES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#define ST25R200_SUPPLY_THRESHOLD 3600U /*!< Power supply measure threshold between 3.3V or 5V */
|
||||
#define ST25R200_NRT_MAX 0xFFFFU /*!< Max Register value of NRT */
|
||||
|
||||
#define ST25R200_RESET_DUR 1U /*!< Reset high duration */
|
||||
#define ST25R200_TOUT_MEASUREMENT 2U /*!< Max duration time of WU Measure|Calibration */
|
||||
#define ST25R200_TOUT_OSC_STABLE 5U /*!< Timeout for Oscillator to get stable */
|
||||
#define ST25R200_TOUT_ADJUST_REGULATORS 10U /*!< Max Adjust Regulators duration */
|
||||
#define ST25R200_TOUT_AGD_OK 2U /*!< Max time for AGD to become stable */
|
||||
|
||||
#define ST25R200_TEST_REG_PATTERN 0x33U /*!< Register Read Write test pattern used during selftest */
|
||||
#define ST25R200_TEST_WU_TOUT 11U /*!< Timeout used on WU timer during self test */
|
||||
#define ST25R200_TEST_TMR_TOUT 20U /*!< Timeout used during self test */
|
||||
#define ST25R200_TEST_TMR_TOUT_DELTA 2U /*!< Timeout used during self test */
|
||||
#define ST25R200_TEST_TMR_TOUT_8FC (ST25R200_TEST_TMR_TOUT * 1695U) /*!< Timeout in 8/fc */
|
||||
|
||||
#define ST25R200_TEST_FD_TRESHOLD 60U /*!< External carrier presence treshold */
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* LOCAL CONSTANTS
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* LOCAL VARIABLES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
static uint32_t gST25R200NRT_64fcs;
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* LOCAL FUNCTION PROTOTYPES
|
||||
******************************************************************************
|
||||
*/
|
||||
static ReturnCode st25r200WaitAgd( void );
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* LOCAL FUNCTION
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************/
|
||||
static ReturnCode st25r200WaitAgd( void )
|
||||
{
|
||||
uint32_t ts;
|
||||
|
||||
/* Wait for AGD to become stable whithin a max ST25R200_TOUT_AGD_OK */
|
||||
ts = platformGetSysTick();
|
||||
while( (platformGetSysTick() < (ts + ST25R200_TOUT_AGD_OK)) )
|
||||
{
|
||||
if( st25r200CheckReg( ST25R200_REG_DISPLAY1, ST25R200_REG_DISPLAY1_agd_ok, ST25R200_REG_DISPLAY1_agd_ok ) )
|
||||
{
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
return RFAL_ERR_SYSTEM;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL FUNCTIONS
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
ReturnCode st25r200Initialize( void )
|
||||
{
|
||||
ReturnCode ret;
|
||||
|
||||
/* Ensure a defined chip select state */
|
||||
platformSpiDeselect();
|
||||
|
||||
#ifdef ST25R_RESET_PIN
|
||||
/* Reset the ST25R200 using the RESET pin */
|
||||
platformGpioSet( ST25R_RESET_PORT, ST25R_RESET_PIN );
|
||||
platformDelay( ST25R200_RESET_DUR );
|
||||
platformGpioClear( ST25R_RESET_PORT, ST25R_RESET_PIN );
|
||||
platformDelay( ST25R200_RESET_DUR );
|
||||
#endif /* ST25R_RESET_PIN */
|
||||
|
||||
/* Set default state on the ST25R200 */
|
||||
st25r200ExecuteCommand( ST25R200_CMD_SET_DEFAULT );
|
||||
if( !st25r200CheckChipID( NULL ) )
|
||||
{
|
||||
platformErrorHandle();
|
||||
return RFAL_ERR_HW_MISMATCH;
|
||||
}
|
||||
|
||||
st25r200InitInterrupts();
|
||||
st25r200ledInit();
|
||||
|
||||
gST25R200NRT_64fcs = 0;
|
||||
|
||||
|
||||
#ifdef ST25R_SELFTEST
|
||||
|
||||
/******************************************************************************
|
||||
* Check communication interface:
|
||||
* - write a pattern in a register
|
||||
* - reads back the register value
|
||||
* - return RFAL_ERR_IO in case the read value is different
|
||||
*/
|
||||
st25r200WriteRegister( ST25R200_REG_WAKEUP_CONF2, ST25R200_TEST_REG_PATTERN );
|
||||
if( !st25r200CheckReg( ST25R200_REG_WAKEUP_CONF2, 0xFFU, ST25R200_TEST_REG_PATTERN ) )
|
||||
{
|
||||
platformErrorHandle();
|
||||
return RFAL_ERR_IO;
|
||||
}
|
||||
|
||||
/* Restore default value */
|
||||
st25r200WriteRegister( ST25R200_REG_WAKEUP_CONF2, 0x00U );
|
||||
|
||||
/*
|
||||
* Check IRQ Handling:
|
||||
* - use the Wake-up timer to trigger an IRQ
|
||||
* - wait the Wake-up timer interrupt
|
||||
* - return RFAL_ERR_TIMEOUT when the Wake-up timer interrupt is not received
|
||||
*/
|
||||
st25r200WriteRegister( ST25R200_REG_WAKEUP_CONF1, ST25R200_REG_WAKEUP_CONF1_wuti );
|
||||
st25r200EnableInterrupts( ST25R200_IRQ_MASK_WUT );
|
||||
st25r200ExecuteCommand( ST25R200_CMD_START_WUP_TIMER );
|
||||
|
||||
if( st25r200WaitForInterruptsTimed(ST25R200_IRQ_MASK_WUT, ST25R200_TEST_WU_TOUT) == 0U )
|
||||
{
|
||||
platformErrorHandle();
|
||||
return RFAL_ERR_TIMEOUT;
|
||||
}
|
||||
|
||||
st25r200DisableInterrupts( ST25R200_IRQ_MASK_WUT );
|
||||
st25r200WriteRegister( ST25R200_REG_WAKEUP_CONF1, 0x00U );
|
||||
/*******************************************************************************/
|
||||
|
||||
#endif /* ST25R_SELFTEST */
|
||||
|
||||
|
||||
/* Enable Oscillator and wait until it gets stable */
|
||||
RFAL_EXIT_ON_ERR( ret, st25r200OscOn() );
|
||||
|
||||
/* Make sure Transmitter and Receiver are disabled */
|
||||
st25r200TxRxOff();
|
||||
|
||||
|
||||
#ifdef ST25R_SELFTEST_TIMER
|
||||
/******************************************************************************
|
||||
* Check SW timer operation :
|
||||
* - use the General Purpose timer to measure an amount of time
|
||||
* - test whether an interrupt is seen when less time was given
|
||||
* - test whether an interrupt is seen when sufficient time was given
|
||||
*/
|
||||
|
||||
st25r200EnableInterrupts( ST25R200_IRQ_MASK_GPE );
|
||||
st25r200SetStartGPTimer( (uint16_t)ST25R200_TEST_TMR_TOUT_8FC, ST25R200_REG_NRT_GPT_CONF_gptc_no_trigger);
|
||||
if( st25r200WaitForInterruptsTimed( ST25R200_IRQ_MASK_GPE, (ST25R200_TEST_TMR_TOUT - ST25R200_TEST_TMR_TOUT_DELTA)) != 0U )
|
||||
{
|
||||
platformErrorHandle();
|
||||
return RFAL_ERR_SYSTEM;
|
||||
}
|
||||
|
||||
/* Stop all activities to stop the GP timer */
|
||||
st25r200ExecuteCommand( ST25R200_CMD_STOP );
|
||||
st25r200ClearAndEnableInterrupts( ST25R200_IRQ_MASK_GPE );
|
||||
st25r200SetStartGPTimer( (uint16_t)ST25R200_TEST_TMR_TOUT_8FC, ST25R200_REG_NRT_GPT_CONF_gptc_no_trigger );
|
||||
if(st25r200WaitForInterruptsTimed( ST25R200_IRQ_MASK_GPE, (ST25R200_TEST_TMR_TOUT + ST25R200_TEST_TMR_TOUT_DELTA)) == 0U )
|
||||
{
|
||||
platformErrorHandle();
|
||||
return RFAL_ERR_SYSTEM;
|
||||
}
|
||||
|
||||
/* Stop all activities to stop the GP timer */
|
||||
st25r200ExecuteCommand( ST25R200_CMD_STOP );
|
||||
/*******************************************************************************/
|
||||
#endif /* ST25R_SELFTEST_TIMER */
|
||||
|
||||
|
||||
/* After reset all interrupts are enabled, so disable them at first */
|
||||
st25r200DisableInterrupts( ST25R200_IRQ_MASK_ALL );
|
||||
|
||||
/* And clear them, just to be sure */
|
||||
st25r200ClearInterrupts();
|
||||
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
void st25r200Deinitialize( void )
|
||||
{
|
||||
/* Stop any ongoing activity */
|
||||
st25r200ExecuteCommand( ST25R200_CMD_STOP );
|
||||
st25r200DisableInterrupts( ST25R200_IRQ_MASK_ALL );
|
||||
|
||||
/* Set the device in PD mode */
|
||||
st25r200ClrRegisterBits( ST25R200_REG_OPERATION, ( ST25R200_REG_OPERATION_en | ST25R200_REG_OPERATION_rx_en |
|
||||
ST25R200_REG_OPERATION_wu_en | ST25R200_REG_OPERATION_tx_en | ST25R200_REG_OPERATION_am_en) );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r200OscOn( void )
|
||||
{
|
||||
ReturnCode ret;
|
||||
uint8_t reg;
|
||||
|
||||
/* Check if oscillator is already turned on and stable */
|
||||
/* Use ST25R200_REG_OP_CONTROL_en instead of ST25R200_REG_AUX_DISPLAY_osc_ok to be on the safe side */
|
||||
if( !st25r200IsOscOn() )
|
||||
{
|
||||
/* Clear any eventual previous oscillator frequency stable IRQ and enable it */
|
||||
st25r200ClearAndEnableInterrupts( ST25R200_IRQ_MASK_OSC );
|
||||
|
||||
/* Clear any oscillator IRQ that was potentially pending on ST25R */
|
||||
st25r200GetInterrupt( ST25R200_IRQ_MASK_OSC );
|
||||
|
||||
/* Enable oscillator and regulator output */
|
||||
st25r200SetRegisterBits( ST25R200_REG_OPERATION, ST25R200_REG_OPERATION_en );
|
||||
|
||||
/* Wait for the oscillator interrupt */
|
||||
st25r200WaitForInterruptsTimed( ST25R200_IRQ_MASK_OSC, ST25R200_TOUT_OSC_STABLE );
|
||||
st25r200DisableInterrupts( ST25R200_IRQ_MASK_OSC );
|
||||
}
|
||||
|
||||
st25r200ReadRegister( ST25R200_REG_DISPLAY1, ® );
|
||||
|
||||
/* Ensure osc_ok flag is set */
|
||||
if( (reg & ST25R200_REG_DISPLAY1_osc_ok) != ST25R200_REG_DISPLAY1_osc_ok )
|
||||
{
|
||||
return RFAL_ERR_SYSTEM;
|
||||
}
|
||||
|
||||
/* Check whether AGD has become stable and wait if needed */
|
||||
if( (reg & ST25R200_REG_DISPLAY1_agd_ok) != ST25R200_REG_DISPLAY1_agd_ok )
|
||||
{
|
||||
RFAL_EXIT_ON_ERR( ret, st25r200WaitAgd() );
|
||||
}
|
||||
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r200AdjustRegulators( uint8_t drop, uint16_t* result )
|
||||
{
|
||||
uint8_t res;
|
||||
|
||||
/* Check if target drop is to be updated */
|
||||
if( drop != ST25R200_REG_DROP_DO_NOT_SET )
|
||||
{
|
||||
st25r200ChangeRegisterBits( ST25R200_REG_REGULATOR, ST25R200_REG_REGULATOR_regd_mask, (drop << ST25R200_REG_REGULATOR_regd_shift) );
|
||||
}
|
||||
|
||||
/* Set voltages to be defined by result of Adjust Regulators command */
|
||||
st25r200ClrRegisterBits( ST25R200_REG_GENERAL, ST25R200_REG_GENERAL_reg_s );
|
||||
|
||||
/* Execute Adjust regulators cmd and retrieve result */
|
||||
st25r200ExecuteCommandAndGetResult( ST25R200_CMD_ADJUST_REGULATORS, ST25R200_REG_DISPLAY1, ST25R200_TOUT_ADJUST_REGULATORS, &res );
|
||||
|
||||
/* Calculate result in mV */
|
||||
res = ((res&ST25R200_REG_DISPLAY1_regc_mask)>>ST25R200_REG_DISPLAY1_regc_shift);
|
||||
|
||||
if( result != NULL )
|
||||
{
|
||||
*result = 2620U; /* Minimum regulated voltage 2.62V */
|
||||
*result += ((uint16_t)res * 80U); /* 80mV steps */
|
||||
}
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r200ExecuteCommandAndGetResult( uint8_t cmd, uint8_t resReg, uint8_t tOut, uint8_t* result )
|
||||
{
|
||||
/* Clear and enable Direct Command interrupt */
|
||||
st25r200GetInterrupt( ST25R200_IRQ_MASK_DCT );
|
||||
st25r200EnableInterrupts( ST25R200_IRQ_MASK_DCT );
|
||||
|
||||
st25r200ExecuteCommand( cmd );
|
||||
|
||||
st25r200WaitForInterruptsTimed( ST25R200_IRQ_MASK_DCT, tOut );
|
||||
st25r200DisableInterrupts( ST25R200_IRQ_MASK_DCT );
|
||||
|
||||
/* After execution read out the result if the pointer is not NULL */
|
||||
if( result != NULL )
|
||||
{
|
||||
st25r200ReadRegister( resReg, result );
|
||||
}
|
||||
|
||||
return RFAL_ERR_NONE;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r200MeasureIQ( int8_t* resI, int8_t* resQ )
|
||||
{
|
||||
ReturnCode ret;
|
||||
uint8_t aux;
|
||||
|
||||
RFAL_EXIT_ON_ERR( ret, st25r200ExecuteCommandAndGetResult( ST25R200_CMD_MEASURE_IQ, 0, ST25R200_TOUT_MEASUREMENT, NULL ) );
|
||||
|
||||
if( resI != NULL )
|
||||
{
|
||||
st25r200ReadRegister( ST25R200_REG_WU_I_ADC, &aux );
|
||||
(*resI) = (int8_t)aux;
|
||||
}
|
||||
|
||||
if( resQ != NULL )
|
||||
{
|
||||
st25r200ReadRegister( ST25R200_REG_WU_Q_ADC, &aux );
|
||||
(*resQ) = (int8_t)aux;
|
||||
}
|
||||
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r200MeasureCombinedIQ( uint8_t* res )
|
||||
{
|
||||
ReturnCode ret;
|
||||
uint8_t I;
|
||||
uint8_t Q;
|
||||
int8_t sI;
|
||||
int8_t sQ;
|
||||
|
||||
RFAL_EXIT_ON_ERR( ret, st25r200CalibrateWU( &I, &Q ) );
|
||||
|
||||
if( res != NULL )
|
||||
{
|
||||
sI = (int8_t) ((uint8_t)(I - 0x7FU));
|
||||
sQ = (int8_t) ((uint8_t)(Q - 0x7FU));
|
||||
|
||||
/*******************************************************************************/
|
||||
/* Usage of SQRT from math.h and float. Due to compiler, resources or *
|
||||
* performance issues sqrt may be not enabled by default. Possible use of *
|
||||
* a less accurate aproach such as: */
|
||||
|
||||
#if 0
|
||||
if( sI < 0) { sI *= -1; }
|
||||
if( sQ < 0) { sQ *= -1; }
|
||||
|
||||
(*res) = (uint8_t) ( ( sI + sQ ) / 2U );
|
||||
#else
|
||||
(*res) = (uint8_t) sqrt( (sI * sI) + (sQ * sQ) );
|
||||
#endif
|
||||
|
||||
/* The vector sum of I and Q shall not exceed 127 with proper configuration *
|
||||
* Saturate in SW to ensure this max value */
|
||||
if( *res > (uint8_t)INT8_MAX )
|
||||
{
|
||||
(*res) = INT8_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r200ClearCalibration( void )
|
||||
{
|
||||
return st25r200ExecuteCommand( ST25R200_CMD_CLEAR_WU_CALIB );
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r200CalibrateWU( uint8_t* resI, uint8_t* resQ )
|
||||
{
|
||||
ReturnCode ret;
|
||||
|
||||
RFAL_EXIT_ON_ERR( ret, st25r200ExecuteCommandAndGetResult( ST25R200_CMD_CALIBRATE_WU, 0, ST25R200_TOUT_MEASUREMENT, NULL ) );
|
||||
|
||||
if( resI != NULL )
|
||||
{
|
||||
st25r200ReadRegister( ST25R200_REG_WU_I_CAL, resI );
|
||||
}
|
||||
|
||||
if( resQ != NULL )
|
||||
{
|
||||
st25r200ReadRegister( ST25R200_REG_WU_Q_CAL, resQ );
|
||||
}
|
||||
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r200MeasureWU( uint8_t* resI, uint8_t* resQ )
|
||||
{
|
||||
ReturnCode ret;
|
||||
|
||||
RFAL_EXIT_ON_ERR( ret, st25r200ExecuteCommandAndGetResult( ST25R200_CMD_MEASURE_WU, 0, ST25R200_TOUT_MEASUREMENT, NULL ) );
|
||||
|
||||
if( resI != NULL )
|
||||
{
|
||||
st25r200ReadRegister( ST25R200_REG_WU_I_ADC, resI );
|
||||
}
|
||||
|
||||
if( resQ != NULL )
|
||||
{
|
||||
st25r200ReadRegister( ST25R200_REG_WU_Q_ADC, resQ );
|
||||
}
|
||||
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
bool st25r200IsExtFieldOn( void )
|
||||
{
|
||||
uint8_t val;
|
||||
uint8_t reg;
|
||||
|
||||
if( st25r200IsTxOn() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
val = 0;
|
||||
|
||||
/* Reduce measurement sensitivity */
|
||||
st25r200ReadRegister( ST25R200_REG_RX_ANA2, ® );
|
||||
st25r200WriteRegister( ST25R200_REG_RX_ANA2, ((reg & ~ST25R200_REG_RX_ANA2_afe_gain_td_mask) | ST25R200_REG_RX_ANA2_afe_gain_td3) );
|
||||
|
||||
st25r200ClearCalibration();
|
||||
st25r200ExecuteCommandAndGetResult( ST25R200_CMD_SENSE_RF, ST25R200_REG_DISPLAY3, ST25R200_TOUT_MEASUREMENT, &val );
|
||||
|
||||
/* Restore measurement sensitivity */
|
||||
st25r200WriteRegister( ST25R200_REG_RX_ANA2, reg );
|
||||
|
||||
return ( (val > ST25R200_TEST_FD_TRESHOLD) ? true : false );
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r200SetBitrate( uint8_t txRate, uint8_t rxRate )
|
||||
{
|
||||
uint8_t reg;
|
||||
|
||||
st25r200ReadRegister( ST25R200_REG_PROTOCOL, ® );
|
||||
if( rxRate != ST25R200_BR_DO_NOT_SET )
|
||||
{
|
||||
if(rxRate > ST25R200_BR_424_53)
|
||||
{
|
||||
return RFAL_ERR_PARAM;
|
||||
}
|
||||
|
||||
reg = (uint8_t)(reg & ~ST25R200_REG_PROTOCOL_rx_rate_mask); /* MISRA 10.3 */
|
||||
reg |= (rxRate << ST25R200_REG_PROTOCOL_rx_rate_shift);
|
||||
}
|
||||
|
||||
if( txRate != ST25R200_BR_DO_NOT_SET )
|
||||
{
|
||||
if(txRate > ST25R200_BR_106_26)
|
||||
{
|
||||
return RFAL_ERR_PARAM;
|
||||
}
|
||||
|
||||
reg = (uint8_t)(reg & ~ST25R200_REG_PROTOCOL_tx_rate_mask); /* MISRA 10.3 */
|
||||
reg |= (txRate << ST25R200_REG_PROTOCOL_rx_rate_shift);
|
||||
}
|
||||
return st25r200ChangeRegisterBits( ST25R200_REG_PROTOCOL, (ST25R200_REG_PROTOCOL_rx_rate_mask | ST25R200_REG_PROTOCOL_tx_rate_mask), reg );
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r200PerformCollisionAvoidance( void )
|
||||
{
|
||||
#if 1
|
||||
/*******************************************************************************/
|
||||
/* RF Collision avoidance is not supported on ST25R200 *
|
||||
* The procedure here provided is not in alignment with Activity 2.1 3 *
|
||||
* One can assess the presence of an external RF carrier and enable its own *
|
||||
* carrier in case no external RF carrier is detected */
|
||||
/*******************************************************************************/
|
||||
|
||||
if( st25r200IsExtFieldOn() )
|
||||
{
|
||||
return RFAL_ERR_RF_COLLISION;
|
||||
}
|
||||
|
||||
st25r200TxRxOn();
|
||||
return RFAL_ERR_NONE;
|
||||
|
||||
#else
|
||||
return RFAL_ERR_NOTSUPP;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
void st25r200SetNumTxBits( uint16_t nBits )
|
||||
{
|
||||
st25r200WriteRegister( ST25R200_REG_TX_FRAME2, (uint8_t)((nBits >> 0) & 0xFFU) );
|
||||
st25r200WriteRegister( ST25R200_REG_TX_FRAME1, (uint8_t)((nBits >> 8) & 0xFFU) );
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
uint16_t st25r200GetNumFIFOBytes( void )
|
||||
{
|
||||
uint8_t reg;
|
||||
uint16_t result;
|
||||
|
||||
|
||||
st25r200ReadRegister( ST25R200_REG_FIFO_STATUS2, ® );
|
||||
reg = ((reg & ST25R200_REG_FIFO_STATUS2_fifo_b8) >> ST25R200_REG_FIFO_STATUS2_fifo_b_shift);
|
||||
result = ((uint16_t)reg << 8);
|
||||
|
||||
st25r200ReadRegister( ST25R200_REG_FIFO_STATUS1, ® );
|
||||
result |= (((uint16_t)reg) & 0x00FFU);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
uint8_t st25r200GetNumFIFOLastBits( void )
|
||||
{
|
||||
uint8_t reg;
|
||||
|
||||
st25r200ReadRegister( ST25R200_REG_FIFO_STATUS2, ® );
|
||||
|
||||
return ((reg & ST25R200_REG_FIFO_STATUS2_fifo_lb_mask) >> ST25R200_REG_FIFO_STATUS2_fifo_lb_shift);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
uint32_t st25r200GetNoResponseTime( void )
|
||||
{
|
||||
return gST25R200NRT_64fcs;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r200SetNoResponseTime( uint32_t nrt )
|
||||
{
|
||||
ReturnCode err;
|
||||
uint8_t nrt_step;
|
||||
uint32_t tmpNRT;
|
||||
|
||||
tmpNRT = nrt; /* MISRA 17.8 */
|
||||
err = RFAL_ERR_NONE;
|
||||
|
||||
gST25R200NRT_64fcs = tmpNRT; /* Store given NRT value in 64/fc into local var */
|
||||
nrt_step = ST25R200_REG_NRT_GPT_CONF_nrt_step_64fc; /* Set default NRT in steps of 64/fc */
|
||||
|
||||
|
||||
if( tmpNRT > ST25R200_NRT_MAX ) /* Check if the given NRT value fits using 64/fc steps */
|
||||
{
|
||||
nrt_step = ST25R200_REG_NRT_GPT_CONF_nrt_step_4096fc; /* If not, change NRT set to 4096/fc */
|
||||
tmpNRT = ((tmpNRT + 63U) / 64U); /* Calculate number of steps in 4096/fc */
|
||||
|
||||
if( tmpNRT > ST25R200_NRT_MAX ) /* Check if the NRT value fits using 64/fc steps */
|
||||
{
|
||||
tmpNRT = ST25R200_NRT_MAX; /* Assign the maximum possible */
|
||||
err = RFAL_ERR_PARAM; /* Signal parameter error */
|
||||
}
|
||||
gST25R200NRT_64fcs = (64U * tmpNRT);
|
||||
}
|
||||
|
||||
/* Set the ST25R200 NRT step units and the value */
|
||||
st25r200ChangeRegisterBits( ST25R200_REG_NRT_GPT_CONF, ST25R200_REG_NRT_GPT_CONF_nrt_step, nrt_step );
|
||||
st25r200WriteRegister( ST25R200_REG_NRT1, (uint8_t)(tmpNRT >> 8U) );
|
||||
st25r200WriteRegister( ST25R200_REG_NRT2, (uint8_t)(tmpNRT & 0xFFU) );
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r200SetStartNoResponseTimer( uint32_t nrt )
|
||||
{
|
||||
ReturnCode err;
|
||||
|
||||
err = st25r200SetNoResponseTime( nrt );
|
||||
if(err == RFAL_ERR_NONE)
|
||||
{
|
||||
st25r200ExecuteCommand( ST25R200_CMD_START_NO_RESPONSE_TIMER );
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
void st25r200SetGPTime( uint16_t gpt )
|
||||
{
|
||||
st25r200WriteRegister( ST25R200_REG_GPT1, (uint8_t)(gpt >> 8) );
|
||||
st25r200WriteRegister( ST25R200_REG_GPT2, (uint8_t)(gpt & 0xFFU) );
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r200SetStartGPTimer( uint16_t gpt, uint8_t trigger )
|
||||
{
|
||||
st25r200SetGPTime( gpt );
|
||||
st25r200ChangeRegisterBits( ST25R200_REG_NRT_GPT_CONF, ST25R200_REG_NRT_GPT_CONF_gptc_mask, trigger );
|
||||
|
||||
/* If there's no trigger source, start GPT immediately */
|
||||
if( trigger == ST25R200_REG_NRT_GPT_CONF_gptc_no_trigger )
|
||||
{
|
||||
st25r200ExecuteCommand( ST25R200_CMD_START_GP_TIMER );
|
||||
}
|
||||
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
bool st25r200CheckChipID( uint8_t *rev )
|
||||
{
|
||||
uint8_t ID;
|
||||
|
||||
ID = 0;
|
||||
st25r200ReadRegister( ST25R200_REG_IC_ID, &ID );
|
||||
|
||||
/* Check if IC Identity Register contains ST25R200's IC type code */
|
||||
if( (ID & ST25R200_REG_IC_ID_ic_type_mask) != ST25R200_REG_IC_ID_ic_type_st25r200 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(rev != NULL)
|
||||
{
|
||||
*rev = (ID & ST25R200_REG_IC_ID_ic_rev_mask);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r200GetRegsDump( uint8_t* resRegDump, uint8_t* sizeRegDump )
|
||||
{
|
||||
uint8_t regIt;
|
||||
uint8_t regDump[ST25R200_REG_IC_ID+1U];
|
||||
|
||||
if( (sizeRegDump == NULL) || (resRegDump == NULL) )
|
||||
{
|
||||
return RFAL_ERR_PARAM;
|
||||
}
|
||||
|
||||
for( regIt = ST25R200_REG_OPERATION; regIt < RFAL_SIZEOF_ARRAY(regDump); regIt++ )
|
||||
{
|
||||
st25r200ReadRegister(regIt, ®Dump[regIt] );
|
||||
}
|
||||
|
||||
*sizeRegDump = RFAL_MIN(*sizeRegDump, regIt);
|
||||
if( *sizeRegDump > 0U ) /* MISRA 21.18 */
|
||||
{
|
||||
RFAL_MEMCPY(resRegDump, regDump, *sizeRegDump );
|
||||
}
|
||||
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
bool st25r200IsCmdValid( uint8_t cmd )
|
||||
{
|
||||
if( (cmd < ST25R200_CMD_SET_DEFAULT) || (cmd > ST25R200_CMD_TEST_ACCESS) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r200SetAntennaMode( bool single, bool rfiox )
|
||||
{
|
||||
uint8_t val;
|
||||
|
||||
val = 0U;
|
||||
val |= ((single)? ST25R200_REG_GENERAL_single : 0U);
|
||||
val |= ((rfiox) ? ST25R200_REG_GENERAL_rfo2 : 0U);
|
||||
|
||||
return st25r200ChangeRegisterBits( ST25R200_REG_GENERAL, (ST25R200_REG_GENERAL_single | ST25R200_REG_GENERAL_rfo2), val );
|
||||
}
|
||||
@@ -0,0 +1,568 @@
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file st25r200.h
|
||||
* @author MMY Application Team
|
||||
* @brief ST25R200 high level interface
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2021 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.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef ST25R200_H
|
||||
#define ST25R200_H
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* INCLUDES
|
||||
******************************************************************************
|
||||
*/
|
||||
#include "rfal_platform.h"
|
||||
#include "rfal_utils.h"
|
||||
#include "st25r200_com.h"
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL DATATYPES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL DEFINES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* ST25R200 direct commands */
|
||||
#define ST25R200_CMD_SET_DEFAULT 0x60U /*!< Puts the chip in default state (same as after power-up) */
|
||||
#define ST25R200_CMD_STOP 0x62U /*!< Stops all activities and clears FIFO */
|
||||
#define ST25R200_CMD_CLEAR_FIFO 0x64U /*!< Clears FIFO, Collision and IRQ status */
|
||||
#define ST25R200_CMD_CLEAR_RXGAIN 0x66U /*!< Clears FIFO, Collision and IRQ status */
|
||||
#define ST25R200_CMD_ADJUST_REGULATORS 0x68U /*!< Adjust regulators */
|
||||
#define ST25R200_CMD_TRANSMIT 0x6AU /*!< Transmit */
|
||||
#define ST25R200_CMD_TRANSMIT_EOF 0x6CU /*!< Transmit ISO15693 EOF */
|
||||
#define ST25R200_CMD_MASK_RECEIVE_DATA 0x70U /*!< Mask receive data */
|
||||
#define ST25R200_CMD_UNMASK_RECEIVE_DATA 0x72U /*!< Unmask receive data */
|
||||
#define ST25R200_CMD_CALIBRATE_WU 0x74U /*!< Calibrate Wake-up Measurement */
|
||||
#define ST25R200_CMD_CLEAR_WU_CALIB 0x76U /*!< Clear Wake-up Calibratation */
|
||||
#define ST25R200_CMD_MEASURE_WU 0x78U /*!< Measure Wake-up I and Q components */
|
||||
#define ST25R200_CMD_MEASURE_IQ 0x7AU /*!< Measure I and Q components */
|
||||
#define ST25R200_CMD_SENSE_RF 0x7CU /*!< Sense RF on RFI pins */
|
||||
#define ST25R200_CMD_TRANSPARENT_MODE 0xE0U /*!< Transparent mode */
|
||||
#define ST25R200_CMD_START_GP_TIMER 0xE2U /*!< Start the general purpose timer */
|
||||
#define ST25R200_CMD_START_WUP_TIMER 0xE4U /*!< Start the wake-up timer */
|
||||
#define ST25R200_CMD_START_MASK_RECEIVE_TIMER 0xE6U /*!< Start the mask-receive timer */
|
||||
#define ST25R200_CMD_START_NO_RESPONSE_TIMER 0xE8U /*!< Start the no-response timer */
|
||||
#define ST25R200_CMD_STOP_NRT 0xEAU /*!< Stop No Response Timer */
|
||||
#define ST25R200_CMD_TEST_ACCESS 0xFCU /*!< Enable R/W access to the test registers */
|
||||
|
||||
|
||||
#define ST25R200_BR_DO_NOT_SET 0xFFU /*!< Indicates not to change this Bit Rate */
|
||||
#define ST25R200_BR_106_26 0x00U /*!< ST25R200 Bit Rate 106 kbps (fc/128) / 26 kbps(fc/512) */
|
||||
#define ST25R200_BR_212 0x01U /*!< ST25R200 Bit Rate 212 kbps (fc/64) */
|
||||
#define ST25R200_BR_424_53 0x02U /*!< ST25R200 Bit Rate 424 kbps (fc/32) / 53 kbps(fc/256) */
|
||||
#define ST25R200_BR_848 0x03U /*!< ST25R200 Bit Rate 848 kbps (fc/16) */
|
||||
|
||||
#define ST25R200_REG_DROP_200 0U /*!< ST25R200 target drop for regulator adjustment: 200mV */
|
||||
#define ST25R200_REG_DROP_250 1U /*!< ST25R200 target drop for regulator adjustment: 250mV */
|
||||
#define ST25R200_REG_DROP_300 2U /*!< ST25R200 target drop for regulator adjustment: 300mV */
|
||||
#define ST25R200_REG_DROP_350 3U /*!< ST25R200 target drop for regulator adjustment: 350mV */
|
||||
#define ST25R200_REG_DROP_400 4U /*!< ST25R200 target drop for regulator adjustment: 400mV */
|
||||
#define ST25R200_REG_DROP_450 5U /*!< ST25R200 target drop for regulator adjustment: 450mV */
|
||||
#define ST25R200_REG_DROP_500 6U /*!< ST25R200 target drop for regulator adjustment: 500mV */
|
||||
#define ST25R200_REG_DROP_550 7U /*!< ST25R200 target drop for regulator adjustment: 550mV */
|
||||
#define ST25R200_REG_DROP_DO_NOT_SET 0xFFU /*!< Indicates not to change this setting (regd) */
|
||||
|
||||
#define ST25R200_REG_LEN 1U /*!< Number of bytes in a ST25R200 register */
|
||||
#define ST25R200_CMD_LEN 1U /*!< ST25R200 CMD length */
|
||||
#define ST25R200_FIFO_DEPTH 256U /*!< Depth of FIFO */
|
||||
|
||||
#define ST25R200_WRITE_MODE (0U << 7) /*!< ST25R200 Operation Mode: Write */
|
||||
#define ST25R200_READ_MODE (1U << 7) /*!< ST25R200 Operation Mode: Read */
|
||||
#define ST25R200_CMD_MODE ST25R200_WRITE_MODE /*!< ST25R200 Operation Mode: Direct Command */
|
||||
#define ST25R200_FIFO_ACCESS (0x5FU) /*!< ST25R200 FIFO Access */
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL MACROS
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/*! Enables the Transmitter (Field On) and Receiver */
|
||||
#define st25r200TxRxOn() st25r200SetRegisterBits( ST25R200_REG_OPERATION, (ST25R200_REG_OPERATION_rx_en | ST25R200_REG_OPERATION_tx_en ) )
|
||||
|
||||
/*! Disables the Transmitter (Field Off) and Receiver */
|
||||
#define st25r200TxRxOff() st25r200ClrRegisterBits( ST25R200_REG_OPERATION, (ST25R200_REG_OPERATION_rx_en | ST25R200_REG_OPERATION_tx_en ) )
|
||||
|
||||
/*! Disables the Transmitter (Field Off) */
|
||||
#define st25r200TxOff() st25r200ClrRegisterBits( ST25R200_REG_OPERATION, ST25R200_REG_OPERATION_tx_en )
|
||||
|
||||
/*! Checks if General Purpose Timer is still running by reading gpt_on flag */
|
||||
#define st25r200IsGPTRunning( ) st25r200CheckReg( ST25R200_REG_STATUS, ST25R200_REG_STATUS_gpt_on, ST25R200_REG_STATUS_gpt_on )
|
||||
|
||||
/*! Checks if Transmitter is enabled (Field On) */
|
||||
#define st25r200IsTxEnabled() st25r200CheckReg( ST25R200_REG_OPERATION, ST25R200_REG_OPERATION_tx_en, ST25R200_REG_OPERATION_tx_en )
|
||||
|
||||
/*! Checks if NRT is in EMV mode */
|
||||
#define st25r200IsNRTinEMV() st25r200CheckReg( ST25R200_REG_NRT_GPT_CONF, ST25R200_REG_NRT_GPT_CONF_nrt_emd, ST25R200_REG_NRT_GPT_CONF_nrt_emd_on )
|
||||
|
||||
/*! Checks if last FIFO byte is complete */
|
||||
#define st25r200IsLastFIFOComplete() st25r200CheckReg( ST25R200_REG_FIFO_STATUS2, ST25R200_REG_FIFO_STATUS2_fifo_lb_mask, 0 )
|
||||
|
||||
/*! Checks if the Oscillator is enabled */
|
||||
#define st25r200IsOscOn() st25r200CheckReg( ST25R200_REG_OPERATION, ST25R200_REG_OPERATION_en, ST25R200_REG_OPERATION_en )
|
||||
|
||||
/*! Checks if Transmitter (Field On) is enabled */
|
||||
#define st25r200IsTxOn() st25r200CheckReg( ST25R200_REG_OPERATION, ST25R200_REG_OPERATION_tx_en, ST25R200_REG_OPERATION_tx_en )
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL FUNCTION PROTOTYPES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Initialise ST25R200 driver
|
||||
*
|
||||
* This function initialises the ST25R200 driver.
|
||||
*
|
||||
* \return RFAL_ERR_NONE : Operation successful
|
||||
* \return RFAL_ERR_HW_MISMATCH : Expected HW do not match or communication error
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r200Initialize( void );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Deinitialize ST25R200 driver
|
||||
*
|
||||
* Calling this function deinitializes the ST25R200 driver.
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
void st25r200Deinitialize( void );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Turn on Oscillator and Regulator
|
||||
*
|
||||
* This function turn on oscillator and regulator and waits for the
|
||||
* oscillator to become stable
|
||||
*
|
||||
* \return RFAL_ERR_SYSTEM: Unable to verify oscilator enable|stable
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r200OscOn( void );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Sets the bitrate
|
||||
*
|
||||
* This function sets the bitrates for rx and tx
|
||||
*
|
||||
* \param txRate : speed is 2^txrate * 106 kb/s
|
||||
* 0xff : don't set txrate (ST25R200_BR_DO_NOT_SET)
|
||||
* \param rxRate : speed is 2^rxrate * 106 kb/s
|
||||
* 0xff : don't set rxrate (ST25R200_BR_DO_NOT_SET)
|
||||
*
|
||||
* \return RFAL_ERR_PARAM: At least one bit rate was invalid
|
||||
* \return RFAL_ERR_NONE : No error, both bit rates were set
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r200SetBitrate( uint8_t txRate, uint8_t rxRate );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Adjusts supply regulators according to the current supply voltage
|
||||
*
|
||||
* The power level is measured in maximum load conditions and
|
||||
* the regulated voltage reference is set below this level.
|
||||
*
|
||||
* The regulated voltages will be set to the result of Adjust Regulators
|
||||
*
|
||||
* \param [in] drop : Targeted drop from supply voltage
|
||||
* \param [out] result : Result of calibration in milliVolts
|
||||
*
|
||||
* \return RFAL_ERR_IO : Error during communication with ST25R200
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r200AdjustRegulators( uint8_t drop, uint16_t* result );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Measure I/Q
|
||||
*
|
||||
* This function performs an I/Q measurement
|
||||
* The result is stored on the \a resI and \a resQ parameters.
|
||||
*
|
||||
* \param[out] resI: 8 bit long result of the I channel (signed)
|
||||
* \param[out] resQ: 8 bit long result of the Q channel (signed)
|
||||
*
|
||||
* \warning Before executing I|Q Measurement the WU calibration
|
||||
* shall be cleared, \see st25r200ClearCalibration()
|
||||
*
|
||||
* \return RFAL_ERR_PARAM : Invalid parameter
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r200MeasureIQ( int8_t* resI, int8_t* resQ );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Measure Combined I/Q
|
||||
*
|
||||
* This function performs an I/Q measurement and returns the
|
||||
* vectorial magnitude
|
||||
*
|
||||
* \param[out] res: 8 bit result of the I Q magnitude
|
||||
* Max value is: 127
|
||||
*
|
||||
* \return RFAL_ERR_PARAM : Invalid parameter
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r200MeasureCombinedIQ( uint8_t* res );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Calibrate WU
|
||||
*
|
||||
* This function executed Wake-up Calibration
|
||||
*
|
||||
* \param[out] resI: I channel calibration (unsigned)
|
||||
* \param[out] resQ: Q channel calibration (unsigned)
|
||||
*
|
||||
* \return RFAL_ERR_PARAM : Invalid parameter
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r200CalibrateWU( uint8_t* resI, uint8_t* resQ );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Clear WU Calibration
|
||||
*
|
||||
* This function clears WU calibration
|
||||
*
|
||||
* \return RFAL_ERR_PARAM : Invalid parameter
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r200ClearCalibration( void );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Measure WU
|
||||
*
|
||||
* This function performs measuremnt as executed during WU mode
|
||||
*
|
||||
* \param[out] resI: 8 bit long result of the I channel (signed)
|
||||
* \param[out] resQ: 8 bit long result of the Q channel (signed)
|
||||
|
||||
* \return RFAL_ERR_PARAM : Invalid parameter
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r200MeasureWU( uint8_t* resI, uint8_t* resQ );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Check External Filed
|
||||
*
|
||||
* This function checks if External Field is detected by performing
|
||||
* Sense RF procedure
|
||||
*
|
||||
* \warning ST25R200 is not equipped with an External Field Detector block.
|
||||
* One can try to assess the presence of an external RF carrier by
|
||||
* observing the signal on the RFIs while own field is turned off.
|
||||
* WU calibration will be cleared.
|
||||
*
|
||||
* \return true external signal was sensed
|
||||
* \return false unable to detect the presence of an external field
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
bool st25r200IsExtFieldOn( void );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Get NRT time
|
||||
*
|
||||
* This returns the last value set on the NRT
|
||||
*
|
||||
* \warning it does not read chip register, just the sw var that contains the
|
||||
* last value set before
|
||||
*
|
||||
* \return the value of the NRT in 64/fc
|
||||
*/
|
||||
uint32_t st25r200GetNoResponseTime( void );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Set NRT time
|
||||
*
|
||||
* This function sets the No Response Time with the given value
|
||||
*
|
||||
* \param [in] nrt : no response time in steps of 64/fc (4.72us)
|
||||
*
|
||||
* \return RFAL_ERR_PARAM : Invalid parameter (time is too large)
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r200SetNoResponseTime( uint32_t nrt );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Set and Start NRT
|
||||
*
|
||||
* This function sets the No Response Time with the given value and
|
||||
* immediately starts it
|
||||
* Used when needs to add more time before timeout without performing Tx
|
||||
*
|
||||
* \param [in] nrt : no response time in steps of 64/fc (4.72us)
|
||||
*
|
||||
* \return RFAL_ERR_PARAM : Invalid parameter
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r200SetStartNoResponseTimer( uint32_t nrt );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Set GPT time
|
||||
*
|
||||
* This function sets the General Purpose Timer time registers
|
||||
*
|
||||
* \param [in] gpt : general purpose timer timeout in steps of 8/fc (590ns)
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
void st25r200SetGPTime( uint16_t gpt );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Set and Start GPT
|
||||
*
|
||||
* This function sets the General Purpose Timer with the given timeout and
|
||||
* immediately starts it ONLY if the trigger source is not set to none.
|
||||
*
|
||||
* \param [in] gpt : general purpose timer timeout in steps of8/fc (590ns)
|
||||
* \param [in] trigger : no trigger, start of Rx, end of Rx, end of Tx in NFC mode
|
||||
*
|
||||
* \return RFAL_ERR_PARAM : Invalid parameter
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r200SetStartGPTimer( uint16_t gpt, uint8_t trigger );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Sets the number Tx Bits
|
||||
*
|
||||
* Sets ST25R200 internal registers with correct number of complete bytes and
|
||||
* bits to be sent
|
||||
*
|
||||
* \param [in] nBits : number of bits to be set/transmitted
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
void st25r200SetNumTxBits( uint16_t nBits );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Get amount of bytes in FIFO
|
||||
*
|
||||
* Gets the number of bytes currently in the FIFO
|
||||
*
|
||||
* \return the number of bytes currently in the FIFO
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
uint16_t st25r200GetNumFIFOBytes( void );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Get amount of bits of the last FIFO byte if incomplete
|
||||
*
|
||||
* Gets the number of bits of the last FIFO byte if incomplete
|
||||
*
|
||||
* \return the number of bits of the last FIFO byte if incomplete, 0 if
|
||||
* the last byte is complete
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
uint8_t st25r200GetNumFIFOLastBits( void );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Perform Collision Avoidance
|
||||
*
|
||||
* Performs Collision Avoidance
|
||||
*
|
||||
* \return RFAL_ERR_PARAM : Invalid parameter
|
||||
* \return RFAL_ERR_RF_COLLISION : Collision detected
|
||||
* \return RFAL_ERR_NONE : No collision detected
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r200PerformCollisionAvoidance( void );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Check Identity
|
||||
*
|
||||
* Checks if the chip ID is as expected.
|
||||
*
|
||||
* 5 bit IC type code for ST25R200: 00101
|
||||
* The 3 lsb contain the IC revision code
|
||||
*
|
||||
* \param[out] rev : the IC revision code
|
||||
*
|
||||
* \return true when IC type is as expected
|
||||
* \return false otherwise
|
||||
*/
|
||||
bool st25r200CheckChipID( uint8_t *rev );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Register Dump
|
||||
*
|
||||
* Retrieves all internal registers from ST25R200
|
||||
*
|
||||
* \param[out] resRegDump : pointer to the struct/buffer where the reg dump
|
||||
* will be written
|
||||
* \param[in,out] sizeRegDump : number of registers requested and the ones actually
|
||||
* written
|
||||
*
|
||||
* \return RFAL_ERR_PARAM : Invalid parameter
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*/
|
||||
ReturnCode st25r200GetRegsDump( uint8_t* resRegDump, uint8_t* sizeRegDump );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Check if command is valid
|
||||
*
|
||||
* Checks if the given command is a valid ST25R200 command
|
||||
*
|
||||
* \param[in] cmd: Command to check
|
||||
*
|
||||
* \return true if is a valid command
|
||||
* \return false otherwise
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
bool st25r200IsCmdValid( uint8_t cmd );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Executes a direct command and returns the result
|
||||
*
|
||||
* This function executes the direct command given by \a cmd waits for
|
||||
* \a sleeptime for I_dct and returns the result read from register \a resreg.
|
||||
* The value of cmd is not checked.
|
||||
*
|
||||
* \param[in] cmd : direct command to execute
|
||||
* \param[in] resReg: address of the register containing the result
|
||||
* \param[in] tOut : time in milliseconds to wait before reading the result
|
||||
* \param[out] result: result
|
||||
*
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r200ExecuteCommandAndGetResult( uint8_t cmd, uint8_t resReg, uint8_t tOut, uint8_t* result );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Gets the RSSI values
|
||||
*
|
||||
* This function gets the RSSI value of the previous reception taking into
|
||||
* account the gain reductions that were used.
|
||||
* RSSI value for both AM and PM channel can be retrieved.
|
||||
*
|
||||
* \param[out] iRssi: the RSSI on the I channel expressed in mV
|
||||
* \param[out] qRssi: the RSSI on the Q channel expressed in mV
|
||||
*
|
||||
* \return RFAL_ERR_PARAM : Invalid parameter
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r200GetRSSI( uint16_t *iRssi, uint16_t *qRssi );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Set Antenna mode
|
||||
*
|
||||
* Sets the antenna mode.
|
||||
* Differential or single ended antenna mode (RFO1 or RFO2)
|
||||
*
|
||||
* \param[in] single: FALSE differential ; single ended mode
|
||||
* \param[in] rfiox: FALSE RFI1/RFO1 ; TRUE RFI2/RFO2
|
||||
*
|
||||
* \return RFAL_ERR_IO : Internal error
|
||||
* \return RFAL_ERR_NOTSUPP : Feature not supported
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r200SetAntennaMode( bool single, bool rfiox );
|
||||
|
||||
#endif /* ST25R200_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
@@ -0,0 +1,632 @@
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file st25r200_com.c
|
||||
* @author MMY Application Team
|
||||
* @brief Implementation of ST25R200 communication
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2021 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 "st25r200.h"
|
||||
#include "st25r200_com.h"
|
||||
#include "st25r200_irq.h"
|
||||
#include "rfal_platform.h"
|
||||
#include "rfal_utils.h"
|
||||
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* LOCAL DEFINES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#define ST25R200_OPTIMIZE true /*!< Optimization switch: false always write value to register */
|
||||
#define ST25R200_MOSI_IDLE (0x00) /*!< ST25R200 MOSI IDLE state */
|
||||
#define ST25R200_BUF_LEN (ST25R200_CMD_LEN+ST25R200_FIFO_DEPTH) /*!< ST25R200 communication buffer: CMD + FIFO length */
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* MACROS
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/*!
|
||||
******************************************************************************
|
||||
* \brief ST25R200 communication Repeat Start
|
||||
*
|
||||
* This method performs the required actions to repeat start a transmission
|
||||
* with ST25R200
|
||||
******************************************************************************
|
||||
*/
|
||||
#define st25r200comRepeatStart()
|
||||
|
||||
#if defined(ST25R_COM_SINGLETXRX)
|
||||
static uint8_t comBuf[ST25R200_BUF_LEN]; /*!< ST25R200 communication buffer */
|
||||
static uint16_t comBufIt; /*!< ST25R200 communication buffer iterator */
|
||||
#endif /* ST25R_COM_SINGLETXRX */
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* LOCAL FUNCTION PROTOTYPES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/*!
|
||||
******************************************************************************
|
||||
* \brief ST25R200 communication Start
|
||||
*
|
||||
* This method performs the required actions to start communications with
|
||||
* ST25R200, either by SPI or I2C
|
||||
******************************************************************************
|
||||
*/
|
||||
static void st25r200comStart( void );
|
||||
|
||||
/*!
|
||||
******************************************************************************
|
||||
* \brief ST25R200 communication Stop
|
||||
*
|
||||
* This method performs the required actions to terminate communications with
|
||||
* ST25R200, either by SPI or I2C
|
||||
******************************************************************************
|
||||
*/
|
||||
static void st25r200comStop( void );
|
||||
|
||||
|
||||
/*!
|
||||
******************************************************************************
|
||||
* \brief ST25R200 communication Tx
|
||||
*
|
||||
* This method performs the required actions to transmit the given buffer
|
||||
* to ST25R200, either by SPI or I2C
|
||||
*
|
||||
* \param[in] txBuf : the buffer to transmit
|
||||
* \param[in] txLen : the length of the buffer to transmit
|
||||
* \param[in] last : true if last data to be transmitted
|
||||
* \param[in] txOnly : true no reception is to be performed
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
static void st25r200comTx( const uint8_t* txBuf, uint16_t txLen, bool last, bool txOnly );
|
||||
|
||||
|
||||
/*!
|
||||
******************************************************************************
|
||||
* \brief ST25R200 communication Rx
|
||||
*
|
||||
* This method performs the required actions to receive from ST25R200 the given
|
||||
* amount of bytes, either by SPI or I2C
|
||||
*
|
||||
* \param[out] rxBuf : the buffer place the received bytes
|
||||
* \param[in] rxLen : the length to receive
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
static void st25r200comRx( uint8_t* rxBuf, uint16_t rxLen );
|
||||
|
||||
/*!
|
||||
******************************************************************************
|
||||
* \brief ST25R200 communication Tx Byte
|
||||
*
|
||||
* This helper method transmits a byte passed by value and not by reference
|
||||
*
|
||||
* \param[in] txByte : the value of the byte to be transmitted
|
||||
* \param[in] last : true if last byte to be transmitted
|
||||
* \param[in] txOnly : true no reception is to be performed
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
static void st25r200comTxByte( uint8_t txByte, bool last, bool txOnly );
|
||||
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* LOCAL FUNCTION
|
||||
******************************************************************************
|
||||
*/
|
||||
static void st25r200comStart( void )
|
||||
{
|
||||
/* Make this operation atomic, disabling ST25R200 interrupt during communications*/
|
||||
platformProtectST25RComm();
|
||||
|
||||
/* Perform the chip select */
|
||||
platformSpiSelect();
|
||||
|
||||
#if defined(ST25R_COM_SINGLETXRX)
|
||||
comBufIt = 0; /* Reset local buffer position */
|
||||
#endif /* ST25R_COM_SINGLETXRX */
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
static void st25r200comStop( void )
|
||||
{
|
||||
/* Release the chip select */
|
||||
platformSpiDeselect();
|
||||
|
||||
/* reEnable the ST25R200 interrupt */
|
||||
platformUnprotectST25RComm();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
static void st25r200comTx( const uint8_t* txBuf, uint16_t txLen, bool last, bool txOnly )
|
||||
{
|
||||
RFAL_NO_WARNING(last);
|
||||
RFAL_NO_WARNING(txOnly);
|
||||
|
||||
if( txLen > 0U )
|
||||
{
|
||||
#ifdef ST25R_COM_SINGLETXRX
|
||||
|
||||
RFAL_MEMCPY( &comBuf[comBufIt], txBuf, RFAL_MIN( txLen, (uint16_t)(ST25R200_BUF_LEN - comBufIt) ) ); /* Copy tx data to local buffer */
|
||||
comBufIt += RFAL_MIN( txLen, (ST25R200_BUF_LEN - comBufIt) ); /* Store position on local buffer */
|
||||
|
||||
if( last && txOnly ) /* Only perform SPI transaction if no Rx will follow */
|
||||
{
|
||||
platformSpiTxRx( comBuf, NULL, comBufIt );
|
||||
}
|
||||
|
||||
#else
|
||||
platformSpiTxRx( txBuf, NULL, txLen );
|
||||
#endif /* ST25R_COM_SINGLETXRX */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
static void st25r200comRx( uint8_t* rxBuf, uint16_t rxLen )
|
||||
{
|
||||
#ifndef ST25R_COM_SINGLETXRX
|
||||
uint8_t dummyBuf;
|
||||
uint16_t rxIt;
|
||||
#endif /* ST25R_COM_SINGLETXRX */
|
||||
|
||||
if( rxLen > 0U )
|
||||
{
|
||||
|
||||
#ifdef ST25R_COM_SINGLETXRX
|
||||
RFAL_MEMSET( &comBuf[comBufIt], ST25R200_MOSI_IDLE, RFAL_MIN( rxLen, (uint16_t)(ST25R200_BUF_LEN - comBufIt) ) ); /* Clear outgoing buffer */
|
||||
platformSpiTxRx( comBuf, comBuf, RFAL_MIN( (comBufIt + rxLen), ST25R200_BUF_LEN ) ); /* Transceive as a single SPI call */
|
||||
if( rxBuf != NULL )
|
||||
{
|
||||
RFAL_MEMCPY( rxBuf, &comBuf[comBufIt], RFAL_MIN( rxLen, (uint16_t)(ST25R200_BUF_LEN - comBufIt) ) );/* Copy from local buf to output buffer and skip cmd byte */
|
||||
}
|
||||
#else
|
||||
|
||||
/* In case rxBuf is not provided, ensure that SPI operation is executed. *
|
||||
* Depending on the HAL used, the SPI driver may not support *
|
||||
* NULL as Rx buffer, do single byte SPI transactions to a dummy buffer */
|
||||
if( rxBuf == NULL )
|
||||
{
|
||||
for( rxIt = 0; (rxIt < rxLen); rxIt++ )
|
||||
{
|
||||
dummyBuf = ST25R200_MOSI_IDLE; /* Clear outgoing|incoming buffer */
|
||||
platformSpiTxRx( &dummyBuf, &dummyBuf, 1U ); /* Re-use the buffer as SPI outputs data first then reads */
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
RFAL_MEMSET( rxBuf, ST25R200_MOSI_IDLE, rxLen ); /* Clear outgoing|incoming buffer */
|
||||
platformSpiTxRx( rxBuf, rxBuf, rxLen ); /* Re-use the rxBuf as SPI outputs data first then reads */
|
||||
}
|
||||
|
||||
#endif /* ST25R_COM_SINGLETXRX */
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
static void st25r200comTxByte( uint8_t txByte, bool last, bool txOnly )
|
||||
{
|
||||
uint8_t val = txByte; /* MISRA 17.8: use intermediate variable */
|
||||
st25r200comTx( &val, ST25R200_REG_LEN, last, txOnly );
|
||||
}
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL FUNCTIONS
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r200ReadRegister( uint8_t reg, uint8_t* val )
|
||||
{
|
||||
return st25r200ReadMultipleRegisters( reg, val, ST25R200_REG_LEN );
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r200ReadMultipleRegisters( uint8_t reg, uint8_t* values, uint16_t length )
|
||||
{
|
||||
if( length > 0U )
|
||||
{
|
||||
st25r200comStart();
|
||||
st25r200comTxByte( (reg | ST25R200_READ_MODE), true, false );
|
||||
st25r200comRepeatStart();
|
||||
st25r200comRx( values, length );
|
||||
st25r200comStop();
|
||||
}
|
||||
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r200WriteRegister( uint8_t reg, uint8_t val )
|
||||
{
|
||||
uint8_t value = val; /* MISRA 17.8: use intermediate variable */
|
||||
return st25r200WriteMultipleRegisters( reg, &value, ST25R200_REG_LEN );
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r200WriteMultipleRegisters( uint8_t reg, const uint8_t* values, uint16_t length )
|
||||
{
|
||||
if( length > 0U )
|
||||
{
|
||||
st25r200comStart();
|
||||
st25r200comTxByte( (reg | ST25R200_WRITE_MODE), false, true );
|
||||
st25r200comTx( values, length, true, true );
|
||||
st25r200comStop();
|
||||
|
||||
/* Send a WriteMultiReg event to LED handling */
|
||||
st25r200ledEvtWrMultiReg( reg, values, (uint8_t)length );
|
||||
}
|
||||
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r200WriteFifo( const uint8_t* values, uint16_t length )
|
||||
{
|
||||
if( length > ST25R200_FIFO_DEPTH )
|
||||
{
|
||||
return RFAL_ERR_PARAM;
|
||||
}
|
||||
|
||||
st25r200WriteMultipleRegisters( ST25R200_FIFO_ACCESS, values, length );
|
||||
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r200ReadFifo( uint8_t* buf, uint16_t length )
|
||||
{
|
||||
if( length > 0U )
|
||||
{
|
||||
if( length > ST25R200_FIFO_DEPTH )
|
||||
{
|
||||
return RFAL_ERR_PARAM;
|
||||
}
|
||||
|
||||
st25r200ReadMultipleRegisters( ST25R200_FIFO_ACCESS, buf, length );
|
||||
}
|
||||
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r200ExecuteCommand( uint8_t cmd )
|
||||
{
|
||||
st25r200comStart();
|
||||
st25r200comTxByte( (cmd | ST25R200_CMD_MODE ), true, true );
|
||||
st25r200comStop();
|
||||
|
||||
/* Send a cmd event to LED handling */
|
||||
st25r200ledEvtCmd(cmd);
|
||||
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r200ReadTestRegister( uint8_t reg, uint8_t* val )
|
||||
{
|
||||
st25r200comStart();
|
||||
st25r200comTxByte( ST25R200_CMD_TEST_ACCESS, false, false );
|
||||
st25r200comTxByte( (reg | ST25R200_READ_MODE), true, false );
|
||||
st25r200comRepeatStart();
|
||||
st25r200comRx( val, ST25R200_REG_LEN );
|
||||
st25r200comStop();
|
||||
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r200WriteTestRegister( uint8_t reg, uint8_t val )
|
||||
{
|
||||
uint8_t value = val; /* MISRA 17.8: use intermediate variable */
|
||||
|
||||
st25r200comStart();
|
||||
st25r200comTxByte( ST25R200_CMD_TEST_ACCESS, false, true );
|
||||
st25r200comTxByte( (reg | ST25R200_WRITE_MODE), false, true );
|
||||
st25r200comTx( &value, ST25R200_REG_LEN, true, true );
|
||||
st25r200comStop();
|
||||
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r200WriteMultipleTestRegister( uint8_t reg, const uint8_t* values, uint8_t length )
|
||||
{
|
||||
st25r200comStart();
|
||||
st25r200comTxByte( ST25R200_CMD_TEST_ACCESS, false, true );
|
||||
st25r200comTxByte( (reg | ST25R200_WRITE_MODE), false, true );
|
||||
st25r200comTx( values, length, true, true );
|
||||
st25r200comStop();
|
||||
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r200ClrRegisterBits( uint8_t reg, uint8_t clr_mask )
|
||||
{
|
||||
ReturnCode ret;
|
||||
uint8_t rdVal;
|
||||
|
||||
/* Read current reg value */
|
||||
RFAL_EXIT_ON_ERR( ret, st25r200ReadRegister(reg, &rdVal) );
|
||||
|
||||
/* Only perform a Write if value to be written is different */
|
||||
if( ST25R200_OPTIMIZE && (rdVal == (uint8_t)(rdVal & ~clr_mask)) )
|
||||
{
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
/* Write new reg value */
|
||||
return st25r200WriteRegister(reg, (uint8_t)(rdVal & ~clr_mask) );
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r200SetRegisterBits( uint8_t reg, uint8_t set_mask )
|
||||
{
|
||||
ReturnCode ret;
|
||||
uint8_t rdVal;
|
||||
|
||||
/* Read current reg value */
|
||||
RFAL_EXIT_ON_ERR( ret, st25r200ReadRegister(reg, &rdVal) );
|
||||
|
||||
/* Only perform a Write if the value to be written is different */
|
||||
if( ST25R200_OPTIMIZE && (rdVal == (rdVal | set_mask)) )
|
||||
{
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
/* Write new reg value */
|
||||
return st25r200WriteRegister(reg, (rdVal | set_mask) );
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r200ChangeRegisterBits( uint8_t reg, uint8_t valueMask, uint8_t value )
|
||||
{
|
||||
return st25r200ModifyRegister(reg, valueMask, (valueMask & value) );
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r200ModifyRegister( uint8_t reg, uint8_t clr_mask, uint8_t set_mask )
|
||||
{
|
||||
ReturnCode ret;
|
||||
uint8_t rdVal;
|
||||
uint8_t wrVal;
|
||||
|
||||
/* Read current reg value */
|
||||
RFAL_EXIT_ON_ERR( ret, st25r200ReadRegister(reg, &rdVal) );
|
||||
|
||||
/* Compute new value */
|
||||
wrVal = (uint8_t)(rdVal & ~clr_mask);
|
||||
wrVal |= set_mask;
|
||||
|
||||
/* Only perform a Write if the value to be written is different */
|
||||
if( ST25R200_OPTIMIZE && (rdVal == wrVal) )
|
||||
{
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
/* Write new reg value */
|
||||
return st25r200WriteRegister(reg, wrVal );
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r200ChangeTestRegisterBits( uint8_t reg, uint8_t valueMask, uint8_t value )
|
||||
{
|
||||
ReturnCode ret;
|
||||
uint8_t rdVal;
|
||||
uint8_t wrVal;
|
||||
|
||||
/* Read current reg value */
|
||||
RFAL_EXIT_ON_ERR( ret, st25r200ReadTestRegister(reg, &rdVal) );
|
||||
|
||||
/* Compute new value */
|
||||
wrVal = (uint8_t)(rdVal & ~valueMask);
|
||||
wrVal |= (uint8_t)(value & valueMask);
|
||||
|
||||
/* Only perform a Write if the value to be written is different */
|
||||
if( ST25R200_OPTIMIZE && (rdVal == wrVal) )
|
||||
{
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
/* Write new reg value */
|
||||
return st25r200WriteTestRegister(reg, wrVal );
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
bool st25r200CheckReg( uint8_t reg, uint8_t mask, uint8_t val )
|
||||
{
|
||||
uint8_t regVal;
|
||||
|
||||
regVal = 0;
|
||||
st25r200ReadRegister( reg, ®Val );
|
||||
|
||||
return ( (regVal & mask) == val );
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
bool st25r200IsRegValid( uint8_t reg )
|
||||
{
|
||||
if( !( ((int16_t)reg >= (int16_t)ST25R200_REG_OPERATION) && (reg < ST25R200_FIFO_ACCESS) ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* MACROS
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifdef PLATFORM_LED_RX_PIN
|
||||
#define st25r200ledRxOn() platformLedOn( PLATFORM_LED_RX_PORT, PLATFORM_LED_RX_PIN ); /*!< LED Rx Pin On from system HAL */
|
||||
#define st25r200ledRxOff() platformLedOff( PLATFORM_LED_RX_PORT, PLATFORM_LED_RX_PIN ); /*!< LED Rx Pin Off from system HAL */
|
||||
#else /* PLATFORM_LED_RX_PIN */
|
||||
#define st25r200ledRxOn()
|
||||
#define st25r200ledRxOff()
|
||||
#endif /* PLATFORM_LED_RX_PIN */
|
||||
|
||||
|
||||
#ifdef PLATFORM_LED_FIELD_PIN
|
||||
#define st25r200ledFieldOn() platformLedOn( PLATFORM_LED_FIELD_PORT, PLATFORM_LED_FIELD_PIN ); /*!< LED Field Pin On from system HAL */
|
||||
#define st25r200ledFieldOff() platformLedOff( PLATFORM_LED_FIELD_PORT, PLATFORM_LED_FIELD_PIN ); /*!< LED Field Pin Off from system HAL */
|
||||
#else /* PLATFORM_LED_FIELD_PIN */
|
||||
#define st25r200ledFieldOn()
|
||||
#define st25r200ledFieldOff()
|
||||
#endif /* PLATFORM_LED_FIELD_PIN */
|
||||
|
||||
#ifdef PLATFORM_LED_ERR_PIN
|
||||
#define st25r200ledErrOn() platformLedOn( PLATFORM_LED_ERR_PORT, PLATFORM_LED_ERR_PIN ); /*!< LED Field Pin On from system HAL */
|
||||
#define st25r200ledErrOff() platformLedOff( PLATFORM_LED_ERR_PORT, PLATFORM_LED_ERR_PIN ); /*!< LED Field Pin Off from system HAL */
|
||||
#else /* PLATFORM_LED_ERR_PIN */
|
||||
#define st25r200ledErrOn()
|
||||
#define st25r200ledErrOff()
|
||||
#endif /* PLATFORM_LED_ERR_PIN */
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL FUNCTIONS
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
void st25r200ledInit( void )
|
||||
{
|
||||
/* Initialize LEDs if existing and defined */
|
||||
platformLedsInitialize();
|
||||
|
||||
st25r200ledRxOff();
|
||||
st25r200ledFieldOff();
|
||||
st25r200ledErrOff();
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
void st25r200ledEvtIrq( uint32_t irqs )
|
||||
{
|
||||
if( (irqs & ST25R200_IRQ_MASK_TXE ) != 0U )
|
||||
{
|
||||
st25r200ledFieldOn();
|
||||
st25r200ledErrOff();
|
||||
}
|
||||
|
||||
if( (irqs & (ST25R200_IRQ_MASK_RXS | ST25R200_IRQ_MASK_SUBC_START) ) != 0U )
|
||||
{
|
||||
st25r200ledRxOn();
|
||||
}
|
||||
|
||||
if( ((irqs & (ST25R200_IRQ_MASK_RXE | ST25R200_IRQ_MASK_NRE | ST25R200_IRQ_MASK_RX_REST | ST25R200_IRQ_MASK_OSC )) != 0U ) )
|
||||
{
|
||||
st25r200ledRxOff();
|
||||
}
|
||||
|
||||
if( ((irqs & (ST25R200_IRQ_MASK_CRC | ST25R200_IRQ_MASK_PAR | ST25R200_IRQ_MASK_HFE | ST25R200_IRQ_MASK_SFE)) != 0U) )
|
||||
{
|
||||
st25r200ledErrOn();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
void st25r200ledEvtWrReg( uint8_t reg, uint8_t val )
|
||||
{
|
||||
if( reg == ST25R200_REG_OPERATION )
|
||||
{
|
||||
if( (ST25R200_REG_OPERATION_tx_en & val) != 0U )
|
||||
{
|
||||
st25r200ledFieldOn();
|
||||
}
|
||||
else
|
||||
{
|
||||
st25r200ledFieldOff();
|
||||
st25r200ledRxOff();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
void st25r200ledEvtWrMultiReg( uint8_t reg, const uint8_t* vals, uint8_t len )
|
||||
{
|
||||
uint8_t i;
|
||||
|
||||
for(i=0; i<(len); i++)
|
||||
{
|
||||
st25r200ledEvtWrReg( (reg+i), vals[i] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
void st25r200ledEvtCmd( uint8_t cmd )
|
||||
{
|
||||
if( cmd == ST25R200_CMD_TRANSMIT )
|
||||
{
|
||||
st25r200ledFieldOff();
|
||||
}
|
||||
|
||||
if( cmd == ST25R200_CMD_UNMASK_RECEIVE_DATA )
|
||||
{
|
||||
st25r200ledRxOff();
|
||||
}
|
||||
|
||||
if( cmd == ST25R200_CMD_SET_DEFAULT )
|
||||
{
|
||||
st25r200ledFieldOff();
|
||||
st25r200ledRxOff();
|
||||
st25r200ledErrOff();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,250 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file st25r200_irq.c
|
||||
* @author MMY Application Team
|
||||
* @brief ST25R200 Interrupt handling
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2021 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 "st25r200_irq.h"
|
||||
#include "st25r200_com.h"
|
||||
#include "st25r200.h"
|
||||
#include "rfal_utils.h"
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* LOCAL DATA TYPES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/*! Holds current and previous interrupt callback pointer as well as current Interrupt status and mask */
|
||||
typedef struct
|
||||
{
|
||||
void (*prevCallback)(void); /*!< call back function for ST25R200 interrupt */
|
||||
void (*callback)(void); /*!< call back function for ST25R200 interrupt */
|
||||
uint32_t status; /*!< latest interrupt status */
|
||||
uint32_t mask; /*!< Interrupt mask. Negative mask = ST25R200 mask regs */
|
||||
} st25r200Interrupt;
|
||||
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL DEFINES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/*! Length of the interrupt registers */
|
||||
#define ST25R200_INT_REGS_LEN ( (ST25R200_REG_IRQ3 - ST25R200_REG_IRQ1) + 1U )
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL VARIABLES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
static volatile st25r200Interrupt st25r200interrupt; /*!< Instance of ST25R200 interrupt */
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL FUNCTIONS
|
||||
******************************************************************************
|
||||
*/
|
||||
void st25r200InitInterrupts( void )
|
||||
{
|
||||
platformIrqST25RPinInitialize();
|
||||
platformIrqST25RSetCallback( st25r200Isr );
|
||||
|
||||
st25r200interrupt.callback = NULL;
|
||||
st25r200interrupt.prevCallback = NULL;
|
||||
st25r200interrupt.status = ST25R200_IRQ_MASK_NONE;
|
||||
st25r200interrupt.mask = ST25R200_IRQ_MASK_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
void st25r200Isr( void )
|
||||
{
|
||||
st25r200CheckForReceivedInterrupts();
|
||||
|
||||
/* Check if callback is set and run it */
|
||||
if( NULL != st25r200interrupt.callback )
|
||||
{
|
||||
st25r200interrupt.callback();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
void st25r200CheckForReceivedInterrupts( void )
|
||||
{
|
||||
uint8_t iregs[ST25R200_INT_REGS_LEN];
|
||||
uint32_t irqStatus;
|
||||
|
||||
#ifdef ST25R_POLL_IRQ
|
||||
/* Exit immediately in case of no IRQ */
|
||||
if( platformGpioIsLow( ST25R_INT_PORT, ST25R_INT_PIN ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif /* ST25R_POLL_IRQ */
|
||||
|
||||
/* Initialize iregs */
|
||||
irqStatus = ST25R200_IRQ_MASK_NONE;
|
||||
RFAL_MEMSET( iregs, (int32_t)(ST25R200_IRQ_MASK_ALL & 0xFFU), ST25R200_INT_REGS_LEN );
|
||||
|
||||
/* In case the IRQ is Edge (not Level) triggered read IRQs until done */
|
||||
while( platformGpioIsHigh( ST25R_INT_PORT, ST25R_INT_PIN ) )
|
||||
{
|
||||
st25r200ReadMultipleRegisters( ST25R200_REG_IRQ1, iregs, ST25R200_INT_REGS_LEN );
|
||||
|
||||
irqStatus |= (uint32_t)iregs[0];
|
||||
irqStatus |= (uint32_t)iregs[1]<<8;
|
||||
irqStatus |= (uint32_t)iregs[2]<<16;
|
||||
}
|
||||
|
||||
/* Forward all interrupts, even masked ones to application */
|
||||
platformProtectST25RIrqStatus();
|
||||
st25r200interrupt.status |= irqStatus;
|
||||
platformUnprotectST25RIrqStatus();
|
||||
|
||||
/* Send an IRQ event to LED handling */
|
||||
st25r200ledEvtIrq( st25r200interrupt.status );
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
void st25r200ModifyInterrupts(uint32_t clr_mask, uint32_t set_mask)
|
||||
{
|
||||
uint8_t i;
|
||||
uint32_t old_mask;
|
||||
uint32_t new_mask;
|
||||
|
||||
old_mask = st25r200interrupt.mask;
|
||||
new_mask = ((~old_mask & set_mask) | (old_mask & clr_mask));
|
||||
st25r200interrupt.mask &= ~clr_mask;
|
||||
st25r200interrupt.mask |= set_mask;
|
||||
|
||||
for(i=0; i<ST25R200_INT_REGS_LEN; i++)
|
||||
{
|
||||
if( ((new_mask >> (8U*i)) & 0xFFU) == 0U )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
st25r200WriteRegister(ST25R200_REG_IRQ_MASK1 + i, (uint8_t)((st25r200interrupt.mask>>(8U*i)) & 0xFFU) );
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
uint32_t st25r200WaitForInterruptsTimed( uint32_t mask, uint16_t tmo )
|
||||
{
|
||||
uint32_t tmrDelay;
|
||||
uint32_t status;
|
||||
|
||||
tmrDelay = platformTimerCreate( tmo );
|
||||
|
||||
/* Run until specific interrupt has happen or the timer has expired */
|
||||
do
|
||||
{
|
||||
#ifdef ST25R_POLL_IRQ
|
||||
st25r200CheckForReceivedInterrupts();
|
||||
#endif /* ST25R_POLL_IRQ */
|
||||
|
||||
status = (st25r200interrupt.status & mask);
|
||||
} while( ( (!platformTimerIsExpired( tmrDelay )) || (tmo == 0U)) && (status == 0U) );
|
||||
|
||||
platformTimerDestroy( tmrDelay );
|
||||
|
||||
status = st25r200interrupt.status & mask;
|
||||
|
||||
platformProtectST25RIrqStatus();
|
||||
st25r200interrupt.status &= ~status;
|
||||
platformUnprotectST25RIrqStatus();
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
uint32_t st25r200GetInterrupt( uint32_t mask )
|
||||
{
|
||||
uint32_t irqs;
|
||||
|
||||
irqs = (st25r200interrupt.status & mask);
|
||||
if(irqs != ST25R200_IRQ_MASK_NONE)
|
||||
{
|
||||
platformProtectST25RIrqStatus();
|
||||
st25r200interrupt.status &= ~irqs;
|
||||
platformUnprotectST25RIrqStatus();
|
||||
}
|
||||
|
||||
return irqs;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
void st25r200ClearAndEnableInterrupts( uint32_t mask )
|
||||
{
|
||||
st25r200GetInterrupt( mask );
|
||||
st25r200EnableInterrupts( mask );
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
void st25r200EnableInterrupts(uint32_t mask)
|
||||
{
|
||||
st25r200ModifyInterrupts(mask, 0);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
void st25r200DisableInterrupts(uint32_t mask)
|
||||
{
|
||||
st25r200ModifyInterrupts(0, mask);
|
||||
}
|
||||
|
||||
/*******************************************************************************/
|
||||
void st25r200ClearInterrupts( void )
|
||||
{
|
||||
uint8_t iregs[ST25R200_INT_REGS_LEN];
|
||||
|
||||
st25r200ReadMultipleRegisters(ST25R200_REG_IRQ1, iregs, ST25R200_INT_REGS_LEN);
|
||||
|
||||
platformProtectST25RIrqStatus();
|
||||
st25r200interrupt.status = ST25R200_IRQ_MASK_NONE;
|
||||
platformUnprotectST25RIrqStatus();
|
||||
return;
|
||||
}
|
||||
|
||||
/*******************************************************************************/
|
||||
void st25r200IRQCallbackSet( void (*cb)(void) )
|
||||
{
|
||||
st25r200interrupt.prevCallback = st25r200interrupt.callback;
|
||||
st25r200interrupt.callback = cb;
|
||||
}
|
||||
|
||||
/*******************************************************************************/
|
||||
void st25r200IRQCallbackRestore( void )
|
||||
{
|
||||
st25r200interrupt.callback = st25r200interrupt.prevCallback;
|
||||
st25r200interrupt.prevCallback = NULL;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,222 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file st25r200_irq.h
|
||||
* @author MMY Application Team
|
||||
* @brief ST25R200 Interrupt handling
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2021 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.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef ST25R200_IRQ_H
|
||||
#define ST25R200_IRQ_H
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* INCLUDES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include "rfal_platform.h"
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL DEFINES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#define ST25R200_IRQ_MASK_ALL (uint32_t)(0xFFFFFFFFUL) /*!< All ST25R200 interrupt sources */
|
||||
#define ST25R200_IRQ_MASK_NONE (uint32_t)(0x00000000UL) /*!< No ST25R200 interrupt source */
|
||||
|
||||
/* Main interrupt register */
|
||||
#define ST25R200_IRQ_MASK_SUBC_START (uint32_t)(0x00000080U) /*!< ST25R200 subcarrier start interrupt */
|
||||
#define ST25R200_IRQ_MASK_COL (uint32_t)(0x00000040U) /*!< ST25R200 bit collision interrupt */
|
||||
#define ST25R200_IRQ_MASK_WL (uint32_t)(0x00000020U) /*!< ST25R200 FIFO water level interrupt */
|
||||
#define ST25R200_IRQ_MASK_RX_REST (uint32_t)(0x00000010U) /*!< ST25R200 automatic reception restart interrupt */
|
||||
#define ST25R200_IRQ_MASK_RXE (uint32_t)(0x00000008U) /*!< ST25R200 end of receive interrupt */
|
||||
#define ST25R200_IRQ_MASK_RXS (uint32_t)(0x00000004U) /*!< ST25R200 start of receive interrupt */
|
||||
#define ST25R200_IRQ_MASK_TXE (uint32_t)(0x00000002U) /*!< ST25R200 end of transmission interrupt */
|
||||
#define ST25R200_IRQ_MASK_RFU1 (uint32_t)(0x00000001U) /*!< ST25R200 RFU interrupt */
|
||||
|
||||
/* Timer and Error interrupt register */
|
||||
#define ST25R200_IRQ_MASK_GPE (uint32_t)(0x00008000U) /*!< ST25R200 general purpose timer expired interrupt */
|
||||
#define ST25R200_IRQ_MASK_NRE (uint32_t)(0x00004000U) /*!< ST25R200 no-response timer expired interrupt */
|
||||
#define ST25R200_IRQ_MASK_RFU2 (uint32_t)(0x00002000U) /*!< ST25R200 RFU interrupt */
|
||||
#define ST25R200_IRQ_MASK_RFU3 (uint32_t)(0x00001000U) /*!< ST25R200 RFU interrupt */
|
||||
#define ST25R200_IRQ_MASK_CRC (uint32_t)(0x00000800U) /*!< ST25R200 CRC error interrupt */
|
||||
#define ST25R200_IRQ_MASK_PAR (uint32_t)(0x00000400U) /*!< ST25R200 parity error interrupt */
|
||||
#define ST25R200_IRQ_MASK_HFE (uint32_t)(0x00000200U) /*!< ST25R200 hard framing error interrupt */
|
||||
#define ST25R200_IRQ_MASK_SFE (uint32_t)(0x00000100U) /*!< ST25R200 soft framing error interrupt */
|
||||
|
||||
/* Wake-up interrupt register */
|
||||
#define ST25R200_IRQ_MASK_RFU4 (uint32_t)(0x00800000U) /*!< ST25R200 RFU interrupt */
|
||||
#define ST25R200_IRQ_MASK_RFU5 (uint32_t)(0x00400000U) /*!< ST25R200 RFU interrupt */
|
||||
#define ST25R200_IRQ_MASK_RFU6 (uint32_t)(0x00200000U) /*!< ST25R200 RFU interrupt */
|
||||
#define ST25R200_IRQ_MASK_DCT (uint32_t)(0x00100000U) /*!< ST25R200 termination of direct command interrupt */
|
||||
#define ST25R200_IRQ_MASK_WUQ (uint32_t)(0x00080000U) /*!< ST25R200 wake-up Q-Channel interrupt */
|
||||
#define ST25R200_IRQ_MASK_WUI (uint32_t)(0x00040000U) /*!< ST25R200 wake-up I-Channel interrupt */
|
||||
#define ST25R200_IRQ_MASK_WUT (uint32_t)(0x00020000U) /*!< ST25R200 wake-up interrupt */
|
||||
#define ST25R200_IRQ_MASK_OSC (uint32_t)(0x00010000U) /*!< ST25R200 oscillator stable interrupt */
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL FUNCTION PROTOTYPES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Wait until an ST25R200 interrupt occurs
|
||||
*
|
||||
* This function is used to access the ST25R200 interrupt flags. Use this
|
||||
* to wait for max. \a tmo milliseconds for the \b first interrupt indicated
|
||||
* with mask \a mask to occur.
|
||||
*
|
||||
* \param[in] mask : mask indicating the interrupts to wait for.
|
||||
* \param[in] tmo : time in milliseconds until timeout occurs. If set to 0
|
||||
* the functions waits forever.
|
||||
*
|
||||
* \return : 0 if timeout occured otherwise a mask indicating the cleared
|
||||
* interrupts.
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
uint32_t st25r200WaitForInterruptsTimed( uint32_t mask, uint16_t tmo );
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Get status for the given interrupt
|
||||
*
|
||||
* This function is used to check whether the interrupt given by \a mask
|
||||
* has occured. If yes the interrupt gets cleared. This function returns
|
||||
* only status bits which are inside \a mask.
|
||||
*
|
||||
* \param[in] mask : mask indicating the interrupt to check for.
|
||||
*
|
||||
* \return the mask of the interrupts occurred
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
uint32_t st25r200GetInterrupt( uint32_t mask );
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Init the 200 interrupt
|
||||
*
|
||||
* This function is used to check whether the interrupt given by \a mask
|
||||
* has occured.
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
void st25r200InitInterrupts( void );
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Modifies the Interrupt
|
||||
*
|
||||
* This function modifies the interrupt
|
||||
*
|
||||
* \param[in] clr_mask : bit mask to be cleared on the interrupt mask
|
||||
* \param[in] set_mask : bit mask to be set on the interrupt mask
|
||||
*****************************************************************************
|
||||
*/
|
||||
void st25r200ModifyInterrupts( uint32_t clr_mask, uint32_t set_mask );
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Checks received interrupts
|
||||
*
|
||||
* Checks received interrupts and saves the result into global params
|
||||
*****************************************************************************
|
||||
*/
|
||||
void st25r200CheckForReceivedInterrupts( void );
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief ISR Service routine
|
||||
*
|
||||
* This function modiefies the interupt
|
||||
*****************************************************************************
|
||||
*/
|
||||
void st25r200Isr( void );
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Enable a given ST25R200 Interrupt source
|
||||
*
|
||||
* This function enables all interrupts given by \a mask,
|
||||
* ST25R200_IRQ_MASK_ALL enables all interrupts.
|
||||
*
|
||||
* \param[in] mask: mask indicating the interrupts to be enabled
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
void st25r200EnableInterrupts( uint32_t mask );
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Disable one or more a given ST25R200 Interrupt sources
|
||||
*
|
||||
* This function disables all interrupts given by \a mask. 0xff disables all.
|
||||
*
|
||||
* \param[in] mask: mask indicating the interrupts to be disabled.
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
void st25r200DisableInterrupts( uint32_t mask );
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Clear all ST25R200 irq flags
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
void st25r200ClearInterrupts( void );
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Clears and then enables the given ST25R200 Interrupt sources
|
||||
*
|
||||
* \param[in] mask: mask indicating the interrupts to be cleared and enabled
|
||||
*****************************************************************************
|
||||
*/
|
||||
void st25r200ClearAndEnableInterrupts( uint32_t mask );
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Sets IRQ callback for the ST25R200 interrupt
|
||||
*
|
||||
* \param[in] cb: pointer to the callback method
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
void st25r200IRQCallbackSet( void (*cb)( void ) );
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Sets IRQ callback for the ST25R200 interrupt
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
void st25r200IRQCallbackRestore( void );
|
||||
|
||||
#endif /* ST25R200_IRQ_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
@@ -0,0 +1,152 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file st_errno.h
|
||||
* @author MMY Application Team
|
||||
* @brief Main error codes
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2021 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.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef ST_ERRNO_H
|
||||
#define ST_ERRNO_H
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* INCLUDES
|
||||
******************************************************************************
|
||||
*/
|
||||
#include <stdint.h>
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL DATA TYPES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
typedef uint16_t stError; /*!< ST error type */
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* DEFINES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Error codes to be used within the application.
|
||||
* They are represented by an uint8_t
|
||||
*/
|
||||
|
||||
#define ERR_NONE ((stError)0U) /*!< no error occurred */
|
||||
#define ERR_NOMEM ((stError)1U) /*!< not enough memory to perform the requested operation */
|
||||
#define ERR_BUSY ((stError)2U) /*!< device or resource busy */
|
||||
#define ERR_IO ((stError)3U) /*!< generic IO error */
|
||||
#define ERR_TIMEOUT ((stError)4U) /*!< error due to timeout */
|
||||
#define ERR_REQUEST ((stError)5U) /*!< invalid request or requested function can't be executed at the moment */
|
||||
#define ERR_NOMSG ((stError)6U) /*!< No message of desired type */
|
||||
#define ERR_PARAM ((stError)7U) /*!< Parameter error */
|
||||
#define ERR_SYSTEM ((stError)8U) /*!< System error */
|
||||
#define ERR_FRAMING ((stError)9U) /*!< Framing error */
|
||||
#define ERR_OVERRUN ((stError)10U) /*!< lost one or more received bytes */
|
||||
#define ERR_PROTO ((stError)11U) /*!< protocol error */
|
||||
#define ERR_INTERNAL ((stError)12U) /*!< Internal Error */
|
||||
#define ERR_AGAIN ((stError)13U) /*!< Call again */
|
||||
#define ERR_MEM_CORRUPT ((stError)14U) /*!< memory corruption */
|
||||
#define ERR_NOT_IMPLEMENTED ((stError)15U) /*!< not implemented */
|
||||
#define ERR_PC_CORRUPT ((stError)16U) /*!< Program Counter has been manipulated or spike/noise trigger illegal operation */
|
||||
#define ERR_SEND ((stError)17U) /*!< error sending*/
|
||||
#define ERR_IGNORE ((stError)18U) /*!< indicates error detected but to be ignored */
|
||||
#define ERR_SEMANTIC ((stError)19U) /*!< indicates error in state machine (unexpected cmd) */
|
||||
#define ERR_SYNTAX ((stError)20U) /*!< indicates error in state machine (unknown cmd) */
|
||||
#define ERR_CRC ((stError)21U) /*!< crc error */
|
||||
#define ERR_NOTFOUND ((stError)22U) /*!< transponder not found */
|
||||
#define ERR_NOTUNIQUE ((stError)23U) /*!< transponder not unique - more than one transponder in field */
|
||||
#define ERR_NOTSUPP ((stError)24U) /*!< requested operation not supported */
|
||||
#define ERR_WRITE ((stError)25U) /*!< write error */
|
||||
#define ERR_FIFO ((stError)26U) /*!< fifo over or underflow error */
|
||||
#define ERR_PAR ((stError)27U) /*!< parity error */
|
||||
#define ERR_DONE ((stError)28U) /*!< transfer has already finished */
|
||||
#define ERR_RF_COLLISION ((stError)29U) /*!< collision error (Bit Collision or during RF Collision avoidance ) */
|
||||
#define ERR_HW_OVERRUN ((stError)30U) /*!< lost one or more received bytes */
|
||||
#define ERR_RELEASE_REQ ((stError)31U) /*!< device requested release */
|
||||
#define ERR_SLEEP_REQ ((stError)32U) /*!< device requested sleep */
|
||||
#define ERR_WRONG_STATE ((stError)33U) /*!< incorrent state for requested operation */
|
||||
#define ERR_MAX_RERUNS ((stError)34U) /*!< blocking procedure reached maximum runs */
|
||||
#define ERR_DISABLED ((stError)35U) /*!< operation aborted due to disabled configuration */
|
||||
#define ERR_HW_MISMATCH ((stError)36U) /*!< expected hw do not match */
|
||||
#define ERR_LINK_LOSS ((stError)37U) /*!< Other device's field didn't behave as expected: turned off by Initiator in Passive mode, or AP2P did not turn on field */
|
||||
#define ERR_INVALID_HANDLE ((stError)38U) /*!< invalid or not initialized device handle */
|
||||
|
||||
#define ERR_INCOMPLETE_BYTE ((stError)40U) /*!< Incomplete byte rcvd */
|
||||
#define ERR_INCOMPLETE_BYTE_01 ((stError)41U) /*!< Incomplete byte rcvd - 1 bit */
|
||||
#define ERR_INCOMPLETE_BYTE_02 ((stError)42U) /*!< Incomplete byte rcvd - 2 bit */
|
||||
#define ERR_INCOMPLETE_BYTE_03 ((stError)43U) /*!< Incomplete byte rcvd - 3 bit */
|
||||
#define ERR_INCOMPLETE_BYTE_04 ((stError)44U) /*!< Incomplete byte rcvd - 4 bit */
|
||||
#define ERR_INCOMPLETE_BYTE_05 ((stError)45U) /*!< Incomplete byte rcvd - 5 bit */
|
||||
#define ERR_INCOMPLETE_BYTE_06 ((stError)46U) /*!< Incomplete byte rcvd - 6 bit */
|
||||
#define ERR_INCOMPLETE_BYTE_07 ((stError)47U) /*!< Incomplete byte rcvd - 7 bit */
|
||||
|
||||
/* General Sub-category number */
|
||||
#define ERR_GENERIC_GRP (0x0000) /*!< Reserved value for generic error no */
|
||||
#define ERR_WARN_GRP (0x0100) /*!< Errors which are not expected in normal operation */
|
||||
#define ERR_PROCESS_GRP (0x0200) /*!< Processes management errors */
|
||||
#define ERR_SIO_GRP (0x0800) /*!< SIO errors due to logging */
|
||||
#define ERR_RINGBUF_GRP (0x0900) /*!< Ring Buffer errors */
|
||||
#define ERR_MQ_GRP (0x0A00) /*!< MQ errors */
|
||||
#define ERR_TIMER_GRP (0x0B00) /*!< Timer errors */
|
||||
#define ERR_RFAL_GRP (0x0C00) /*!< RFAL errors */
|
||||
#define ERR_UART_GRP (0x0D00) /*!< UART errors */
|
||||
#define ERR_SPI_GRP (0x0E00) /*!< SPI errors */
|
||||
#define ERR_I2C_GRP (0x0F00) /*!< I2c errors */
|
||||
|
||||
|
||||
#define ERR_INSERT_SIO_GRP(x) (ERR_SIO_GRP | (x)) /*!< Insert the SIO grp */
|
||||
#define ERR_INSERT_RINGBUF_GRP(x) (ERR_RINGBUF_GRP | (x)) /*!< Insert the Ring Buffer grp */
|
||||
#define ERR_INSERT_RFAL_GRP(x) (ERR_RFAL_GRP | (x)) /*!< Insert the RFAL grp */
|
||||
#define ERR_INSERT_SPI_GRP(x) (ERR_SPI_GRP | (x)) /*!< Insert the spi grp */
|
||||
#define ERR_INSERT_I2C_GRP(x) (ERR_I2C_GRP | (x)) /*!< Insert the i2c grp */
|
||||
#define ERR_INSERT_UART_GRP(x) (ERR_UART_GRP | (x)) /*!< Insert the uart grp */
|
||||
#define ERR_INSERT_TIMER_GRP(x) (ERR_TIMER_GRP | (x)) /*!< Insert the timer grp */
|
||||
#define ERR_INSERT_MQ_GRP(x) (ERR_MQ_GRP | (x)) /*!< Insert the mq grp */
|
||||
#define ERR_INSERT_PROCESS_GRP(x) (ERR_PROCESS_GRP | (x)) /*!< Insert the process grp */
|
||||
#define ERR_INSERT_WARN_GRP(x) (ERR_WARN_GRP | (x)) /*!< Insert the i2c grp */
|
||||
#define ERR_INSERT_GENERIC_GRP(x) (ERR_GENERIC_GRP | (x)) /*!< Insert the generic grp */
|
||||
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL MACROS
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#define ERR_NO_MASK(x) ((uint16_t)(x) & 0x00FFU) /*!< Mask the error number */
|
||||
|
||||
|
||||
|
||||
/*! Common code to exit a function with the error if function f return error */
|
||||
#define EXIT_ON_ERR(r, f) \
|
||||
(r) = (f); \
|
||||
if (ERR_NONE != (r)) \
|
||||
{ \
|
||||
return (r); \
|
||||
}
|
||||
|
||||
|
||||
/*! Common code to exit a function if process/function f has not concluded */
|
||||
#define EXIT_ON_BUSY(r, f) \
|
||||
(r) = (f); \
|
||||
if (ERR_BUSY == (r)) \
|
||||
{ \
|
||||
return (r); \
|
||||
}
|
||||
#endif /* ST_ERRNO_H */
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file timer.c
|
||||
* @author MMY Application Team
|
||||
* @brief This module makes use of a System Tick in millisconds and provides
|
||||
* an abstraction for SW timers
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2021 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 "timer.h"
|
||||
#include "rfal_platform.h"
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* LOCAL DEFINES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* LOCAL VARIABLES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
static uint32_t timerStopwatchTick;
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL FUNCTIONS
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
uint32_t timerCalculateTimer( uint16_t time )
|
||||
{
|
||||
return (platformGetSysTick() + time);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
bool timerIsExpired( uint32_t timer )
|
||||
{
|
||||
uint32_t uDiff;
|
||||
int32_t sDiff;
|
||||
|
||||
uDiff = (timer - platformGetSysTick()); /* Calculate the diff between the timers */
|
||||
sDiff = uDiff; /* Convert the diff to a signed var */
|
||||
/* Having done this has two side effects:
|
||||
* 1) all differences smaller than -(2^31) ms (~25d) will become positive
|
||||
* Signaling not expired: acceptable!
|
||||
* 2) Time roll-over case will be handled correctly: super!
|
||||
*/
|
||||
|
||||
/* Check if the given timer has expired already */
|
||||
if( sDiff < 0 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
void timerDelay( uint16_t tOut )
|
||||
{
|
||||
uint32_t t;
|
||||
|
||||
/* Calculate the timer and wait blocking until is running */
|
||||
t = timerCalculateTimer( tOut );
|
||||
while( timerIsRunning(t) );
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
void timerStopwatchStart( void )
|
||||
{
|
||||
timerStopwatchTick = platformGetSysTick();
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
uint32_t timerStopwatchMeasure( void )
|
||||
{
|
||||
return (uint32_t)(platformGetSysTick() - timerStopwatchTick);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file timer.h
|
||||
* @author MMY Application Team
|
||||
* @brief This module makes use of a System Tick in millisconds and provides
|
||||
* an abstraction for SW timers
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2021 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.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef TIMER_H
|
||||
#define TIMER_H
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* INCLUDES
|
||||
******************************************************************************
|
||||
*/
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL MACROS
|
||||
******************************************************************************
|
||||
*/
|
||||
#define timerIsRunning(t) (!timerIsExpired(t))
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL DEFINES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Calculate Timer
|
||||
*
|
||||
* This method calculates when the timer will be expired given the amount
|
||||
* time in milliseconds /a tOut.
|
||||
* Once the timer has been calculated it will then be used to check when
|
||||
* it expires.
|
||||
*
|
||||
* \see timersIsExpired
|
||||
*
|
||||
* \param[in] time : time/duration in Milliseconds for the timer
|
||||
*
|
||||
* \return u32 : The new timer calculated based on the given time
|
||||
*****************************************************************************
|
||||
*/
|
||||
uint32_t timerCalculateTimer( uint16_t time );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Checks if a Timer is Expired
|
||||
*
|
||||
* This method checks if a timer has already expired.
|
||||
* Based on the given timer previously calculated it checks if this timer
|
||||
* has already elapsed
|
||||
*
|
||||
* \see timersCalculateTimer
|
||||
*
|
||||
* \param[in] timer : the timer to check
|
||||
*
|
||||
* \return true : timer has already expired
|
||||
* \return false : timer is still running
|
||||
*****************************************************************************
|
||||
*/
|
||||
bool timerIsExpired( uint32_t timer );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Performs a Delay
|
||||
*
|
||||
* This method performs a delay for the given amount of time in Milliseconds
|
||||
*
|
||||
* \param[in] time : time/duration in Milliseconds of the delay
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
void timerDelay( uint16_t time );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Stopwatch start
|
||||
*
|
||||
* This method initiates the stopwatch to later measure the time in ms
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
void timerStopwatchStart( void );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Stopwatch Measure
|
||||
*
|
||||
* This method returns the elapsed time in ms since the stopwatch was initiated
|
||||
*
|
||||
* \return The time in ms since the stopwatch was started
|
||||
*****************************************************************************
|
||||
*/
|
||||
uint32_t timerStopwatchMeasure( void );
|
||||
|
||||
#endif /* TIMER_H */
|
||||
@@ -0,0 +1,92 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file utils.h
|
||||
* @author MMY Application Team
|
||||
* @brief Common and helpful macros
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2021 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.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef UTILS_H
|
||||
#define UTILS_H
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* INCLUDES
|
||||
******************************************************************************
|
||||
*/
|
||||
#include <string.h>
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL MACROS
|
||||
******************************************************************************
|
||||
*/
|
||||
/*!
|
||||
* this macro evaluates an error variable \a ERR against an error code \a EC.
|
||||
* in case it is not equal it jumps to the given label \a LABEL.
|
||||
*/
|
||||
#define EVAL_ERR_NE_GOTO(EC, ERR, LABEL) \
|
||||
if ((EC) != (ERR)) goto LABEL;
|
||||
|
||||
/*!
|
||||
* this macro evaluates an error variable \a ERR against an error code \a EC.
|
||||
* in case it is equal it jumps to the given label \a LABEL.
|
||||
*/
|
||||
#define EVAL_ERR_EQ_GOTO(EC, ERR, LABEL) \
|
||||
if ((EC) == (ERR)) goto LABEL;
|
||||
|
||||
#define SIZEOF_ARRAY(a) (sizeof(a) / sizeof((a)[0])) /*!< Compute the size of an array */
|
||||
#define MAX(a, b) (((a) > (b)) ? (a) : (b)) /*!< Return the maximum of the 2 values */
|
||||
#define MIN(a, b) (((a) < (b)) ? (a) : (b)) /*!< Return the minimum of the 2 values */
|
||||
#define BITMASK_1 (0x01) /*!< Bit mask for lsb bit */
|
||||
#define BITMASK_2 (0x03) /*!< Bit mask for two lsb bits */
|
||||
#define BITMASK_3 (0x07) /*!< Bit mask for three lsb bits */
|
||||
#define BITMASK_4 (0x0F) /*!< Bit mask for four lsb bits */
|
||||
#define U16TOU8(a) ((a) & 0x00FF) /*!< Cast 16-bit unsigned to 8-bit unsigned */
|
||||
#define GETU16(a) (((uint16_t)(a)[0] << 8) | (uint16_t)(a)[1])/*!< Cast two Big Endian 8-bits byte array to 16-bits unsigned */
|
||||
#define GETU32(a) (((uint32_t)(a)[0] << 24) | ((uint32_t)(a)[1] << 16) | ((uint32_t)(a)[2] << 8) | ((uint32_t)(a)[3])) /*!< Cast four Big Endian 8-bit byte array to 32-bit unsigned */
|
||||
|
||||
#define REVERSE_BYTES(pData, nDataSize) \
|
||||
{unsigned char swap, *lo = ((unsigned char *)(pData)), *hi = ((unsigned char *)(pData)) + (nDataSize) - 1; \
|
||||
while (lo < hi) { swap = *lo; *lo++ = *hi; *hi-- = swap; }}
|
||||
|
||||
#ifdef __CSMC__
|
||||
/* STM8 COSMIC */
|
||||
#define ST_MEMMOVE(s1,s2,n) memmove(s1,s2,n) /*!< map memmove to string library code */
|
||||
static inline void * ST_MEMCPY(void *s1, const void *s2, uint32_t n) { return memcpy(s1,s2,(uint16_t)n); } /* PRQA S 0431 # MISRA 1.1 - string.h from Cosmic only provides functions with low qualified parameters */
|
||||
#define ST_MEMSET(s1,c,n) memset(s1,(char)(c),n) /*!< map memset to string library code */
|
||||
static inline int32_t ST_BYTECMP(void *s1, const void *s2, uint32_t n) { return (int32_t)memcmp(s1,s2,(uint16_t)n); } /* PRQA S 0431 # MISRA 1.1 - string.h from Cosmic only provides functions with low qualified parameters */
|
||||
|
||||
#else /* __CSMC__ */
|
||||
|
||||
#define ST_MEMMOVE memmove /*!< map memmove to string library code */
|
||||
#define ST_MEMCPY memcpy /*!< map memcpy to string library code */
|
||||
#define ST_MEMSET memset /*!< map memset to string library code */
|
||||
#define ST_BYTECMP memcmp /*!< map bytecmp to string library code */
|
||||
#endif /* __CSMC__ */
|
||||
|
||||
#define NO_WARNING(v) ((void) (v)) /*!< Macro to suppress compiler warning */
|
||||
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL (void*)0 /*!< represents a NULL pointer */
|
||||
#endif /* !NULL */
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL FUNCTION PROTOTYPES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#endif /* UTILS_H */
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
Copyright 2021 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,6 @@
|
||||
This software component is provided to you as part of a software package and
|
||||
applicable license terms are in the Package_license file. If you received this
|
||||
software component outside of a package or without applicable license terms,
|
||||
the terms of the BSD-3-Clause license shall apply.
|
||||
You may obtain a copy of the BSD-3-Clause at:
|
||||
https://opensource.org/licenses/BSD-3-Clause
|
||||
@@ -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 ST25R500</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]-->
|
||||
<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-x-cube-nfc12-software-for-stm32"><small>Release Notes for</small> <strong>ST25R500 driver</strong></h1>
|
||||
<p>Copyright © 2023 STMicroelectronics<br />
|
||||
</p>
|
||||
<a href="https://www.st.com" class="logo"><img src="../../../../_htmresc/st_logo.png" alt="ST logo" /></a>
|
||||
</center>
|
||||
<h1 id="purpose">Purpose</h1>
|
||||
<p>The X-CUBE-NFC12 software package is an expansion for STM32Cube. This software provides drivers running on STM32 for ST25R500 device.</p>
|
||||
<ul>
|
||||
</ul>
|
||||
<ul>
|
||||
<ul>
|
||||
</ul></li>
|
||||
<ul>
|
||||
</ul></li>
|
||||
<ul>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<ul>
|
||||
</ul>
|
||||
</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">V1.0.0 / 10-April-2025</label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<h3 id="maintenance-release">First release</h3>
|
||||
<ul>
|
||||
<li>First official release.</li>
|
||||
</ul>
|
||||
<h2 id="known-limitations">Known Limitations</h2>
|
||||
<ul>
|
||||
<li>None</li>
|
||||
</ul>
|
||||
<h2 id="known-issues">Known Issues</h2>
|
||||
<ul>
|
||||
<li>None</li>
|
||||
</ul>
|
||||
<h2 id="important-hardware-additional-information">Important Hardware Additional Information</h2>
|
||||
<ul>
|
||||
<li>None</li>
|
||||
</ul>
|
||||
<h2 id="backward-compatibility">Backward Compatibility</h2>
|
||||
<ul>
|
||||
<li>None</li>
|
||||
</ul>
|
||||
<h2 id="dependencies">Dependencies</h2>
|
||||
<ul>
|
||||
<li>None</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="sticky">
|
||||
<p>For complete documentation on <strong>X-CUBE-NFC12</strong> , visit: <a href="https://www.st.com/en/embedded-software/x-cube-nfc12.html">www.st.com</a></p>
|
||||
This release note uses up to date web standards and, for this reason, should not be opened with Internet Explorer but preferably with popular browsers such as Google Chrome, Mozilla Firefox, Opera or Microsoft Edge.
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,751 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file : rfal_analogConfig.h
|
||||
* @brief : ST25R500 Analog Configuration Settings
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2025 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.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef ST25R500_ANALOGCONFIG_H
|
||||
#define ST25R500_ANALOGCONFIG_H
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* INCLUDES
|
||||
******************************************************************************
|
||||
*/
|
||||
#include "rfal_analogConfig.h"
|
||||
#include "st25r500_com.h"
|
||||
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* DEFINES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL MACROS
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/*! Macro for Configuration Setting with only one register-mask-value set:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1] */
|
||||
#define MODE_ENTRY_1_REG(MODE, R0, M0, V0) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 1, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0)
|
||||
|
||||
/*! Macro for Configuration Setting with only two register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1] */
|
||||
#define MODE_ENTRY_2_REG(MODE, R0, M0, V0, R1, M1, V1) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 2, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1)
|
||||
|
||||
/*! Macro for Configuration Setting with only three register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_3_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 3, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2)
|
||||
|
||||
/*! Macro for Configuration Setting with only four register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_4_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 4, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3)
|
||||
|
||||
/*! Macro for Configuration Setting with only five register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_5_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 5, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4)
|
||||
|
||||
/*! Macro for Configuration Setting with only six register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_6_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 6, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5)
|
||||
|
||||
/*! Macro for Configuration Setting with only seven register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_7_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 7, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \
|
||||
, (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6)
|
||||
|
||||
/*! Macro for Configuration Setting with only eight register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_8_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 8, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \
|
||||
, (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \
|
||||
, (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7)
|
||||
|
||||
/*! Macro for Configuration Setting with only nine register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_9_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 9, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \
|
||||
, (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \
|
||||
, (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \
|
||||
, (uint8_t)((uint16_t)(R8) >> 8U), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8)
|
||||
|
||||
/*! Macro for Configuration Setting with only ten register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_10_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU),10, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \
|
||||
, (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \
|
||||
, (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \
|
||||
, (uint8_t)((uint16_t)(R8) >> 8U), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \
|
||||
, (uint8_t)((uint16_t)(R9) >> 8U), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9)
|
||||
|
||||
/*! Macro for Configuration Setting with eleven register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_11_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU),11, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \
|
||||
, (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \
|
||||
, (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \
|
||||
, (uint8_t)((uint16_t)(R8) >> 8U), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \
|
||||
, (uint8_t)((uint16_t)(R9) >> 8U), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \
|
||||
, (uint8_t)((uint16_t)(R10) >> 8U), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10)
|
||||
|
||||
/*! Macro for Configuration Setting with twelve register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_12_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU),12, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \
|
||||
, (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \
|
||||
, (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \
|
||||
, (uint8_t)((uint16_t)(R8) >> 8U), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \
|
||||
, (uint8_t)((uint16_t)(R9) >> 8U), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \
|
||||
, (uint8_t)((uint16_t)(R10) >> 8U), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \
|
||||
, (uint8_t)((uint16_t)(R11) >> 8U), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11)
|
||||
|
||||
/*! Macro for Configuration Setting with thirteen register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_13_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11, R12, M12, V12) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU),13, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \
|
||||
, (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \
|
||||
, (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \
|
||||
, (uint8_t)((uint16_t)(R8) >> 8U), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \
|
||||
, (uint8_t)((uint16_t)(R9) >> 8U), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \
|
||||
, (uint8_t)((uint16_t)(R10) >> 8U), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \
|
||||
, (uint8_t)((uint16_t)(R11) >> 8U), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11) \
|
||||
, (uint8_t)((uint16_t)(R12) >> 8U), (uint8_t)((R12) & 0xFFU), (uint8_t)(M12), (uint8_t)(V12)
|
||||
|
||||
/*! Macro for Configuration Setting with fourteen register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_14_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11, R12, M12, V12, R13, M13, V13) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU),14, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \
|
||||
, (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \
|
||||
, (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \
|
||||
, (uint8_t)((uint16_t)(R8) >> 8U), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \
|
||||
, (uint8_t)((uint16_t)(R9) >> 8U), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \
|
||||
, (uint8_t)((uint16_t)(R10) >> 8U), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \
|
||||
, (uint8_t)((uint16_t)(R11) >> 8U), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11) \
|
||||
, (uint8_t)((uint16_t)(R12) >> 8U), (uint8_t)((R12) & 0xFFU), (uint8_t)(M12), (uint8_t)(V12) \
|
||||
, (uint8_t)((uint16_t)(R13) >> 8U), (uint8_t)((R13) & 0xFFU), (uint8_t)(M13), (uint8_t)(V13)
|
||||
|
||||
/*! Macro for Configuration Setting with fifteen register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_15_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11, R12, M12, V12, R13, M13, V13, R14, M14, V14) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU),15, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \
|
||||
, (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \
|
||||
, (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \
|
||||
, (uint8_t)((uint16_t)(R8) >> 8U), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \
|
||||
, (uint8_t)((uint16_t)(R9) >> 8U), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \
|
||||
, (uint8_t)((uint16_t)(R10) >> 8U), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \
|
||||
, (uint8_t)((uint16_t)(R11) >> 8U), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11) \
|
||||
, (uint8_t)((uint16_t)(R12) >> 8U), (uint8_t)((R12) & 0xFFU), (uint8_t)(M12), (uint8_t)(V12) \
|
||||
, (uint8_t)((uint16_t)(R13) >> 8U), (uint8_t)((R13) & 0xFFU), (uint8_t)(M13), (uint8_t)(V13) \
|
||||
, (uint8_t)((uint16_t)(R14) >> 8U), (uint8_t)((R14) & 0xFFU), (uint8_t)(M14), (uint8_t)(V14)
|
||||
|
||||
/*! Macro for Configuration Setting with sixteen register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_16_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11, R12, M12, V12, R13, M13, V13, R14, M14, V14, R15, M15, V15) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU),16, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \
|
||||
, (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \
|
||||
, (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \
|
||||
, (uint8_t)((uint16_t)(R8) >> 8U), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \
|
||||
, (uint8_t)((uint16_t)(R9) >> 8U), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \
|
||||
, (uint8_t)((uint16_t)(R10) >> 8U), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \
|
||||
, (uint8_t)((uint16_t)(R11) >> 8U), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11) \
|
||||
, (uint8_t)((uint16_t)(R12) >> 8U), (uint8_t)((R12) & 0xFFU), (uint8_t)(M12), (uint8_t)(V12) \
|
||||
, (uint8_t)((uint16_t)(R13) >> 8U), (uint8_t)((R13) & 0xFFU), (uint8_t)(M13), (uint8_t)(V13) \
|
||||
, (uint8_t)((uint16_t)(R14) >> 8U), (uint8_t)((R14) & 0xFFU), (uint8_t)(M14), (uint8_t)(V14) \
|
||||
, (uint8_t)((uint16_t)(R15) >> 8U), (uint8_t)((R15) & 0xFFU), (uint8_t)(M15), (uint8_t)(V15)
|
||||
|
||||
/*! Macro for Configuration Setting with seventeen register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_17_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11, R12, M12, V12, R13, M13, V13, R14, M14, V14, R15, M15, V15, R16, M16, V16) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU),17, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \
|
||||
, (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \
|
||||
, (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \
|
||||
, (uint8_t)((uint16_t)(R8) >> 8U), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \
|
||||
, (uint8_t)((uint16_t)(R9) >> 8U), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \
|
||||
, (uint8_t)((uint16_t)(R10) >> 8U), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \
|
||||
, (uint8_t)((uint16_t)(R11) >> 8U), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11) \
|
||||
, (uint8_t)((uint16_t)(R12) >> 8U), (uint8_t)((R12) & 0xFFU), (uint8_t)(M12), (uint8_t)(V12) \
|
||||
, (uint8_t)((uint16_t)(R13) >> 8U), (uint8_t)((R13) & 0xFFU), (uint8_t)(M13), (uint8_t)(V13) \
|
||||
, (uint8_t)((uint16_t)(R14) >> 8U), (uint8_t)((R14) & 0xFFU), (uint8_t)(M14), (uint8_t)(V14) \
|
||||
, (uint8_t)((uint16_t)(R15) >> 8U), (uint8_t)((R15) & 0xFFU), (uint8_t)(M15), (uint8_t)(V15) \
|
||||
, (uint8_t)((uint16_t)(R16) >> 8U), (uint8_t)((R16) & 0xFFU), (uint8_t)(M16), (uint8_t)(V16)
|
||||
|
||||
/*! Macro for Configuration Setting with seventeen register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_18_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11, R12, M12, V12, R13, M13, V13, R14, M14, V14, R15, M15, V15, R16, M16, V16, R17, M17, V17) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU),18, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \
|
||||
, (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \
|
||||
, (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \
|
||||
, (uint8_t)((uint16_t)(R8) >> 8U), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \
|
||||
, (uint8_t)((uint16_t)(R9) >> 8U), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \
|
||||
, (uint8_t)((uint16_t)(R10) >> 8U), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \
|
||||
, (uint8_t)((uint16_t)(R11) >> 8U), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11) \
|
||||
, (uint8_t)((uint16_t)(R12) >> 8U), (uint8_t)((R12) & 0xFFU), (uint8_t)(M12), (uint8_t)(V12) \
|
||||
, (uint8_t)((uint16_t)(R13) >> 8U), (uint8_t)((R13) & 0xFFU), (uint8_t)(M13), (uint8_t)(V13) \
|
||||
, (uint8_t)((uint16_t)(R14) >> 8U), (uint8_t)((R14) & 0xFFU), (uint8_t)(M14), (uint8_t)(V14) \
|
||||
, (uint8_t)((uint16_t)(R15) >> 8U), (uint8_t)((R15) & 0xFFU), (uint8_t)(M15), (uint8_t)(V15) \
|
||||
, (uint8_t)((uint16_t)(R16) >> 8U), (uint8_t)((R16) & 0xFFU), (uint8_t)(M16), (uint8_t)(V16) \
|
||||
, (uint8_t)((uint16_t)(R17) >> 8U), (uint8_t)((R17) & 0xFFU), (uint8_t)(M17), (uint8_t)(V17)
|
||||
|
||||
/*! Macro for Configuration Setting with seventeen register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_19_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11, R12, M12, V12, R13, M13, V13, R14, M14, V14, R15, M15, V15, R16, M16, V16, R17, M17, V17, R18, M18, V18) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU),19, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \
|
||||
, (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \
|
||||
, (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \
|
||||
, (uint8_t)((uint16_t)(R8) >> 8U), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \
|
||||
, (uint8_t)((uint16_t)(R9) >> 8U), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \
|
||||
, (uint8_t)((uint16_t)(R10) >> 8U), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \
|
||||
, (uint8_t)((uint16_t)(R11) >> 8U), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11) \
|
||||
, (uint8_t)((uint16_t)(R12) >> 8U), (uint8_t)((R12) & 0xFFU), (uint8_t)(M12), (uint8_t)(V12) \
|
||||
, (uint8_t)((uint16_t)(R13) >> 8U), (uint8_t)((R13) & 0xFFU), (uint8_t)(M13), (uint8_t)(V13) \
|
||||
, (uint8_t)((uint16_t)(R14) >> 8U), (uint8_t)((R14) & 0xFFU), (uint8_t)(M14), (uint8_t)(V14) \
|
||||
, (uint8_t)((uint16_t)(R15) >> 8U), (uint8_t)((R15) & 0xFFU), (uint8_t)(M15), (uint8_t)(V15) \
|
||||
, (uint8_t)((uint16_t)(R16) >> 8U), (uint8_t)((R16) & 0xFFU), (uint8_t)(M16), (uint8_t)(V16) \
|
||||
, (uint8_t)((uint16_t)(R17) >> 8U), (uint8_t)((R17) & 0xFFU), (uint8_t)(M17), (uint8_t)(V17) \
|
||||
, (uint8_t)((uint16_t)(R18) >> 8U), (uint8_t)((R18) & 0xFFU), (uint8_t)(M18), (uint8_t)(V18)
|
||||
|
||||
/*! Macro for Configuration Setting with seventeen register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_20_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11, R12, M12, V12, R13, M13, V13, R14, M14, V14, R15, M15, V15, R16, M16, V16, R17, M17, V17, R18, M18, V18, R19, M19, V19) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU),20, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \
|
||||
, (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \
|
||||
, (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \
|
||||
, (uint8_t)((uint16_t)(R8) >> 8U), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \
|
||||
, (uint8_t)((uint16_t)(R9) >> 8U), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \
|
||||
, (uint8_t)((uint16_t)(R10) >> 8U), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \
|
||||
, (uint8_t)((uint16_t)(R11) >> 8U), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11) \
|
||||
, (uint8_t)((uint16_t)(R12) >> 8U), (uint8_t)((R12) & 0xFFU), (uint8_t)(M12), (uint8_t)(V12) \
|
||||
, (uint8_t)((uint16_t)(R13) >> 8U), (uint8_t)((R13) & 0xFFU), (uint8_t)(M13), (uint8_t)(V13) \
|
||||
, (uint8_t)((uint16_t)(R14) >> 8U), (uint8_t)((R14) & 0xFFU), (uint8_t)(M14), (uint8_t)(V14) \
|
||||
, (uint8_t)((uint16_t)(R15) >> 8U), (uint8_t)((R15) & 0xFFU), (uint8_t)(M15), (uint8_t)(V15) \
|
||||
, (uint8_t)((uint16_t)(R16) >> 8U), (uint8_t)((R16) & 0xFFU), (uint8_t)(M16), (uint8_t)(V16) \
|
||||
, (uint8_t)((uint16_t)(R17) >> 8U), (uint8_t)((R17) & 0xFFU), (uint8_t)(M17), (uint8_t)(V17) \
|
||||
, (uint8_t)((uint16_t)(R18) >> 8U), (uint8_t)((R18) & 0xFFU), (uint8_t)(M18), (uint8_t)(V18) \
|
||||
, (uint8_t)((uint16_t)(R19) >> 8U), (uint8_t)((R19) & 0xFFU), (uint8_t)(M19), (uint8_t)(V19)
|
||||
|
||||
/*! Macro for Configuration Setting with seventeen register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_21_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11, R12, M12, V12, R13, M13, V13, R14, M14, V14, R15, M15, V15, R16, M16, V16, R17, M17, V17, R18, M18, V18, R19, M19, V19, R20, M20, V20) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU),21, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \
|
||||
, (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \
|
||||
, (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \
|
||||
, (uint8_t)((uint16_t)(R8) >> 8U), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \
|
||||
, (uint8_t)((uint16_t)(R9) >> 8U), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \
|
||||
, (uint8_t)((uint16_t)(R10) >> 8U), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \
|
||||
, (uint8_t)((uint16_t)(R11) >> 8U), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11) \
|
||||
, (uint8_t)((uint16_t)(R12) >> 8U), (uint8_t)((R12) & 0xFFU), (uint8_t)(M12), (uint8_t)(V12) \
|
||||
, (uint8_t)((uint16_t)(R13) >> 8U), (uint8_t)((R13) & 0xFFU), (uint8_t)(M13), (uint8_t)(V13) \
|
||||
, (uint8_t)((uint16_t)(R14) >> 8U), (uint8_t)((R14) & 0xFFU), (uint8_t)(M14), (uint8_t)(V14) \
|
||||
, (uint8_t)((uint16_t)(R15) >> 8U), (uint8_t)((R15) & 0xFFU), (uint8_t)(M15), (uint8_t)(V15) \
|
||||
, (uint8_t)((uint16_t)(R16) >> 8U), (uint8_t)((R16) & 0xFFU), (uint8_t)(M16), (uint8_t)(V16) \
|
||||
, (uint8_t)((uint16_t)(R17) >> 8U), (uint8_t)((R17) & 0xFFU), (uint8_t)(M17), (uint8_t)(V17) \
|
||||
, (uint8_t)((uint16_t)(R18) >> 8U), (uint8_t)((R18) & 0xFFU), (uint8_t)(M18), (uint8_t)(V18) \
|
||||
, (uint8_t)((uint16_t)(R19) >> 8U), (uint8_t)((R19) & 0xFFU), (uint8_t)(M19), (uint8_t)(V19) \
|
||||
, (uint8_t)((uint16_t)(R20) >> 8U), (uint8_t)((R20) & 0xFFU), (uint8_t)(M20), (uint8_t)(V20)
|
||||
|
||||
/*! Macro for Configuration Setting with seventeen register-mask-value sets:
|
||||
* - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */
|
||||
#define MODE_ENTRY_22_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11, R12, M12, V12, R13, M13, V13, R14, M14, V14, R15, M15, V15, R16, M16, V16, R17, M17, V17, R18, M18, V18, R19, M19, V19, R20, M20, V20, R21, M21, V21) \
|
||||
(uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU),22, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \
|
||||
, (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \
|
||||
, (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \
|
||||
, (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \
|
||||
, (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \
|
||||
, (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \
|
||||
, (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \
|
||||
, (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \
|
||||
, (uint8_t)((uint16_t)(R8) >> 8U), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \
|
||||
, (uint8_t)((uint16_t)(R9) >> 8U), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \
|
||||
, (uint8_t)((uint16_t)(R10) >> 8U), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \
|
||||
, (uint8_t)((uint16_t)(R11) >> 8U), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11) \
|
||||
, (uint8_t)((uint16_t)(R12) >> 8U), (uint8_t)((R12) & 0xFFU), (uint8_t)(M12), (uint8_t)(V12) \
|
||||
, (uint8_t)((uint16_t)(R13) >> 8U), (uint8_t)((R13) & 0xFFU), (uint8_t)(M13), (uint8_t)(V13) \
|
||||
, (uint8_t)((uint16_t)(R14) >> 8U), (uint8_t)((R14) & 0xFFU), (uint8_t)(M14), (uint8_t)(V14) \
|
||||
, (uint8_t)((uint16_t)(R15) >> 8U), (uint8_t)((R15) & 0xFFU), (uint8_t)(M15), (uint8_t)(V15) \
|
||||
, (uint8_t)((uint16_t)(R16) >> 8U), (uint8_t)((R16) & 0xFFU), (uint8_t)(M16), (uint8_t)(V16) \
|
||||
, (uint8_t)((uint16_t)(R17) >> 8U), (uint8_t)((R17) & 0xFFU), (uint8_t)(M17), (uint8_t)(V17) \
|
||||
, (uint8_t)((uint16_t)(R18) >> 8U), (uint8_t)((R18) & 0xFFU), (uint8_t)(M18), (uint8_t)(V18) \
|
||||
, (uint8_t)((uint16_t)(R19) >> 8U), (uint8_t)((R19) & 0xFFU), (uint8_t)(M19), (uint8_t)(V19) \
|
||||
, (uint8_t)((uint16_t)(R20) >> 8U), (uint8_t)((R20) & 0xFFU), (uint8_t)(M20), (uint8_t)(V20) \
|
||||
, (uint8_t)((uint16_t)(R21) >> 8U), (uint8_t)((R21) & 0xFFU), (uint8_t)(M21), (uint8_t)(V21)
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL DATA TYPES
|
||||
******************************************************************************
|
||||
*/
|
||||
/* PRQA S 3674 2 # CERT ARR02 - Flexible array will be used with sizeof, on adding elements error-prone manual update of size would be required */
|
||||
/* PRQA S 3406 1 # MISRA 8.6 - Externally generated table included by the library */ /* PRQA S 1514 1 # MISRA 8.9 - Externally generated table included by the library */
|
||||
const uint8_t rfalAnalogConfigDefaultSettings[] = {
|
||||
|
||||
/****** Default Analog Configuration for Chip-Specific Reset ******/
|
||||
MODE_ENTRY_17_REG( (RFAL_ANALOG_CONFIG_TECH_CHIP | RFAL_ANALOG_CONFIG_CHIP_INIT)
|
||||
, ST25R500_REG_GENERAL, ST25R500_REG_GENERAL_miso_pd_mask, (ST25R500_REG_GENERAL_miso_pd1 | ST25R500_REG_GENERAL_miso_pd2) /* SPI MISO Pull downs */
|
||||
, ST25R500_REG_REGULATOR, ST25R500_REG_REGULATOR_reg_s, 0x00 /* Force adjust regulator direct command */
|
||||
, ST25R500_REG_DRIVER, ST25R500_REG_DRIVER_regd_mask, ST25R500_REG_DRIVER_regd_350mV /* Configure proper LDO drop-out 200mV + regd*50mV: 350mV */
|
||||
, ST25R500_REG_TX_MOD1, (ST25R500_REG_TX_MOD1_rgs_am | ST25R500_REG_TX_MOD1_res_am), (ST25R500_REG_TX_MOD1_rgs_am | ST25R500_REG_TX_MOD1_res_am)/* Use AM via regulator and resistor, need to replicate FIELD_OFF */
|
||||
, ST25R500_REG_TX_MOD2, ST25R500_REG_TX_MOD2_md_res_mask, 0x7F /* Specify md_res as highZ used with res_am */
|
||||
, ST25R500_REG_DRIVER, ST25R500_REG_DRIVER_d_res_mask, 0x00 /* Set RFO resistance Active Tx */
|
||||
, ST25R500_REG_RX_ANA2, ST25R500_REG_RX_ANA2_afe_gain_td_mask, 0x02 /* Increased Gain for TD */
|
||||
, ST25R500_REG_CE_TX_MOD1, (ST25R500_REG_CE_TX_MOD1_cem_res_mask | ST25R500_REG_CE_TX_MOD1_ce_res_mask), 0xF0 /* Set passive listen modulation: high ohmic modulated state */
|
||||
, ST25R500_REG_GPIO, 0xFF, 0x03 /* EMI capacitor switched for RW */
|
||||
, ST25R500_REG_RX_ANA1, ST25R500_REG_RX_ANA1_dig_clk_dly_mask, 0x70 /* Adapt to recommended dig_clk_dly */
|
||||
, ST25R500_REG_CE_CONFIG2, ST25R500_REG_CE_CONFIG2_fdel_mask, 0xC0 /* Set CE FDT adjustmet */
|
||||
, ST25R500_REG_EFD_THRESHOLD, 0xFF, 0x89 /* Set External Field Detector thresholds */
|
||||
, ST25R500_REG_WAKEUP_CONF2, ST25R500_REG_WAKEUP_CONF2_weak_disch, ST25R500_REG_WAKEUP_CONF2_weak_disch /* Weak discharge VDD_A low power modes */
|
||||
, ST25R500_REG_WAKEUP_CONF2, ST25R500_REG_WAKEUP_CONF2_tagdet_len_mask, 0x03 /* Set measurement pulse to 61.4us */
|
||||
, (RFAL_TEST_REG | ST25R500_TEST_REG_MAN_TIMING), ST25R500_TEST_REG_MAN_TIMING_main_wait_ok, ST25R500_TEST_REG_MAN_TIMING_main_wait_ok /* man_wait_ok */
|
||||
, (RFAL_TEST_REG | ST25R500_TEST_REG_OSC_TIMING), ST25R500_TEST_REG_OSC_TIMING_wait_ok_count_set_mask, 0x3F /* max wait_ok_count_set for best wake-up stability */
|
||||
, (RFAL_TEST_REG | ST25R500_TEST_REG_DIAG_MEAS), ST25R500_TEST_REG_DIAG_MEAS_discon_tad_out, ST25R500_TEST_REG_DIAG_MEAS_discon_tad_out /* Stable diagnostic measurement */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Chip-Specific Poll Common ******/
|
||||
, MODE_ENTRY_12_REG( (RFAL_ANALOG_CONFIG_TECH_CHIP | RFAL_ANALOG_CONFIG_CHIP_POLL_COMMON)
|
||||
, ST25R500_REG_RX_ANA2, ST25R500_REG_RX_ANA2_afe_gain_rw_mask, 0x00 /* Nominal gain for RW */
|
||||
, ST25R500_REG_CORR2, 0xFF, 0x2D /* Adjust Squelch and AGC */
|
||||
, ST25R500_REG_CORR3, ST25R500_REG_CORR3_en_subc_end, 0x00 /* Disable fast subcarrier end detection */
|
||||
, ST25R500_REG_RX_ANA4, ST25R500_REG_RX_ANA4_en_phase_deadzone, 0x00 /* en_phase_deadzone=0, needed for listen, reset for poll */
|
||||
, ST25R500_REG_RX_ANA4, ST25R500_REG_RX_ANA4_en_rect_cor, ST25R500_REG_RX_ANA4_en_rect_cor /* en_rect_cor=1 for phase drift tests in BPSK */
|
||||
, ST25R500_REG_PROTOCOL_TX1, ST25R500_REG_PROTOCOL_TX1_p_len_mask, 0x00 /* set p_len default in middle(default) */
|
||||
, ST25R500_REG_PROTOCOL_TX1, ST25R500_REG_PROTOCOL_TX1_tr_am, ST25R500_REG_PROTOCOL_TX1_tr_am /* Use AM as default */
|
||||
, ST25R500_REG_AWS_TIME2, 0xF0, 0x00 /* tpassingx1 = 0(default) */
|
||||
, ST25R500_REG_SQT, 0xFF, 0xFF /* Reset to setting which uses MRT setting */
|
||||
, ST25R500_REG_AWS_TIME1, 0xF0, 0xF0 /* tentx1 setting */
|
||||
, ST25R500_REG_AWS_TIME1, 0x0F, 0x0F /* tdres1 setting */
|
||||
, ST25R500_REG_PROTOCOL_TX2, ST25R500_REG_PROTOCOL_TX2_b_tx_half, ST25R500_REG_PROTOCOL_TX2_b_tx_half /* Set b_tx_half to not have marginal SOF/EOF */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-A Tx Common ******/
|
||||
, MODE_ENTRY_1_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCA | RFAL_ANALOG_CONFIG_BITRATE_COMMON | RFAL_ANALOG_CONFIG_TX)
|
||||
, ST25R500_REG_AWS_CONFIG1, 0x10, 0x00 /* Disable dyn_pass_sink */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-A Tx 106 ******/
|
||||
, MODE_ENTRY_5_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCA | RFAL_ANALOG_CONFIG_BITRATE_106 | RFAL_ANALOG_CONFIG_TX)
|
||||
, ST25R500_REG_AWS_CONFIG2, 0xFF, 0x33 /* setting the am_filt for rising and falling edge */
|
||||
, ST25R500_REG_PROTOCOL_TX1, ST25R500_REG_PROTOCOL_TX1_tr_am, 0x00 /* Use OOK */
|
||||
, ST25R500_REG_TX_MOD1, ST25R500_REG_TX_MOD1_am_mod_mask, ST25R500_REG_TX_MOD1_am_mod_97percent /* Set Modulation index to highest (OOK) */
|
||||
, ST25R500_REG_TX_MOD1, (ST25R500_REG_TX_MOD1_res_am | ST25R500_REG_TX_MOD1_rgs_am), (ST25R500_REG_TX_MOD1_res_am | ST25R500_REG_TX_MOD1_rgs_am) /* Set res_am and rgs_am */
|
||||
, ST25R500_REG_AWS_TIME3, 0x0F, 0x00 /* Set tdres2, only used with res_am=1, no need to clear elsewhere */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-A Rx 106 ******/
|
||||
, MODE_ENTRY_12_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCA | RFAL_ANALOG_CONFIG_BITRATE_106 | RFAL_ANALOG_CONFIG_RX)
|
||||
, ST25R500_REG_RX_ANA2, ST25R500_REG_RX_ANA2_afe_gain_rw_mask, 0x20 /* Reduce gain */
|
||||
, ST25R500_REG_RX_ANA1, ST25R500_REG_RX_ANA1_hpf_ctrl_mask, 0x03 /* Higher hpf_ctrl for max neg LMA */
|
||||
, ST25R500_REG_RX_DIG, (ST25R500_REG_RX_DIG_lpf_coef_mask | ST25R500_REG_RX_DIG_hpf_coef_mask), 0x68 /* Narrower window for max neg LMA */
|
||||
, ST25R500_REG_CORR1, (ST25R500_REG_CORR1_iir_coef2_mask | ST25R500_REG_CORR1_iir_coef1_mask), 0xF8
|
||||
, ST25R500_REG_CORR2, 0xFF, 0x2E /* Increase agc_thr according #1179027 */
|
||||
, ST25R500_REG_CORR3, ST25R500_REG_CORR3_start_wait_mask, 0x0F
|
||||
, ST25R500_REG_CORR4, (ST25R500_REG_CORR4_coll_lvl_mask | ST25R500_REG_CORR4_data_lvl_mask), 0x88 /* With reduced gain use lower levels */
|
||||
, ST25R500_REG_CORR5, 0xFF, 0x32
|
||||
, ST25R500_REG_CORR6, (ST25R500_REG_CORR6_init_noise_lvl_mask | ST25R500_REG_CORR6_agc_freeze_cnt_mask), 0x20 /* Increase init_noise_lvl to filter noise */
|
||||
, ST25R500_REG_RX_ANA4, ST25R500_REG_RX_ANA4_en_rect_cor, 0 /* NFC-A 106 is not BPSK */
|
||||
, ST25R500_REG_MRT1, ST25R500_REG_MRT1_sq_del_mask, 0x00
|
||||
, ST25R500_REG_SQT, 0xFF, 0x1C /* In 16/fc steps, requires proper mrt_step */
|
||||
)
|
||||
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-A Anticolision setting ******/
|
||||
, MODE_ENTRY_1_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCA | RFAL_ANALOG_CONFIG_BITRATE_COMMON | RFAL_ANALOG_CONFIG_ANTICOL)
|
||||
, ST25R500_REG_CORR4, ST25R500_REG_CORR4_coll_lvl_mask, 0x70 /* Lower collision level during anticollision */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-A Tx 212 ******/
|
||||
, MODE_ENTRY_5_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCA | RFAL_ANALOG_CONFIG_BITRATE_212 | RFAL_ANALOG_CONFIG_TX)
|
||||
, ST25R500_REG_AWS_CONFIG2, 0xFF, 0x70 /* setting the am_filt for rising and falling edge */
|
||||
, ST25R500_REG_PROTOCOL_TX1, ST25R500_REG_PROTOCOL_TX1_p_len_mask, 0x01 /* p_len 19 instead of 18 pulses */
|
||||
, ST25R500_REG_PROTOCOL_TX1, ST25R500_REG_PROTOCOL_TX1_tr_am, ST25R500_REG_PROTOCOL_TX1_tr_am /* Use AM */
|
||||
, ST25R500_REG_TX_MOD1, (ST25R500_REG_TX_MOD1_res_am | ST25R500_REG_TX_MOD1_rgs_am), ST25R500_REG_TX_MOD1_rgs_am /* Clear res_am and set rgs_am */
|
||||
, ST25R500_REG_TX_MOD1, ST25R500_REG_TX_MOD1_am_mod_mask, ST25R500_REG_TX_MOD1_am_mod_80percent /* Set Modulation index */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-A Rx 212 ******/
|
||||
, MODE_ENTRY_9_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCA | RFAL_ANALOG_CONFIG_BITRATE_212 | RFAL_ANALOG_CONFIG_RX)
|
||||
, ST25R500_REG_RX_ANA1, ST25R500_REG_RX_ANA1_hpf_ctrl_mask, 0x01
|
||||
, ST25R500_REG_RX_DIG, (ST25R500_REG_RX_DIG_lpf_coef_mask | ST25R500_REG_RX_DIG_hpf_coef_mask), 0x48
|
||||
, ST25R500_REG_CORR1, (ST25R500_REG_CORR1_iir_coef2_mask | ST25R500_REG_CORR1_iir_coef1_mask), 0xD4
|
||||
, ST25R500_REG_CORR3, ST25R500_REG_CORR3_start_wait_mask, 0x0F
|
||||
, ST25R500_REG_CORR3, ST25R500_REG_CORR3_en_subc_end, ST25R500_REG_CORR3_en_subc_end /* Enable fast subcarrier end detection */
|
||||
, ST25R500_REG_CORR4, (ST25R500_REG_CORR4_coll_lvl_mask | ST25R500_REG_CORR4_data_lvl_mask), 0xA3
|
||||
, ST25R500_REG_CORR5, 0xFF, 0x32U
|
||||
, ST25R500_REG_CORR6, (ST25R500_REG_CORR6_init_noise_lvl_mask | ST25R500_REG_CORR6_agc_freeze_cnt_mask), 0x01
|
||||
, ST25R500_REG_MRT1, ST25R500_REG_MRT1_sq_del_mask, 0x00
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-A Tx 424 ******/
|
||||
, MODE_ENTRY_4_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCA | RFAL_ANALOG_CONFIG_BITRATE_424 | RFAL_ANALOG_CONFIG_TX)
|
||||
, ST25R500_REG_AWS_CONFIG2, 0xFF, 0x00 /* Setting the am_filt for rising and falling edge */
|
||||
, ST25R500_REG_PROTOCOL_TX1, ST25R500_REG_PROTOCOL_TX1_tr_am, ST25R500_REG_PROTOCOL_TX1_tr_am /* Use AM */
|
||||
, ST25R500_REG_TX_MOD1, ST25R500_REG_TX_MOD1_am_mod_mask, ST25R500_REG_TX_MOD1_am_mod_60percent /* Set Modulation index */
|
||||
, ST25R500_REG_TX_MOD1, (ST25R500_REG_TX_MOD1_res_am | ST25R500_REG_TX_MOD1_rgs_am), ST25R500_REG_TX_MOD1_rgs_am /* Clear res_am and set rgs_am */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-A Rx 424 ******/
|
||||
, MODE_ENTRY_10_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCA | RFAL_ANALOG_CONFIG_BITRATE_424 | RFAL_ANALOG_CONFIG_RX)
|
||||
, ST25R500_REG_RX_ANA1, ST25R500_REG_RX_ANA1_hpf_ctrl_mask, 0x01
|
||||
, ST25R500_REG_RX_DIG, (ST25R500_REG_RX_DIG_lpf_coef_mask | ST25R500_REG_RX_DIG_hpf_coef_mask), 0x58
|
||||
, ST25R500_REG_CORR1, (ST25R500_REG_CORR1_iir_coef2_mask | ST25R500_REG_CORR1_iir_coef1_mask), 0xD6
|
||||
, ST25R500_REG_CORR2, 0xFF, 0x2D
|
||||
, ST25R500_REG_CORR3, ST25R500_REG_CORR3_start_wait_mask, 0x1F
|
||||
, ST25R500_REG_CORR3, ST25R500_REG_CORR3_en_subc_end, ST25R500_REG_CORR3_en_subc_end /* Enable fast subcarrier end detection */
|
||||
, ST25R500_REG_CORR4, (ST25R500_REG_CORR4_coll_lvl_mask | ST25R500_REG_CORR4_data_lvl_mask), 0xA3
|
||||
, ST25R500_REG_CORR5, 0xFF, (ST25R500_REG_CORR5_dis_soft_sq | ST25R500_REG_CORR5_dis_agc_noise_meas | ST25R500_REG_CORR5_no_phase | 0x01U)
|
||||
, ST25R500_REG_CORR6, (ST25R500_REG_CORR6_init_noise_lvl_mask | ST25R500_REG_CORR6_agc_freeze_cnt_mask), 0x04
|
||||
, ST25R500_REG_MRT1, ST25R500_REG_MRT1_sq_del_mask, 0x00
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-A Tx 848 ******/
|
||||
, MODE_ENTRY_6_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCA | RFAL_ANALOG_CONFIG_BITRATE_848 | RFAL_ANALOG_CONFIG_TX)
|
||||
, ST25R500_REG_PROTOCOL_TX1, ST25R500_REG_PROTOCOL_TX1_p_len_mask, 0x0E /* p_len 3 instead of 5 */
|
||||
, ST25R500_REG_PROTOCOL_TX1, ST25R500_REG_PROTOCOL_TX1_tr_am, ST25R500_REG_PROTOCOL_TX1_tr_am /* Use AM */
|
||||
, ST25R500_REG_TX_MOD1, ST25R500_REG_TX_MOD1_am_mod_mask, ST25R500_REG_TX_MOD1_am_mod_97percent /* Set Modulation index */
|
||||
, ST25R500_REG_AWS_CONFIG2, 0xFF, 0x00 /* am_filt set to fastest value */
|
||||
, ST25R500_REG_AWS_TIME2, 0xF0, 0x50 /* tpassingx1 = 5 */
|
||||
, ST25R500_REG_TX_MOD1, (ST25R500_REG_TX_MOD1_res_am | ST25R500_REG_TX_MOD1_rgs_am), ST25R500_REG_TX_MOD1_rgs_am /* Clear res_am and set rgs_am */
|
||||
)
|
||||
/****** Default Analog Configuration for Poll NFC-A Rx 848 ******/
|
||||
, MODE_ENTRY_10_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCA | RFAL_ANALOG_CONFIG_BITRATE_848 | RFAL_ANALOG_CONFIG_RX)
|
||||
, ST25R500_REG_RX_ANA1, ST25R500_REG_RX_ANA1_hpf_ctrl_mask, 0x01
|
||||
, ST25R500_REG_RX_DIG, (ST25R500_REG_RX_DIG_lpf_coef_mask | ST25R500_REG_RX_DIG_hpf_coef_mask), 0x64
|
||||
, ST25R500_REG_CORR1, (ST25R500_REG_CORR1_iir_coef2_mask | ST25R500_REG_CORR1_iir_coef1_mask), 0xAA
|
||||
, ST25R500_REG_CORR2, 0xFF, 0x2B
|
||||
, ST25R500_REG_CORR3, ST25R500_REG_CORR3_start_wait_mask, 0x3F
|
||||
, ST25R500_REG_CORR3, ST25R500_REG_CORR3_en_subc_end, ST25R500_REG_CORR3_en_subc_end /* Enable fast subcarrier end detection */
|
||||
, ST25R500_REG_CORR4, (ST25R500_REG_CORR4_coll_lvl_mask | ST25R500_REG_CORR4_data_lvl_mask), 0xA6
|
||||
, ST25R500_REG_CORR5, 0xFF, (ST25R500_REG_CORR5_dis_soft_sq | ST25R500_REG_CORR5_dis_agc_noise_meas | ST25R500_REG_CORR5_no_phase | 0x00U)
|
||||
, ST25R500_REG_CORR6, (ST25R500_REG_CORR6_init_noise_lvl_mask | ST25R500_REG_CORR6_agc_freeze_cnt_mask), 0x19
|
||||
, ST25R500_REG_MRT1, ST25R500_REG_MRT1_sq_del_mask, 0x40
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-B Tx Common ******/
|
||||
, MODE_ENTRY_3_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCB | RFAL_ANALOG_CONFIG_BITRATE_COMMON | RFAL_ANALOG_CONFIG_TX)
|
||||
, ST25R500_REG_AWS_CONFIG1, 0x10, 0x00 /* Disable dyn_pass_sink */
|
||||
, ST25R500_REG_TX_MOD1, ST25R500_REG_TX_MOD1_am_mod_mask, ST25R500_REG_TX_MOD1_am_mod_12percent /* Set Modulation index */
|
||||
, ST25R500_REG_TX_MOD1, (ST25R500_REG_TX_MOD1_res_am | ST25R500_REG_TX_MOD1_rgs_am), ST25R500_REG_TX_MOD1_rgs_am /* Clear res_am and set rgs_am */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-B Tx 106 ******/
|
||||
, MODE_ENTRY_1_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCB | RFAL_ANALOG_CONFIG_BITRATE_106 | RFAL_ANALOG_CONFIG_TX)
|
||||
, ST25R500_REG_AWS_CONFIG2, 0xFF, 0x44 /* Setting the am_filt for rising and falling edge */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-B Rx 106 ******/
|
||||
, MODE_ENTRY_10_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCB | RFAL_ANALOG_CONFIG_BITRATE_106 | RFAL_ANALOG_CONFIG_RX)
|
||||
, ST25R500_REG_RX_ANA1, ST25R500_REG_RX_ANA1_hpf_ctrl_mask, 0x02
|
||||
, ST25R500_REG_RX_DIG, (ST25R500_REG_RX_DIG_lpf_coef_mask | ST25R500_REG_RX_DIG_hpf_coef_mask), 0x48
|
||||
, ST25R500_REG_CORR1, (ST25R500_REG_CORR1_iir_coef2_mask | ST25R500_REG_CORR1_iir_coef1_mask), 0xD1
|
||||
, ST25R500_REG_CORR3, ST25R500_REG_CORR3_start_wait_mask, 0x07
|
||||
, ST25R500_REG_CORR4, (ST25R500_REG_CORR4_coll_lvl_mask | ST25R500_REG_CORR4_data_lvl_mask), 0xA3 /* Lower data level for NFC-B */
|
||||
, ST25R500_REG_CORR5, 0xFF, (ST25R500_REG_CORR5_dis_soft_sq | ST25R500_REG_CORR5_dis_agc_noise_meas | 0x03U) /* dis_soft_sq=1 to resolve #1209674 (ISO EMD suppression), dis_agc_noise_meas=1 to resolve #1315123 */
|
||||
, ST25R500_REG_CORR6, (ST25R500_REG_CORR6_init_noise_lvl_mask | ST25R500_REG_CORR6_agc_freeze_cnt_mask), 0x00
|
||||
, ST25R500_REG_CORR3, ST25R500_REG_CORR3_en_subc_end, ST25R500_REG_CORR3_en_subc_end /* Enable fast subcarrier end detection */
|
||||
, ST25R500_REG_MRT1, ST25R500_REG_MRT1_sq_del_mask, 0x00
|
||||
, ST25R500_REG_SQT, 0xFF, 0x1C /* In 16/fc steps, equivalent to previous 7*64/fc */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-B Tx 212 ******/
|
||||
, MODE_ENTRY_1_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCB | RFAL_ANALOG_CONFIG_BITRATE_212 | RFAL_ANALOG_CONFIG_TX)
|
||||
, ST25R500_REG_AWS_CONFIG2, 0xFF, 0x44 /* Setting the am_filt for rising and falling edge */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-B Rx 212 ******/
|
||||
, MODE_ENTRY_9_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCB | RFAL_ANALOG_CONFIG_BITRATE_212 | RFAL_ANALOG_CONFIG_RX)
|
||||
, ST25R500_REG_RX_ANA1, ST25R500_REG_RX_ANA1_hpf_ctrl_mask, 0x01
|
||||
, ST25R500_REG_RX_DIG, (ST25R500_REG_RX_DIG_lpf_coef_mask | ST25R500_REG_RX_DIG_hpf_coef_mask), 0x48
|
||||
, ST25R500_REG_CORR1, (ST25R500_REG_CORR1_iir_coef2_mask | ST25R500_REG_CORR1_iir_coef1_mask), 0xD4
|
||||
, ST25R500_REG_CORR3, ST25R500_REG_CORR3_start_wait_mask, 0x0F
|
||||
, ST25R500_REG_CORR4, (ST25R500_REG_CORR4_coll_lvl_mask | ST25R500_REG_CORR4_data_lvl_mask), 0xA3
|
||||
, ST25R500_REG_CORR5, 0xFF, (ST25R500_REG_CORR5_dis_soft_sq | ST25R500_REG_CORR5_dis_agc_noise_meas | 0x02U)
|
||||
, ST25R500_REG_CORR3, ST25R500_REG_CORR3_en_subc_end, ST25R500_REG_CORR3_en_subc_end /* Enable fast subcarrier end detection */
|
||||
, ST25R500_REG_CORR6, (ST25R500_REG_CORR6_init_noise_lvl_mask | ST25R500_REG_CORR6_agc_freeze_cnt_mask), 0x01
|
||||
, ST25R500_REG_MRT1, ST25R500_REG_MRT1_sq_del_mask, 0x00
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-B Tx 424 ******/
|
||||
, MODE_ENTRY_1_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCB | RFAL_ANALOG_CONFIG_BITRATE_424 | RFAL_ANALOG_CONFIG_TX)
|
||||
, ST25R500_REG_AWS_CONFIG2, 0xFF, 0x00 /* Setting the am_filt for rising and falling edge */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-B Rx 424 ******/
|
||||
, MODE_ENTRY_10_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCB | RFAL_ANALOG_CONFIG_BITRATE_424 | RFAL_ANALOG_CONFIG_RX)
|
||||
, ST25R500_REG_RX_ANA1, ST25R500_REG_RX_ANA1_hpf_ctrl_mask, 0x01
|
||||
, ST25R500_REG_RX_DIG, (ST25R500_REG_RX_DIG_lpf_coef_mask | ST25R500_REG_RX_DIG_hpf_coef_mask), 0x58
|
||||
, ST25R500_REG_CORR1, (ST25R500_REG_CORR1_iir_coef2_mask | ST25R500_REG_CORR1_iir_coef1_mask), 0xD6
|
||||
, ST25R500_REG_CORR2, 0xFF, 0x2D
|
||||
, ST25R500_REG_CORR3, ST25R500_REG_CORR3_start_wait_mask, 0x1F
|
||||
, ST25R500_REG_CORR4, (ST25R500_REG_CORR4_coll_lvl_mask | ST25R500_REG_CORR4_data_lvl_mask), 0xA3
|
||||
, ST25R500_REG_CORR5, 0xFF, (ST25R500_REG_CORR5_dis_soft_sq | ST25R500_REG_CORR5_dis_agc_noise_meas | ST25R500_REG_CORR5_no_phase | 0x01U)
|
||||
, ST25R500_REG_CORR3, ST25R500_REG_CORR3_en_subc_end, ST25R500_REG_CORR3_en_subc_end /* Enable fast subcarrier end detection */
|
||||
, ST25R500_REG_CORR6, (ST25R500_REG_CORR6_init_noise_lvl_mask | ST25R500_REG_CORR6_agc_freeze_cnt_mask), 0x04
|
||||
, ST25R500_REG_MRT1, ST25R500_REG_MRT1_sq_del_mask, 0x00
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-B Tx 848 ******/
|
||||
, MODE_ENTRY_4_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCB | RFAL_ANALOG_CONFIG_BITRATE_848 | RFAL_ANALOG_CONFIG_TX)
|
||||
, ST25R500_REG_AWS_CONFIG2, 0xFF, 0x00 /* setting the am_filt for rising and falling edge */
|
||||
, ST25R500_REG_AWS_TIME1, 0xF0, 0xF0 /* tentx1 setting */
|
||||
, ST25R500_REG_AWS_TIME2, 0xF0, 0x10 /* tpassingx1 = 1 */
|
||||
, ST25R500_REG_TX_MOD1, ST25R500_REG_TX_MOD1_am_mod_mask, ST25R500_REG_TX_MOD1_am_mod_12percent
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-B Rx 848 ******/
|
||||
, MODE_ENTRY_10_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCB | RFAL_ANALOG_CONFIG_BITRATE_848 | RFAL_ANALOG_CONFIG_RX)
|
||||
, ST25R500_REG_RX_ANA1, ST25R500_REG_RX_ANA1_hpf_ctrl_mask, 0x01
|
||||
, ST25R500_REG_RX_DIG, (ST25R500_REG_RX_DIG_lpf_coef_mask | ST25R500_REG_RX_DIG_hpf_coef_mask), 0x64
|
||||
, ST25R500_REG_CORR1, (ST25R500_REG_CORR1_iir_coef2_mask | ST25R500_REG_CORR1_iir_coef1_mask), 0xAA
|
||||
, ST25R500_REG_CORR2, 0xFF, 0x2B
|
||||
, ST25R500_REG_CORR3, ST25R500_REG_CORR3_start_wait_mask, 0x3F
|
||||
, ST25R500_REG_CORR4, (ST25R500_REG_CORR4_coll_lvl_mask | ST25R500_REG_CORR4_data_lvl_mask), 0xA6
|
||||
, ST25R500_REG_CORR5, 0xFF, (ST25R500_REG_CORR5_dis_soft_sq | ST25R500_REG_CORR5_dis_agc_noise_meas | ST25R500_REG_CORR5_no_phase | 0x00U)
|
||||
, ST25R500_REG_CORR3, ST25R500_REG_CORR3_en_subc_end, ST25R500_REG_CORR3_en_subc_end /* Enable fast subcarrier end detection */
|
||||
, ST25R500_REG_CORR6, (ST25R500_REG_CORR6_init_noise_lvl_mask | ST25R500_REG_CORR6_agc_freeze_cnt_mask), 0x19
|
||||
, ST25R500_REG_MRT1, ST25R500_REG_MRT1_sq_del_mask, 0x40
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-F Tx Common ******/
|
||||
, MODE_ENTRY_3_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCF | RFAL_ANALOG_CONFIG_BITRATE_COMMON | RFAL_ANALOG_CONFIG_TX)
|
||||
, ST25R500_REG_AWS_CONFIG1, 0x10, 0x00 /* Disable dyn_pass_sink */
|
||||
, ST25R500_REG_TX_MOD1, ST25R500_REG_TX_MOD1_am_mod_mask, ST25R500_REG_TX_MOD1_am_mod_12percent /* Set Modulation index */
|
||||
, ST25R500_REG_TX_MOD1, (ST25R500_REG_TX_MOD1_res_am | ST25R500_REG_TX_MOD1_rgs_am), ST25R500_REG_TX_MOD1_rgs_am /* clear res_am and set rgs_am */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-F Rx Common ******/
|
||||
, MODE_ENTRY_3_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCF | RFAL_ANALOG_CONFIG_BITRATE_COMMON | RFAL_ANALOG_CONFIG_RX)
|
||||
, ST25R500_REG_RX_ANA1, ST25R500_REG_RX_ANA1_hpf_ctrl_mask, 0x00
|
||||
, ST25R500_REG_CORR4, (ST25R500_REG_CORR4_coll_lvl_mask | ST25R500_REG_CORR4_data_lvl_mask), 0xA6
|
||||
, ST25R500_REG_MRT1, ST25R500_REG_MRT1_sq_del_mask, 0x40
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-F Tx 212 ******/
|
||||
, MODE_ENTRY_1_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCF | RFAL_ANALOG_CONFIG_BITRATE_212 | RFAL_ANALOG_CONFIG_TX)
|
||||
, ST25R500_REG_AWS_CONFIG2, 0xFF, 0x33 /* setting the am_filt for rising and falling edge */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-F Rx 212 ******/
|
||||
, MODE_ENTRY_5_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCF | RFAL_ANALOG_CONFIG_BITRATE_212 | RFAL_ANALOG_CONFIG_RX)
|
||||
, ST25R500_REG_RX_DIG, (ST25R500_REG_RX_DIG_lpf_coef_mask | ST25R500_REG_RX_DIG_hpf_coef_mask), 0x10
|
||||
, ST25R500_REG_CORR1, (ST25R500_REG_CORR1_iir_coef2_mask | ST25R500_REG_CORR1_iir_coef1_mask), 0xD1
|
||||
, ST25R500_REG_CORR3, ST25R500_REG_CORR3_start_wait_mask, 0x1F
|
||||
, ST25R500_REG_CORR5, 0xFF, (ST25R500_REG_CORR5_dis_soft_sq | ST25R500_REG_CORR5_dis_agc_noise_meas | 0x02U)
|
||||
, ST25R500_REG_CORR6, (ST25R500_REG_CORR6_init_noise_lvl_mask | ST25R500_REG_CORR6_agc_freeze_cnt_mask), 0x04
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-F Tx 424 ******/
|
||||
, MODE_ENTRY_1_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCF | RFAL_ANALOG_CONFIG_BITRATE_424 | RFAL_ANALOG_CONFIG_TX)
|
||||
, ST25R500_REG_AWS_CONFIG2, 0xFF, 0x11 /* setting the am_filt for rising and falling edge */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-F Rx 424 ******/
|
||||
, MODE_ENTRY_6_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCF | RFAL_ANALOG_CONFIG_BITRATE_424 | RFAL_ANALOG_CONFIG_RX)
|
||||
, ST25R500_REG_RX_DIG, (ST25R500_REG_RX_DIG_lpf_coef_mask | ST25R500_REG_RX_DIG_hpf_coef_mask), 0x40
|
||||
, ST25R500_REG_CORR1, (ST25R500_REG_CORR1_iir_coef2_mask | ST25R500_REG_CORR1_iir_coef1_mask), 0xD4
|
||||
, ST25R500_REG_CORR2, 0xFF, 0x2B
|
||||
, ST25R500_REG_CORR3, ST25R500_REG_CORR3_start_wait_mask, 0x3F
|
||||
, ST25R500_REG_CORR5, 0xFF, (ST25R500_REG_CORR5_dis_soft_sq | ST25R500_REG_CORR5_dis_agc_noise_meas | 0x01U)
|
||||
, ST25R500_REG_CORR6, (ST25R500_REG_CORR6_init_noise_lvl_mask | ST25R500_REG_CORR6_agc_freeze_cnt_mask), 0x09
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-V Tx 26 ******/
|
||||
, MODE_ENTRY_6_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCV | RFAL_ANALOG_CONFIG_BITRATE_26 | RFAL_ANALOG_CONFIG_TX)
|
||||
, ST25R500_REG_AWS_CONFIG2, 0xFF, 0x33 /* setting the am_filt for rising and falling edge */
|
||||
, ST25R500_REG_PROTOCOL_TX1, ST25R500_REG_PROTOCOL_TX1_tr_am, 0 /* Use OOK */
|
||||
, ST25R500_REG_TX_MOD1, ST25R500_REG_TX_MOD1_am_mod_mask, ST25R500_REG_TX_MOD1_am_mod_97percent /* Set Modulation index to highest (OOK) */
|
||||
, ST25R500_REG_TX_MOD1, (ST25R500_REG_TX_MOD1_res_am | ST25R500_REG_TX_MOD1_rgs_am), (ST25R500_REG_TX_MOD1_res_am | ST25R500_REG_TX_MOD1_rgs_am) /* Set res_am and rgs_am */
|
||||
, ST25R500_REG_AWS_TIME3, 0x0F, 0x00 /* set tdres2, only used with res_am=1, no need to clear elsewhere */
|
||||
, ST25R500_REG_AWS_CONFIG1, 0x10, 0x00 /* Disable dyn_pass_sink */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-V Rx Common *****/
|
||||
, MODE_ENTRY_1_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCV | RFAL_ANALOG_CONFIG_BITRATE_COMMON | RFAL_ANALOG_CONFIG_RX)
|
||||
, ST25R500_REG_MRT1, ST25R500_REG_MRT1_sq_del_mask, 0x40
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-V Anticolision setting ******/
|
||||
, MODE_ENTRY_1_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCV | RFAL_ANALOG_CONFIG_BITRATE_COMMON | RFAL_ANALOG_CONFIG_ANTICOL)
|
||||
, ST25R500_REG_CORR4, ST25R500_REG_CORR4_coll_lvl_mask, 0x70 /* Lower collision level during anticollision */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-V Rx 26 ******/
|
||||
, MODE_ENTRY_9_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCV | RFAL_ANALOG_CONFIG_BITRATE_26 | RFAL_ANALOG_CONFIG_RX)
|
||||
, ST25R500_REG_RX_ANA1, ST25R500_REG_RX_ANA1_hpf_ctrl_mask, 0x01
|
||||
, ST25R500_REG_RX_DIG, (ST25R500_REG_RX_DIG_lpf_coef_mask | ST25R500_REG_RX_DIG_hpf_coef_mask), 0x50
|
||||
, ST25R500_REG_CORR1, (ST25R500_REG_CORR1_iir_coef2_mask | ST25R500_REG_CORR1_iir_coef1_mask), 0xD0
|
||||
, ST25R500_REG_CORR2, 0xFF, 0x2A
|
||||
, ST25R500_REG_CORR3, ST25R500_REG_CORR3_start_wait_mask, 0x08
|
||||
, ST25R500_REG_CORR4, (ST25R500_REG_CORR4_coll_lvl_mask | ST25R500_REG_CORR4_data_lvl_mask), 0xAA /* Restore default levels */
|
||||
, ST25R500_REG_CORR5, 0xFF, (ST25R500_REG_CORR5_dis_soft_sq | ST25R500_REG_CORR5_dis_agc_noise_meas | 0x04U)
|
||||
, ST25R500_REG_CORR6, (ST25R500_REG_CORR6_init_noise_lvl_mask | ST25R500_REG_CORR6_agc_freeze_cnt_mask), 0x10
|
||||
, ST25R500_REG_RX_ANA4, ST25R500_REG_RX_ANA4_en_rect_cor, 0 /* NFC-V is not BPSK */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-V Rx 53 ******/
|
||||
, MODE_ENTRY_9_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCV | RFAL_ANALOG_CONFIG_BITRATE_53 | RFAL_ANALOG_CONFIG_RX)
|
||||
, ST25R500_REG_RX_ANA1, ST25R500_REG_RX_ANA1_hpf_ctrl_mask, 0x01
|
||||
, ST25R500_REG_RX_DIG, (ST25R500_REG_RX_DIG_lpf_coef_mask | ST25R500_REG_RX_DIG_hpf_coef_mask), 0x50
|
||||
, ST25R500_REG_CORR1, (ST25R500_REG_CORR1_iir_coef2_mask | ST25R500_REG_CORR1_iir_coef1_mask), 0xD2
|
||||
, ST25R500_REG_CORR2, 0xFF, 0x2A
|
||||
, ST25R500_REG_CORR3, ST25R500_REG_CORR3_start_wait_mask, 0x08
|
||||
, ST25R500_REG_CORR4, (ST25R500_REG_CORR4_coll_lvl_mask | ST25R500_REG_CORR4_data_lvl_mask), 0xAA /* Restore default levels */
|
||||
, ST25R500_REG_CORR5, 0xFF, (ST25R500_REG_CORR5_dis_soft_sq | ST25R500_REG_CORR5_dis_agc_noise_meas | 0x03U)
|
||||
, ST25R500_REG_CORR6, (ST25R500_REG_CORR6_init_noise_lvl_mask | ST25R500_REG_CORR6_agc_freeze_cnt_mask), 0x10
|
||||
, ST25R500_REG_RX_ANA4, ST25R500_REG_RX_ANA4_en_rect_cor, 0 /* NFC-V is not BPSK */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-V Rx 105.94 ******/
|
||||
, MODE_ENTRY_9_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCV | RFAL_ANALOG_CONFIG_BITRATE_105p94 | RFAL_ANALOG_CONFIG_RX)
|
||||
, ST25R500_REG_RX_ANA1, ST25R500_REG_RX_ANA1_hpf_ctrl_mask, 0x01
|
||||
, ST25R500_REG_RX_DIG, (ST25R500_REG_RX_DIG_lpf_coef_mask | ST25R500_REG_RX_DIG_hpf_coef_mask), 0x50
|
||||
, ST25R500_REG_CORR1, 0xFF, 0xD6
|
||||
, ST25R500_REG_CORR2, 0xFF, 0x2A
|
||||
, ST25R500_REG_CORR3, ST25R500_REG_CORR3_start_wait_mask, 0x09
|
||||
, ST25R500_REG_CORR4, (ST25R500_REG_CORR4_coll_lvl_mask | ST25R500_REG_CORR4_data_lvl_mask), 0xAA /* Restore default levels */
|
||||
, ST25R500_REG_CORR5, 0xFF, (ST25R500_REG_CORR5_dis_soft_sq | ST25R500_REG_CORR5_dis_agc_noise_meas | 0x02U)
|
||||
, ST25R500_REG_CORR6, (ST25R500_REG_CORR6_init_noise_lvl_mask | ST25R500_REG_CORR6_agc_freeze_cnt_mask), 0x20
|
||||
, ST25R500_REG_RX_ANA4, ST25R500_REG_RX_ANA4_en_rect_cor, 0 /* NFC-V is not BPSK */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Poll NFC-V Rx 211.88 ******/
|
||||
, MODE_ENTRY_9_REG( (RFAL_ANALOG_CONFIG_POLL | RFAL_ANALOG_CONFIG_TECH_NFCV | RFAL_ANALOG_CONFIG_BITRATE_211p88 | RFAL_ANALOG_CONFIG_RX)
|
||||
, ST25R500_REG_RX_ANA1, ST25R500_REG_RX_ANA1_hpf_ctrl_mask, 0x03
|
||||
, ST25R500_REG_RX_DIG, (ST25R500_REG_RX_DIG_lpf_coef_mask | ST25R500_REG_RX_DIG_hpf_coef_mask), 0x34
|
||||
, ST25R500_REG_CORR1, 0xFF, 0xDB
|
||||
, ST25R500_REG_CORR2, 0xFF, 0x2D /* Reduce to have clean LMA scan */
|
||||
, ST25R500_REG_CORR3, ST25R500_REG_CORR3_start_wait_mask, 0x09
|
||||
, ST25R500_REG_CORR4, (ST25R500_REG_CORR4_coll_lvl_mask | ST25R500_REG_CORR4_data_lvl_mask), 0xAA /* Restore default levels */
|
||||
, ST25R500_REG_CORR5, 0xFF, (ST25R500_REG_CORR5_dis_soft_sq | ST25R500_REG_CORR5_dis_agc_noise_meas | 0x01U)
|
||||
, ST25R500_REG_CORR6, (ST25R500_REG_CORR6_init_noise_lvl_mask | ST25R500_REG_CORR6_agc_freeze_cnt_mask), 0x40
|
||||
, ST25R500_REG_RX_ANA4, ST25R500_REG_RX_ANA4_en_rect_cor, 0 /* NFC-V is not BPSK */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Listen On ******/
|
||||
|
||||
, MODE_ENTRY_4_REG( (RFAL_ANALOG_CONFIG_TECH_CHIP | RFAL_ANALOG_CONFIG_CHIP_LISTEN_ON)
|
||||
, ST25R500_REG_CORR2, 0xFF, 0x5A /* Switch back to default agc_thr as also done in PD mode */
|
||||
, ST25R500_REG_RX_ANA4, ST25R500_REG_RX_ANA4_en_phase_deadzone, ST25R500_REG_RX_ANA4_en_phase_deadzone /* en_phase_deadzone=1, needed for listen NFC-F, d.c. for listen NFC-A */
|
||||
, ST25R500_REG_RX_ANA4, ST25R500_REG_RX_ANA4_en_rect_cor, 0 /* Restore for listen mode receptions */
|
||||
, ST25R500_REG_EFD_THRESHOLD, 0xFF, 0x89 /* Set External Field Detector thresholds */
|
||||
)
|
||||
|
||||
/****** Default Analog Configuration for Wake-up On ******/
|
||||
, MODE_ENTRY_1_REG( (RFAL_ANALOG_CONFIG_TECH_CHIP | RFAL_ANALOG_CONFIG_CHIP_WAKEUP_ON)
|
||||
, ST25R500_REG_RX_ANA1, ST25R500_REG_RX_ANA1_gain_boost, ST25R500_REG_RX_ANA1_gain_boost /* gain_boost on */
|
||||
)
|
||||
/****** Default Analog Configuration for Wake-up Off ******/
|
||||
, MODE_ENTRY_1_REG( (RFAL_ANALOG_CONFIG_TECH_CHIP | RFAL_ANALOG_CONFIG_CHIP_WAKEUP_OFF)
|
||||
, ST25R500_REG_RX_ANA1, ST25R500_REG_RX_ANA1_gain_boost, 0x00 /* gain_boost back to off */
|
||||
)
|
||||
};
|
||||
|
||||
#endif /* ST25R500_ANALOGCONFIG_H */
|
||||
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file : rfal_dlmaTbl.h
|
||||
* @brief : RF Dynamic LMA Table default values
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2025 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.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef ST25R500_DLMA_TBL_H
|
||||
#define ST25R500_DLMA_TBL_H
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* INCLUDES
|
||||
******************************************************************************
|
||||
*/
|
||||
#include "rfal_dlma.h"
|
||||
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL DATA TYPES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/*! Default DLMA table */
|
||||
/* PRQA S 3674 2 # CERT ARR02 - Flexible array will be used with sizeof, on adding elements error-prone manual update of size would be required */
|
||||
/* PRQA S 3406 1 # MISRA 8.6 - Externally generated table included by the library */ /* PRQA S 1514 1 # MISRA 8.9 - Externally generated table included by the library */
|
||||
const rfalDlmaEntry rfalDlmaDefaultSettings [] = {
|
||||
{0x05, 0x0F, 3, 0},
|
||||
{0x05, 0x0D, 7, 3},
|
||||
{0x05, 0x0B, 11, 7},
|
||||
{0x05, 0x09, 15, 11}
|
||||
};
|
||||
|
||||
#endif /* ST25R500_DLMA_TBL_H */
|
||||
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file : rfal_dpo.h
|
||||
* @brief : RF Dynamic Power Table default values
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2025 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.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
#ifndef ST25R500_DPO_H
|
||||
#define ST25R500_DPO_H
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* INCLUDES
|
||||
******************************************************************************
|
||||
*/
|
||||
#include "rfal_dpo.h"
|
||||
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL DATA TYPES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/*! Default DPO table */
|
||||
/* PRQA S 3674 2 # CERT ARR02 - Flexible array will be used with sizeof, on adding elements error-prone manual update of size would be required */
|
||||
/* PRQA S 3406 1 # MISRA 8.6 - Externally generated table included by the library */ /* PRQA S 1514 1 # MISRA 8.9 - Externally generated table included by the library */ /* PRQA S 1502 1 # MISRA 2.8 - Object usage dependent on feature switch (DPO vs DPO CR) */
|
||||
const rfalDpoEntry rfalDpoDefaultSettings [] = {
|
||||
{ 0x00, 150, 100 },
|
||||
{ 0x09, 110, 50 },
|
||||
{ 0x0A, 60, 0 }
|
||||
};
|
||||
|
||||
#endif /* ST25R500_DPO_H */
|
||||
@@ -0,0 +1,219 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file : rfal_features.h
|
||||
* @brief : RFAL Features/Capabilities Definition for ST25R500
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2025 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.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef RFAL_FEATURES_H
|
||||
#define RFAL_FEATURES_H
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* INCLUDES
|
||||
******************************************************************************
|
||||
*/
|
||||
#include "rfal_platform.h"
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL DEFINES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#define RFAL_SUPPORT_MODE_POLL_NFCA true /*!< RFAL Poll NFCA mode support switch */
|
||||
#define RFAL_SUPPORT_MODE_POLL_NFCB true /*!< RFAL Poll NFCB mode support switch */
|
||||
#define RFAL_SUPPORT_MODE_POLL_NFCF true /*!< RFAL Poll NFCF mode support switch */
|
||||
#define RFAL_SUPPORT_MODE_POLL_NFCV true /*!< RFAL Poll NFCV mode support switch */
|
||||
#define RFAL_SUPPORT_MODE_POLL_ACTIVE_P2P false /*!< RFAL Poll AP2P mode support switch */
|
||||
#define RFAL_SUPPORT_MODE_LISTEN_NFCA true /*!< RFAL Listen NFCA mode support switch */
|
||||
#define RFAL_SUPPORT_MODE_LISTEN_NFCB false /*!< RFAL Listen NFCB mode support switch */
|
||||
#define RFAL_SUPPORT_MODE_LISTEN_NFCF true /*!< RFAL Listen NFCF mode support switch */
|
||||
#define RFAL_SUPPORT_MODE_LISTEN_ACTIVE_P2P false /*!< RFAL Listen AP2P mode support switch */
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
/*! RFAL supported Card Emulation (CE) */
|
||||
#define RFAL_SUPPORT_CE ( RFAL_SUPPORT_MODE_LISTEN_NFCA || RFAL_SUPPORT_MODE_LISTEN_NFCB || RFAL_SUPPORT_MODE_LISTEN_NFCF )
|
||||
|
||||
/*! RFAL supported Reader/Writer (RW) */
|
||||
#define RFAL_SUPPORT_RW ( RFAL_SUPPORT_MODE_POLL_NFCA || RFAL_SUPPORT_MODE_POLL_NFCB || RFAL_SUPPORT_MODE_POLL_NFCF || RFAL_SUPPORT_MODE_POLL_NFCV )
|
||||
|
||||
/*! RFAL support for Active P2P (AP2P) */
|
||||
#define RFAL_SUPPORT_AP2P ( RFAL_SUPPORT_MODE_POLL_ACTIVE_P2P || RFAL_SUPPORT_MODE_LISTEN_ACTIVE_P2P )
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
#define RFAL_SUPPORT_BR_RW_26 true /*!< RFAL RW 26 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_RW_53 true /*!< RFAL RW 53 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_RW_106 true /*!< RFAL RW 106 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_RW_212 true /*!< RFAL RW 212 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_RW_424 true /*!< RFAL RW 424 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_RW_848 true /*!< RFAL RW 848 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_RW_1695 false /*!< RFAL RW 1695 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_RW_3390 false /*!< RFAL RW 3390 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_RW_6780 false /*!< RFAL RW 6780 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_RW_13560 false /*!< RFAL RW 6780 Bit Rate support switch */
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
#define RFAL_SUPPORT_BR_AP2P_106 false /*!< RFAL AP2P 106 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_AP2P_212 false /*!< RFAL AP2P 212 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_AP2P_424 false /*!< RFAL AP2P 424 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_AP2P_848 false /*!< RFAL AP2P 848 Bit Rate support switch */
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
#define RFAL_SUPPORT_BR_CE_A_106 true /*!< RFAL CE A 106 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_CE_A_212 false /*!< RFAL CE A 212 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_CE_A_424 false /*!< RFAL CE A 424 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_CE_A_848 false /*!< RFAL CE A 848 Bit Rate support switch */
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
#define RFAL_SUPPORT_BR_CE_B_106 false /*!< RFAL CE B 106 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_CE_B_212 false /*!< RFAL CE B 212 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_CE_B_424 false /*!< RFAL CE B 424 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_CE_B_848 false /*!< RFAL CE B 848 Bit Rate support switch */
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
#define RFAL_SUPPORT_BR_CE_F_212 true /*!< RFAL CE F 212 Bit Rate support switch */
|
||||
#define RFAL_SUPPORT_BR_CE_F_424 true /*!< RFAL CE F 424 Bit Rate support switch */
|
||||
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* DEVICE SPECIFIC FEATURE DEFINITIONS
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/*! RFAL Wake-Up Period/Timer */
|
||||
typedef enum
|
||||
{
|
||||
RFAL_WUM_PERIOD_12MS = 0x00, /*!< Wake-Up timer ~12.5ms */
|
||||
RFAL_WUM_PERIOD_25MS = 0x01, /*!< Wake-Up timer ~25ms */
|
||||
RFAL_WUM_PERIOD_50MS = 0x02, /*!< Wake-Up timer ~50ms */
|
||||
RFAL_WUM_PERIOD_75MS = 0x03, /*!< Wake-Up timer ~75ms */
|
||||
RFAL_WUM_PERIOD_100MS = 0x04, /*!< Wake-Up timer ~100ms */
|
||||
RFAL_WUM_PERIOD_125MS = 0x05, /*!< Wake-Up timer ~125ms */
|
||||
RFAL_WUM_PERIOD_150MS = 0x06, /*!< Wake-Up timer ~150ms */
|
||||
RFAL_WUM_PERIOD_200MS = 0x07, /*!< Wake-Up timer ~200ms */
|
||||
RFAL_WUM_PERIOD_250MS = 0x08, /*!< Wake-Up timer ~250ms */
|
||||
RFAL_WUM_PERIOD_300MS = 0x09, /*!< Wake-Up timer ~300ms */
|
||||
RFAL_WUM_PERIOD_350MS = 0x0A, /*!< Wake-Up timer ~350ms */
|
||||
RFAL_WUM_PERIOD_400MS = 0x0B, /*!< Wake-Up timer ~400ms */
|
||||
RFAL_WUM_PERIOD_500MS = 0x0C, /*!< Wake-Up timer ~500ms */
|
||||
RFAL_WUM_PERIOD_800MS = 0x0D, /*!< Wake-Up timer ~800ms */
|
||||
RFAL_WUM_PERIOD_1000MS = 0x0E, /*!< Wake-Up timer ~1000ms */
|
||||
RFAL_WUM_PERIOD_INF = 0x0F, /*!< Wake-Up timer Infinite */
|
||||
} rfalWumPeriod;
|
||||
|
||||
|
||||
/*! RFAL Wake-Up weight of last measurement result for auto- averaging */
|
||||
typedef enum
|
||||
{
|
||||
RFAL_WUM_AA_WEIGHT_4 = 0x00, /*!< Wake-Up Auto Average Weight 4 */
|
||||
RFAL_WUM_AA_WEIGHT_8 = 0x01, /*!< Wake-Up Auto Average Weight 8 */
|
||||
RFAL_WUM_AA_WEIGHT_16 = 0x02, /*!< Wake-Up Auto Average Weight 16 */
|
||||
RFAL_WUM_AA_WEIGHT_32 = 0x03, /*!< Wake-Up Auto Average Weight 32 */
|
||||
RFAL_WUM_AA_WEIGHT_50 = 0x04, /*!< Wake-Up Auto Average Weight 50 */
|
||||
RFAL_WUM_AA_WEIGHT_64 = 0x05, /*!< Wake-Up Auto Average Weight 64 */
|
||||
RFAL_WUM_AA_WEIGHT_100 = 0x06, /*!< Wake-Up Auto Average Weight 100 */
|
||||
RFAL_WUM_AA_WEIGHT_128 = 0x07, /*!< Wake-Up Auto Average Weight 128 */
|
||||
} rfalWumAAWeight;
|
||||
|
||||
|
||||
/*! RFAL Wake-Up mesurement duration */
|
||||
typedef enum {
|
||||
RFAL_WUM_MEAS_DUR_26_10 = 0, /*!< WU measurement duration: 26.0us (slow) / 10.6us (fast) */
|
||||
RFAL_WUM_MEAS_DUR_30_14 = 1, /*!< WU measurement duration: 29.5us (slow) / 14.2us (fast) */
|
||||
RFAL_WUM_MEAS_DUR_34_19 = 2, /*!< WU measurement duration: 34.2us (slow) / 18.9us (fast) */
|
||||
RFAL_WUM_MEAS_DUR_44_28 = 3, /*!< WU measurement duration: 43.7us (slow) / 28.3us (fast) */
|
||||
}rfalWumMeasDuration;
|
||||
|
||||
|
||||
/*! RFAL Wake-Up mesurement filter */
|
||||
typedef enum {
|
||||
RFAL_WUM_MEAS_FIL_SLOW = false, /*!< Wake-Up measurement slow filter */
|
||||
RFAL_WUM_MEAS_FIL_FAST = true, /*!< Wake-up measurement fast filter */
|
||||
}rfalWumMeasFilter;
|
||||
|
||||
|
||||
|
||||
/*! RFAL Wake-Up trigger tresholds for threshold bitmask config */
|
||||
enum {
|
||||
RFAL_WUM_TRE_ABOVE = (1U<<2), /*!< Wake-up trigger threshold: above upper limit */
|
||||
RFAL_WUM_TRE_BETWEEN = (1U<<1), /*!< Wake-up trigger threshold: between upper and lower limit */
|
||||
RFAL_WUM_TRE_BELOW = (1U<<0), /*!< Wake-up trigger threshold: below lower limit */
|
||||
};
|
||||
|
||||
|
||||
/*! RFAL Wake-Up channel configuration */
|
||||
typedef struct {
|
||||
bool enabled; /*!< Inductive Amplitude measurement enabled */
|
||||
uint8_t delta; /*!< Delta between the reference and measurement to wake-up */
|
||||
uint8_t reference; /*!< Reference to be used;RFAL_WUM_REFERENCE_AUTO sets it auto */
|
||||
uint8_t threshold; /*!< Wake-Up trigger treshold bitmask */
|
||||
bool aaInclMeas; /*!< When AutoAvg is enabled, include IRQ measurement */
|
||||
rfalWumAAWeight aaWeight; /*!< When AutoAvg is enabled, last measure weight */
|
||||
}rfalWumMeasChannel;
|
||||
|
||||
|
||||
/*! RFAL Wake-Up Mode configuration */
|
||||
typedef struct
|
||||
{
|
||||
rfalWumPeriod period; /*!< Wake-Up Timer period;how often measurement(s) is performed */
|
||||
bool irqTout; /*!< IRQ due to Wake-up timer and measurement event (wutme) */
|
||||
bool autoAvg; /*!< Use the HW Auto Averaging feature on the enabled channel(s)*/
|
||||
bool skipCal; /*!< Do not preform calibration starting WU mode */
|
||||
bool skipReCal; /*!< Do not preform recalibration during WU mode */
|
||||
bool delCal; /*!< Delay calibration step starting WU mode */
|
||||
bool delRef; /*!< Delay reference step starting WU mode */
|
||||
rfalWumMeasDuration measDur; /*!< Wake-up measurement duration config */
|
||||
rfalWumMeasFilter measFil; /*!< Wake-up measurement filter config */
|
||||
|
||||
rfalWumMeasChannel I; /*!< I channel Configuration */
|
||||
rfalWumMeasChannel Q; /*!< Q channel Configuration */
|
||||
} rfalWakeUpConfig;
|
||||
|
||||
|
||||
/*! RFAL Wake-Up Mode information */
|
||||
typedef struct
|
||||
{
|
||||
bool irqWut; /*!< Wake-Up timer and measurement event IRQ (cleared upon read)*/
|
||||
uint8_t status; /*!< Wake-Up status */
|
||||
|
||||
struct{
|
||||
uint8_t lastMeas; /*!< Value of the latest measurement */
|
||||
uint8_t reference; /*!< Current reference value */
|
||||
uint8_t calib; /*!< Current calibration value */
|
||||
bool irqWu; /*!< Amplitude WU IRQ received (cleared upon read) */
|
||||
}I; /*!< I channel Information */
|
||||
|
||||
struct{
|
||||
uint8_t lastMeas; /*!< Value of the latest measurement */
|
||||
uint8_t reference; /*!< Current reference value */
|
||||
uint8_t calib; /*!< Current calibration value */
|
||||
bool irqWu; /*!< Phase WU IRQ received (cleared upon read) */
|
||||
}Q; /*!< Q channel Information */
|
||||
|
||||
struct{
|
||||
bool irqWptFod; /*!< WLC WPT FOD detected */
|
||||
bool irqWptStop; /*!< WLC WPT Stop condition detected */
|
||||
}WLC; /*!< WLC Wireless Power Transfer phase */
|
||||
} rfalWakeUpInfo;
|
||||
|
||||
|
||||
#endif /* RFAL_FEATURES_H */
|
||||
@@ -0,0 +1,741 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file : st25r500.h
|
||||
* @brief : ST25R500 high level interface
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2025 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.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ST25R500_H
|
||||
#define ST25R500_H
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* INCLUDES
|
||||
******************************************************************************
|
||||
*/
|
||||
#include "rfal_platform.h"
|
||||
#include "rfal_utils.h"
|
||||
#include "st25r500_com.h"
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL DATATYPES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL DEFINES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* ST25R500 direct commands */
|
||||
#define ST25R500_CMD_SET_DEFAULT 0x60U /*!< Puts the chip in default state (same as after power-up) */
|
||||
#define ST25R500_CMD_STOP 0x62U /*!< Stops all activities and clears FIFO */
|
||||
#define ST25R500_CMD_CLEAR_FIFO 0x64U /*!< Clears FIFO, Collision and IRQ status */
|
||||
#define ST25R500_CMD_CLEAR_RXGAIN 0x66U /*!< Clears FIFO, Collision and IRQ status */
|
||||
#define ST25R500_CMD_ADJUST_REGULATORS 0x68U /*!< Adjust regulators */
|
||||
#define ST25R500_CMD_TRANSMIT 0x6AU /*!< Transmit */
|
||||
#define ST25R500_CMD_TRANSMIT_EOF 0x6CU /*!< Transmit ISO15693 EOF */
|
||||
#define ST25R500_CMD_NFC_FIELD_ON 0x6EU /*!< Field On */
|
||||
#define ST25R500_CMD_MASK_RECEIVE_DATA 0x70U /*!< Mask receive data */
|
||||
#define ST25R500_CMD_UNMASK_RECEIVE_DATA 0x72U /*!< Unmask receive data */
|
||||
#define ST25R500_CMD_CALIBRATE_WU 0x74U /*!< Calibrate Wake-up Measurement */
|
||||
#define ST25R500_CMD_CLEAR_WU_CALIB 0x76U /*!< Clear Wake-up Calibratation */
|
||||
#define ST25R500_CMD_MEASURE_WU 0x78U /*!< Measure Wake-up I and Q components */
|
||||
#define ST25R500_CMD_MEASURE_IQ 0x7AU /*!< Measure I and Q components */
|
||||
#define ST25R500_CMD_SENSE_RF 0x7CU /*!< Sense RF on RFI pins */
|
||||
#define ST25R500_CMD_TRIGGER_WU_EV 0x7EU /*!< Trigger Wake-up Event */
|
||||
#define ST25R500_CMD_START_GP_TIMER 0xE2U /*!< Start the general purpose timer */
|
||||
#define ST25R500_CMD_START_WUT 0xE4U /*!< Start the wake-up timer */
|
||||
#define ST25R500_CMD_START_MRT 0xE6U /*!< Start the mask-receive timer */
|
||||
#define ST25R500_CMD_START_NRT 0xE8U /*!< Start the no-response timer */
|
||||
#define ST25R500_CMD_STOP_NRT 0xEAU /*!< Stop No Response Timer */
|
||||
#define ST25R500_CMD_CALIBRATE_RC 0xEEU /*!< Calibrate RC */
|
||||
#define ST25R500_CMD_TRIGGER_DIAG 0xF8U /*!< Trigger Diagnostic Measurement */
|
||||
#define ST25R500_CMD_TEST_ACCESS 0xFCU /*!< Enable R/W access to the test registers */
|
||||
|
||||
#define ST25R500_BR_DO_NOT_SET 0xFFU /*!< Indicates not to change this Bit Rate */
|
||||
#define ST25R500_BR_106_26 0x00U /*!< ST25R500 Bit Rate 106 kbps (fc/128) / 26 kbps(fc/512) */
|
||||
#define ST25R500_BR_212_53 0x01U /*!< ST25R500 Bit Rate 212 kbps (fc/64) */
|
||||
#define ST25R500_BR_424 0x02U /*!< ST25R500 Bit Rate 424 kbps (fc/32) / 53 kbps(fc/256) */
|
||||
#define ST25R500_BR_848 0x03U /*!< ST25R500 Bit Rate 848 kbps (fc/16) */
|
||||
|
||||
#define ST25R500_REG_DROP_200 0U /*!< ST25R500 target drop for regulator adjustment: 200mV */
|
||||
#define ST25R500_REG_DROP_250 1U /*!< ST25R500 target drop for regulator adjustment: 250mV */
|
||||
#define ST25R500_REG_DROP_300 2U /*!< ST25R500 target drop for regulator adjustment: 300mV */
|
||||
#define ST25R500_REG_DROP_350 3U /*!< ST25R500 target drop for regulator adjustment: 350mV */
|
||||
#define ST25R500_REG_DROP_400 4U /*!< ST25R500 target drop for regulator adjustment: 400mV */
|
||||
#define ST25R500_REG_DROP_450 5U /*!< ST25R500 target drop for regulator adjustment: 450mV */
|
||||
#define ST25R500_REG_DROP_500 6U /*!< ST25R500 target drop for regulator adjustment: 500mV */
|
||||
#define ST25R500_REG_DROP_550 7U /*!< ST25R500 target drop for regulator adjustment: 550mV */
|
||||
#define ST25R500_REG_DROP_DO_NOT_SET 0xFFU /*!< Indicates not to change this setting (regd) */
|
||||
|
||||
#define ST25R500_THRESHOLD_DO_NOT_SET 0xFFU /*!< Indicates not to change this Threshold */
|
||||
|
||||
#define ST25R500_REG_LEN 1U /*!< Number of bytes in a ST25R500 register */
|
||||
#define ST25R500_CMD_LEN 1U /*!< ST25R500 CMD length */
|
||||
#define ST25R500_FIFO_DEPTH 256U /*!< Depth of FIFO */
|
||||
#define ST25R500_TOUT_OSC_STABLE 5U /*!< Timeout for Oscillator to get stable */
|
||||
|
||||
#define ST25R500_WRITE_MODE (0U << 7) /*!< ST25R500 Operation Mode: Write */
|
||||
#define ST25R500_READ_MODE (1U << 7) /*!< ST25R500 Operation Mode: Read */
|
||||
#define ST25R500_CMD_MODE ST25R500_WRITE_MODE /*!< ST25R500 Operation Mode: Direct Command */
|
||||
#define ST25R500_FIFO_ACCESS (0x5FU) /*!< ST25R500 FIFO Access */
|
||||
|
||||
|
||||
#define ST25R500_DIAG_MEAS_CMD 0x01U /*!< ST25R500 Diagnostic Measurement cmd size */
|
||||
#define ST25R500_DIAG_MEAS_CMD_LEN 0x02U /*!< ST25R500 Diagnostic Measurement cmd length */
|
||||
#define ST25R500_DIAG_MEAS_RES_LEN 0x04U /*!< ST25R500 Diagnostic Measurement res length */
|
||||
|
||||
#define ST25R500_DIAG_MEAS_I_VDD_DR 0x01U /*!< ST25R500 Diagnostic Measurement: I_VDD_DR */
|
||||
#define ST25R500_DIAG_MEAS_VDD_TX 0x02U /*!< ST25R500 Diagnostic Measurement: VDD_TX */
|
||||
#define ST25R500_DIAG_MEAS_VDD_DR 0x03U /*!< ST25R500 Diagnostic Measurement: VDD_DR */
|
||||
#define ST25R500_DIAG_MEAS_VDD_IO 0x04U /*!< ST25R500 Diagnostic Measurement: VDD_IO */
|
||||
#define ST25R500_DIAG_MEAS_VDD_D 0x0CU /*!< ST25R500 Diagnostic Measurement: VDD_D */
|
||||
#define ST25R500_DIAG_MEAS_VDD_A 0x0DU /*!< ST25R500 Diagnostic Measurement: VDD_A */
|
||||
#define ST25R500_DIAG_MEAS_VDD_VDD 0x11U /*!< ST25R500 Diagnostic Measurement: VDD */
|
||||
#define ST25R500_DIAG_MEAS_VDD_AGD 0x12U /*!< ST25R500 Diagnostic Measurement: AGD */
|
||||
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL MACROS
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/*! Enables the Transmitter (Field On) and Receiver */
|
||||
#define st25r500TxRxOn() st25r500SetRegisterBits( ST25R500_REG_OPERATION, (ST25R500_REG_OPERATION_rx_en | ST25R500_REG_OPERATION_tx_en ) )
|
||||
|
||||
/*! Disables the Transmitter (Field Off) and Receiver */
|
||||
#define st25r500TxRxOff() st25r500ClrRegisterBits( ST25R500_REG_OPERATION, (ST25R500_REG_OPERATION_rx_en | ST25R500_REG_OPERATION_tx_en ) )
|
||||
|
||||
/*! Enables the VDD_DR regulator */
|
||||
#define st25r500VDDDROn() st25r500SetRegisterBits( ST25R500_REG_OPERATION, (ST25R500_REG_OPERATION_vdddr_en | ST25R500_REG_OPERATION_vdddr_en ) )
|
||||
|
||||
/*! Disables the Transmitter (Field Off) and Receiver */
|
||||
#define st25r500VDDDROff() st25r500ClrRegisterBits( ST25R500_REG_OPERATION, (ST25R500_REG_OPERATION_vdddr_en | ST25R500_REG_OPERATION_vdddr_en ) )
|
||||
|
||||
/*! Disables the Transmitter (Field Off) */
|
||||
#define st25r500TxOff() st25r500ClrRegisterBits( ST25R500_REG_OPERATION, ST25R500_REG_OPERATION_tx_en )
|
||||
|
||||
/*! Checks if General Purpose Timer is still running by reading gpt_on flag */
|
||||
#define st25r500IsGPTRunning( ) st25r500CheckReg( ST25R500_REG_STATUS2, ST25R500_REG_STATUS2_gpt_on, ST25R500_REG_STATUS2_gpt_on )
|
||||
|
||||
/*! Checks if External Filed is detected by reading ST25R3916 External Field Detector output */
|
||||
#define st25r500IsExtFieldOn() st25r500CheckReg( ST25R500_REG_STATUS1, ST25R500_REG_STATUS1_efd_out, ST25R500_REG_STATUS1_efd_out )
|
||||
|
||||
/*! Checks if Transmitter is enabled (Field On) */
|
||||
#define st25r500IsTxEnabled() st25r500CheckReg( ST25R500_REG_OPERATION, ST25R500_REG_OPERATION_tx_en, ST25R500_REG_OPERATION_tx_en )
|
||||
|
||||
/*! Checks if NRT is in EMV mode */
|
||||
#define st25r500IsNRTinEMV() st25r500CheckReg( ST25R500_REG_NRT_GPT_CONF, ST25R500_REG_NRT_GPT_CONF_nrt_emv, ST25R500_REG_NRT_GPT_CONF_nrt_emv_on )
|
||||
|
||||
/*! Checks if last FIFO byte is complete */
|
||||
#define st25r500IsLastFIFOComplete() st25r500CheckReg( ST25R500_REG_FIFO_STATUS2, ST25R500_REG_FIFO_STATUS2_fifo_lb_mask, 0 )
|
||||
|
||||
/*! Checks if the Oscillator is enabled */
|
||||
#define st25r500IsOscOn() st25r500CheckReg( ST25R500_REG_OPERATION, ST25R500_REG_OPERATION_en, ST25R500_REG_OPERATION_en )
|
||||
|
||||
/*! Checks if Transmitter (Field On) is enabled */
|
||||
#define st25r500IsTxOn() st25r500CheckReg( ST25R500_REG_OPERATION, ST25R500_REG_OPERATION_tx_en, ST25R500_REG_OPERATION_tx_en )
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL FUNCTION PROTOTYPES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Initialise ST25R500 driver
|
||||
*
|
||||
* This function initialises the ST25R500 driver.
|
||||
*
|
||||
* \return RFAL_ERR_NONE : Operation successful
|
||||
* \return RFAL_ERR_HW_MISMATCH : Expected HW do not match or communication error
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r500Initialize( void );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Deinitialize ST25R500 driver
|
||||
*
|
||||
* Calling this function deinitializes the ST25R500 driver.
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
void st25r500Deinitialize( void );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Turn on Oscillator and Regulator
|
||||
*
|
||||
* This function turn on oscillator and regulator and waits for the
|
||||
* oscillator to become stable
|
||||
*
|
||||
* \return RFAL_ERR_SYSTEM: Unable to verify oscilator enable|stable
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r500OscOn( void );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Sets the bitrate
|
||||
*
|
||||
* This function sets the bitrates for rx and tx
|
||||
*
|
||||
* \param txRate : speed is 2^txrate * 106 kb/s
|
||||
* 0xff : don't set txrate (ST25R500_BR_DO_NOT_SET)
|
||||
* \param rxRate : speed is 2^rxrate * 106 kb/s
|
||||
* 0xff : don't set rxrate (ST25R500_BR_DO_NOT_SET)
|
||||
*
|
||||
* \return RFAL_ERR_PARAM: At least one bit rate was invalid
|
||||
* \return RFAL_ERR_NONE : No error, both bit rates were set
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r500SetBitrate( uint8_t txRate, uint8_t rxRate );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Adjusts supply regulators according to the current supply voltage
|
||||
*
|
||||
* The power level is measured in maximum load conditions and
|
||||
* the regulated voltage reference is set below this level.
|
||||
*
|
||||
* The regulated voltages will be set to the result of Adjust Regulators
|
||||
*
|
||||
* \param [in] drop : Targeted drop from supply voltage
|
||||
* \param [out] result : Result of calibration in milliVolts
|
||||
*
|
||||
* \return RFAL_ERR_IO : Error during communication with ST25R500
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r500AdjustRegulators( uint8_t drop, uint16_t* result );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Sets supply regulators
|
||||
*
|
||||
* Manually sets the regulated voltage setting (rege).
|
||||
* The regulated voltages will be set to the manual configuratiom.
|
||||
*
|
||||
* Regulation shall be set according to the desired voltage considering the
|
||||
* supplied voltage.
|
||||
*
|
||||
* \param [in] regulation : Regulator setting
|
||||
*
|
||||
* \return RFAL_ERR_IO : Error during communication with ST25R500
|
||||
* \return RFAL_ERR_PARAM : Invalid regulator setting
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r500SetRegulators( uint8_t regulation );
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Measure Amplitude
|
||||
*
|
||||
* This function measured the amplitude on the RFI inputs and stores the
|
||||
* result in parameter \a result.
|
||||
*
|
||||
* \param[out] result: result of RF measurement (unsigned)
|
||||
*
|
||||
* \return RFAL_ERR_PARAM : Invalid parameter
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r500MeasureAmplitude( uint8_t* result );
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Get Ce gain
|
||||
*
|
||||
* This function retieves an RFI indicator
|
||||
* and stores the result in parameter \a result.
|
||||
*
|
||||
* \warning This method can only be executed in Listen mode
|
||||
*
|
||||
* \param[out] result: received signal indicator
|
||||
*
|
||||
* \return RFAL_ERR_PARAM : Invalid parameter
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r500GetCeGain( uint8_t *result );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Measure I/Q
|
||||
*
|
||||
* This function performs an I/Q measurement
|
||||
* The result is stored on the \a resI and \a resQ parameters.
|
||||
*
|
||||
* \param[out] resI: 8 bit long result of the I channel (signed)
|
||||
* \param[out] resQ: 8 bit long result of the Q channel (signed)
|
||||
*
|
||||
* \return RFAL_ERR_PARAM : Invalid parameter
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r500MeasureIQ( int8_t* resI, int8_t* resQ );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Measure Combined I/Q
|
||||
*
|
||||
* This function performs an I/Q measurement and returns the
|
||||
* vectorial magnitude
|
||||
*
|
||||
* \param[out] res
|
||||
*
|
||||
* \return RFAL_ERR_PARAM : Invalid parameter
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r500MeasureCombinedIQ( uint8_t* res );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Measure I
|
||||
*
|
||||
* This function performs an I/Q measurement and returns I
|
||||
*
|
||||
* \param[out] res
|
||||
*
|
||||
* \return RFAL_ERR_PARAM : Invalid parameter
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r500MeasureI( uint8_t* res );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Measure Q
|
||||
*
|
||||
* This function performs an I/Q measurement and returns Q
|
||||
*
|
||||
* \param[out] res
|
||||
*
|
||||
* \return RFAL_ERR_PARAM : Invalid parameter
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r500MeasureQ( uint8_t* res );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Measure Phase
|
||||
*
|
||||
* This function performs an I/Q measurement and returns the
|
||||
* vectorial angle
|
||||
*
|
||||
* \param[out] res
|
||||
*
|
||||
* \return RFAL_ERR_PARAM : Invalid parameter
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r500MeasurePhase( uint8_t* res );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Measure electrical current
|
||||
*
|
||||
* This function performs measurement of I_VDD_DR using
|
||||
* Diagnostic Measurement Mode
|
||||
* For limitations see st25r500DiagMeasure().
|
||||
*
|
||||
* \param[out] res: Raw value - approx 3.2mA/unit
|
||||
*
|
||||
* \return RFAL_ERR_WRONG_STATE : Measurement could not be performed (e.g. en=0)
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r500MeasureCurrent( uint8_t* res );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Calibrate WU
|
||||
*
|
||||
* This function executes Wake-up Calibration
|
||||
*
|
||||
* \param[out] resI: I channel calibration (unsigned)
|
||||
* \param[out] resQ: Q channel calibration (unsigned)
|
||||
*
|
||||
* \return RFAL_ERR_PARAM : Invalid parameter
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r500CalibrateWU( uint16_t* resI, uint16_t* resQ );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Clear WU Calibration
|
||||
*
|
||||
* This function clears WU calibration
|
||||
*
|
||||
* \return RFAL_ERR_PARAM : Invalid parameter
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r500ClearCalibration( void );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Measure WU
|
||||
*
|
||||
* This function performs measuremnt as executed during WU mode
|
||||
*
|
||||
* \param[out] resI: 8 bit long result of the I channel (signed)
|
||||
* \param[out] resQ: 8 bit long result of the Q channel (signed)
|
||||
|
||||
* \return RFAL_ERR_PARAM : Invalid parameter
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r500MeasureWU( uint8_t* resI, uint8_t* resQ );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Get NRT time
|
||||
*
|
||||
* This returns the last value set on the NRT
|
||||
*
|
||||
* \warning it does not read chip register, just the sw var that contains the
|
||||
* last value set before
|
||||
*
|
||||
* \return the value of the NRT in 64/fc
|
||||
*/
|
||||
uint32_t st25r500GetNoResponseTime( void );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Set NRT time
|
||||
*
|
||||
* This function sets the No Response Time with the given value
|
||||
*
|
||||
* \param [in] nrt : no response time in steps of 64/fc (4.72us)
|
||||
*
|
||||
* \return RFAL_ERR_PARAM : Invalid parameter (time is too large)
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r500SetNoResponseTime( uint32_t nrt );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Set MRT time
|
||||
*
|
||||
* This function sets the Mask Receive Time with the given value. It also
|
||||
* adapts mrt_step to achieve highest precision.
|
||||
*
|
||||
* \param [in] value_fc : mask receive time in steps of 1/fc
|
||||
*
|
||||
* \return RFAL_ERR_PARAM : Invalid parameter (time is too large), max will
|
||||
* be set
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*
|
||||
***************************************************************************
|
||||
*/
|
||||
ReturnCode st25r500SetMRT( uint32_t value_fc );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Set and Start NRT
|
||||
*
|
||||
* This function sets the No Response Time with the given value and
|
||||
* immediately starts it
|
||||
* Used when needs to add more time before timeout without performing Tx
|
||||
*
|
||||
* \param [in] nrt : no response time in steps of 64/fc (4.72us)
|
||||
*
|
||||
* \return RFAL_ERR_PARAM : Invalid parameter
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r500SetStartNoResponseTimer( uint32_t nrt );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Set GPT time
|
||||
*
|
||||
* This function sets the General Purpose Timer time registers
|
||||
*
|
||||
* \param [in] gpt : general purpose timer timeout in steps of 8/fc (590ns)
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
void st25r500SetGPTime( uint16_t gpt );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Set and Start GPT
|
||||
*
|
||||
* This function sets the General Purpose Timer with the given timeout and
|
||||
* immediately starts it ONLY if the trigger source is not set to none.
|
||||
*
|
||||
* \param [in] gpt : general purpose timer timeout in steps of8/fc (590ns)
|
||||
* \param [in] trigger : no trigger, start of Rx, end of Rx, end of Tx in NFC mode
|
||||
*
|
||||
* \return RFAL_ERR_PARAM : Invalid parameter
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r500SetStartGPTimer( uint16_t gpt, uint8_t trigger );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Sets the number Tx Bits
|
||||
*
|
||||
* Sets ST25R500 internal registers with correct number of complete bytes and
|
||||
* bits to be sent
|
||||
*
|
||||
* \param [in] nBits : number of bits to be set/transmitted
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
void st25r500SetNumTxBits( uint16_t nBits );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Get amount of bytes in FIFO
|
||||
*
|
||||
* Gets the number of bytes currently in the FIFO
|
||||
*
|
||||
* \return the number of bytes currently in the FIFO
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
uint16_t st25r500GetNumFIFOBytes( void );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Get amount of bits of the last FIFO byte if incomplete
|
||||
*
|
||||
* Gets the number of bits of the last FIFO byte if incomplete
|
||||
*
|
||||
* \return the number of bits of the last FIFO byte if incomplete, 0 if
|
||||
* the last byte is complete
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
uint8_t st25r500GetNumFIFOLastBits( void );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Perform Collision Avoidance
|
||||
*
|
||||
* Performs Collision Avoidance with the given threshold and with the
|
||||
* n number of TRFW
|
||||
*
|
||||
* \param[in] atThreshold : Activation Threshold (ST25R500_REG_EFD_THRESHOLDS_efd_at_xx)
|
||||
* 0xff : don't set Threshold (ST25R500_THRESHOLD_DO_NOT_SET)
|
||||
* \param[in] dtThreshold : Deactivation Threshold (ST25R500_REG_EFD_THRESHOLDS_efd_dt_xx)
|
||||
* 0xff : don't set Threshold (ST25R500_THRESHOLD_DO_NOT_SET)
|
||||
* \param[in] nTRFW : Number of TRFW
|
||||
*
|
||||
* \return RFAL_ERR_PARAM : Invalid parameter
|
||||
* \return RFAL_ERR_RF_COLLISION : Collision detected
|
||||
* \return RFAL_ERR_NONE : No collision detected
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r500PerformCollisionAvoidance( uint8_t atThreshold, uint8_t dtThreshold, uint8_t nTRFW );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Check Identity
|
||||
*
|
||||
* Checks if the chip ID is as expected.
|
||||
*
|
||||
* 5 bit IC type code for ST25R500: 00101
|
||||
* The 3 lsb contain the IC revision code
|
||||
*
|
||||
* \param[out] rev : the IC revision code
|
||||
*
|
||||
* \return true when IC type is as expected
|
||||
* \return false otherwise
|
||||
*/
|
||||
bool st25r500CheckChipID( uint8_t *rev );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Register Dump
|
||||
*
|
||||
* Retrieves all internal registers from ST25R500
|
||||
*
|
||||
* \param[out] resRegDump : pointer to the struct/buffer where the reg dump
|
||||
* will be written. NULL is allowed and causes only
|
||||
* reading to internal buffer
|
||||
* \param[in,out] sizeRegDump : number of registers requested and the ones actually
|
||||
* written
|
||||
*
|
||||
* \return RFAL_ERR_PARAM : Invalid parameter
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*/
|
||||
ReturnCode st25r500GetRegsDump( uint8_t* resRegDump, uint8_t* sizeRegDump );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Check if command is valid
|
||||
*
|
||||
* Checks if the given command is a valid ST25R500 command
|
||||
*
|
||||
* \param[in] cmd: Command to check
|
||||
*
|
||||
* \return true if is a valid command
|
||||
* \return false otherwise
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
bool st25r500IsCmdValid( uint8_t cmd );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Executes a direct command and returns the result
|
||||
*
|
||||
* This function executes the direct command given by \a cmd waits for
|
||||
* \a sleeptime for I_dct and returns the result read from register \a resreg.
|
||||
* The value of cmd is not checked.
|
||||
*
|
||||
* \param[in] cmd : direct command to execute
|
||||
* \param[in] resReg: address of the register containing the result
|
||||
* \param[in] tOut : time in milliseconds to wait before reading the result
|
||||
* \param[out] result: result
|
||||
*
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r500ExecuteCommandAndGetResult( uint8_t cmd, uint8_t resReg, uint8_t tOut, uint8_t* result );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Gets the RSSI values
|
||||
*
|
||||
* This function gets the RSSI value of the previous reception taking into
|
||||
* account the gain reductions that were used.
|
||||
* RSSI value for both I and Q channel can be retrieved.
|
||||
*
|
||||
* \param[out] iRssi: the RSSI on the I channel expressed in mV
|
||||
* \param[out] qRssi: the RSSI on the Q channel expressed in mV
|
||||
*
|
||||
* \return RFAL_ERR_PARAM : Invalid parameter
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r500GetRSSI( uint16_t *iRssi, uint16_t *qRssi );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Set Antenna mode
|
||||
*
|
||||
* Sets the antenna mode.
|
||||
* Differential or single ended antenna mode (RFO1 or RFO2)
|
||||
*
|
||||
* \param[in] single: FALSE differential ; single ended mode
|
||||
* \param[in] rfiox: FALSE RFI1/RFO1 ; TRUE RFI2/RFO2
|
||||
*
|
||||
* \return RFAL_ERR_IO : Internal error
|
||||
* \return RFAL_ERR_NOTSUPP : Feature not supported
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r500SetAntennaMode( bool single, bool rfiox );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Diagnostic Measurement
|
||||
*
|
||||
* Performs a diagnostic measurement of certain currents and voltages.
|
||||
* The function does not work when oscillator is not enabled. For its operation
|
||||
* it may temporarily enable the reciever (rx_en=1).
|
||||
* Ongoing transmissions/receptions (also in CE mode) may be garbled when
|
||||
* this functions is executed.
|
||||
*
|
||||
* \param[in] meas: the measurement function to perform, see ST25R500_DIAG_MEAS_*
|
||||
* \param[out] res: 9 bit unsigned value
|
||||
*
|
||||
* \return RFAL_ERR_WRONG_STATE : Measurement could not be performed (e.g. en=0)
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r500DiagMeasure( uint8_t meas, uint16_t *res );
|
||||
|
||||
#endif /* ST25R500_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
@@ -0,0 +1,649 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file : st25r500_com.c
|
||||
* @brief : Implementation of ST25R500 communication
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2025 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 "st25r500.h"
|
||||
#include "st25r500_com.h"
|
||||
#include "st25r500_irq.h"
|
||||
#include "rfal_platform.h"
|
||||
#include "rfal_utils.h"
|
||||
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* LOCAL DEFINES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#define ST25R500_OPTIMIZE true /*!< Optimization switch: false always write value to register */
|
||||
#define ST25R500_MOSI_IDLE (0x00) /*!< ST25R500 MOSI IDLE state */
|
||||
#define ST25R500_BUF_LEN (ST25R500_CMD_LEN+ST25R500_FIFO_DEPTH) /*!< ST25R500 communication buffer: CMD + FIFO length */
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* MACROS
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/*!
|
||||
******************************************************************************
|
||||
* \brief ST25R500 communication Repeat Start
|
||||
*
|
||||
* This method performs the required actions to repeat start a transmission
|
||||
* with ST25R500
|
||||
******************************************************************************
|
||||
*/
|
||||
#define st25r500comRepeatStart()
|
||||
|
||||
|
||||
|
||||
#if defined(ST25R_COM_SINGLETXRX)
|
||||
static uint8_t comBuf[ST25R500_BUF_LEN]; /*!< ST25R500 communication buffer */
|
||||
static uint16_t comBufIt; /*!< ST25R500 communication buffer iterator */
|
||||
#endif /* ST25R_COM_SINGLETXRX */
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* LOCAL FUNCTION PROTOTYPES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/*!
|
||||
******************************************************************************
|
||||
* \brief ST25R500 communication Start
|
||||
*
|
||||
* This method performs the required actions to start communications with
|
||||
* ST25R500, either by SPI or I2C
|
||||
******************************************************************************
|
||||
*/
|
||||
static void st25r500comStart( void );
|
||||
|
||||
/*!
|
||||
******************************************************************************
|
||||
* \brief ST25R500 communication Stop
|
||||
*
|
||||
* This method performs the required actions to terminate communications with
|
||||
* ST25R500, either by SPI or I2C
|
||||
******************************************************************************
|
||||
*/
|
||||
static void st25r500comStop( void );
|
||||
|
||||
|
||||
/*!
|
||||
******************************************************************************
|
||||
* \brief ST25R500 communication Tx
|
||||
*
|
||||
* This method performs the required actions to transmit the given buffer
|
||||
* to ST25R500, either by SPI or I2C
|
||||
*
|
||||
* \param[in] txBuf : the buffer to transmit
|
||||
* \param[in] txLen : the length of the buffer to transmit
|
||||
* \param[in] last : true if last data to be transmitted
|
||||
* \param[in] txOnly : true no reception is to be performed
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
static void st25r500comTx( const uint8_t* txBuf, uint16_t txLen, bool last, bool txOnly );
|
||||
|
||||
|
||||
/*!
|
||||
******************************************************************************
|
||||
* \brief ST25R500 communication Rx
|
||||
*
|
||||
* This method performs the required actions to receive from ST25R500 the given
|
||||
* amount of bytes, either by SPI or I2C
|
||||
*
|
||||
* \param[out] rxBuf : the buffer place the received bytes
|
||||
* \param[in] rxLen : the length to receive
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
static void st25r500comRx( uint8_t* rxBuf, uint16_t rxLen );
|
||||
|
||||
/*!
|
||||
******************************************************************************
|
||||
* \brief ST25R500 communication Tx Byte
|
||||
*
|
||||
* This helper method transmits a byte passed by value and not by reference
|
||||
*
|
||||
* \param[in] txByte : the value of the byte to be transmitted
|
||||
* \param[in] last : true if last byte to be transmitted
|
||||
* \param[in] txOnly : true no reception is to be performed
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
static void st25r500comTxByte( uint8_t txByte, bool last, bool txOnly );
|
||||
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* LOCAL FUNCTION
|
||||
******************************************************************************
|
||||
*/
|
||||
static void st25r500comStart( void )
|
||||
{
|
||||
/* Make this operation atomic, disabling ST25R500 interrupt during communications*/
|
||||
platformProtectST25RComm();
|
||||
|
||||
/* Perform the chip select */
|
||||
platformSpiSelect();
|
||||
|
||||
#if defined(ST25R_COM_SINGLETXRX)
|
||||
comBufIt = 0; /* Reset local buffer position */
|
||||
#endif /* ST25R_COM_SINGLETXRX */
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
static void st25r500comStop( void )
|
||||
{
|
||||
/* Release the chip select */
|
||||
platformSpiDeselect();
|
||||
|
||||
/* reEnable the ST25R500 interrupt */
|
||||
platformUnprotectST25RComm();
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
static void st25r500comTx( const uint8_t* txBuf, uint16_t txLen, bool last, bool txOnly )
|
||||
{
|
||||
RFAL_NO_WARNING(last);
|
||||
RFAL_NO_WARNING(txOnly);
|
||||
|
||||
if( txLen > 0U )
|
||||
{
|
||||
#ifdef ST25R_COM_SINGLETXRX
|
||||
|
||||
RFAL_MEMCPY( &comBuf[comBufIt], txBuf, RFAL_MIN( txLen, (uint16_t)(ST25R500_BUF_LEN - comBufIt) ) ); /* Copy tx data to local buffer */
|
||||
comBufIt += RFAL_MIN( txLen, (ST25R500_BUF_LEN - comBufIt) ); /* Store position on local buffer */
|
||||
|
||||
if( last && txOnly ) /* Only perform SPI transaction if no Rx will follow */
|
||||
{
|
||||
platformSpiTxRx( comBuf, NULL, comBufIt );
|
||||
}
|
||||
|
||||
#else
|
||||
platformSpiTxRx( txBuf, NULL, txLen );
|
||||
#endif /* ST25R_COM_SINGLETXRX */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
static void st25r500comRx( uint8_t* rxBuf, uint16_t rxLen )
|
||||
{
|
||||
#ifndef ST25R_COM_SINGLETXRX
|
||||
uint8_t dummyBuf;
|
||||
uint16_t rxIt;
|
||||
#endif /* ST25R_COM_SINGLETXRX */
|
||||
|
||||
|
||||
if( rxLen > 0U )
|
||||
{
|
||||
|
||||
#ifdef ST25R_COM_SINGLETXRX
|
||||
RFAL_MEMSET( &comBuf[comBufIt], ST25R500_MOSI_IDLE, RFAL_MIN( rxLen, (uint16_t)(ST25R500_BUF_LEN - comBufIt) ) ); /* Clear outgoing buffer */
|
||||
platformSpiTxRx( comBuf, comBuf, RFAL_MIN( (comBufIt + rxLen), ST25R500_BUF_LEN ) ); /* Transceive as a single SPI call */
|
||||
if( rxBuf != NULL )
|
||||
{
|
||||
RFAL_MEMCPY( rxBuf, &comBuf[comBufIt], RFAL_MIN( rxLen, (uint16_t)(ST25R500_BUF_LEN - comBufIt) ) );/* Copy from local buf to output buffer and skip cmd byte */
|
||||
}
|
||||
#else
|
||||
/* In case rxBuf is not provided, ensure that SPI operation is executed. *
|
||||
* Depending on the HAL used, the SPI driver may not support *
|
||||
* NULL as Rx buffer, do single byte SPI transactions to a dummy buffer */
|
||||
if( rxBuf == NULL )
|
||||
{
|
||||
for( rxIt = 0; (rxIt < rxLen); rxIt++ )
|
||||
{
|
||||
dummyBuf = ST25R500_MOSI_IDLE; /* Clear outgoing|incoming buffer */
|
||||
platformSpiTxRx( &dummyBuf, &dummyBuf, 1U ); /* Re-use the rxBuf as SPI outputs data first then reads */
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
RFAL_MEMSET( rxBuf, ST25R500_MOSI_IDLE, rxLen ); /* Clear outgoing|incoming buffer */
|
||||
platformSpiTxRx( rxBuf, rxBuf, rxLen ); /* Re-use the rxBuf as SPI outputs data first then reads */
|
||||
}
|
||||
|
||||
#endif /* ST25R_COM_SINGLETXRX */
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
static void st25r500comTxByte( uint8_t txByte, bool last, bool txOnly )
|
||||
{
|
||||
uint8_t val = txByte; /* MISRA 17.8: use intermediate variable */
|
||||
st25r500comTx( &val, ST25R500_REG_LEN, last, txOnly );
|
||||
}
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL FUNCTIONS
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r500ReadRegister( uint8_t reg, uint8_t* val )
|
||||
{
|
||||
return st25r500ReadMultipleRegisters( reg, val, ST25R500_REG_LEN );
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r500ReadMultipleRegisters( uint8_t reg, uint8_t* values, uint16_t length )
|
||||
{
|
||||
if( length > 0U )
|
||||
{
|
||||
st25r500comStart();
|
||||
st25r500comTxByte( (reg | ST25R500_READ_MODE), true, false );
|
||||
st25r500comRepeatStart();
|
||||
st25r500comRx( values, length );
|
||||
st25r500comStop();
|
||||
}
|
||||
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r500WriteRegister( uint8_t reg, uint8_t val )
|
||||
{
|
||||
uint8_t value = val; /* MISRA 17.8: use intermediate variable */
|
||||
return st25r500WriteMultipleRegisters( reg, &value, ST25R500_REG_LEN );
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r500WriteMultipleRegisters( uint8_t reg, const uint8_t* values, uint16_t length )
|
||||
{
|
||||
if( length > 0U )
|
||||
{
|
||||
st25r500comStart();
|
||||
st25r500comTxByte( (reg | ST25R500_WRITE_MODE), false, true );
|
||||
st25r500comTx( values, length, true, true );
|
||||
st25r500comStop();
|
||||
|
||||
/* Send a WriteMultiReg event to LED handling */
|
||||
st25r500ledEvtWrMultiReg( reg, values, (uint8_t)length );
|
||||
}
|
||||
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r500WriteFifo( const uint8_t* values, uint16_t length )
|
||||
{
|
||||
if( length > ST25R500_FIFO_DEPTH )
|
||||
{
|
||||
return RFAL_ERR_PARAM;
|
||||
}
|
||||
|
||||
st25r500WriteMultipleRegisters( ST25R500_FIFO_ACCESS, values, length );
|
||||
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r500ReadFifo( uint8_t* buf, uint16_t length )
|
||||
{
|
||||
if( length > 0U )
|
||||
{
|
||||
if( length > ST25R500_FIFO_DEPTH )
|
||||
{
|
||||
return RFAL_ERR_PARAM;
|
||||
}
|
||||
|
||||
st25r500ReadMultipleRegisters( ST25R500_FIFO_ACCESS, buf, length );
|
||||
}
|
||||
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r500ExecuteCommand( uint8_t cmd )
|
||||
{
|
||||
st25r500comStart();
|
||||
st25r500comTxByte( (cmd | ST25R500_CMD_MODE ), true, true );
|
||||
st25r500comStop();
|
||||
|
||||
/* Send a cmd event to LED handling */
|
||||
st25r500ledEvtCmd( cmd );
|
||||
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r500ExecuteCommands( const uint8_t *cmds, uint8_t length )
|
||||
{
|
||||
st25r500comStart();
|
||||
st25r500comTx( cmds, length, true, true );
|
||||
st25r500comStop();
|
||||
|
||||
/* Send cmd event to LED handling */
|
||||
st25r500ledEvtCmds( cmds, length );
|
||||
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r500ReadTestRegister( uint8_t reg, uint8_t* val )
|
||||
{
|
||||
st25r500comStart();
|
||||
st25r500comTxByte( ST25R500_CMD_TEST_ACCESS, false, false );
|
||||
st25r500comTxByte( (reg | ST25R500_READ_MODE), true, false );
|
||||
st25r500comRepeatStart();
|
||||
st25r500comRx( val, ST25R500_REG_LEN );
|
||||
st25r500comStop();
|
||||
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r500WriteTestRegister( uint8_t reg, uint8_t val )
|
||||
{
|
||||
uint8_t value = val; /* MISRA 17.8: use intermediate variable */
|
||||
|
||||
st25r500comStart();
|
||||
st25r500comTxByte( ST25R500_CMD_TEST_ACCESS, false, true );
|
||||
st25r500comTxByte( (reg | ST25R500_WRITE_MODE), false, true );
|
||||
st25r500comTx( &value, ST25R500_REG_LEN, true, true );
|
||||
st25r500comStop();
|
||||
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r500WriteMultipleTestRegister( uint8_t reg, const uint8_t* values, uint8_t length )
|
||||
{
|
||||
st25r500comStart();
|
||||
st25r500comTxByte( ST25R500_CMD_TEST_ACCESS, false, true );
|
||||
st25r500comTxByte( (reg | ST25R500_WRITE_MODE), false, true );
|
||||
st25r500comTx( values, length, true, true );
|
||||
st25r500comStop();
|
||||
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r500ClrRegisterBits( uint8_t reg, uint8_t clr_mask )
|
||||
{
|
||||
ReturnCode ret;
|
||||
uint8_t rdVal;
|
||||
|
||||
/* Read current reg value */
|
||||
RFAL_EXIT_ON_ERR( ret, st25r500ReadRegister(reg, &rdVal) );
|
||||
|
||||
/* Only perform a Write if value to be written is different */
|
||||
if( ST25R500_OPTIMIZE && (rdVal == (uint8_t)(rdVal & ~clr_mask)) )
|
||||
{
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
/* Write new reg value */
|
||||
return st25r500WriteRegister(reg, (uint8_t)(rdVal & ~clr_mask) );
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r500SetRegisterBits( uint8_t reg, uint8_t set_mask )
|
||||
{
|
||||
ReturnCode ret;
|
||||
uint8_t rdVal;
|
||||
|
||||
/* Read current reg value */
|
||||
RFAL_EXIT_ON_ERR( ret, st25r500ReadRegister(reg, &rdVal) );
|
||||
|
||||
/* Only perform a Write if the value to be written is different */
|
||||
if( ST25R500_OPTIMIZE && (rdVal == (rdVal | set_mask)) )
|
||||
{
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
/* Write new reg value */
|
||||
return st25r500WriteRegister(reg, (rdVal | set_mask) );
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r500ChangeRegisterBits( uint8_t reg, uint8_t valueMask, uint8_t value )
|
||||
{
|
||||
return st25r500ModifyRegister(reg, valueMask, (valueMask & value) );
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r500ModifyRegister( uint8_t reg, uint8_t clr_mask, uint8_t set_mask )
|
||||
{
|
||||
ReturnCode ret;
|
||||
uint8_t rdVal;
|
||||
uint8_t wrVal;
|
||||
|
||||
/* Read current reg value */
|
||||
RFAL_EXIT_ON_ERR( ret, st25r500ReadRegister(reg, &rdVal) );
|
||||
|
||||
/* Compute new value */
|
||||
wrVal = (uint8_t)(rdVal & ~clr_mask);
|
||||
wrVal |= set_mask;
|
||||
|
||||
/* Only perform a Write if the value to be written is different */
|
||||
if( ST25R500_OPTIMIZE && (rdVal == wrVal) )
|
||||
{
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
/* Write new reg value */
|
||||
return st25r500WriteRegister(reg, wrVal );
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r500ChangeTestRegisterBits( uint8_t reg, uint8_t valueMask, uint8_t value )
|
||||
{
|
||||
ReturnCode ret;
|
||||
uint8_t rdVal;
|
||||
uint8_t wrVal;
|
||||
|
||||
/* Read current reg value */
|
||||
RFAL_EXIT_ON_ERR( ret, st25r500ReadTestRegister(reg, &rdVal) );
|
||||
|
||||
/* Compute new value */
|
||||
wrVal = (uint8_t)(rdVal & ~valueMask);
|
||||
wrVal |= (uint8_t)(value & valueMask);
|
||||
|
||||
/* Only perform a Write if the value to be written is different */
|
||||
if( ST25R500_OPTIMIZE && (rdVal == wrVal) )
|
||||
{
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
/* Write new reg value */
|
||||
return st25r500WriteTestRegister(reg, wrVal );
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
bool st25r500CheckReg( uint8_t reg, uint8_t mask, uint8_t val )
|
||||
{
|
||||
uint8_t regVal;
|
||||
|
||||
regVal = 0;
|
||||
st25r500ReadRegister( reg, ®Val );
|
||||
|
||||
return ( (regVal & mask) == val );
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
bool st25r500IsRegValid( uint8_t reg )
|
||||
{
|
||||
if( !(( (int16_t)reg >= (int16_t)ST25R500_REG_OPERATION) && (reg < ST25R500_REG_FIFO) ))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* MACROS
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifdef PLATFORM_LED_RX_PIN
|
||||
#define st25r500ledRxOn() platformLedOn( PLATFORM_LED_RX_PORT, PLATFORM_LED_RX_PIN ); /*!< LED Rx Pin On from system HAL */
|
||||
#define st25r500ledRxOff() platformLedOff( PLATFORM_LED_RX_PORT, PLATFORM_LED_RX_PIN ); /*!< LED Rx Pin Off from system HAL */
|
||||
#else /* PLATFORM_LED_RX_PIN */
|
||||
#define st25r500ledRxOn()
|
||||
#define st25r500ledRxOff()
|
||||
#endif /* PLATFORM_LED_RX_PIN */
|
||||
|
||||
|
||||
#ifdef PLATFORM_LED_FIELD_PIN
|
||||
#define st25r500ledFieldOn() platformLedOn( PLATFORM_LED_FIELD_PORT, PLATFORM_LED_FIELD_PIN ); /*!< LED Field Pin On from system HAL */
|
||||
#define st25r500ledFieldOff() platformLedOff( PLATFORM_LED_FIELD_PORT, PLATFORM_LED_FIELD_PIN ); /*!< LED Field Pin Off from system HAL */
|
||||
#else /* PLATFORM_LED_FIELD_PIN */
|
||||
#define st25r500ledFieldOn()
|
||||
#define st25r500ledFieldOff()
|
||||
#endif /* PLATFORM_LED_FIELD_PIN */
|
||||
|
||||
#ifdef PLATFORM_LED_ERR_PIN
|
||||
#define st25r500ledErrOn() platformLedOn( PLATFORM_LED_ERR_PORT, PLATFORM_LED_ERR_PIN ); /*!< LED Field Pin On from system HAL */
|
||||
#define st25r500ledErrOff() platformLedOff( PLATFORM_LED_ERR_PORT, PLATFORM_LED_ERR_PIN ); /*!< LED Field Pin Off from system HAL */
|
||||
#else /* PLATFORM_LED_ERR_PIN */
|
||||
#define st25r500ledErrOn()
|
||||
#define st25r500ledErrOff()
|
||||
#endif /* PLATFORM_LED_ERR_PIN */
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL FUNCTIONS
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
void st25r500ledInit( void )
|
||||
{
|
||||
/* Initialize LEDs if existing and defined */
|
||||
platformLedsInitialize();
|
||||
|
||||
st25r500ledRxOff();
|
||||
st25r500ledFieldOff();
|
||||
st25r500ledErrOff();
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
void st25r500ledEvtIrq( uint32_t irqs )
|
||||
{
|
||||
|
||||
if( (irqs & ST25R500_IRQ_MASK_TXE) != 0U )
|
||||
{
|
||||
st25r500ledErrOff();
|
||||
}
|
||||
if( (irqs & (ST25R500_IRQ_MASK_RXS | ST25R500_IRQ_MASK_SUBC_START) ) != 0U )
|
||||
{
|
||||
st25r500ledRxOn();
|
||||
}
|
||||
|
||||
if( ((irqs & (ST25R500_IRQ_MASK_RXE | ST25R500_IRQ_MASK_NRE | ST25R500_IRQ_MASK_RX_REST )) != 0U ) )
|
||||
{
|
||||
st25r500ledRxOff();
|
||||
}
|
||||
|
||||
if( ((irqs & ST25R500_IRQ_MASK_RX_ERR) != 0U) )
|
||||
{
|
||||
st25r500ledErrOn();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
void st25r500ledEvtWrReg( uint8_t reg, uint8_t val )
|
||||
{
|
||||
if( reg == ST25R500_REG_OPERATION )
|
||||
{
|
||||
if( (ST25R500_REG_OPERATION_tx_en & val) != 0U )
|
||||
{
|
||||
st25r500ledFieldOn();
|
||||
}
|
||||
else
|
||||
{
|
||||
st25r500ledFieldOff();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
void st25r500ledEvtWrMultiReg( uint8_t reg, const uint8_t* vals, uint8_t len )
|
||||
{
|
||||
uint8_t i;
|
||||
|
||||
for(i=0; i<(len); i++)
|
||||
{
|
||||
st25r500ledEvtWrReg( (reg+i), vals[i] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
void st25r500ledEvtCmds( const uint8_t* cmds, uint8_t len )
|
||||
{
|
||||
uint8_t i;
|
||||
|
||||
for(i=0; i<(len); i++)
|
||||
{
|
||||
st25r500ledEvtCmd( cmds[i] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
void st25r500ledEvtCmd( uint8_t cmd )
|
||||
{
|
||||
|
||||
if( cmd == ST25R500_CMD_NFC_FIELD_ON )
|
||||
{
|
||||
st25r500ledFieldOn();
|
||||
}
|
||||
|
||||
if( cmd == ST25R500_CMD_UNMASK_RECEIVE_DATA )
|
||||
{
|
||||
st25r500ledRxOff();
|
||||
}
|
||||
|
||||
if( cmd == ST25R500_CMD_SET_DEFAULT )
|
||||
{
|
||||
st25r500ledFieldOff();
|
||||
st25r500ledRxOff();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,506 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file : st25r500_dpocr.c
|
||||
* @brief : Functions to manage and set dynamic power settings for electric current based approach on R500
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2025 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 "st25r500_dpocr.h"
|
||||
#include "st25r500.h"
|
||||
#include "rfal_platform.h"
|
||||
#include "rfal_analogConfig.h"
|
||||
#include "rfal_utils.h"
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* ENABLE SWITCH
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Feature switch may be enabled or disabled by user at rfal_platform.h
|
||||
* Default configuration (ST25R dependant) also provided at rfal_defConfig.h
|
||||
*
|
||||
* RFAL_FEATURE_DPO_CR
|
||||
*/
|
||||
|
||||
#if RFAL_FEATURE_DPO_CR
|
||||
|
||||
|
||||
#if RFAL_FEATURE_DPO
|
||||
#error " Single DPO mechanism supported "
|
||||
#endif /* RFAL_FEATURE_DPO */
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* DEFINES
|
||||
******************************************************************************
|
||||
*/
|
||||
#define RFAL_DPO_ANALOGCONFIG_SHIFT 13U /* FIXME: Redifiniation of DPO macros, exclude? */
|
||||
#define RFAL_DPO_ANALOGCONFIG_MASK 0x6000U
|
||||
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* MACROS
|
||||
******************************************************************************
|
||||
*/
|
||||
#define DELTA(A,B) (((A)>(B))?((A)-(B)):((B)-(A)))
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* LOCAL DATA TYPES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/*! ST25R500 DPOCR Point struct */
|
||||
typedef struct{
|
||||
uint8_t dres;
|
||||
uint8_t rege;
|
||||
uint8_t curr;
|
||||
} st25r500DpoPoint;
|
||||
|
||||
|
||||
/*! ST25R500 DPOCR instance */
|
||||
typedef struct{
|
||||
bool isInit;
|
||||
st25r500DpocrConfig config;
|
||||
st25r500DpocrInfo info;
|
||||
rfalMode curMode;
|
||||
rfalBitRate curBR;
|
||||
bool forceAdj;
|
||||
st25r500DpoPoint currBest;
|
||||
} st25r500Dpocr;
|
||||
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* LOCAL VARIABLES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
static st25r500Dpocr gSt25r500Dpocr;
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL FUNCTIONS
|
||||
******************************************************************************
|
||||
*/
|
||||
ReturnCode st25r500DpocrInitialize( const st25r500DpocrConfig *config )
|
||||
{
|
||||
gSt25r500Dpocr.isInit = false;
|
||||
|
||||
/* Check for valid configuration *
|
||||
* Regulator must be set to manual setting for DPO CR usage */
|
||||
if( (!st25r500CheckReg( ST25R500_REG_REGULATOR, ST25R500_REG_REGULATOR_reg_s, ST25R500_REG_REGULATOR_reg_s )) )
|
||||
{
|
||||
return RFAL_ERR_DISABLED;
|
||||
}
|
||||
|
||||
/* Initialize DPO CR struct */
|
||||
RFAL_MEMSET( &gSt25r500Dpocr, 0x00, sizeof(st25r500Dpocr) );
|
||||
|
||||
if( NULL == config )
|
||||
{
|
||||
gSt25r500Dpocr.config.enabled = false;
|
||||
gSt25r500Dpocr.config.target = 60; /*193mA*/
|
||||
gSt25r500Dpocr.config.maxRege = 96; /*4.5V*/
|
||||
gSt25r500Dpocr.config.minRege = 71; /*3.3V*/
|
||||
gSt25r500Dpocr.config.maxDres = 10; /*4.09*RRFO*/
|
||||
gSt25r500Dpocr.config.minDres = 5; /*1.67*RRFO*/
|
||||
gSt25r500Dpocr.config.currThreshold = 2;
|
||||
gSt25r500Dpocr.config.numEntries = 0;
|
||||
gSt25r500Dpocr.config.tableUpThresholds[0] = 75;
|
||||
gSt25r500Dpocr.config.tableUpThresholds[1] = 85;
|
||||
gSt25r500Dpocr.config.tableUpThresholds[2] = 95;
|
||||
gSt25r500Dpocr.config.tableUpThresholds[3] = 200;
|
||||
}
|
||||
else
|
||||
{
|
||||
gSt25r500Dpocr.config = *config;
|
||||
}
|
||||
|
||||
|
||||
gSt25r500Dpocr.isInit = true;
|
||||
|
||||
/* By default DPO is disabled */
|
||||
st25r500DpocrSetEnabled( false );
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r500DpocrAdjust( void )
|
||||
{
|
||||
uint8_t refValue;
|
||||
uint16_t modeID;
|
||||
rfalBitRate br;
|
||||
rfalMode mode;
|
||||
uint8_t tableEntry;
|
||||
uint16_t target;
|
||||
uint8_t maxRege;
|
||||
uint8_t minRege;
|
||||
uint8_t maxDres;
|
||||
uint8_t minDres;
|
||||
uint8_t reg;
|
||||
uint8_t res;
|
||||
uint16_t currThreshold;
|
||||
bool increasing;
|
||||
uint8_t stage;
|
||||
|
||||
|
||||
/* Initialize local vars */
|
||||
refValue = 0;
|
||||
mode = RFAL_MODE_NONE;
|
||||
br = RFAL_BR_KEEP;
|
||||
target = gSt25r500Dpocr.config.target;
|
||||
maxRege = gSt25r500Dpocr.config.maxRege;
|
||||
minRege = gSt25r500Dpocr.config.minRege;
|
||||
maxDres = gSt25r500Dpocr.config.maxDres;
|
||||
minDres = gSt25r500Dpocr.config.minDres;
|
||||
currThreshold = gSt25r500Dpocr.config.currThreshold;
|
||||
|
||||
|
||||
/* Algoithm has three stages:
|
||||
* 1: Move rege until we are on the other side of target, if within boundaries stop
|
||||
* 2: Move d_res until we are on the other side of target
|
||||
* 3: Move again rege until again on the other side of target
|
||||
*/
|
||||
stage = 0;
|
||||
|
||||
/* Obtain RFAL's current mode and bit rate */
|
||||
mode = rfalGetMode();
|
||||
rfalGetBitRate( &br, NULL );
|
||||
|
||||
/* Check if initialized */
|
||||
if( (!gSt25r500Dpocr.isInit) )
|
||||
{
|
||||
return RFAL_ERR_WRONG_STATE;
|
||||
}
|
||||
|
||||
/* Check if the Power Adjustment is disabled */
|
||||
if( (!gSt25r500Dpocr.config.enabled) )
|
||||
{
|
||||
return RFAL_ERR_PARAM;
|
||||
}
|
||||
|
||||
/* Ensure that the current mode is Passive Poller and table is initialized */ /* TODO: RFAL Analog Config called directly from Low level Driver HAL. To be improved|revisited */
|
||||
if( (!rfalIsModePassivePoll( mode )) )
|
||||
{
|
||||
return RFAL_ERR_WRONG_STATE;
|
||||
}
|
||||
|
||||
/* Check for valid configuration *
|
||||
* Regulator must be set to manual setting for DPO CR usage */
|
||||
if( (!st25r500CheckReg( ST25R500_REG_REGULATOR, ST25R500_REG_REGULATOR_reg_s, ST25R500_REG_REGULATOR_reg_s )) )
|
||||
{
|
||||
return RFAL_ERR_DISABLED;
|
||||
}
|
||||
|
||||
|
||||
if( gSt25r500Dpocr.info.currentRege > maxRege )
|
||||
{
|
||||
gSt25r500Dpocr.info.currentRege = maxRege;
|
||||
st25r500ChangeRegisterBits(ST25R500_REG_REGULATOR, ST25R500_REG_REGULATOR_rege_mask, gSt25r500Dpocr.info.currentRege);
|
||||
}
|
||||
|
||||
if( gSt25r500Dpocr.info.currentRege < minRege )
|
||||
{
|
||||
gSt25r500Dpocr.info.currentRege = minRege;
|
||||
st25r500ChangeRegisterBits(ST25R500_REG_REGULATOR, ST25R500_REG_REGULATOR_rege_mask, gSt25r500Dpocr.info.currentRege);
|
||||
}
|
||||
|
||||
if( gSt25r500Dpocr.info.currentDres > maxDres )
|
||||
{
|
||||
gSt25r500Dpocr.info.currentDres = maxDres;
|
||||
st25r500ChangeRegisterBits(ST25R500_REG_DRIVER, ST25R500_REG_DRIVER_d_res_mask, gSt25r500Dpocr.info.currentDres);
|
||||
}
|
||||
|
||||
if( gSt25r500Dpocr.info.currentDres < minDres )
|
||||
{
|
||||
gSt25r500Dpocr.info.currentDres = minDres;
|
||||
st25r500ChangeRegisterBits(ST25R500_REG_DRIVER, ST25R500_REG_DRIVER_d_res_mask, gSt25r500Dpocr.info.currentDres);
|
||||
}
|
||||
|
||||
st25r500MeasureCurrent( &refValue );
|
||||
|
||||
if( DELTA( (uint16_t)refValue, gSt25r500Dpocr.currBest.curr) > currThreshold )
|
||||
{
|
||||
/* Value changed compared to last call -> move regulator */
|
||||
reg = gSt25r500Dpocr.info.currentRege;
|
||||
res = gSt25r500Dpocr.info.currentDres;
|
||||
gSt25r500Dpocr.currBest.dres = gSt25r500Dpocr.info.currentDres;
|
||||
gSt25r500Dpocr.currBest.rege = gSt25r500Dpocr.info.currentRege;
|
||||
gSt25r500Dpocr.currBest.curr = refValue;
|
||||
|
||||
if( refValue < target )
|
||||
{
|
||||
/* If we are overall trying to increase, give precedence to reducing d_res */
|
||||
stage = 1; /* Skip stage 1, start with minimal regulator */
|
||||
reg = minRege;
|
||||
st25r500ChangeRegisterBits(ST25R500_REG_REGULATOR, ST25R500_REG_REGULATOR_rege_mask, reg); /* Write rege */
|
||||
|
||||
st25r500MeasureCurrent( &refValue );
|
||||
if( DELTA(refValue, target) < DELTA(gSt25r500Dpocr.currBest.curr, target) )
|
||||
{
|
||||
gSt25r500Dpocr.currBest.dres = res;
|
||||
gSt25r500Dpocr.currBest.rege = reg;
|
||||
gSt25r500Dpocr.currBest.curr = refValue;
|
||||
}
|
||||
}
|
||||
|
||||
while( (stage++) < 3U )
|
||||
{
|
||||
increasing = (refValue < target);
|
||||
|
||||
if( (1U == stage) || (3U == stage) )
|
||||
{
|
||||
/* Try with changing regulator */
|
||||
do{
|
||||
if( increasing && (reg < maxRege) )
|
||||
{
|
||||
reg++;
|
||||
}
|
||||
else if( (!increasing) && (reg > minRege) )
|
||||
{
|
||||
reg--;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (reg != maxRege) && (reg != minRege) )
|
||||
{ /* If the fine rege allowed to stay within boundaries: stop here */
|
||||
stage = 3;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
st25r500ChangeRegisterBits(ST25R500_REG_REGULATOR, ST25R500_REG_REGULATOR_rege_mask, reg); /* Write rege */
|
||||
|
||||
st25r500MeasureCurrent( &refValue );
|
||||
if( DELTA(refValue, target) < DELTA(gSt25r500Dpocr.currBest.curr, target) )
|
||||
{
|
||||
gSt25r500Dpocr.currBest.dres = res;
|
||||
gSt25r500Dpocr.currBest.rege = reg;
|
||||
gSt25r500Dpocr.currBest.curr = refValue;
|
||||
}
|
||||
}
|
||||
while( increasing == (refValue < target) );
|
||||
}
|
||||
else if( 2U == stage )
|
||||
{
|
||||
/* Try with changing resistor */
|
||||
do{ /* PRQA S 0771 # MISRA 15.4 - Multiple break used to simplify logic */
|
||||
if( increasing && (res > minDres) )
|
||||
{
|
||||
res--;
|
||||
}
|
||||
else if( (!increasing) && (res < maxDres) )
|
||||
{
|
||||
res++;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
st25r500ChangeRegisterBits(ST25R500_REG_DRIVER, ST25R500_REG_DRIVER_d_res_mask, res); /* Write d_res */
|
||||
|
||||
st25r500MeasureCurrent( &refValue );
|
||||
if( DELTA(refValue, target) < DELTA(gSt25r500Dpocr.currBest.curr, target) )
|
||||
{
|
||||
gSt25r500Dpocr.currBest.dres = res;
|
||||
gSt25r500Dpocr.currBest.rege = reg;
|
||||
gSt25r500Dpocr.currBest.curr = refValue;
|
||||
}
|
||||
if( increasing && (refValue >= target) )
|
||||
{ /* rege should at this step already at minRege, cannot further decrease: increase d_res */
|
||||
res++;
|
||||
st25r500ChangeRegisterBits(ST25R500_REG_DRIVER, ST25R500_REG_DRIVER_d_res_mask, res); /* Write d_res */
|
||||
|
||||
st25r500MeasureCurrent( &refValue );
|
||||
if( DELTA(refValue, target) < DELTA(gSt25r500Dpocr.currBest.curr, target) )
|
||||
{
|
||||
gSt25r500Dpocr.currBest.dres = res;
|
||||
gSt25r500Dpocr.currBest.rege = reg;
|
||||
gSt25r500Dpocr.currBest.curr = refValue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
while( increasing == (refValue < target) );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* MISRA 15.7 - Empty else */
|
||||
}
|
||||
}
|
||||
|
||||
/* Apply the best found point */
|
||||
st25r500ChangeRegisterBits(ST25R500_REG_REGULATOR, ST25R500_REG_REGULATOR_rege_mask, gSt25r500Dpocr.currBest.rege); /* Write rege */
|
||||
st25r500ChangeRegisterBits(ST25R500_REG_DRIVER, ST25R500_REG_DRIVER_d_res_mask, gSt25r500Dpocr.currBest.dres); /* Write d_res */
|
||||
gSt25r500Dpocr.info.currentRege = gSt25r500Dpocr.currBest.rege;
|
||||
gSt25r500Dpocr.info.currentDres = gSt25r500Dpocr.currBest.dres;
|
||||
st25r500MeasureCurrent( &refValue );
|
||||
|
||||
}
|
||||
|
||||
/* Store last measurement */
|
||||
gSt25r500Dpocr.info.currentElecCurrent = refValue;
|
||||
|
||||
if( gSt25r500Dpocr.config.numEntries >= 1U )
|
||||
{
|
||||
for( tableEntry=0; tableEntry < (gSt25r500Dpocr.config.numEntries - 1U); tableEntry++ )
|
||||
{
|
||||
if( gSt25r500Dpocr.currBest.rege <= gSt25r500Dpocr.config.tableUpThresholds[tableEntry] )
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Apply new configs if there was a change on DPO level or RFAL mode|bitrate */
|
||||
if( (mode != gSt25r500Dpocr.curMode) || (br != gSt25r500Dpocr.curBR) || (tableEntry != gSt25r500Dpocr.info.currentEntryIdx) || ((mode == RFAL_MODE_NONE) && (tableEntry != gSt25r500Dpocr.info.currentEntryIdx)) || (gSt25r500Dpocr.forceAdj) )
|
||||
{
|
||||
/* Update local context */
|
||||
gSt25r500Dpocr.curMode = mode;
|
||||
gSt25r500Dpocr.curBR = br;
|
||||
gSt25r500Dpocr.forceAdj = false;
|
||||
gSt25r500Dpocr.info.currentEntryIdx = tableEntry;
|
||||
|
||||
|
||||
/* Apply the DPO Analog Config according to this threshold */
|
||||
/* Technology field is being extended for DPO: 2msb are used for threshold step (only 4 allowed) */
|
||||
modeID = rfalAnalogConfigGenModeID( gSt25r500Dpocr.curMode, gSt25r500Dpocr.curBR, RFAL_ANALOG_CONFIG_DPO ); /* Generate Analog Config mode ID */
|
||||
modeID |= (((uint16_t)gSt25r500Dpocr.info.currentEntryIdx << RFAL_DPO_ANALOGCONFIG_SHIFT) & RFAL_DPO_ANALOGCONFIG_MASK); /* Add DPO threshold step|level */
|
||||
rfalSetAnalogConfig( modeID ); /* Apply DPO Analog Config */
|
||||
|
||||
/* TODO: RFAL Analog Config called directly from Low level Driver HAL. To be improved|revisited */
|
||||
}
|
||||
}
|
||||
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
void st25r500DpocrSetEnabled( bool enable )
|
||||
{
|
||||
if( gSt25r500Dpocr.isInit )
|
||||
{
|
||||
gSt25r500Dpocr.config.enabled = enable;
|
||||
gSt25r500Dpocr.forceAdj = enable;
|
||||
gSt25r500Dpocr.curMode = RFAL_MODE_NONE;
|
||||
gSt25r500Dpocr.curBR = RFAL_BR_KEEP;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
void st25r500DpocrReqAdj( void )
|
||||
{
|
||||
gSt25r500Dpocr.forceAdj = true;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r500DpocrConfigWrite( const st25r500DpocrConfig* config )
|
||||
{
|
||||
uint8_t reg;
|
||||
uint8_t res;
|
||||
|
||||
if( NULL == config )
|
||||
{
|
||||
return RFAL_ERR_PARAM;
|
||||
}
|
||||
|
||||
/* Check if the table size parameter is too big */
|
||||
if( config->numEntries > ST25R500_DPOCR_MAX_ENTRIES )
|
||||
{
|
||||
return RFAL_ERR_PARAM;
|
||||
}
|
||||
|
||||
if( (!gSt25r500Dpocr.isInit) )
|
||||
{
|
||||
return RFAL_ERR_WRONG_STATE;
|
||||
}
|
||||
|
||||
/* TODO: more checks might help */
|
||||
|
||||
/* Copy config passed as parameter */
|
||||
gSt25r500Dpocr.config = *config;
|
||||
|
||||
/* Initialize info structure */
|
||||
RFAL_MEMSET( &gSt25r500Dpocr.info, 0x00, sizeof(st25r500DpocrInfo) );
|
||||
|
||||
/* Initialize currBest structure */
|
||||
RFAL_MEMSET( &gSt25r500Dpocr.currBest, 0x00, sizeof(st25r500DpoPoint) );
|
||||
|
||||
/* Read current values from chip - note that it is ok to read
|
||||
* values outside limits of the config struct. First adjustment will
|
||||
* correct this. */
|
||||
st25r500ReadRegister( ST25R500_REG_REGULATOR, ® );
|
||||
gSt25r500Dpocr.info.currentRege = (reg & ST25R500_REG_REGULATOR_rege_mask); /* Keep only rege */
|
||||
|
||||
st25r500ReadRegister( ST25R500_REG_DRIVER, &res );
|
||||
gSt25r500Dpocr.info.currentDres = (res & ST25R500_REG_DRIVER_d_res_mask);
|
||||
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r500DpocrConfigRead( st25r500DpocrConfig* config )
|
||||
{
|
||||
/* Check for valid parameters */
|
||||
if( config == NULL )
|
||||
{
|
||||
return RFAL_ERR_PARAM;
|
||||
}
|
||||
|
||||
/* Check if initialized */
|
||||
if( (!gSt25r500Dpocr.isInit) )
|
||||
{
|
||||
return RFAL_ERR_WRONG_STATE;
|
||||
}
|
||||
|
||||
*config = gSt25r500Dpocr.config;
|
||||
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
ReturnCode st25r500DpocrGetInfo( st25r500DpocrInfo* info )
|
||||
{
|
||||
/* Check for valid parameters */
|
||||
if( info == NULL )
|
||||
{
|
||||
return RFAL_ERR_PARAM;
|
||||
}
|
||||
|
||||
/* Check if initialized */
|
||||
if( (!gSt25r500Dpocr.isInit) )
|
||||
{
|
||||
return RFAL_ERR_WRONG_STATE;
|
||||
}
|
||||
|
||||
*info = gSt25r500Dpocr.info;
|
||||
|
||||
return RFAL_ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
#endif /* RFAL_FEATURE_DPO_CR */
|
||||
@@ -0,0 +1,188 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file : st25r500_dpocr.h
|
||||
* @brief : Dynamic Power Output adjustment via Current Regulation
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2025 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.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef ST25R500_DPOCR_H
|
||||
#define ST25R500_DPOCR_H
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* INCLUDES
|
||||
******************************************************************************
|
||||
*/
|
||||
#include "rfal_platform.h"
|
||||
#include "rfal_utils.h"
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL DEFINES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#define ST25R500_DPOCR_MAX_ENTRIES 4U /*!< Max number of table entries */
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL TYPES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/*! DPO table entry struct, to have link into AC, similar to rfal_dpo levels */
|
||||
|
||||
typedef struct {
|
||||
bool enabled; /*!< DPO Enabled state */
|
||||
uint16_t target; /*!< Target value - electric current as per I_VDD_DR measurement */
|
||||
uint8_t maxRege; /*!< Max regulator which will be selected */
|
||||
uint8_t minRege; /*!< Min regulator which will be selected */
|
||||
uint8_t maxDres; /*!< Max dres which will be selected */
|
||||
uint8_t minDres; /*!< Min dres which will be selected */
|
||||
uint8_t regeStepSize; /*!< Step size for rege, 1 gives best accuracy */
|
||||
uint16_t currThreshold; /*!< If current value is <(target-curr_threshold) or >(target+curr_treshold) regulation will again happen */
|
||||
uint16_t tableUpThresholds[ST25R500_DPOCR_MAX_ENTRIES]; /*!< Table with rege levels for AC */
|
||||
uint8_t numEntries; /*!< Number of entries to be used in table */
|
||||
}st25r500DpocrConfig;
|
||||
|
||||
|
||||
/*! DPO information struct */
|
||||
typedef struct {
|
||||
uint8_t currentEntryIdx; /*!< Current DPO table Index */
|
||||
uint16_t currentElecCurrent; /*!< Current DPO measured electrical current */
|
||||
uint8_t currentRege; /*!< Current ST25R500 rege setting */
|
||||
uint8_t currentDres; /*!< Current ST25R500 dres setting */
|
||||
} st25r500DpocrInfo;
|
||||
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL FUNCTION PROTOTYPES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Initialize dynamic power table
|
||||
*
|
||||
* Initialize the R500 current regulation DPO
|
||||
*
|
||||
* \param[in] config : pointer to a user provided config or NULL if default one to be used
|
||||
*
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
* \return RFAL_ERR_WRONG_STATE : If the current state is valid for DPO operation
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r500DpocrInitialize( const st25r500DpocrConfig *config );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Dynamic power adjust
|
||||
*
|
||||
* This function measures the current output and adjusts the power accordingly to
|
||||
* the dynamic power table.
|
||||
* This method | The adjustment shall be performed when the device
|
||||
* is already emiting RF field.
|
||||
*
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
* \return RFAL_ERR_PARAM : If configTbl is invalid or parameters are invalid
|
||||
* \return RFAL_ERR_WRONG_STATE : If the current state is valid for DPO Adjustment
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r500DpocrAdjust( void );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Dynamic power set enabled state
|
||||
*
|
||||
* \param[in] enable : new active state
|
||||
*
|
||||
* Set state to enable or disable the Dynamic power adjustment
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
void st25r500DpocrSetEnabled( bool enable );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Write dynamic power config
|
||||
*
|
||||
* Load the dynamic power config
|
||||
*
|
||||
* \param[in] config : location of power Table to be loaded
|
||||
*
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
* \return RFAL_ERR_PARAM : If configTbl is invalid
|
||||
* \return RFAL_ERR_NOMEM : If the given Table is bigger exceeds the max size
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r500DpocrConfigWrite( const st25r500DpocrConfig* config );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Dynamic power table Read
|
||||
*
|
||||
* Read the dynamic power config
|
||||
*
|
||||
* \param[out] config : location to the config to place the current config
|
||||
*
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
* \return RFAL_ERR_PARAM : If configTbl is invalid or parameters are invalid
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r500DpocrConfigRead( st25r500DpocrConfig* config );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Request DPO adjust
|
||||
*
|
||||
* Flags the DPO module to perform the adjustment on the next round, even
|
||||
* if no change has been perceived from previous measurement|state
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
void st25r500DpocrReqAdj( void );
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Get Dynamic power information
|
||||
*
|
||||
* Get the DPO information|status
|
||||
*
|
||||
* \param[out] info : pointer where DPO info is to be stored
|
||||
*
|
||||
* \return RFAL_ERR_NONE : No error
|
||||
* \return RFAL_ERR_PARAM : Invalid parameter
|
||||
*****************************************************************************
|
||||
*/
|
||||
ReturnCode st25r500DpocrGetInfo( st25r500DpocrInfo* info );
|
||||
|
||||
|
||||
#endif /* ST25R500_DPOCR_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
@@ -0,0 +1,247 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file : st25r500_irq.c
|
||||
* @brief : ST25R500 Interrupt handling
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2025 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.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include "st25r500_irq.h"
|
||||
#include "st25r500_com.h"
|
||||
#include "st25r500.h"
|
||||
#include "rfal_utils.h"
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* LOCAL DATA TYPES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/*! Holds current and previous interrupt callback pointer as well as current Interrupt status and mask */
|
||||
typedef struct
|
||||
{
|
||||
void (*prevCallback)(void); /*!< call back function for ST25R500 interrupt */
|
||||
void (*callback)(void); /*!< call back function for ST25R500 interrupt */
|
||||
uint32_t status; /*!< latest interrupt status */
|
||||
uint32_t mask; /*!< Interrupt mask. Negative mask = ST25R500 mask regs */
|
||||
} st25r500Interrupt;
|
||||
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL DEFINES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/*! Length of the interrupt registers */
|
||||
#define ST25R500_INT_REGS_LEN ( (ST25R500_REG_IRQ3 - ST25R500_REG_IRQ1) + 1U )
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL VARIABLES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
static volatile st25r500Interrupt st25r500interrupt; /*!< Instance of ST25R500 interrupt */
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL FUNCTIONS
|
||||
******************************************************************************
|
||||
*/
|
||||
void st25r500InitInterrupts( void )
|
||||
{
|
||||
platformIrqST25RPinInitialize();
|
||||
platformIrqST25RSetCallback( st25r500Isr );
|
||||
|
||||
st25r500interrupt.callback = NULL;
|
||||
st25r500interrupt.prevCallback = NULL;
|
||||
st25r500interrupt.status = ST25R500_IRQ_MASK_NONE;
|
||||
st25r500interrupt.mask = ST25R500_IRQ_MASK_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
void st25r500Isr( void )
|
||||
{
|
||||
st25r500CheckForReceivedInterrupts();
|
||||
|
||||
/* Check if callback is set and run it */
|
||||
if( NULL != st25r500interrupt.callback )
|
||||
{
|
||||
st25r500interrupt.callback();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
void st25r500CheckForReceivedInterrupts( void )
|
||||
{
|
||||
uint8_t iregs[ST25R500_INT_REGS_LEN];
|
||||
uint32_t irqStatus;
|
||||
|
||||
#ifdef ST25R_POLL_IRQ
|
||||
/* Exit immediately in case of no IRQ */
|
||||
if( platformGpioIsLow( ST25R_INT_PORT, ST25R_INT_PIN ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif /* ST25R_POLL_IRQ */
|
||||
|
||||
/* Initialize iregs */
|
||||
irqStatus = ST25R500_IRQ_MASK_NONE;
|
||||
RFAL_MEMSET( iregs, (int32_t)(ST25R500_IRQ_MASK_ALL & 0xFFU), ST25R500_INT_REGS_LEN );
|
||||
|
||||
/* In case the IRQ is Edge (not Level) triggered read IRQs until done */
|
||||
while( platformGpioIsHigh( ST25R_INT_PORT, ST25R_INT_PIN ) )
|
||||
{
|
||||
st25r500ReadMultipleRegisters( ST25R500_REG_IRQ1, iregs, ST25R500_INT_REGS_LEN );
|
||||
|
||||
irqStatus |= (uint32_t)iregs[0];
|
||||
irqStatus |= (uint32_t)iregs[1]<<8;
|
||||
irqStatus |= (uint32_t)iregs[2]<<16;
|
||||
}
|
||||
|
||||
/* Forward all interrupts, even masked ones to application */
|
||||
platformProtectST25RIrqStatus();
|
||||
st25r500interrupt.status |= irqStatus;
|
||||
platformUnprotectST25RIrqStatus();
|
||||
|
||||
/* Send an IRQ event to LED handling */
|
||||
st25r500ledEvtIrq( st25r500interrupt.status );
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
void st25r500ModifyInterrupts(uint32_t clr_mask, uint32_t set_mask)
|
||||
{
|
||||
uint8_t i;
|
||||
uint32_t old_mask;
|
||||
uint32_t new_mask;
|
||||
|
||||
|
||||
old_mask = st25r500interrupt.mask;
|
||||
new_mask = ((~old_mask & set_mask) | (old_mask & clr_mask));
|
||||
st25r500interrupt.mask &= ~clr_mask;
|
||||
st25r500interrupt.mask |= set_mask;
|
||||
|
||||
for(i=0; i<ST25R500_INT_REGS_LEN; i++)
|
||||
{
|
||||
if( ((new_mask >> (8U*i)) & 0xFFU) == 0U )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
st25r500WriteRegister(ST25R500_REG_IRQ_MASK1 + i, (uint8_t)((st25r500interrupt.mask>>(8U*i)) & 0xFFU) );
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
uint32_t st25r500WaitForInterruptsTimed( uint32_t mask, uint16_t tmo )
|
||||
{
|
||||
uint32_t tmrDelay;
|
||||
uint32_t status;
|
||||
|
||||
tmrDelay = platformTimerCreate( tmo );
|
||||
|
||||
/* Run until specific interrupt has happen or the timer has expired */
|
||||
do
|
||||
{
|
||||
#ifdef ST25R_POLL_IRQ
|
||||
st25r500CheckForReceivedInterrupts();
|
||||
#endif /* ST25R_POLL_IRQ */
|
||||
|
||||
status = (st25r500interrupt.status & mask);
|
||||
} while( ( (!platformTimerIsExpired( tmrDelay )) || (tmo == 0U)) && (status == 0U) );
|
||||
|
||||
platformTimerDestroy( tmrDelay );
|
||||
|
||||
status = st25r500interrupt.status & mask;
|
||||
|
||||
platformProtectST25RIrqStatus();
|
||||
st25r500interrupt.status &= ~status;
|
||||
platformUnprotectST25RIrqStatus();
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
uint32_t st25r500GetInterrupt( uint32_t mask )
|
||||
{
|
||||
uint32_t irqs;
|
||||
|
||||
irqs = (st25r500interrupt.status & mask);
|
||||
if(irqs != ST25R500_IRQ_MASK_NONE)
|
||||
{
|
||||
platformProtectST25RIrqStatus();
|
||||
st25r500interrupt.status &= ~irqs;
|
||||
platformUnprotectST25RIrqStatus();
|
||||
}
|
||||
|
||||
return irqs;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
void st25r500ClearAndEnableInterrupts( uint32_t mask )
|
||||
{
|
||||
st25r500GetInterrupt( mask );
|
||||
st25r500EnableInterrupts( mask );
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
void st25r500EnableInterrupts(uint32_t mask)
|
||||
{
|
||||
st25r500ModifyInterrupts(mask, 0);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
void st25r500DisableInterrupts(uint32_t mask)
|
||||
{
|
||||
st25r500ModifyInterrupts(0, mask);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
void st25r500ClearInterrupts( void )
|
||||
{
|
||||
uint8_t iregs[ST25R500_INT_REGS_LEN];
|
||||
|
||||
st25r500ReadMultipleRegisters(ST25R500_REG_IRQ1, iregs, ST25R500_INT_REGS_LEN);
|
||||
|
||||
platformProtectST25RIrqStatus();
|
||||
st25r500interrupt.status = ST25R500_IRQ_MASK_NONE;
|
||||
platformUnprotectST25RIrqStatus();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
void st25r500IRQCallbackSet( void (*cb)(void) )
|
||||
{
|
||||
st25r500interrupt.prevCallback = st25r500interrupt.callback;
|
||||
st25r500interrupt.callback = cb;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************/
|
||||
void st25r500IRQCallbackRestore( void )
|
||||
{
|
||||
st25r500interrupt.callback = st25r500interrupt.prevCallback;
|
||||
st25r500interrupt.prevCallback = NULL;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,221 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file : st25r500_irq.h
|
||||
* @brief : ST25R500 Interrupt handling
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2025 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.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef ST25R500_IRQ_H
|
||||
#define ST25R500_IRQ_H
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* INCLUDES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include "rfal_platform.h"
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL DEFINES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#define ST25R500_IRQ_MASK_ALL (uint32_t)(0xFFFFFFFFUL) /*!< All ST25R500 interrupt sources */
|
||||
#define ST25R500_IRQ_MASK_NONE (uint32_t)(0x00000000UL) /*!< No ST25R500 interrupt source */
|
||||
|
||||
/* Main interrupt register */
|
||||
#define ST25R500_IRQ_MASK_SUBC_START (uint32_t)(0x00000080U) /*!< ST25R500 subcarrier start interrupt */
|
||||
#define ST25R500_IRQ_MASK_COL (uint32_t)(0x00000040U) /*!< ST25R500 bit collision interrupt */
|
||||
#define ST25R500_IRQ_MASK_WL (uint32_t)(0x00000020U) /*!< ST25R500 FIFO water level interrupt */
|
||||
#define ST25R500_IRQ_MASK_RX_REST (uint32_t)(0x00000010U) /*!< ST25R500 automatic reception restart interrupt */
|
||||
#define ST25R500_IRQ_MASK_RXE (uint32_t)(0x00000008U) /*!< ST25R500 end of receive interrupt */
|
||||
#define ST25R500_IRQ_MASK_RXS (uint32_t)(0x00000004U) /*!< ST25R500 start of receive interrupt */
|
||||
#define ST25R500_IRQ_MASK_TXE (uint32_t)(0x00000002U) /*!< ST25R500 end of transmission interrupt */
|
||||
#define ST25R500_IRQ_MASK_RX_ERR (uint32_t)(0x00000001U) /*!< ST25R500 Reception error interrupt */
|
||||
|
||||
/* Timer and Error interrupt register */
|
||||
#define ST25R500_IRQ_MASK_GPE (uint32_t)(0x00008000U) /*!< ST25R500 general purpose timer expired interrupt */
|
||||
#define ST25R500_IRQ_MASK_NRE (uint32_t)(0x00004000U) /*!< ST25R500 no-response timer expired interrupt */
|
||||
#define ST25R500_IRQ_MASK_WPT_STOP (uint32_t)(0x00002000U) /*!< ST25R500 WPT stop received interrupt */
|
||||
#define ST25R500_IRQ_MASK_WPT_FOD (uint32_t)(0x00001000U) /*!< ST25R500 WPT FOD received interrupt */
|
||||
#define ST25R500_IRQ_MASK_RFU (uint32_t)(0x00000800U) /*!< ST25R500 RFU */
|
||||
#define ST25R500_IRQ_MASK_CE_SC (uint32_t)(0x00000400U) /*!< ST25R500 CE state change interrupt */
|
||||
#define ST25R500_IRQ_MASK_RXE_CE (uint32_t)(0x00000200U) /*!< ST25R500 end of reception in CE interrupt */
|
||||
#define ST25R500_IRQ_MASK_NFCT (uint32_t)(0x00000100U) /*!< ST25R500 bit rate was recognized interrupt */
|
||||
|
||||
/* Wake-up interrupt register */
|
||||
#define ST25R500_IRQ_MASK_WUTME (uint32_t)(0x00800000U) /*!< ST25R500 WU Measure event interrupt */
|
||||
#define ST25R500_IRQ_MASK_EOF (uint32_t)(0x00400000U) /*!< ST25R500 External Field Off interrupt */
|
||||
#define ST25R500_IRQ_MASK_EON (uint32_t)(0x00200000U) /*!< ST25R500 External Field On interrupt */
|
||||
#define ST25R500_IRQ_MASK_DCT (uint32_t)(0x00100000U) /*!< ST25R500 termination of direct command interrupt */
|
||||
#define ST25R500_IRQ_MASK_WUQ (uint32_t)(0x00080000U) /*!< ST25R500 wake-up Q-Channel interrupt */
|
||||
#define ST25R500_IRQ_MASK_WUI (uint32_t)(0x00040000U) /*!< ST25R500 wake-up I-Channel interrupt */
|
||||
#define ST25R500_IRQ_MASK_WUT (uint32_t)(0x00020000U) /*!< ST25R500 wake-up timer interrupt */
|
||||
#define ST25R500_IRQ_MASK_OSC (uint32_t)(0x00010000U) /*!< ST25R500 oscillator stable interrupt */
|
||||
|
||||
/*
|
||||
******************************************************************************
|
||||
* GLOBAL FUNCTION PROTOTYPES
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Wait until an ST25R500 interrupt occurs
|
||||
*
|
||||
* This function is used to access the ST25R500 interrupt flags. Use this
|
||||
* to wait for max. \a tmo milliseconds for the \b first interrupt indicated
|
||||
* with mask \a mask to occur.
|
||||
*
|
||||
* \param[in] mask : mask indicating the interrupts to wait for.
|
||||
* \param[in] tmo : time in milliseconds until timeout occurs. If set to 0
|
||||
* the functions waits forever.
|
||||
*
|
||||
* \return : 0 if timeout occured otherwise a mask indicating the cleared
|
||||
* interrupts.
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
uint32_t st25r500WaitForInterruptsTimed( uint32_t mask, uint16_t tmo );
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Get status for the given interrupt
|
||||
*
|
||||
* This function is used to check whether the interrupt given by \a mask
|
||||
* has occured. If yes the interrupt gets cleared. This function returns
|
||||
* only status bits which are inside \a mask.
|
||||
*
|
||||
* \param[in] mask : mask indicating the interrupt to check for.
|
||||
*
|
||||
* \return the mask of the interrupts occurred
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
uint32_t st25r500GetInterrupt( uint32_t mask );
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Init the 200 interrupt
|
||||
*
|
||||
* This function is used to check whether the interrupt given by \a mask
|
||||
* has occured.
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
void st25r500InitInterrupts( void );
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Modifies the Interrupt
|
||||
*
|
||||
* This function modifies the interrupt
|
||||
*
|
||||
* \param[in] clr_mask : bit mask to be cleared on the interrupt mask
|
||||
* \param[in] set_mask : bit mask to be set on the interrupt mask
|
||||
*****************************************************************************
|
||||
*/
|
||||
void st25r500ModifyInterrupts( uint32_t clr_mask, uint32_t set_mask );
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Checks received interrupts
|
||||
*
|
||||
* Checks received interrupts and saves the result into global params
|
||||
*****************************************************************************
|
||||
*/
|
||||
void st25r500CheckForReceivedInterrupts( void );
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief ISR Service routine
|
||||
*
|
||||
* This function modiefies the interupt
|
||||
*****************************************************************************
|
||||
*/
|
||||
void st25r500Isr( void );
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Enable a given ST25R500 Interrupt source
|
||||
*
|
||||
* This function enables all interrupts given by \a mask,
|
||||
* ST25R500_IRQ_MASK_ALL enables all interrupts.
|
||||
*
|
||||
* \param[in] mask: mask indicating the interrupts to be enabled
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
void st25r500EnableInterrupts( uint32_t mask );
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Disable one or more a given ST25R500 Interrupt sources
|
||||
*
|
||||
* This function disables all interrupts given by \a mask. 0xff disables all.
|
||||
*
|
||||
* \param[in] mask: mask indicating the interrupts to be disabled.
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
void st25r500DisableInterrupts( uint32_t mask );
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Clear all ST25R500 irq flags
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
void st25r500ClearInterrupts( void );
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Clears and then enables the given ST25R500 Interrupt sources
|
||||
*
|
||||
* \param[in] mask: mask indicating the interrupts to be cleared and enabled
|
||||
*****************************************************************************
|
||||
*/
|
||||
void st25r500ClearAndEnableInterrupts( uint32_t mask );
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Sets IRQ callback for the ST25R500 interrupt
|
||||
*
|
||||
* \param[in] cb: pointer to the callback method
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
void st25r500IRQCallbackSet( void (*cb)( void ) );
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* \brief Sets IRQ callback for the ST25R500 interrupt
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
void st25r500IRQCallbackRestore( void );
|
||||
|
||||
#endif /* ST25R500_IRQ_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
@@ -0,0 +1,6 @@
|
||||
This software component is provided to you as part of a software package and
|
||||
applicable license terms are in the Package_license file. If you received this
|
||||
software component outside of a package or without applicable license terms,
|
||||
the terms of the BSD-3-Clause license shall apply.
|
||||
You may obtain a copy of the BSD-3-Clause at:
|
||||
https://opensource.org/licenses/BSD-3-Clause
|
||||
@@ -0,0 +1,65 @@
|
||||
<!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 X-CUBE-NFC9 Projects</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]-->
|
||||
<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-x-cube-nfc7-projects">Release Notes for X-CUBE-NFC9 BSP</h1>
|
||||
<p>Copyright © 2022 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>The X-CUBE-NFC9 software package is an expansion for STM32Cube. This software provides drivers running on STM32 for ST25R100 device.</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">V1.0.0 / March 19th 2024</label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<h3 id="maintenance-release">First Release</h3>
|
||||
<table>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th style="text-align: left;">Headline</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td style="text-align: left;">First official release of BSP for X-NUCLEO-NFC09A1</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="sticky">
|
||||
<div class="columns">
|
||||
<div class="column" style="width:95%;">
|
||||
<p>For complete documentation on <strong>X-CUBE-NFC9</strong> , visit: <a href="https://www.st.com/en/embedded-software/x-cube-nfc7.html">www.st.com</a></p>
|
||||
</div><div class="column" style="width:5%;">
|
||||
<p><abbr title="Based on template cx566953 version 2.0">Info</abbr></p>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,144 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file : nfc09a1.c
|
||||
* @author : MMY Application Team
|
||||
* @brief : This file provides NFC09A1 specific functions
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2023 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "nfc09a1.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup NFC09A1
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
/* Private defines -----------------------------------------------------------*/
|
||||
/* Private macros ------------------------------------------------------------*/
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
/** @defgroup NFC09A1_Private_Variables
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** Array including all led pin and port information */
|
||||
static NFC09A1_Led_TypeDef NFC09A1_Led[6] = { { NFC09A1_LED1_PIN, NFC09A1_LED1_PIN_PORT } ,
|
||||
{ NFC09A1_LED2_PIN, NFC09A1_LED2_PIN_PORT } ,
|
||||
{ NFC09A1_LED3_PIN, NFC09A1_LED3_PIN_PORT } ,
|
||||
{ NFC09A1_LED4_PIN, NFC09A1_LED4_PIN_PORT } ,
|
||||
{ NFC09A1_LED5_PIN, NFC09A1_LED5_PIN_PORT } ,
|
||||
{ NFC09A1_LED6_PIN, NFC09A1_LED6_PIN_PORT } };
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
/* External variables --------------------------------------------------------*/
|
||||
/* Functions Definition ------------------------------------------------------*/
|
||||
/** @defgroup NFC09A1_Private_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief This function initialize the GPIO to manage the Leds
|
||||
* through GPIO
|
||||
* @param None
|
||||
* @return None
|
||||
*/
|
||||
void NFC09A1_LED_Init(void)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
uint8_t led;
|
||||
|
||||
/* Enable all GPIO port clock for the Led pins */
|
||||
NFC09A1_ALLLED_GPIO_CLK_ENABLE();
|
||||
|
||||
/* Configure GPIO for all Led pins */
|
||||
for (led = 0; led < (sizeof(NFC09A1_Led) / sizeof(NFC09A1_Led_TypeDef)); led++)
|
||||
{
|
||||
GPIO_InitStruct.Pin = NFC09A1_Led[led].NFC09A1_LED_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(NFC09A1_Led[led].NFC09A1_LED_PIN_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* Configure Led pin Output Level as off */
|
||||
HAL_GPIO_WritePin(NFC09A1_Led[led].NFC09A1_LED_PIN_PORT, NFC09A1_Led[led].NFC09A1_LED_PIN, GPIO_PIN_RESET);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DeInit LEDs.
|
||||
* @note Led DeInit does not disable the GPIO clock nor disable the Mfx
|
||||
* @param[in] Led : LED to be de-init.
|
||||
* @return None
|
||||
*/
|
||||
void NFC09A1_LED_DeInit(const NFC09A1_Led_E led)
|
||||
{
|
||||
GPIO_InitTypeDef gpio_init_structure;
|
||||
|
||||
/* Turn off LED */
|
||||
HAL_GPIO_WritePin(NFC09A1_Led[led].NFC09A1_LED_PIN_PORT, NFC09A1_Led[led].NFC09A1_LED_PIN, GPIO_PIN_RESET);
|
||||
/* DeInit the GPIO_LED pin */
|
||||
gpio_init_structure.Pin = NFC09A1_Led[led].NFC09A1_LED_PIN;
|
||||
HAL_GPIO_DeInit(NFC09A1_Led[led].NFC09A1_LED_PIN_PORT, gpio_init_structure.Pin);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function light on selected Led
|
||||
* @param[in] led : Led to be lit on
|
||||
* @return None
|
||||
*/
|
||||
void NFC09A1_LED_ON(const NFC09A1_Led_E led)
|
||||
{
|
||||
HAL_GPIO_WritePin(NFC09A1_Led[led].NFC09A1_LED_PIN_PORT, NFC09A1_Led[led].NFC09A1_LED_PIN, GPIO_PIN_SET);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function light off selected Led
|
||||
* @param[in] led : Led to be lit off
|
||||
* @return None
|
||||
*/
|
||||
void NFC09A1_LED_OFF(const NFC09A1_Led_E led)
|
||||
{
|
||||
HAL_GPIO_WritePin(NFC09A1_Led[led].NFC09A1_LED_PIN_PORT, NFC09A1_Led[led].NFC09A1_LED_PIN, GPIO_PIN_RESET);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Toggles the selected LED
|
||||
* @param[in] led : Specifies the Led to be toggled
|
||||
* @return None
|
||||
*/
|
||||
void NFC09A1_LED_Toggle(const NFC09A1_Led_E led)
|
||||
{
|
||||
HAL_GPIO_TogglePin(NFC09A1_Led[led].NFC09A1_LED_PIN_PORT, NFC09A1_Led[led].NFC09A1_LED_PIN);
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file : nfc09a1.h
|
||||
* @author : MMY Application Team
|
||||
* @brief : This file contains definitions for the NFC09A1.c
|
||||
* board specific functions.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2023 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef NFC09A1_H
|
||||
#define NFC09A1_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "rfal_platform.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup NFC09A1
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/** @defgroup NFC09A1_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @brief NFC09A1 Led enumerator definition
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
TF_LED = 0, /*!< Led Type F */
|
||||
TB_LED, /*!< Led Type B */
|
||||
TA_LED, /*!< Led Type A */
|
||||
TV_LED, /*!< Led Type V */
|
||||
AP2P_LED, /*!< Led Type P2P */
|
||||
TX_LED /*!< Led Field */
|
||||
}NFC09A1_Led_E;
|
||||
|
||||
/**
|
||||
* @brief NFC09A1 Led structure definition
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint16_t NFC09A1_LED_PIN;
|
||||
GPIO_TypeDef * NFC09A1_LED_PIN_PORT;
|
||||
}NFC09A1_Led_TypeDef;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
/* Exported variables --------------------------------------------------------*/
|
||||
/* Exported functions ------------------------------------------------------- */
|
||||
/** @defgroup NFC09A1_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
void NFC09A1_LED_Init(void);
|
||||
void NFC09A1_LED_DeInit(const NFC09A1_Led_E led);
|
||||
void NFC09A1_LED_ON(const NFC09A1_Led_E led);
|
||||
void NFC09A1_LED_OFF(const NFC09A1_Led_E led);
|
||||
void NFC09A1_LED_Toggle(const NFC09A1_Led_E led);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* NFC09A1_H */
|
||||
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file : nfc09a1_conf_template.h
|
||||
* @author : MMY Application Team
|
||||
* @brief : This file contains definitions for the NFC6 components bus interfaces
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2023 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef NFC09A1_CONF_H_
|
||||
#define NFC09A1_CONF_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32l4xx_hal.h"
|
||||
|
||||
#if 0 /* Code not compiled, reserved for Doxygen */
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup NFC09A1
|
||||
* @{
|
||||
*/
|
||||
#endif /* MISRAC2012 4.4 : Avoid a section of code seems to be commented out */
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
#if 0 /* Code not compiled, reserved for Doxygen */
|
||||
/** @defgroup NFC09A1_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
#endif /* MISRAC2012 4.4 : Avoid a section of code seems to be commented out */
|
||||
|
||||
#define NFC09A1_LED1_PIN_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
#define NFC09A1_LED2_PIN_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
#define NFC09A1_LED3_PIN_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE();
|
||||
#define NFC09A1_LED4_PIN_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE();
|
||||
#define NFC09A1_LED5_PIN_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE();
|
||||
#define NFC09A1_LED6_PIN_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
#define NFC09A1_LED1_PIN_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE();
|
||||
#define NFC09A1_LED2_PIN_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE();
|
||||
#define NFC09A1_LED3_PIN_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE();
|
||||
#define NFC09A1_LED4_PIN_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE();
|
||||
#define NFC09A1_LED5_PIN_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE();
|
||||
#define NFC09A1_LED6_PIN_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE();
|
||||
#define NFC09A1_LED1_PIN GPIO_PIN_1
|
||||
#define NFC09A1_LED1_PIN_PORT GPIOA
|
||||
#define NFC09A1_LED2_PIN GPIO_PIN_4
|
||||
#define NFC09A1_LED2_PIN_PORT GPIOA
|
||||
#define NFC09A1_LED3_PIN GPIO_PIN_0
|
||||
#define NFC09A1_LED3_PIN_PORT GPIOB
|
||||
#define NFC09A1_LED4_PIN GPIO_PIN_1
|
||||
#define NFC09A1_LED4_PIN_PORT GPIOC
|
||||
#define NFC09A1_LED5_PIN GPIO_PIN_0
|
||||
#define NFC09A1_LED5_PIN_PORT GPIOC
|
||||
#define NFC09A1_LED6_PIN GPIO_PIN_8
|
||||
#define NFC09A1_LED6_PIN_PORT GPIOA
|
||||
#if 0 /* Code not compiled, reserved for Doxygen */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#endif /* MISRAC2012 4.4 : Avoid a section of code seems to be commented out */
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
#if 0 /* Code not compiled, reserved for Doxygen */
|
||||
/** @defgroup NFC09A1_Exported_Macro
|
||||
* @{
|
||||
*/
|
||||
#endif /* MISRAC2012 4.4 : Avoid a section of code seems to be commented out */
|
||||
|
||||
#define NFC09A1_ALLLED_GPIO_CLK_ENABLE() do{__HAL_RCC_GPIOA_CLK_ENABLE(); \
|
||||
__HAL_RCC_GPIOB_CLK_ENABLE(); \
|
||||
__HAL_RCC_GPIOC_CLK_ENABLE(); \
|
||||
}while(0)
|
||||
|
||||
#define NFC09A1_ALLLED_GPIO_CLK_DISABLE() do{__HAL_RCC_GPIOA_CLK_DISABLE(); \
|
||||
__HAL_RCC_GPIOB_CLK_DISABLE(); \
|
||||
__HAL_RCC_GPIOC_CLK_DISABLE(); \
|
||||
}while(0)
|
||||
#if 0 /* Code not compiled, reserved for Doxygen */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#endif /* MISRAC2012 4.4 : Avoid a section of code seems to be commented out */
|
||||
/* Exported variables --------------------------------------------------------*/
|
||||
/* Exported functions ------------------------------------------------------- */
|
||||
#if 0 /* Code not compiled, reserved for Doxygen */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#endif /* MISRAC2012 4.4 : Avoid a section of code seems to be commented out */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* NFC09A1_CONF_H_ */
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
This software component is provided to you as part of a software package and
|
||||
applicable license terms are in the Package_license file. If you received this
|
||||
software component outside of a package or without applicable license terms,
|
||||
the terms of the BSD-3-Clause license shall apply.
|
||||
You may obtain a copy of the BSD-3-Clause at:
|
||||
https://opensource.org/licenses/BSD-3-Clause
|
||||
@@ -0,0 +1,65 @@
|
||||
<!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 X-CUBE-NFC9 Projects</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]-->
|
||||
<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-x-cube-nfc7-projects">Release Notes for X-CUBE-NFC9 BSP</h1>
|
||||
<p>Copyright © 2022 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>The X-CUBE-NFC9 software package is an expansion for STM32Cube. This software provides drivers running on STM32 for ST25R100 device.</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">V1.0.0 / March 19th 2024</label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<h3 id="maintenance-release">First Release</h3>
|
||||
<table>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th style="text-align: left;">Headline</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td style="text-align: left;">First official release of BSP for X-NUCLEO-NFC09A1</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="sticky">
|
||||
<div class="columns">
|
||||
<div class="column" style="width:95%;">
|
||||
<p>For complete documentation on <strong>X-CUBE-NFC9</strong> , visit: <a href="https://www.st.com/en/embedded-software/x-cube-nfc7.html">www.st.com</a></p>
|
||||
</div><div class="column" style="width:5%;">
|
||||
<p><abbr title="Based on template cx566953 version 2.0">Info</abbr></p>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,144 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file : nfc10a1.c
|
||||
* @author : MMY Application Team
|
||||
* @brief : This file provides NFC10A1 specific functions
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2023 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "nfc10a1.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup NFC10A1
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
/* Private defines -----------------------------------------------------------*/
|
||||
/* Private macros ------------------------------------------------------------*/
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
/** @defgroup NFC10A1_Private_Variables
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** Array including all led pin and port information */
|
||||
static NFC10A1_Led_TypeDef NFC10A1_Led[6] = { { NFC10A1_LED1_PIN, NFC10A1_LED1_PIN_PORT } ,
|
||||
{ NFC10A1_LED2_PIN, NFC10A1_LED2_PIN_PORT } ,
|
||||
{ NFC10A1_LED3_PIN, NFC10A1_LED3_PIN_PORT } ,
|
||||
{ NFC10A1_LED4_PIN, NFC10A1_LED4_PIN_PORT } ,
|
||||
{ NFC10A1_LED5_PIN, NFC10A1_LED5_PIN_PORT } ,
|
||||
{ NFC10A1_LED6_PIN, NFC10A1_LED6_PIN_PORT } };
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
/* External variables --------------------------------------------------------*/
|
||||
/* Functions Definition ------------------------------------------------------*/
|
||||
/** @defgroup NFC10A1_Private_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief This function initialize the GPIO to manage the Leds
|
||||
* through GPIO
|
||||
* @param None
|
||||
* @return None
|
||||
*/
|
||||
void NFC10A1_LED_Init(void)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
uint8_t led;
|
||||
|
||||
/* Enable all GPIO port clock for the Led pins */
|
||||
NFC10A1_ALLLED_GPIO_CLK_ENABLE();
|
||||
|
||||
/* Configure GPIO for all Led pins */
|
||||
for (led = 0; led < (sizeof(NFC10A1_Led) / sizeof(NFC10A1_Led_TypeDef)); led++)
|
||||
{
|
||||
GPIO_InitStruct.Pin = NFC10A1_Led[led].NFC10A1_LED_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(NFC10A1_Led[led].NFC10A1_LED_PIN_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* Configure Led pin Output Level as off */
|
||||
HAL_GPIO_WritePin(NFC10A1_Led[led].NFC10A1_LED_PIN_PORT, NFC10A1_Led[led].NFC10A1_LED_PIN, GPIO_PIN_RESET);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DeInit LEDs.
|
||||
* @note Led DeInit does not disable the GPIO clock nor disable the Mfx
|
||||
* @param[in] Led : LED to be de-init.
|
||||
* @return None
|
||||
*/
|
||||
void NFC10A1_LED_DeInit(const NFC10A1_Led_E led)
|
||||
{
|
||||
GPIO_InitTypeDef gpio_init_structure;
|
||||
|
||||
/* Turn off LED */
|
||||
HAL_GPIO_WritePin(NFC10A1_Led[led].NFC10A1_LED_PIN_PORT, NFC10A1_Led[led].NFC10A1_LED_PIN, GPIO_PIN_RESET);
|
||||
/* DeInit the GPIO_LED pin */
|
||||
gpio_init_structure.Pin = NFC10A1_Led[led].NFC10A1_LED_PIN;
|
||||
HAL_GPIO_DeInit(NFC10A1_Led[led].NFC10A1_LED_PIN_PORT, gpio_init_structure.Pin);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function light on selected Led
|
||||
* @param[in] led : Led to be lit on
|
||||
* @return None
|
||||
*/
|
||||
void NFC10A1_LED_ON(const NFC10A1_Led_E led)
|
||||
{
|
||||
HAL_GPIO_WritePin(NFC10A1_Led[led].NFC10A1_LED_PIN_PORT, NFC10A1_Led[led].NFC10A1_LED_PIN, GPIO_PIN_SET);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function light off selected Led
|
||||
* @param[in] led : Led to be lit off
|
||||
* @return None
|
||||
*/
|
||||
void NFC10A1_LED_OFF(const NFC10A1_Led_E led)
|
||||
{
|
||||
HAL_GPIO_WritePin(NFC10A1_Led[led].NFC10A1_LED_PIN_PORT, NFC10A1_Led[led].NFC10A1_LED_PIN, GPIO_PIN_RESET);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Toggles the selected LED
|
||||
* @param[in] led : Specifies the Led to be toggled
|
||||
* @return None
|
||||
*/
|
||||
void NFC10A1_LED_Toggle(const NFC10A1_Led_E led)
|
||||
{
|
||||
HAL_GPIO_TogglePin(NFC10A1_Led[led].NFC10A1_LED_PIN_PORT, NFC10A1_Led[led].NFC10A1_LED_PIN);
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file : nfc10a1.h
|
||||
* @author : MMY Application Team
|
||||
* @brief : This file contains definitions for the NFC10A1.c
|
||||
* board specific functions.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2023 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef NFC10A1_H
|
||||
#define NFC10A1_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "rfal_platform.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup NFC10A1
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/** @defgroup NFC10A1_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @brief NFC10A1 Led enumerator definition
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
TF_LED = 0, /*!< Led Type F */
|
||||
TB_LED, /*!< Led Type B */
|
||||
TA_LED, /*!< Led Type A */
|
||||
TV_LED, /*!< Led Type V */
|
||||
AP2P_LED, /*!< Led Type P2P */
|
||||
TX_LED /*!< Led Field */
|
||||
}NFC10A1_Led_E;
|
||||
|
||||
/**
|
||||
* @brief NFC10A1 Led structure definition
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint16_t NFC10A1_LED_PIN;
|
||||
GPIO_TypeDef * NFC10A1_LED_PIN_PORT;
|
||||
}NFC10A1_Led_TypeDef;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
/* Exported variables --------------------------------------------------------*/
|
||||
/* Exported functions ------------------------------------------------------- */
|
||||
/** @defgroup NFC10A1_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
void NFC10A1_LED_Init(void);
|
||||
void NFC10A1_LED_DeInit(const NFC10A1_Led_E led);
|
||||
void NFC10A1_LED_ON(const NFC10A1_Led_E led);
|
||||
void NFC10A1_LED_OFF(const NFC10A1_Led_E led);
|
||||
void NFC10A1_LED_Toggle(const NFC10A1_Led_E led);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* NFC10A1_H */
|
||||
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file : nfc10a1_conf_template.h
|
||||
* @author : MMY Application Team
|
||||
* @brief : This file contains definitions for the NFC6 components bus interfaces
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2023 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef NFC10A1_CONF_H_
|
||||
#define NFC10A1_CONF_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32l4xx_hal.h"
|
||||
|
||||
#if 0 /* Code not compiled, reserved for Doxygen */
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup NFC10A1
|
||||
* @{
|
||||
*/
|
||||
#endif /* MISRAC2012 4.4 : Avoid a section of code seems to be commented out */
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
#if 0 /* Code not compiled, reserved for Doxygen */
|
||||
/** @defgroup NFC10A1_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
#endif /* MISRAC2012 4.4 : Avoid a section of code seems to be commented out */
|
||||
|
||||
#define NFC10A1_LED1_PIN_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
#define NFC10A1_LED2_PIN_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
#define NFC10A1_LED3_PIN_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE();
|
||||
#define NFC10A1_LED4_PIN_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE();
|
||||
#define NFC10A1_LED5_PIN_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE();
|
||||
#define NFC10A1_LED6_PIN_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
#define NFC10A1_LED1_PIN_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE();
|
||||
#define NFC10A1_LED2_PIN_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE();
|
||||
#define NFC10A1_LED3_PIN_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE();
|
||||
#define NFC10A1_LED4_PIN_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE();
|
||||
#define NFC10A1_LED5_PIN_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE();
|
||||
#define NFC10A1_LED6_PIN_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE();
|
||||
#define NFC10A1_LED1_PIN GPIO_PIN_1
|
||||
#define NFC10A1_LED1_PIN_PORT GPIOA
|
||||
#define NFC10A1_LED2_PIN GPIO_PIN_4
|
||||
#define NFC10A1_LED2_PIN_PORT GPIOA
|
||||
#define NFC10A1_LED3_PIN GPIO_PIN_0
|
||||
#define NFC10A1_LED3_PIN_PORT GPIOB
|
||||
#define NFC10A1_LED4_PIN GPIO_PIN_1
|
||||
#define NFC10A1_LED4_PIN_PORT GPIOC
|
||||
#define NFC10A1_LED5_PIN GPIO_PIN_0
|
||||
#define NFC10A1_LED5_PIN_PORT GPIOC
|
||||
#define NFC10A1_LED6_PIN GPIO_PIN_8
|
||||
#define NFC10A1_LED6_PIN_PORT GPIOA
|
||||
#if 0 /* Code not compiled, reserved for Doxygen */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#endif /* MISRAC2012 4.4 : Avoid a section of code seems to be commented out */
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
#if 0 /* Code not compiled, reserved for Doxygen */
|
||||
/** @defgroup NFC10A1_Exported_Macro
|
||||
* @{
|
||||
*/
|
||||
#endif /* MISRAC2012 4.4 : Avoid a section of code seems to be commented out */
|
||||
|
||||
#define NFC10A1_ALLLED_GPIO_CLK_ENABLE() do{__HAL_RCC_GPIOA_CLK_ENABLE(); \
|
||||
__HAL_RCC_GPIOB_CLK_ENABLE(); \
|
||||
__HAL_RCC_GPIOC_CLK_ENABLE(); \
|
||||
}while(0)
|
||||
|
||||
#define NFC10A1_ALLLED_GPIO_CLK_DISABLE() do{__HAL_RCC_GPIOA_CLK_DISABLE(); \
|
||||
__HAL_RCC_GPIOB_CLK_DISABLE(); \
|
||||
__HAL_RCC_GPIOC_CLK_DISABLE(); \
|
||||
}while(0)
|
||||
#if 0 /* Code not compiled, reserved for Doxygen */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#endif /* MISRAC2012 4.4 : Avoid a section of code seems to be commented out */
|
||||
/* Exported variables --------------------------------------------------------*/
|
||||
/* Exported functions ------------------------------------------------------- */
|
||||
#if 0 /* Code not compiled, reserved for Doxygen */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#endif /* MISRAC2012 4.4 : Avoid a section of code seems to be commented out */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* NFC10A1_CONF_H_ */
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
This software component is provided to you as part of a software package and
|
||||
applicable license terms are in the Package_license file. If you received this
|
||||
software component outside of a package or without applicable license terms,
|
||||
the terms of the BSD-3-Clause license shall apply.
|
||||
You may obtain a copy of the BSD-3-Clause at:
|
||||
https://opensource.org/licenses/BSD-3-Clause
|
||||
@@ -0,0 +1,65 @@
|
||||
<!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 X-CUBE-NFC12 Projects</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]-->
|
||||
<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-x-cube-nfc12-projects">Release Notes for X-CUBE-NFC12 BSP</h1>
|
||||
<p>Copyright © 2022 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>The X-CUBE-NFC12 software package is an expansion for STM32Cube. This software provides drivers running on STM32 for ST25R300 device.</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">V1.0.0 / 5 Mar 2025</label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<h3 id="maintenance-release">First Release</h3>
|
||||
<table>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th style="text-align: left;">Headline</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td style="text-align: left;">First official release of BSP for X-NUCLEO-NFC12A1</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="sticky">
|
||||
<div class="columns">
|
||||
<div class="column" style="width:95%;">
|
||||
<p>For complete documentation on <strong>X-CUBE-NFC12</strong> , visit: <a href="https://www.st.com/en/embedded-software/x-cube-nfc12.html">www.st.com</a></p>
|
||||
</div><div class="column" style="width:5%;">
|
||||
<p><abbr title="Based on template cx566953 version 2.0">Info</abbr></p>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,144 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file : nfc12a1.c
|
||||
* @author : MMY Application Team
|
||||
* @brief : This file provides nfc12a1 specific functions
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2023 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "nfc12a1.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup NFC12A1
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
/* Private defines -----------------------------------------------------------*/
|
||||
/* Private macros ------------------------------------------------------------*/
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
/** @defgroup NFC12A1_Private_Variables
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** Array including all led pin and port information */
|
||||
static NFC12A1_Led_TypeDef NFC12A1_Led[6] = { { NFC12A1_LED1_PIN, NFC12A1_LED1_PIN_PORT } ,
|
||||
{ NFC12A1_LED2_PIN, NFC12A1_LED2_PIN_PORT } ,
|
||||
{ NFC12A1_LED3_PIN, NFC12A1_LED3_PIN_PORT } ,
|
||||
{ NFC12A1_LED4_PIN, NFC12A1_LED4_PIN_PORT } ,
|
||||
{ NFC12A1_LED5_PIN, NFC12A1_LED5_PIN_PORT } ,
|
||||
{ NFC12A1_LED6_PIN, NFC12A1_LED6_PIN_PORT } };
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
/* External variables --------------------------------------------------------*/
|
||||
/* Functions Definition ------------------------------------------------------*/
|
||||
/** @defgroup NFC12A1_Private_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief This function initialize the GPIO to manage the Leds
|
||||
* through GPIO
|
||||
* @param None
|
||||
* @return None
|
||||
*/
|
||||
void NFC12A1_LED_Init(void)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
uint8_t led;
|
||||
|
||||
/* Enable all GPIO port clock for the Led pins */
|
||||
NFC12A1_ALLLED_GPIO_CLK_ENABLE();
|
||||
|
||||
/* Configure GPIO for all Led pins */
|
||||
for (led = 0; led < (sizeof(NFC12A1_Led) / sizeof(NFC12A1_Led_TypeDef)); led++)
|
||||
{
|
||||
GPIO_InitStruct.Pin = NFC12A1_Led[led].NFC12A1_LED_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(NFC12A1_Led[led].NFC12A1_LED_PIN_PORT, &GPIO_InitStruct);
|
||||
|
||||
/* Configure Led pin Output Level as off */
|
||||
HAL_GPIO_WritePin(NFC12A1_Led[led].NFC12A1_LED_PIN_PORT, NFC12A1_Led[led].NFC12A1_LED_PIN, GPIO_PIN_RESET);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DeInit LEDs.
|
||||
* @note Led DeInit does not disable the GPIO clock nor disable the Mfx
|
||||
* @param[in] Led : LED to be de-init.
|
||||
* @return None
|
||||
*/
|
||||
void NFC12A1_LED_DeInit(const NFC12A1_Led_E led)
|
||||
{
|
||||
GPIO_InitTypeDef gpio_init_structure;
|
||||
|
||||
/* Turn off LED */
|
||||
HAL_GPIO_WritePin(NFC12A1_Led[led].NFC12A1_LED_PIN_PORT, NFC12A1_Led[led].NFC12A1_LED_PIN, GPIO_PIN_RESET);
|
||||
/* DeInit the GPIO_LED pin */
|
||||
gpio_init_structure.Pin = NFC12A1_Led[led].NFC12A1_LED_PIN;
|
||||
HAL_GPIO_DeInit(NFC12A1_Led[led].NFC12A1_LED_PIN_PORT, gpio_init_structure.Pin);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function light on selected Led
|
||||
* @param[in] led : Led to be lit on
|
||||
* @return None
|
||||
*/
|
||||
void NFC12A1_LED_ON(const NFC12A1_Led_E led)
|
||||
{
|
||||
HAL_GPIO_WritePin(NFC12A1_Led[led].NFC12A1_LED_PIN_PORT, NFC12A1_Led[led].NFC12A1_LED_PIN, GPIO_PIN_SET);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function light off selected Led
|
||||
* @param[in] led : Led to be lit off
|
||||
* @return None
|
||||
*/
|
||||
void NFC12A1_LED_OFF(const NFC12A1_Led_E led)
|
||||
{
|
||||
HAL_GPIO_WritePin(NFC12A1_Led[led].NFC12A1_LED_PIN_PORT, NFC12A1_Led[led].NFC12A1_LED_PIN, GPIO_PIN_RESET);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Toggles the selected LED
|
||||
* @param[in] led : Specifies the Led to be toggled
|
||||
* @return None
|
||||
*/
|
||||
void NFC12A1_LED_Toggle(const NFC12A1_Led_E led)
|
||||
{
|
||||
HAL_GPIO_TogglePin(NFC12A1_Led[led].NFC12A1_LED_PIN_PORT, NFC12A1_Led[led].NFC12A1_LED_PIN);
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file : nfc12a1.h
|
||||
* @author : MMY Application Team
|
||||
* @brief : This file contains definitions for the nfc12a1.c
|
||||
* board specific functions.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2023 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef NFC12A1_H
|
||||
#define NFC12A1_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#if (defined (USE_STM32L4XX_NUCLEO))
|
||||
#include "stm32l4xx_nucleo.h"
|
||||
#elif (defined (USE_STM32F4XX_NUCLEO))
|
||||
#include "stm32f4xx_nucleo.h"
|
||||
#elif (defined (USE_STM32L0XX_NUCLEO))
|
||||
#include "stm32l0xx_nucleo.h"
|
||||
#endif
|
||||
#include "nfc_conf.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup NFC12A1
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/** @defgroup NFC12A1_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @brief NFC12A1 Led enumerator definition
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
TF_LED = 0, /*!< Led Type F */
|
||||
TB_LED, /*!< Led Type B */
|
||||
TA_LED, /*!< Led Type A */
|
||||
TV_LED, /*!< Led Type V */
|
||||
AP2P_LED, /*!< Led Type P2P */
|
||||
TX_LED /*!< Led Field */
|
||||
}NFC12A1_Led_E;
|
||||
|
||||
/**
|
||||
* @brief NFC12A1 Led structure definition
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint16_t NFC12A1_LED_PIN;
|
||||
GPIO_TypeDef * NFC12A1_LED_PIN_PORT;
|
||||
}NFC12A1_Led_TypeDef;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
/* Exported variables --------------------------------------------------------*/
|
||||
/* Exported functions ------------------------------------------------------- */
|
||||
/** @defgroup NFC12A1_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
void NFC12A1_LED_Init(void);
|
||||
void NFC12A1_LED_DeInit(const NFC12A1_Led_E led);
|
||||
void NFC12A1_LED_ON(const NFC12A1_Led_E led);
|
||||
void NFC12A1_LED_OFF(const NFC12A1_Led_E led);
|
||||
void NFC12A1_LED_Toggle(const NFC12A1_Led_E led);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* NFC12A1_H */
|
||||
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file : nfc12a1_conf_template.h
|
||||
* @author : MMY Application Team
|
||||
* @brief : This file contains definitions for the NFC12 components bus interfaces
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2023 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef NFC12A1_CONF_H_
|
||||
#define NFC12A1_CONF_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32l4xx_hal.h"
|
||||
|
||||
#if 0 /* Code not compiled, reserved for Doxygen */
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup NFC12A1
|
||||
* @{
|
||||
*/
|
||||
#endif /* MISRAC2012 4.4 : Avoid a section of code seems to be commented out */
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
#if 0 /* Code not compiled, reserved for Doxygen */
|
||||
/** @defgroup NFC12A1_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
#endif /* MISRAC2012 4.4 : Avoid a section of code seems to be commented out */
|
||||
|
||||
#define NFC12A1_LED1_PIN_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
#define NFC12A1_LED2_PIN_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
#define NFC12A1_LED3_PIN_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE();
|
||||
#define NFC12A1_LED4_PIN_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE();
|
||||
#define NFC12A1_LED5_PIN_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE();
|
||||
#define NFC12A1_LED6_PIN_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
#define NFC12A1_LED1_PIN_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE();
|
||||
#define NFC12A1_LED2_PIN_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE();
|
||||
#define NFC12A1_LED3_PIN_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE();
|
||||
#define NFC12A1_LED4_PIN_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE();
|
||||
#define NFC12A1_LED5_PIN_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE();
|
||||
#define NFC12A1_LED6_PIN_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE();
|
||||
#define NFC12A1_LED1_PIN GPIO_PIN_1
|
||||
#define NFC12A1_LED1_PIN_PORT GPIOA
|
||||
#define NFC12A1_LED2_PIN GPIO_PIN_4
|
||||
#define NFC12A1_LED2_PIN_PORT GPIOA
|
||||
#define NFC12A1_LED3_PIN GPIO_PIN_0
|
||||
#define NFC12A1_LED3_PIN_PORT GPIOB
|
||||
#define NFC12A1_LED4_PIN GPIO_PIN_1
|
||||
#define NFC12A1_LED4_PIN_PORT GPIOC
|
||||
#define NFC12A1_LED5_PIN GPIO_PIN_0
|
||||
#define NFC12A1_LED5_PIN_PORT GPIOC
|
||||
#define NFC12A1_LED6_PIN GPIO_PIN_8
|
||||
#define NFC12A1_LED6_PIN_PORT GPIOA
|
||||
#if 0 /* Code not compiled, reserved for Doxygen */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#endif /* MISRAC2012 4.4 : Avoid a section of code seems to be commented out */
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
#if 0 /* Code not compiled, reserved for Doxygen */
|
||||
/** @defgroup NFC12A1_Exported_Macro
|
||||
* @{
|
||||
*/
|
||||
#endif /* MISRAC2012 4.4 : Avoid a section of code seems to be commented out */
|
||||
|
||||
#define NFC12A1_ALLLED_GPIO_CLK_ENABLE() do{__HAL_RCC_GPIOA_CLK_ENABLE(); \
|
||||
__HAL_RCC_GPIOB_CLK_ENABLE(); \
|
||||
__HAL_RCC_GPIOC_CLK_ENABLE(); \
|
||||
}while(0)
|
||||
|
||||
#define NFC12A1_ALLLED_GPIO_CLK_DISABLE() do{__HAL_RCC_GPIOA_CLK_DISABLE(); \
|
||||
__HAL_RCC_GPIOB_CLK_DISABLE(); \
|
||||
__HAL_RCC_GPIOC_CLK_DISABLE(); \
|
||||
}while(0)
|
||||
#if 0 /* Code not compiled, reserved for Doxygen */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#endif /* MISRAC2012 4.4 : Avoid a section of code seems to be commented out */
|
||||
/* Exported variables --------------------------------------------------------*/
|
||||
/* Exported functions ------------------------------------------------------- */
|
||||
#if 0 /* Code not compiled, reserved for Doxygen */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#endif /* MISRAC2012 4.4 : Avoid a section of code seems to be commented out */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* NFC12A1_CONF_H_ */
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
Copyright 2021 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,6 @@
|
||||
This software component is provided to you as part of a software package and
|
||||
applicable license terms are in the Package_license file. If you received this
|
||||
software component outside of a package or without applicable license terms,
|
||||
the terms of the BSD-3-Clause license shall apply.
|
||||
You may obtain a copy of the BSD-3-Clause at:
|
||||
https://opensource.org/licenses/BSD-3-Clause
|
||||
@@ -0,0 +1,103 @@
|
||||
<!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 STM32U5xx_Nucleo BSP Drivers</title>
|
||||
<style type="text/css">
|
||||
code{white-space: pre-wrap;}
|
||||
span.smallcaps{font-variant: small-caps;}
|
||||
span.underline{text-decoration: underline;}
|
||||
div.column{display: inline-block; vertical-align: top; width: 50%;}
|
||||
</style>
|
||||
<link rel="stylesheet" href="_htmresc/mini-st_2020.css" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
<link rel="icon" type="image/x-icon" href="_htmresc/favicon.png" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-lg-4">
|
||||
<center>
|
||||
<h1 id="release-notes-for-stm32u5xx_nucleo-bsp-drivers">Release Notes for <mark>STM32U5xx_Nucleo BSP Drivers</mark></h1>
|
||||
<p>Copyright © 2021 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>The BSP (Board Specific Package) drivers are parts of the STM32Cube package based on the HAL drivers and provide a set of high level APIs relative to the hardware components and features in the evaluation boards, discovery kits and nucleo boards coming with the STM32Cube package for a given STM32 series.</p>
|
||||
<p>The BSP drivers allow a quick access to the boards’ services using high level APIs and without any specific configuration as the link with the HAL and the external components is done in intrinsic within the drivers.</p>
|
||||
<p>From project settings points of view, user has only to add the necessary driver’s files in the workspace and call the needed functions from examples. However some low level configuration functions are weak and can be overridden by the applications if user wants to change some BSP drivers default behavior.</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-section7" checked aria-hidden="true"> <label for="collapse-section7" aria-hidden="true"><strong>V1.2.3 / 04-June-2025</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Include stdio Library for all toolchains when USE_BSP_COM_FEATURE is set.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section6" aria-hidden="true"> <label for="collapse-section6" aria-hidden="true"><strong>V1.2.2 / 05-June-2024</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-1">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Fix printf() implementation to be compliant with IAR 9.x</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section5" aria-hidden="true"> <label for="collapse-section5" aria-hidden="true"><strong>V1.2.1 / 20-October-2023</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-2">Main Changes</h2>
|
||||
<ul>
|
||||
<li>STM32U5xx_Nucleo_BSP_User_Manual.chm Updated</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section4" aria-hidden="true"> <label for="collapse-section4" aria-hidden="true"><strong>V1.2.0 / 08-February-2023</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-3">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Add NUCLEO-U545RE-Q support</li>
|
||||
<li>MCUAstyle formatting</li>
|
||||
<li>STM32U5xx_Nucleo_BSP_User_Manual.chm Updated</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section3" aria-hidden="true"> <label for="collapse-section3" aria-hidden="true"><strong>V1.1.0 / 16-February-2022</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-4">Main Changes</h2>
|
||||
<ul>
|
||||
<li>STM32U5xx_Nucleo_BSP_User_Manual.chm Updated</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section2" aria-hidden="true"> <label for="collapse-section2" aria-hidden="true"><strong>V1.0.1 / 01-October-2021</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-5">Main Changes</h2>
|
||||
<p>Fix MISRA-Rule-10.4 violation in stm32u5xx_nucleo.c</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section1" aria-hidden="true"> <label for="collapse-section1" aria-hidden="true"><strong>V1.0.0 / 20-June-2021</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-6">Main Changes</h2>
|
||||
<p>First official release of <strong>STM32U5xx_Nucleo</strong> BSP drivers in line with STM32Cube BSP drivers development guidelines (UM2298)</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="sticky">
|
||||
For complete documentation on <mark>STM32 Microcontrollers</mark> , visit: <span style="font-color: blue;"><a href="http://www.st.com/STM32">www.st.com</a></span>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,123 @@
|
||||
---
|
||||
pagetitle: Release Notes for STM32U5xx_Nucleo BSP Drivers
|
||||
lang: en
|
||||
header-includes: <link rel="icon" type="image/x-icon" href="_htmresc/favicon.png" />
|
||||
---
|
||||
::: {.row}
|
||||
::: {.col-sm-12 .col-lg-4}
|
||||
|
||||
<center>
|
||||
# Release Notes for <mark>STM32U5xx_Nucleo BSP Drivers</mark>
|
||||
Copyright © 2021 STMicroelectronics\
|
||||
|
||||
[](https://www.st.com){.logo}
|
||||
</center>
|
||||
|
||||
# Purpose
|
||||
|
||||
The BSP (Board Specific Package) drivers are parts of the STM32Cube package based on the HAL drivers and provide a set of high level APIs relative to the hardware components and features in the evaluation boards, discovery kits and nucleo boards coming with the STM32Cube package for a given STM32 series.
|
||||
|
||||
The BSP drivers allow a quick access to the boards’ services using high level APIs and without any specific configuration as the link with the HAL and the external components is done in intrinsic within the drivers.
|
||||
|
||||
From project settings points of view, user has only to add the necessary driver’s files in the workspace and call the needed functions from examples. However some low level configuration functions are weak and can be overridden by the applications if user wants to change some BSP drivers default behavior.
|
||||
|
||||
:::
|
||||
|
||||
::: {.col-sm-12 .col-lg-8}
|
||||
# Update History
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section7" checked aria-hidden="true">
|
||||
<label for="collapse-section7" aria-hidden="true">__V1.2.3 / 04-June-2025__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- Include stdio Library for all toolchains when USE_BSP_COM_FEATURE is set.
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section6" aria-hidden="true">
|
||||
<label for="collapse-section6" aria-hidden="true">__V1.2.2 / 05-June-2024__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- Fix printf() implementation to be compliant with IAR 9.x
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section5" aria-hidden="true">
|
||||
<label for="collapse-section5" aria-hidden="true">__V1.2.1 / 20-October-2023__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- STM32U5xx_Nucleo_BSP_User_Manual.chm Updated
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section4" aria-hidden="true">
|
||||
<label for="collapse-section4" aria-hidden="true">__V1.2.0 / 08-February-2023__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- Add NUCLEO-U545RE-Q support
|
||||
- MCUAstyle formatting
|
||||
- STM32U5xx_Nucleo_BSP_User_Manual.chm Updated
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section3" aria-hidden="true">
|
||||
<label for="collapse-section3" aria-hidden="true">__V1.1.0 / 16-February-2022__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- STM32U5xx_Nucleo_BSP_User_Manual.chm Updated
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section2" aria-hidden="true">
|
||||
<label for="collapse-section2" aria-hidden="true">__V1.0.1 / 01-October-2021__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
Fix MISRA-Rule-10.4 violation in stm32u5xx_nucleo.c
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section1" aria-hidden="true">
|
||||
<label for="collapse-section1" aria-hidden="true">__V1.0.0 / 20-June-2021__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
First official release of __STM32U5xx_Nucleo__ BSP 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>
|
||||
@@ -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: 832 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,27 @@
|
||||
{
|
||||
"name": "BSP nucleo",
|
||||
"configList": [
|
||||
{
|
||||
"file": "stm32u5xx_nucleo.h",
|
||||
"commit": true,
|
||||
"replacements": [
|
||||
{
|
||||
"search":"VERSION_MAIN\\s+\\(0x[a-fA-F\\d]+U?\\)",
|
||||
"replace":"'VERSION_MAIN (0x' + '{:02X}'.format(major) + 'U)'"
|
||||
},
|
||||
{
|
||||
"search":"VERSION_SUB1\\s+\\(0x[a-fA-F\\d]+U?\\)",
|
||||
"replace":"'VERSION_SUB1 (0x' + '{:02X}'.format(minor) + 'U)'"
|
||||
},
|
||||
{
|
||||
"search":"VERSION_SUB2\\s+\\(0x[a-fA-F\\d]+U?\\)",
|
||||
"replace":"'VERSION_SUB2 (0x' + '{:02X}'.format(patch) + 'U)'"
|
||||
},
|
||||
{
|
||||
"search":"VERSION_RC\\s+\\(0x[a-fA-F\\d]+U?\\)",
|
||||
"replace":"'VERSION_RC (0x' + '{:02X}'.format(rc) + 'U)'"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,795 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32u5xx_nucleo.c
|
||||
* @author MCD Application Team
|
||||
* @brief This file provides set of firmware functions to manage:
|
||||
* - LEDs and push-button available on STM32U5xx-Nucleo Kit
|
||||
* from STMicroelectronics
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2021 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 "stm32u5xx_nucleo.h"
|
||||
#if defined(__ICCARM__)
|
||||
#include <LowLevelIOInterface.h>
|
||||
#endif /* __ICCARM__ */
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32U5XX_NUCLEO
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32U5XX_NUCLEO_LOW_LEVEL LOW LEVEL
|
||||
* @brief This file provides set of firmware functions to manage Leds and push-button
|
||||
* available on STM32U5xx-Nucleo Kit from STMicroelectronics.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup STM32U5XX_NUCLEO_LOW_LEVEL_Private_Defines LOW LEVEL Private Defines
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32U5XX_NUCLEO_LOW_LEVEL_Private_TypesDefinitions LOW LEVEL Private Types Definitions
|
||||
* @{
|
||||
*/
|
||||
typedef void (* BSP_EXTI_LineCallback)(void);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32U5XX_NUCLEO_LOW_LEVEL_Exported_Variables LOW LEVEL Exported Variables
|
||||
* @{
|
||||
*/
|
||||
EXTI_HandleTypeDef hpb_exti[BUTTONn];
|
||||
#if (USE_BSP_COM_FEATURE > 0)
|
||||
UART_HandleTypeDef hcom_uart[COMn];
|
||||
USART_TypeDef *COM_USART[COMn] = {COM1_UART};
|
||||
#endif /* USE_BSP_COM_FEATURE */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/** @defgroup STM32U5XX_NUCLEO_LOW_LEVEL_Private_Variables LOW LEVEL Private Variables
|
||||
* @{
|
||||
*/
|
||||
static GPIO_TypeDef *LED_PORT[LEDn] =
|
||||
{
|
||||
#if defined (USE_NUCLEO_144)
|
||||
LED1_GPIO_PORT,
|
||||
#endif /* defined (USE_NUCLEO_144) */
|
||||
LED2_GPIO_PORT,
|
||||
#if defined (USE_NUCLEO_144)
|
||||
LED3_GPIO_PORT
|
||||
#endif /* defined (USE_NUCLEO_144) */
|
||||
};
|
||||
|
||||
static const uint16_t LED_PIN[LEDn] =
|
||||
{
|
||||
#if defined (USE_NUCLEO_144)
|
||||
LED1_PIN,
|
||||
#endif /* defined (USE_NUCLEO_144) */
|
||||
LED2_PIN,
|
||||
#if defined (USE_NUCLEO_144)
|
||||
LED3_PIN
|
||||
#endif /* defined (USE_NUCLEO_144) */
|
||||
};
|
||||
|
||||
static GPIO_TypeDef *BUTTON_PORT[BUTTONn] = {BUTTON_USER_GPIO_PORT};
|
||||
static const uint16_t BUTTON_PIN[BUTTONn] = {BUTTON_USER_PIN};
|
||||
static const IRQn_Type BUTTON_IRQn[BUTTONn] = {BUTTON_USER_EXTI_IRQn};
|
||||
|
||||
#if (USE_BSP_COM_FEATURE > 0)
|
||||
#if (USE_COM_LOG > 0)
|
||||
static COM_TypeDef COM_ActiveLogPort = COM1;
|
||||
#endif /* USE_COM_LOG */
|
||||
#if (USE_HAL_UART_REGISTER_CALLBACKS == 1)
|
||||
static uint32_t IsComMspCbValid[COMn] = {0};
|
||||
#endif /* (USE_HAL_UART_REGISTER_CALLBACKS == 1) */
|
||||
#endif /* USE_BSP_COM_FEATURE) */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32U5XX_NUCLEO_LOW_LEVEL_Private_FunctionPrototypes LOW LEVEL Private Functions Prototypes
|
||||
* @{
|
||||
*/
|
||||
static void BUTTON_USER_EXTI_Callback(void);
|
||||
#if (USE_BSP_COM_FEATURE > 0)
|
||||
static void COM1_MspInit(UART_HandleTypeDef *huart);
|
||||
static void COM1_MspDeInit(UART_HandleTypeDef *huart);
|
||||
#endif /* USE_BSP_COM_FEATURE */
|
||||
|
||||
#if defined(__ICCARM__)
|
||||
/* New definition from EWARM V9, compatible with EWARM8 */
|
||||
int iar_fputc(int ch);
|
||||
#define PUTCHAR_PROTOTYPE int iar_fputc(int ch)
|
||||
#elif defined ( __CC_ARM ) || defined(__ARMCC_VERSION)
|
||||
/* ARM Compiler 5/6*/
|
||||
#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
|
||||
#elif defined(__GNUC__)
|
||||
#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
|
||||
#endif /* __ICCARM__ */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32U5XX_NUCLEO_LOW_LEVEL_Exported_Functions LOW LEVEL Exported Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief This method returns the STM32U5XX NUCLEO BSP Driver revision
|
||||
* @retval version: 0xXYZR (8bits for each decimal, R for RC)
|
||||
*/
|
||||
int32_t BSP_GetVersion(void)
|
||||
{
|
||||
return (int32_t)STM32U5XX_NUCLEO_BSP_VERSION;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This method returns the board name
|
||||
* @retval pointer to the board name string
|
||||
*/
|
||||
const uint8_t *BSP_GetBoardName(void)
|
||||
{
|
||||
return (uint8_t *)STM32U5XX_NUCLEO_BSP_BOARD_NAME;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This method returns the board ID
|
||||
* @retval pointer to the board name string
|
||||
*/
|
||||
const uint8_t *BSP_GetBoardID(void)
|
||||
{
|
||||
return (uint8_t *)STM32U5XX_NUCLEO_BSP_BOARD_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configures LED GPIO.
|
||||
* @param Led Specifies the Led to be configured.
|
||||
* This parameter can be one of following parameters:
|
||||
* @arg LED1
|
||||
* @arg LED2
|
||||
* @arg LED3
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_LED_Init(Led_TypeDef Led)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
GPIO_InitTypeDef gpio_init_structure;
|
||||
#if defined (USE_NUCLEO_144)
|
||||
uint32_t pwrenabled = 0U;
|
||||
#endif /* USE_NUCLEO_144 */
|
||||
|
||||
if ((Led != LED2)
|
||||
#if defined (USE_NUCLEO_144)
|
||||
&& (Led != LED1) && (Led != LED3)
|
||||
#endif /* defined (USE_NUCLEO_144) */
|
||||
)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Enable the GPIO LED Clock */
|
||||
if (Led == LED2)
|
||||
{
|
||||
LED2_GPIO_CLK_ENABLE();
|
||||
}
|
||||
#if defined (USE_NUCLEO_144)
|
||||
else if (Led == LED1)
|
||||
{
|
||||
LED1_GPIO_CLK_ENABLE();
|
||||
}
|
||||
else /* Led == Led3 */
|
||||
{
|
||||
/* Enable VddIO2 for Led3 */
|
||||
if (__HAL_RCC_PWR_IS_CLK_DISABLED())
|
||||
{
|
||||
__HAL_RCC_PWR_CLK_ENABLE();
|
||||
pwrenabled = 1U;
|
||||
}
|
||||
|
||||
HAL_PWREx_EnableVddIO2();
|
||||
|
||||
if (pwrenabled == 1U)
|
||||
{
|
||||
__HAL_RCC_PWR_CLK_DISABLE();
|
||||
}
|
||||
|
||||
LED3_GPIO_CLK_ENABLE();
|
||||
}
|
||||
#endif /* defined (USE_NUCLEO_144) */
|
||||
/* Configure the GPIO_LED pin */
|
||||
gpio_init_structure.Pin = LED_PIN[Led];
|
||||
gpio_init_structure.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
gpio_init_structure.Pull = GPIO_NOPULL;
|
||||
gpio_init_structure.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
|
||||
HAL_GPIO_Init(LED_PORT[Led], &gpio_init_structure);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DeInit LEDs.
|
||||
* @param Led LED to be de-init.
|
||||
* This parameter can be one of the following values:
|
||||
* @arg LED1
|
||||
* @arg LED2
|
||||
* @arg LED3
|
||||
* @note Led DeInit does not disable the GPIO clock nor disable the Mfx
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_LED_DeInit(Led_TypeDef Led)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
GPIO_InitTypeDef gpio_init_structure;
|
||||
|
||||
if ((Led != LED2)
|
||||
#if defined (USE_NUCLEO_144)
|
||||
&& (Led != LED1) && (Led != LED3)
|
||||
#endif /* defined (USE_NUCLEO_144) */
|
||||
)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Turn off LED */
|
||||
HAL_GPIO_WritePin(LED_PORT[Led], LED_PIN[Led], GPIO_PIN_RESET);
|
||||
/* DeInit the GPIO_LED pin */
|
||||
gpio_init_structure.Pin = LED_PIN[Led];
|
||||
HAL_GPIO_DeInit(LED_PORT[Led], gpio_init_structure.Pin);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Turns selected LED On.
|
||||
* @param Led Specifies the Led to be set on.
|
||||
* This parameter can be one of following parameters:
|
||||
* @arg LED1
|
||||
* @arg LED2
|
||||
* @arg LED3
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_LED_On(Led_TypeDef Led)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
|
||||
if ((Led != LED2)
|
||||
#if defined (USE_NUCLEO_144)
|
||||
&& (Led != LED1) && (Led != LED3)
|
||||
#endif /* defined (USE_NUCLEO_144) */
|
||||
)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
HAL_GPIO_WritePin(LED_PORT[Led], LED_PIN[Led], GPIO_PIN_SET);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Turns selected LED Off.
|
||||
* @param Led: Specifies the Led to be set off.
|
||||
* This parameter can be one of following parameters:
|
||||
* @arg LED1
|
||||
* @arg LED2
|
||||
* @arg LED3
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_LED_Off(Led_TypeDef Led)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
|
||||
if ((Led != LED2)
|
||||
#if defined (USE_NUCLEO_144)
|
||||
&& (Led != LED1) && (Led != LED3)
|
||||
#endif /* defined (USE_NUCLEO_144) */
|
||||
)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
HAL_GPIO_WritePin(LED_PORT[Led], LED_PIN[Led], GPIO_PIN_RESET);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Toggles the selected LED.
|
||||
* @param Led Specifies the Led to be toggled.
|
||||
* This parameter can be one of following parameters:
|
||||
* @arg LED1
|
||||
* @arg LED2
|
||||
* @arg LED3
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_LED_Toggle(Led_TypeDef Led)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
|
||||
if ((Led != LED2)
|
||||
#if defined (USE_NUCLEO_144)
|
||||
&& (Led != LED1) && (Led != LED3)
|
||||
#endif /* defined (USE_NUCLEO_144) */
|
||||
)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
HAL_GPIO_TogglePin(LED_PORT[Led], LED_PIN[Led]);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the state of the selected LED.
|
||||
* @param Led LED to get its state
|
||||
* This parameter can be one of following parameters:
|
||||
* @arg LED1
|
||||
* @arg LED2
|
||||
* @arg LED3
|
||||
* @retval LED status
|
||||
*/
|
||||
int32_t BSP_LED_GetState(Led_TypeDef Led)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
if ((Led != LED2)
|
||||
#if defined (USE_NUCLEO_144)
|
||||
&& (Led != LED1) && (Led != LED3)
|
||||
#endif /* defined (USE_NUCLEO_144) */
|
||||
)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = (int32_t)HAL_GPIO_ReadPin(LED_PORT [Led], LED_PIN [Led]);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configures button GPIO and EXTI Line.
|
||||
* @param Button Button to be configured
|
||||
* This parameter can be one of the following values:
|
||||
* @arg BUTTON_USER: Wakeup Push Button
|
||||
* @param ButtonMode Button mode
|
||||
* This parameter can be one of the following values:
|
||||
* @arg BUTTON_MODE_GPIO: Button will be used as simple IO
|
||||
* @arg BUTTON_MODE_EXTI: Button will be connected to EXTI line
|
||||
* with interrupt generation capability
|
||||
*/
|
||||
int32_t BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef ButtonMode)
|
||||
{
|
||||
GPIO_InitTypeDef gpio_init_structure;
|
||||
static BSP_EXTI_LineCallback ButtonCallback[BUTTONn] = {BUTTON_USER_EXTI_Callback};
|
||||
static uint32_t BSP_BUTTON_PRIO [BUTTONn] = {BSP_BUTTON_USER_IT_PRIORITY};
|
||||
static const uint32_t BUTTON_EXTI_LINE[BUTTONn] = {BUTTON_USER_EXTI_LINE};
|
||||
|
||||
/* Enable the BUTTON clock */
|
||||
BUTTON_USER_GPIO_CLK_ENABLE();
|
||||
|
||||
gpio_init_structure.Pin = BUTTON_PIN [Button];
|
||||
gpio_init_structure.Pull = GPIO_PULLDOWN;
|
||||
gpio_init_structure.Speed = GPIO_SPEED_FREQ_HIGH;
|
||||
|
||||
if (ButtonMode == BUTTON_MODE_GPIO)
|
||||
{
|
||||
/* Configure Button pin as input */
|
||||
gpio_init_structure.Mode = GPIO_MODE_INPUT;
|
||||
HAL_GPIO_Init(BUTTON_PORT [Button], &gpio_init_structure);
|
||||
}
|
||||
else /* (ButtonMode == BUTTON_MODE_EXTI) */
|
||||
{
|
||||
/* Configure Button pin as input with External interrupt */
|
||||
gpio_init_structure.Mode = GPIO_MODE_IT_RISING;
|
||||
|
||||
HAL_GPIO_Init(BUTTON_PORT[Button], &gpio_init_structure);
|
||||
|
||||
(void)HAL_EXTI_GetHandle(&hpb_exti[Button], BUTTON_EXTI_LINE[Button]);
|
||||
(void)HAL_EXTI_RegisterCallback(&hpb_exti[Button], HAL_EXTI_COMMON_CB_ID, ButtonCallback[Button]);
|
||||
|
||||
/* Enable and set Button EXTI Interrupt to the lowest priority */
|
||||
HAL_NVIC_SetPriority((BUTTON_IRQn[Button]), BSP_BUTTON_PRIO[Button], 0x00);
|
||||
HAL_NVIC_EnableIRQ((BUTTON_IRQn[Button]));
|
||||
}
|
||||
|
||||
return BSP_ERROR_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Push Button DeInit.
|
||||
* @param Button Button to be configured
|
||||
* This parameter can be one of the following values:
|
||||
* @arg BUTTON_USER: Wakeup Push Button
|
||||
* @note PB DeInit does not disable the GPIO clock
|
||||
*/
|
||||
int32_t BSP_PB_DeInit(Button_TypeDef Button)
|
||||
{
|
||||
GPIO_InitTypeDef gpio_init_structure;
|
||||
|
||||
gpio_init_structure.Pin = BUTTON_PIN[Button];
|
||||
HAL_NVIC_DisableIRQ((IRQn_Type)(BUTTON_IRQn[Button]));
|
||||
HAL_GPIO_DeInit(BUTTON_PORT[Button], gpio_init_structure.Pin);
|
||||
|
||||
return BSP_ERROR_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns the selected button state.
|
||||
* @param Button Button to be checked
|
||||
* This parameter can be one of the following values:
|
||||
* @arg BUTTON_USER: Wakeup Push Button
|
||||
* @retval The Button GPIO pin value (GPIO_PIN_RESET = button pressed)
|
||||
*/
|
||||
int32_t BSP_PB_GetState(Button_TypeDef Button)
|
||||
{
|
||||
return (int32_t)HAL_GPIO_ReadPin(BUTTON_PORT[Button], BUTTON_PIN[Button]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief BSP Button IRQ handler
|
||||
* @param Button Can only be BUTTON_USER
|
||||
* @retval None
|
||||
*/
|
||||
void BSP_PB_IRQHandler(Button_TypeDef Button)
|
||||
{
|
||||
HAL_EXTI_IRQHandler(&hpb_exti[Button]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief BSP Push Button callback
|
||||
* @param Button Specifies the pin connected EXTI line
|
||||
* @retval None
|
||||
*/
|
||||
__weak void BSP_PB_Callback(Button_TypeDef Button)
|
||||
{
|
||||
/* Prevent unused argument(s) compilation warning */
|
||||
UNUSED(Button);
|
||||
|
||||
/* This function should be implemented by the user application.
|
||||
It is called into this driver when an event on Button is triggered. */
|
||||
}
|
||||
|
||||
#if (USE_BSP_COM_FEATURE > 0)
|
||||
/**
|
||||
* @brief Configures COM port.
|
||||
* @param COM COM port to be configured.
|
||||
* This parameter can be COM1
|
||||
* @param COM_Init Pointer to a UART_HandleTypeDef structure that contains the
|
||||
* configuration information for the specified USART peripheral.
|
||||
* @retval BSP error code
|
||||
*/
|
||||
int32_t BSP_COM_Init(COM_TypeDef COM, COM_InitTypeDef *COM_Init)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
|
||||
if (COM >= COMn)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
#if (USE_HAL_UART_REGISTER_CALLBACKS == 0)
|
||||
/* Init the UART Msp */
|
||||
COM1_MspInit(&hcom_uart[COM]);
|
||||
#else
|
||||
if (IsComMspCbValid[COM] == 0U)
|
||||
{
|
||||
if (BSP_COM_RegisterDefaultMspCallbacks(COM) != BSP_ERROR_NONE)
|
||||
{
|
||||
return BSP_ERROR_MSP_FAILURE;
|
||||
}
|
||||
}
|
||||
#endif /* (USE_HAL_UART_REGISTER_CALLBACKS == 0) */
|
||||
|
||||
if (MX_USART1_Init(&hcom_uart[COM], COM_Init) != HAL_OK)
|
||||
{
|
||||
ret = BSP_ERROR_PERIPH_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DeInit COM port.
|
||||
* @param COM COM port to be configured.
|
||||
* This parameter can be COM1
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_COM_DeInit(COM_TypeDef COM)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
|
||||
if (COM >= COMn)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* USART configuration */
|
||||
hcom_uart[COM].Instance = COM_USART[COM];
|
||||
|
||||
#if (USE_HAL_UART_REGISTER_CALLBACKS == 0)
|
||||
COM1_MspDeInit(&hcom_uart[COM]);
|
||||
#endif /* (USE_HAL_UART_REGISTER_CALLBACKS == 0) */
|
||||
|
||||
if (HAL_UART_DeInit(&hcom_uart[COM]) != HAL_OK)
|
||||
{
|
||||
ret = BSP_ERROR_PERIPH_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configures COM port.
|
||||
* @param huart USART handle
|
||||
* @param COM_Init Pointer to a UART_HandleTypeDef structure that contains the
|
||||
* configuration information for the specified USART peripheral.
|
||||
* @retval HAL error code
|
||||
*/
|
||||
__weak HAL_StatusTypeDef MX_USART1_Init(UART_HandleTypeDef *huart, MX_UART_InitTypeDef *COM_Init)
|
||||
{
|
||||
/* USART configuration */
|
||||
huart->Instance = COM_USART[COM1];
|
||||
huart->Init.BaudRate = COM_Init->BaudRate;
|
||||
huart->Init.Mode = UART_MODE_TX_RX;
|
||||
huart->Init.Parity = (uint32_t)COM_Init->Parity;
|
||||
huart->Init.WordLength = (uint32_t)COM_Init->WordLength;
|
||||
huart->Init.StopBits = (uint32_t)COM_Init->StopBits;
|
||||
huart->Init.HwFlowCtl = (uint32_t)COM_Init->HwFlowCtl;
|
||||
huart->Init.OverSampling = UART_OVERSAMPLING_8;
|
||||
huart->Init.ClockPrescaler = UART_PRESCALER_DIV1;
|
||||
return HAL_UART_Init(huart);
|
||||
}
|
||||
|
||||
#if (USE_HAL_UART_REGISTER_CALLBACKS == 1)
|
||||
/**
|
||||
* @brief Register Default COM Msp Callbacks
|
||||
* @param COM COM port to be configured.
|
||||
* This parameter can be COM1
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_COM_RegisterDefaultMspCallbacks(COM_TypeDef COM)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
|
||||
if (COM >= COMn)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
__HAL_UART_RESET_HANDLE_STATE(&hcom_uart[COM]);
|
||||
|
||||
/* Register default MspInit/MspDeInit Callback */
|
||||
if (HAL_UART_RegisterCallback(&hcom_uart[COM], HAL_UART_MSPINIT_CB_ID, COM1_MspInit) != HAL_OK)
|
||||
{
|
||||
ret = BSP_ERROR_PERIPH_FAILURE;
|
||||
}
|
||||
else if (HAL_UART_RegisterCallback(&hcom_uart[COM], HAL_UART_MSPDEINIT_CB_ID, COM1_MspDeInit) != HAL_OK)
|
||||
{
|
||||
ret = BSP_ERROR_PERIPH_FAILURE;
|
||||
}
|
||||
else
|
||||
{
|
||||
IsComMspCbValid[COM] = 1U;
|
||||
}
|
||||
}
|
||||
|
||||
/* BSP status */
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Register COM Msp Callback registering
|
||||
* @param COM COM port to be configured.
|
||||
* This parameter can be COM1
|
||||
* @param Callbacks pointer to COM1 MspInit/MspDeInit callback functions
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_COM_RegisterMspCallbacks(COM_TypeDef COM, BSP_COM_Cb_t *Callback)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
|
||||
if (COM >= COMn)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
__HAL_UART_RESET_HANDLE_STATE(&hcom_uart[COM]);
|
||||
|
||||
/* Register MspInit/MspDeInit Callbacks */
|
||||
if (HAL_UART_RegisterCallback(&hcom_uart[COM], HAL_UART_MSPINIT_CB_ID, Callback->pMspInitCb) != HAL_OK)
|
||||
{
|
||||
ret = BSP_ERROR_PERIPH_FAILURE;
|
||||
}
|
||||
else if (HAL_UART_RegisterCallback(&hcom_uart[COM], HAL_UART_MSPDEINIT_CB_ID, Callback->pMspDeInitCb) != HAL_OK)
|
||||
{
|
||||
ret = BSP_ERROR_PERIPH_FAILURE;
|
||||
}
|
||||
else
|
||||
{
|
||||
IsComMspCbValid[COM] = 1U;
|
||||
}
|
||||
}
|
||||
/* BSP status */
|
||||
return ret;
|
||||
}
|
||||
#endif /* USE_HAL_UART_REGISTER_CALLBACKS */
|
||||
|
||||
#if (USE_COM_LOG > 0)
|
||||
/**
|
||||
* @brief Select the active COM port.
|
||||
* @param COM COM port to be activated.
|
||||
* This parameter can be COM1
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_COM_SelectLogPort(COM_TypeDef COM)
|
||||
{
|
||||
if (COM_ActiveLogPort != COM)
|
||||
{
|
||||
COM_ActiveLogPort = COM;
|
||||
}
|
||||
return BSP_ERROR_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Retargets the C library __write function to the IAR function iar_fputc.
|
||||
* @param file: file descriptor.
|
||||
* @param ptr: pointer to the buffer where the data is stored.
|
||||
* @param len: length of the data to write in bytes.
|
||||
* @retval length of the written data in bytes.
|
||||
*/
|
||||
#if defined(__ICCARM__)
|
||||
size_t __write(int file, unsigned char const *ptr, size_t len)
|
||||
{
|
||||
size_t idx;
|
||||
unsigned char const *pdata = ptr;
|
||||
|
||||
for (idx = 0; idx < len; idx++)
|
||||
{
|
||||
iar_fputc((int)*pdata);
|
||||
pdata++;
|
||||
}
|
||||
return len;
|
||||
}
|
||||
#endif /* __ICCARM__ */
|
||||
|
||||
/**
|
||||
* @brief Redirect console output to COM
|
||||
*/
|
||||
PUTCHAR_PROTOTYPE
|
||||
{
|
||||
HAL_UART_Transmit(&hcom_uart [COM_ActiveLogPort], (uint8_t *) &ch, 1, COM_POLL_TIMEOUT);
|
||||
return ch;
|
||||
}
|
||||
#endif /* USE_COM_LOG */
|
||||
#endif /* USE_BSP_COM_FEATURE */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32U5XX_NUCLEO_LOW_LEVEL_Private_Functions LOW LEVEL Private functions
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @brief Key EXTI line detection callbacks.
|
||||
* @retval BSP status
|
||||
*/
|
||||
static void BUTTON_USER_EXTI_Callback(void)
|
||||
{
|
||||
BSP_PB_Callback(BUTTON_USER);
|
||||
}
|
||||
|
||||
#if (USE_BSP_COM_FEATURE > 0)
|
||||
/**
|
||||
* @brief Initializes UART MSP.
|
||||
* @param huart UART handle
|
||||
* @retval BSP status
|
||||
*/
|
||||
static void COM1_MspInit(UART_HandleTypeDef *huart)
|
||||
{
|
||||
GPIO_InitTypeDef gpio_init_structure;
|
||||
|
||||
/* Prevent unused argument(s) compilation warning */
|
||||
UNUSED(huart);
|
||||
|
||||
/* Enable GPIO clock */
|
||||
COM1_TX_GPIO_CLK_ENABLE();
|
||||
COM1_RX_GPIO_CLK_ENABLE();
|
||||
|
||||
/* Enable USART clock */
|
||||
COM1_CLK_ENABLE();
|
||||
|
||||
/* Configure USART Tx as alternate function */
|
||||
gpio_init_structure.Pin = COM1_TX_PIN;
|
||||
gpio_init_structure.Mode = GPIO_MODE_AF_PP;
|
||||
gpio_init_structure.Speed = GPIO_SPEED_FREQ_HIGH;
|
||||
gpio_init_structure.Pull = GPIO_PULLUP;
|
||||
gpio_init_structure.Alternate = COM1_TX_AF;
|
||||
HAL_GPIO_Init(COM1_TX_GPIO_PORT, &gpio_init_structure);
|
||||
|
||||
/* Configure USART Rx as alternate function */
|
||||
gpio_init_structure.Pin = COM1_RX_PIN;
|
||||
gpio_init_structure.Mode = GPIO_MODE_AF_PP;
|
||||
gpio_init_structure.Alternate = COM1_RX_AF;
|
||||
HAL_GPIO_Init(COM1_RX_GPIO_PORT, &gpio_init_structure);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Initialize USART3 Msp part
|
||||
* @param huart UART handle
|
||||
* @retval BSP status
|
||||
*/
|
||||
static void COM1_MspDeInit(UART_HandleTypeDef *huart)
|
||||
{
|
||||
GPIO_InitTypeDef gpio_init_structure;
|
||||
|
||||
/* Prevent unused argument(s) compilation warning */
|
||||
UNUSED(huart);
|
||||
|
||||
/* COM GPIO pin configuration */
|
||||
gpio_init_structure.Pin = COM1_TX_PIN;
|
||||
HAL_GPIO_DeInit(COM1_TX_GPIO_PORT, gpio_init_structure.Pin);
|
||||
|
||||
gpio_init_structure.Pin = COM1_RX_PIN;
|
||||
HAL_GPIO_DeInit(COM1_RX_GPIO_PORT, gpio_init_structure.Pin);
|
||||
|
||||
/* Disable USART clock */
|
||||
COM1_CLK_DISABLE();
|
||||
}
|
||||
#endif /* USE_BSP_COM_FEATURE */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
@@ -0,0 +1,323 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32u5xx_nucleo.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains definitions for:
|
||||
* - LEDs and push-button available on STM32U5xx-Nucleo Kit
|
||||
* from STMicroelectronics
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2021 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 STM32U5XX_NUCLEO_H
|
||||
#define STM32U5XX_NUCLEO_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32u5xx_nucleo_conf.h"
|
||||
#include "stm32u5xx_nucleo_errno.h"
|
||||
|
||||
#if (USE_BSP_COM_FEATURE == 1)
|
||||
#include "stdio.h"
|
||||
#endif /* USE_BSP_COM_FEATURE */
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup STM32U5XX_NUCLEO STM32U5XX_NUCLEO
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup STM32U5XX_NUCLEO_LOW_LEVEL LOW LEVEL
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Define for STM32U5XX_NUCLEO board
|
||||
*/
|
||||
#if !defined (USE_STM32U5XX_NUCLEO)
|
||||
#define USE_STM32U5XX_NUCLEO
|
||||
#endif /* !defined (USE_STM32U5XX_NUCLEO) */
|
||||
|
||||
#if !defined (USE_NUCLEO_144) && !defined (USE_NUCLEO_64)
|
||||
#error "Board Pin number not defined!! Add USE_NUCLEO_144 or USE_NUCLEO_64 define within stm32u5xx_nucleo_conf.h file"
|
||||
#endif /* !defined (USE_NUCLEO_144) && !defined (USE_NUCLEO_64) */
|
||||
|
||||
/** @defgroup STM32U5XX_NUCLEO_LOW_LEVEL_Exported_Types LOW LEVEL Exported Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
typedef enum
|
||||
{
|
||||
#if defined (USE_NUCLEO_144)
|
||||
LED1 = 0,
|
||||
LED_GREEN = LED1,
|
||||
LED2 = 1,
|
||||
LED_BLUE = LED2,
|
||||
LED3 = 2,
|
||||
LED_RED = LED3,
|
||||
#else
|
||||
LED2 = 0,
|
||||
LED_GREEN = LED2,
|
||||
#endif /* defined (USE_NUCLEO_144) */
|
||||
LEDn
|
||||
} Led_TypeDef;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
BUTTON_USER = 0U,
|
||||
BUTTONn
|
||||
} Button_TypeDef;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
BUTTON_MODE_GPIO = 0,
|
||||
BUTTON_MODE_EXTI = 1
|
||||
} ButtonMode_TypeDef;
|
||||
|
||||
#if (USE_BSP_COM_FEATURE > 0)
|
||||
typedef enum
|
||||
{
|
||||
COM1 = 0U,
|
||||
COMn
|
||||
} COM_TypeDef;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
COM_STOPBITS_1 = UART_STOPBITS_1,
|
||||
COM_STOPBITS_2 = UART_STOPBITS_2,
|
||||
} COM_StopBitsTypeDef;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
COM_PARITY_NONE = UART_PARITY_NONE,
|
||||
COM_PARITY_EVEN = UART_PARITY_EVEN,
|
||||
COM_PARITY_ODD = UART_PARITY_ODD,
|
||||
} COM_ParityTypeDef;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
COM_HWCONTROL_NONE = UART_HWCONTROL_NONE,
|
||||
COM_HWCONTROL_RTS = UART_HWCONTROL_RTS,
|
||||
COM_HWCONTROL_CTS = UART_HWCONTROL_CTS,
|
||||
COM_HWCONTROL_RTS_CTS = UART_HWCONTROL_RTS_CTS,
|
||||
} COM_HwFlowCtlTypeDef;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
COM_WORDLENGTH_7B = UART_WORDLENGTH_7B,
|
||||
COM_WORDLENGTH_8B = UART_WORDLENGTH_8B,
|
||||
COM_WORDLENGTH_9B = UART_WORDLENGTH_9B,
|
||||
} COM_WordLengthTypeDef;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t BaudRate;
|
||||
COM_WordLengthTypeDef WordLength;
|
||||
COM_StopBitsTypeDef StopBits;
|
||||
COM_ParityTypeDef Parity;
|
||||
COM_HwFlowCtlTypeDef HwFlowCtl;
|
||||
} COM_InitTypeDef;
|
||||
|
||||
#if (USE_HAL_UART_REGISTER_CALLBACKS == 1)
|
||||
typedef struct
|
||||
{
|
||||
void (* pMspInitCb)(UART_HandleTypeDef *);
|
||||
void (* pMspDeInitCb)(UART_HandleTypeDef *);
|
||||
} BSP_COM_Cb_t;
|
||||
#endif /* (USE_HAL_UART_REGISTER_CALLBACKS == 1) */
|
||||
|
||||
#define MX_UART_InitTypeDef COM_InitTypeDef
|
||||
|
||||
#endif /* USE_BSP_COM_FEATURE */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32U5XX_NUCLEO_LOW_LEVEL_Exported_Constants LOW LEVEL Exported Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief STM32U5XX NUCLEO BSP Driver version number V1.2.3
|
||||
*/
|
||||
#define STM32U5XX_NUCLEO_BSP_VERSION_MAIN (0x01U) /*!< [31:24] main version */
|
||||
#define STM32U5XX_NUCLEO_BSP_VERSION_SUB1 (0x02U) /*!< [23:16] sub1 version */
|
||||
#define STM32U5XX_NUCLEO_BSP_VERSION_SUB2 (0x03U) /*!< [15:8] sub2 version */
|
||||
#define STM32U5XX_NUCLEO_BSP_VERSION_RC (0x00U) /*!< [7:0] release candidate */
|
||||
#define STM32U5XX_NUCLEO_BSP_VERSION ((STM32U5XX_NUCLEO_BSP_VERSION_MAIN << 24)\
|
||||
|(STM32U5XX_NUCLEO_BSP_VERSION_SUB1 << 16)\
|
||||
|(STM32U5XX_NUCLEO_BSP_VERSION_SUB2 << 8 )\
|
||||
|(STM32U5XX_NUCLEO_BSP_VERSION_RC))
|
||||
|
||||
#if defined (USE_NUCLEO_144)
|
||||
#define STM32U5XX_NUCLEO_BSP_BOARD_NAME "NUCLEO-U575ZI-Q";
|
||||
#define STM32U5XX_NUCLEO_BSP_BOARD_ID "MB1549C";
|
||||
#else
|
||||
#define STM32U5XX_NUCLEO_BSP_BOARD_NAME "NUCLEO-U545RE-Q";
|
||||
#define STM32U5XX_NUCLEO_BSP_BOARD_ID "MB1841A";
|
||||
#endif /* defined (USE_NUCLEO_144) */
|
||||
|
||||
/** @defgroup STM32U5XX_NUCLEO_LOW_LEVEL_LED LOW LEVEL LED
|
||||
* @{
|
||||
*/
|
||||
#if defined (USE_NUCLEO_144)
|
||||
#define LED1_PIN GPIO_PIN_7
|
||||
#define LED1_GPIO_PORT GPIOC
|
||||
#define LED1_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
|
||||
#define LED1_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
|
||||
|
||||
#define LED2_PIN GPIO_PIN_7
|
||||
#define LED2_GPIO_PORT GPIOB
|
||||
#define LED2_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
#define LED2_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
|
||||
|
||||
#define LED3_PIN GPIO_PIN_2
|
||||
#define LED3_GPIO_PORT GPIOG
|
||||
#define LED3_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE()
|
||||
#define LED3_GPIO_CLK_DISABLE() __HAL_RCC_GPIOG_CLK_DISABLE()
|
||||
#else
|
||||
#define LED2_PIN GPIO_PIN_5
|
||||
#define LED2_GPIO_PORT GPIOA
|
||||
#define LED2_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
#define LED2_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE()
|
||||
#endif /* defined (USE_NUCLEO_144) */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32U5XX_NUCLEO_LOW_LEVEL_BUTTON LOW LEVEL BUTTON
|
||||
* @{
|
||||
*/
|
||||
/* Button state */
|
||||
#define BUTTON_RELEASED 0U
|
||||
#define BUTTON_PRESSED 1U
|
||||
|
||||
/**
|
||||
* @brief Key push-button
|
||||
*/
|
||||
#define BUTTON_USER_PIN GPIO_PIN_13
|
||||
#define BUTTON_USER_GPIO_PORT GPIOC
|
||||
#define BUTTON_USER_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
|
||||
#define BUTTON_USER_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
|
||||
#define BUTTON_USER_EXTI_IRQn EXTI13_IRQn
|
||||
#define BUTTON_USER_EXTI_LINE EXTI_LINE_13
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32U5XX_NUCLEO_LOW_LEVEL_COM LOW LEVEL COM
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @brief Definition for COM port1, connected to UART1
|
||||
*/
|
||||
#if (USE_BSP_COM_FEATURE > 0)
|
||||
#define COM1_UART USART1
|
||||
#define COM1_CLK_ENABLE() __HAL_RCC_USART1_CLK_ENABLE()
|
||||
#define COM1_CLK_DISABLE() __HAL_RCC_USART1_CLK_DISABLE()
|
||||
|
||||
#define COM1_TX_PIN GPIO_PIN_9
|
||||
#define COM1_TX_GPIO_PORT GPIOA
|
||||
#define COM1_TX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
#define COM1_TX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE()
|
||||
#define COM1_TX_AF GPIO_AF7_USART1
|
||||
|
||||
#define COM1_RX_PIN GPIO_PIN_10
|
||||
#define COM1_RX_GPIO_PORT GPIOA
|
||||
#define COM1_RX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
#define COM1_RX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE()
|
||||
#define COM1_RX_AF GPIO_AF7_USART1
|
||||
#define COM_POLL_TIMEOUT 1000
|
||||
#endif /* USE_BSP_COM_FEATURE */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32U5XX_NUCLEO_LOW_LEVEL_Exported_Variables LOW LEVEL Exported Variables
|
||||
* @{
|
||||
*/
|
||||
extern EXTI_HandleTypeDef hpb_exti[];
|
||||
#if (USE_BSP_COM_FEATURE > 0)
|
||||
extern UART_HandleTypeDef hcom_uart[];
|
||||
extern USART_TypeDef *COM_USART[];
|
||||
#endif /* USE_BSP_COM_FEATURE */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32U5XX_NUCLEO_LOW_LEVEL_Exported_FunctionsPrototypes LOW LEVEL Exported Functions Prototypes
|
||||
* @{
|
||||
*/
|
||||
int32_t BSP_GetVersion(void);
|
||||
const uint8_t *BSP_GetBoardName(void);
|
||||
const uint8_t *BSP_GetBoardID(void);
|
||||
int32_t BSP_LED_Init(Led_TypeDef Led);
|
||||
int32_t BSP_LED_DeInit(Led_TypeDef Led);
|
||||
int32_t BSP_LED_On(Led_TypeDef Led);
|
||||
int32_t BSP_LED_Off(Led_TypeDef Led);
|
||||
int32_t BSP_LED_Toggle(Led_TypeDef Led);
|
||||
int32_t BSP_LED_GetState(Led_TypeDef Led);
|
||||
int32_t BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef ButtonMode);
|
||||
int32_t BSP_PB_DeInit(Button_TypeDef Button);
|
||||
int32_t BSP_PB_GetState(Button_TypeDef Button);
|
||||
void BSP_PB_IRQHandler(Button_TypeDef Button);
|
||||
void BSP_PB_Callback(Button_TypeDef Button);
|
||||
|
||||
#if (USE_BSP_COM_FEATURE > 0)
|
||||
int32_t BSP_COM_Init(COM_TypeDef COM, COM_InitTypeDef *COM_Init);
|
||||
int32_t BSP_COM_DeInit(COM_TypeDef COM);
|
||||
#if (USE_COM_LOG > 0)
|
||||
int32_t BSP_COM_SelectLogPort(COM_TypeDef COM);
|
||||
#endif /* USE_COM_LOG */
|
||||
|
||||
#if (USE_HAL_UART_REGISTER_CALLBACKS == 1)
|
||||
int32_t BSP_COM_RegisterDefaultMspCallbacks(COM_TypeDef COM);
|
||||
int32_t BSP_COM_RegisterMspCallbacks(COM_TypeDef COM, BSP_COM_Cb_t *Callback);
|
||||
#endif /* USE_HAL_UART_REGISTER_CALLBACKS */
|
||||
HAL_StatusTypeDef MX_USART1_Init(UART_HandleTypeDef *huart, MX_UART_InitTypeDef *COM_Init);
|
||||
#endif /* USE_BSP_COM_FEATURE */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* STM32U5XX_NUCLEO_H */
|
||||
@@ -0,0 +1,78 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32u5xx_nucleo_conf_template.h
|
||||
* @author MCD Application Team
|
||||
* @brief STM32U5xx_Nuleo board configuration file.
|
||||
* This file should be copied to the application folder and renamed
|
||||
* to stm32u5xx_nucleo_conf.h
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2021 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 STM32U5XX_NUCLEO_CONF_H
|
||||
#define STM32U5XX_NUCLEO_CONF_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32u5xx_hal.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32U5XX_NUCLEO
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup STM32U5XX_NUCLEO_CONFIG Config
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup STM32U5XX_NUCLEO_CONFIG_Exported_Constants Exported Constants
|
||||
* @{
|
||||
*/
|
||||
/* Nucleo pin and part number defines */
|
||||
#define USE_NUCLEO_144
|
||||
/* #define USE_NUCLEO_64 */
|
||||
|
||||
/* COM define */
|
||||
#define USE_COM_LOG 0U
|
||||
#define USE_BSP_COM_FEATURE 0U
|
||||
|
||||
/* IRQ priorities */
|
||||
#define BSP_BUTTON_USER_IT_PRIORITY 15U
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* STM32U5XX_NUCLEO_CONF_H */
|
||||
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32u5xx_nucleo_errno.h
|
||||
* @author MCD Application Team
|
||||
* @brief Error Code.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2021 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 STM32U5XX_NUCLEO_ERRNO_H
|
||||
#define STM32U5XX_NUCLEO_ERRNO_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Common Error codes */
|
||||
#define BSP_ERROR_NONE 0
|
||||
#define BSP_ERROR_NO_INIT -1
|
||||
#define BSP_ERROR_WRONG_PARAM -2
|
||||
#define BSP_ERROR_BUSY -3
|
||||
#define BSP_ERROR_PERIPH_FAILURE -4
|
||||
#define BSP_ERROR_COMPONENT_FAILURE -5
|
||||
#define BSP_ERROR_UNKNOWN_FAILURE -6
|
||||
#define BSP_ERROR_UNKNOWN_COMPONENT -7
|
||||
#define BSP_ERROR_BUS_FAILURE -8
|
||||
#define BSP_ERROR_CLOCK_FAILURE -9
|
||||
#define BSP_ERROR_MSP_FAILURE -10
|
||||
#define BSP_ERROR_FEATURE_NOT_SUPPORTED -11
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* STM32U5XX_NUCLEO_ERRNO_H */
|
||||
@@ -0,0 +1,857 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32u5xx_nucleo_usbpd_pwr.c
|
||||
* @author MCD Application Team
|
||||
* @brief This file provides a set of firmware functions to manage
|
||||
* USB-PD Power on a STM32U5xx-Nucleo Kit:
|
||||
* - VBUS control
|
||||
* - VBUS voltage/current measurement
|
||||
* - VCONN control
|
||||
* - VBUS presence detection
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2021 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 "stm32u5xx_nucleo_usbpd_pwr.h"
|
||||
#include "stm32u5xx_ll_adc.h"
|
||||
#include "stm32u5xx_ll_bus.h"
|
||||
#include "stm32u5xx_ll_gpio.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32U5XX_NUCLEO
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32U5XX_NUCLEO_USBPD_PWR USBPD PWR
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup STM32U5XX_NUCLEO_USBPD_PWR_Private_Typedef USBPD PWR Private Typedef
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32U5XX_NUCLEO_USBPD_PWR_Private_Constants USBPD PWR Private Constants
|
||||
* @{
|
||||
*/
|
||||
#define VDDA_APPLI 3300U
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32U5XX_NUCLEO_USBPD_PWR_Private_Macros USBPD PWR Private Macros
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32U5XX_NUCLEO_USBPD_PWR_Private_Variables USBPD PWR Private Variables
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32U5XX_NUCLEO_USBPD_PWR_Private_Functions USBPD PWR Private Functions
|
||||
* @{
|
||||
*/
|
||||
static void MX_ADC1_Init(void);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32U5XX_NUCLEO_USBPD_PWR_Exported_Functions USBPD PWR Exported Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Global initialization of PWR resource used by USB-PD
|
||||
* @param PortNum Type-C port identifier
|
||||
* This parameter can be take one of the following values:
|
||||
* @arg @ref USBPD_PWR_TYPE_C_PORT_1
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_USBPD_PWR_Init(uint32_t PortNum)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
|
||||
/* Check if instance is valid */
|
||||
if (PortNum >= USBPD_PWR_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Disable DB management on TCPP01 */
|
||||
GPIO_TCPP01_DB_CLK_ENABLE();
|
||||
LL_GPIO_SetPinMode(GPIO_TCPP01_DB_PORT, GPIO_TCPP01_DB_PIN, LL_GPIO_MODE_OUTPUT);
|
||||
LL_GPIO_SetPinSpeed(GPIO_TCPP01_DB_PORT, GPIO_TCPP01_DB_PIN, LL_GPIO_SPEED_FREQ_HIGH);
|
||||
LL_GPIO_SetPinOutputType(GPIO_TCPP01_DB_PORT, GPIO_TCPP01_DB_PIN, LL_GPIO_OUTPUT_PUSHPULL);
|
||||
LL_GPIO_SetPinPull(GPIO_TCPP01_DB_PORT, GPIO_TCPP01_DB_PIN, LL_GPIO_PULL_UP);
|
||||
LL_GPIO_SetOutputPin(GPIO_TCPP01_DB_PORT, GPIO_TCPP01_DB_PIN);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Global de-initialization of PWR resource used by USB-PD
|
||||
* @param PortNum Type-C port identifier
|
||||
* This parameter can be take one of the following values:
|
||||
* @arg @ref USBPD_PWR_TYPE_C_PORT_1
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_USBPD_PWR_Deinit(uint32_t PortNum)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
|
||||
/* Check if instance is valid */
|
||||
if (PortNum >= USBPD_PWR_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Nothing to do */
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Initialize the hardware resources used by the Type-C power delivery (PD)
|
||||
* controller.
|
||||
* @param PortNum Type-C port identifier
|
||||
* This parameter can be take one of the following values:
|
||||
* @arg @ref USBPD_PWR_TYPE_C_PORT_1
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_USBPD_PWR_VBUSInit(uint32_t PortNum)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
|
||||
/* Check if instance is valid */
|
||||
if (PortNum >= USBPD_PWR_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Initialize VBUS sensing ADC */
|
||||
MX_ADC1_Init();
|
||||
|
||||
LL_ADC_REG_StartConversion(VSENSE_ADC_INSTANCE);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Release the hardware resources used by the Type-C power delivery (PD)
|
||||
* controller.
|
||||
* @param PortNum Type-C port identifier
|
||||
* This parameter can be take one of the following values:
|
||||
* @arg @ref USBPD_PWR_TYPE_C_PORT_1
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_USBPD_PWR_VBUSDeInit(uint32_t PortNum)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
|
||||
/* Check if instance is valid */
|
||||
if (PortNum >= USBPD_PWR_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (LL_ADC_REG_IsConversionOngoing(VSENSE_ADC_INSTANCE) != 0UL)
|
||||
{
|
||||
LL_ADC_REG_StopConversion(VSENSE_ADC_INSTANCE);
|
||||
}
|
||||
|
||||
/* Disable ADC */
|
||||
if (LL_ADC_IsEnabled(VSENSE_ADC_INSTANCE) == 1UL)
|
||||
{
|
||||
LL_ADC_Disable(VSENSE_ADC_INSTANCE);
|
||||
}
|
||||
|
||||
/* Reset ADC configuration */
|
||||
VSENSE_ADC_DISABLE_CLOCK();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable power supply over VBUS.
|
||||
* @param PortNum Type-C port identifier
|
||||
* This parameter can be take one of the following values:
|
||||
* @arg @ref USBPD_PWR_TYPE_C_PORT_1
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_USBPD_PWR_VBUSOn(uint32_t PortNum)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
/* Check if instance is valid */
|
||||
if (PortNum >= USBPD_PWR_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Disable power supply over VBUS.
|
||||
* @param PortNum Type-C port identifier
|
||||
* This parameter can be take one of the following values:
|
||||
* @arg @ref USBPD_PWR_TYPE_C_PORT_1
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_USBPD_PWR_VBUSOff(uint32_t PortNum)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
/* Check if instance is valid */
|
||||
if (PortNum >= USBPD_PWR_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get actual VBUS status.
|
||||
* @param PortNum Type-C port identifier
|
||||
* This parameter can be take one of the following values:
|
||||
* @arg @ref USBPD_PWR_TYPE_C_PORT_1
|
||||
* @param pState VBUS status (1: On, 0: Off)
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_USBPD_PWR_VBUSIsOn(uint32_t PortNum, uint8_t *pState)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
/* Check if instance is valid */
|
||||
if (PortNum >= USBPD_PWR_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
*pState = 0u;
|
||||
ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set a fixed/variable PDO and manage the power control.
|
||||
* @param PortNum Type-C port identifier
|
||||
* This parameter can be take one of the following values:
|
||||
* @arg @ref USBPD_PWR_TYPE_C_PORT_1
|
||||
* @param VbusTargetInmv the vbus Target (in mV)
|
||||
* @param OperatingCurrent the Operating Current (in mA)
|
||||
* @param MaxOperatingCurrent the Max Operating Current (in mA)
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_USBPD_PWR_VBUSSetVoltage_Fixed(uint32_t PortNum,
|
||||
uint32_t VbusTargetInmv,
|
||||
uint32_t OperatingCurrent,
|
||||
uint32_t MaxOperatingCurrent)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
UNUSED(MaxOperatingCurrent);
|
||||
UNUSED(OperatingCurrent);
|
||||
UNUSED(VbusTargetInmv);
|
||||
|
||||
/* Check if instance is valid */
|
||||
if (PortNum >= USBPD_PWR_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set a fixed/variable PDO and manage the power control.
|
||||
* @param PortNum Type-C port identifier
|
||||
* This parameter can be take one of the following values:
|
||||
* @arg @ref USBPD_PWR_TYPE_C_PORT_1
|
||||
* @param VbusTargetMinInmv the vbus Target min (in mV)
|
||||
* @param VbusTargetMaxInmv the vbus Target max (in mV)
|
||||
* @param OperatingCurrent the Operating Current (in mA)
|
||||
* @param MaxOperatingCurrent the Max Operating Current (in mA)
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_USBPD_PWR_VBUSSetVoltage_Variable(uint32_t PortNum,
|
||||
uint32_t VbusTargetMinInmv,
|
||||
uint32_t VbusTargetMaxInmv,
|
||||
uint32_t OperatingCurrent,
|
||||
uint32_t MaxOperatingCurrent)
|
||||
{
|
||||
int32_t ret;
|
||||
UNUSED(MaxOperatingCurrent);
|
||||
UNUSED(OperatingCurrent);
|
||||
UNUSED(VbusTargetMaxInmv);
|
||||
UNUSED(VbusTargetMinInmv);
|
||||
|
||||
/* Check if instance is valid */
|
||||
if (PortNum >= USBPD_PWR_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set a Battery PDO and manage the power control.
|
||||
* @param PortNum Type-C port identifier
|
||||
* This parameter can be take one of the following values:
|
||||
* @arg @ref USBPD_PWR_TYPE_C_PORT_1
|
||||
* @param VbusTargetMin the vbus Target min (in mV)
|
||||
* @param VbusTargetMax the vbus Target max (in mV)
|
||||
* @param OperatingPower the Operating Power (in mW)
|
||||
* @param MaxOperatingPower the Max Operating Power (in mW)
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_USBPD_PWR_VBUSSetVoltage_Battery(uint32_t PortNum,
|
||||
uint32_t VbusTargetMin,
|
||||
uint32_t VbusTargetMax,
|
||||
uint32_t OperatingPower,
|
||||
uint32_t MaxOperatingPower)
|
||||
{
|
||||
int32_t ret;
|
||||
UNUSED(OperatingPower);
|
||||
UNUSED(VbusTargetMax);
|
||||
UNUSED(VbusTargetMin);
|
||||
UNUSED(MaxOperatingPower);
|
||||
|
||||
/* Check if instance is valid */
|
||||
if (PortNum >= USBPD_PWR_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Set the power, the precision must be at 5% */
|
||||
/* Set the current limitation */
|
||||
/* not implemented */
|
||||
|
||||
ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set a APDO and manage the power control.
|
||||
* @param PortNum Type-C port identifier
|
||||
* This parameter can be take one of the following values:
|
||||
* @arg @ref USBPD_PWR_TYPE_C_PORT_1
|
||||
* @param VbusTargetInmv the vbus Target (in mV)
|
||||
* @param OperatingCurrent the Operating current (in mA)
|
||||
* @param Delta Delta between with previous APDO (in mV), 0 means APDO start
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_USBPD_PWR_VBUSSetVoltage_APDO(uint32_t PortNum,
|
||||
uint32_t VbusTargetInmv,
|
||||
uint32_t OperatingCurrent,
|
||||
int32_t Delta)
|
||||
{
|
||||
int32_t ret;
|
||||
UNUSED(Delta);
|
||||
UNUSED(OperatingCurrent);
|
||||
UNUSED(VbusTargetInmv);
|
||||
|
||||
/* Check if instance is valid */
|
||||
if (PortNum >= USBPD_PWR_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the VBUS disconnection voltage threshold.
|
||||
* @note Callback function registered through BSP_USBPD_PWR_RegisterVBUSDetectCallback
|
||||
* function call is invoked when VBUS falls below programmed threshold.
|
||||
* @note By default VBUS disconnection threshold is set to 3.3V
|
||||
* @param PortNum Type-C port identifier
|
||||
* This parameter can be take one of the following values:
|
||||
* @arg @ref USBPD_PWR_TYPE_C_PORT_1
|
||||
* @param VoltageThreshold VBUS disconnection voltage threshold (in mV)
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_USBPD_PWR_SetVBUSDisconnectionThreshold(uint32_t PortNum,
|
||||
uint32_t VoltageThreshold)
|
||||
{
|
||||
UNUSED(VoltageThreshold);
|
||||
int32_t ret;
|
||||
|
||||
/* Check if instance is valid */
|
||||
if (PortNum >= USBPD_PWR_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Register USB Type-C Current callback function.
|
||||
* @note Callback function invoked when VBUS rises above 4V (VBUS present) or
|
||||
* when VBUS falls below programmed threshold (VBUS absent).
|
||||
* @note Callback function is un-registered when callback function pointer
|
||||
* argument is NULL.
|
||||
* @param PortNum Type-C port identifier
|
||||
* This parameter can be take one of the following values:
|
||||
* @arg @ref USBPD_PWR_TYPE_C_PORT_1
|
||||
* @param pfnVBUSDetectCallback callback function pointer
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_USBPD_PWR_RegisterVBUSDetectCallback(uint32_t PortNum,
|
||||
USBPD_PWR_VBUSDetectCallbackFunc *pfnVBUSDetectCallback)
|
||||
{
|
||||
UNUSED(pfnVBUSDetectCallback);
|
||||
int32_t ret;
|
||||
|
||||
/* Check if instance is valid */
|
||||
if (PortNum >= USBPD_PWR_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get actual voltage level measured on the VBUS line.
|
||||
* @param PortNum Type-C port identifier
|
||||
* This parameter can be take one of the following values:
|
||||
* @arg @ref USBPD_PWR_TYPE_C_PORT_1
|
||||
* @param pVoltage Pointer on measured voltage level (in mV)
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_USBPD_PWR_VBUSGetVoltage(uint32_t PortNum, uint32_t *pVoltage)
|
||||
{
|
||||
int32_t ret = BSP_ERROR_NONE;
|
||||
|
||||
/* Check if instance is valid */
|
||||
if ((PortNum >= USBPD_PWR_INSTANCES_NBR) || (NULL == pVoltage))
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
uint32_t val;
|
||||
|
||||
LL_ADC_REG_StartConversion(ADC1);
|
||||
|
||||
val = (((uint32_t) LL_ADC_REG_ReadConversionData12(VSENSE_ADC_INSTANCE)) * (VDDA_APPLI))
|
||||
/ (__LL_ADC_DIGITAL_SCALE(VSENSE_ADC_INSTANCE, LL_ADC_RESOLUTION_12B));
|
||||
|
||||
/* NUCLEO144_Q (MB1549) board is used */
|
||||
/* Value is multiplied by 7.61 (Divider R35+R34/R34 (379.9K/49.9K) for VSENSE) */
|
||||
val *= 761UL;
|
||||
val /= 100UL;
|
||||
*pVoltage = val;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get actual current level measured on the VBUS line.
|
||||
* @param PortNum Type-C port identifier
|
||||
* This parameter can be take one of the following values:
|
||||
* @arg @ref USBPD_PWR_TYPE_C_PORT_1
|
||||
* @param pCurrent Pointer on measured current level (in mA)
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_USBPD_PWR_VBUSGetCurrent(uint32_t PortNum, int32_t *pCurrent)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
/* Check if instance is valid */
|
||||
if ((PortNum >= USBPD_PWR_INSTANCES_NBR) || (NULL == pCurrent))
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
*pCurrent = 0;
|
||||
ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Activate discharge on VBUS.
|
||||
* @param PortNum Type-C port identifier
|
||||
* This parameter can be take one of the following values:
|
||||
* @arg @ref USBPD_PWR_TYPE_C_PORT_1
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_USBPD_PWR_VBUSDischargeOn(uint32_t PortNum)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
/* Check if instance is valid */
|
||||
if (PortNum >= USBPD_PWR_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Deactivate discharge on VBUS.
|
||||
* @param PortNum Type-C port identifier
|
||||
* This parameter can be take one of the following values:
|
||||
* @arg @ref USBPD_PWR_TYPE_C_PORT_1
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_USBPD_PWR_VBUSDischargeOff(uint32_t PortNum)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
/* Check if instance is valid */
|
||||
if (PortNum >= USBPD_PWR_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Initialize VCONN sourcing.
|
||||
* @param PortNum Type-C port identifier
|
||||
* This parameter can be take one of the following values:
|
||||
* @arg @ref USBPD_PWR_TYPE_C_PORT_1
|
||||
* @param CCPinId Type-C CC pin identifier
|
||||
* This parameter can be take one of the following values:
|
||||
* @arg @ref USBPD_PWR_TYPE_C_CC1
|
||||
* @arg @ref USBPD_PWR_TYPE_C_CC2
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_USBPD_PWR_VCONNInit(uint32_t PortNum,
|
||||
uint32_t CCPinId)
|
||||
{
|
||||
UNUSED(CCPinId);
|
||||
int32_t ret;
|
||||
|
||||
/* Check if instance is valid */
|
||||
if (PortNum >= USBPD_PWR_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Un-Initialize VCONN sourcing.
|
||||
* @param PortNum Type-C port identifier
|
||||
* This parameter can be take one of the following values:
|
||||
* @arg @ref USBPD_PWR_TYPE_C_PORT_1
|
||||
* @param CCPinId Type-C CC pin identifier
|
||||
* This parameter can be take one of the following values:
|
||||
* @arg @ref USBPD_PWR_TYPE_C_CC1
|
||||
* @arg @ref USBPD_PWR_TYPE_C_CC2
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_USBPD_PWR_VCONNDeInit(uint32_t PortNum,
|
||||
uint32_t CCPinId)
|
||||
{
|
||||
UNUSED(CCPinId);
|
||||
int32_t ret;
|
||||
|
||||
/* Check if instance is valid */
|
||||
if (PortNum >= USBPD_PWR_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable VCONN sourcing.
|
||||
* @param PortNum Type-C port identifier
|
||||
* This parameter can be take one of the following values:
|
||||
* @arg @ref USBPD_PWR_TYPE_C_PORT_1
|
||||
* @param CCPinId Type-C CC pin identifier
|
||||
* This parameter can be take one of the following values:
|
||||
* @arg @ref USBPD_PWR_TYPE_C_CC1
|
||||
* @arg @ref USBPD_PWR_TYPE_C_CC2
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_USBPD_PWR_VCONNOn(uint32_t PortNum,
|
||||
uint32_t CCPinId)
|
||||
{
|
||||
UNUSED(CCPinId);
|
||||
int32_t ret;
|
||||
|
||||
/* Check if instance is valid */
|
||||
if (PortNum >= USBPD_PWR_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Disable VCONN sourcing.
|
||||
* @param PortNum Type-C port identifier
|
||||
* This parameter can be take one of the following values:
|
||||
* @arg @ref USBPD_PWR_TYPE_C_PORT_1
|
||||
* @param CCPinId CC pin identifier
|
||||
* This parameter can be take one of the following values:
|
||||
* @arg @ref USBPD_PWR_TYPE_C_CC1
|
||||
* @arg @ref USBPD_PWR_TYPE_C_CC2
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_USBPD_PWR_VCONNOff(uint32_t PortNum,
|
||||
uint32_t CCPinId)
|
||||
{
|
||||
UNUSED(CCPinId);
|
||||
int32_t ret;
|
||||
|
||||
/* Check if instance is valid */
|
||||
if (PortNum >= USBPD_PWR_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get actual VCONN status.
|
||||
* @param PortNum Type-C port identifier
|
||||
* This parameter can be take one of the following values:
|
||||
* @arg @ref USBPD_PWR_TYPE_C_PORT_1
|
||||
* @param CCPinId Type-C CC pin identifier
|
||||
* This parameter can be take one of the following values:
|
||||
* @arg @ref USBPD_PWR_TYPE_C_CC1
|
||||
* @arg @ref USBPD_PWR_TYPE_C_CC2
|
||||
* @param pState VCONN status (1: On, 0: Off)
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_USBPD_PWR_VCONNIsOn(uint32_t PortNum,
|
||||
uint32_t CCPinId, uint8_t *pState)
|
||||
{
|
||||
UNUSED(CCPinId);
|
||||
int32_t ret;
|
||||
|
||||
/* Check if parameters are valid */
|
||||
if ((PortNum >= USBPD_PWR_INSTANCES_NBR) || (NULL == pState))
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
*pState = 0;
|
||||
ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Activate discharge on VCONN.
|
||||
* @param PortNum Type-C port identifier
|
||||
* This parameter can be take one of the following values:
|
||||
* @arg @ref USBPD_PWR_TYPE_C_PORT_1
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_USBPD_PWR_VCONNDischargeOn(uint32_t PortNum)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
/* Check if instance is valid */
|
||||
if (PortNum >= USBPD_PWR_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Deactivate discharge on VCONN.
|
||||
* @param PortNum Type-C port identifier
|
||||
* This parameter can be take one of the following values:
|
||||
* @arg @ref USBPD_PWR_TYPE_C_PORT_1
|
||||
* @retval BSP status
|
||||
*/
|
||||
int32_t BSP_USBPD_PWR_VCONNDischargeOff(uint32_t PortNum)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
/* Check if instance is valid */
|
||||
if (PortNum >= USBPD_PWR_INSTANCES_NBR)
|
||||
{
|
||||
ret = BSP_ERROR_WRONG_PARAM;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32U5XX_NUCLEO_USBPD_PWR_Private_Functions USBPD PWR Private Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
static void MX_ADC1_Init(void)
|
||||
{
|
||||
static ADC_HandleTypeDef hadc1;
|
||||
|
||||
/* Enable GPIO Clock */
|
||||
VSENSE_GPIO_ENABLE_CLOCK();
|
||||
|
||||
/* Configure GPIO in analog mode to be used as ADC input */
|
||||
LL_GPIO_SetPinMode(VSENSE_GPIO_PORT, VSENSE_GPIO_PIN, LL_GPIO_MODE_ANALOG);
|
||||
LL_GPIO_SetPinPull(VSENSE_GPIO_PORT, VSENSE_GPIO_PIN, LL_GPIO_PULL_NO);
|
||||
|
||||
/* Enable ADC clock (core clock) */
|
||||
VSENSE_ADC_ENABLE_CLOCK();
|
||||
|
||||
/* Configure the global features of the ADC (Clock, Resolution, Data Alignment and number of conversion) */
|
||||
|
||||
/* The clock source of the ADC is by default HCLCK (see RCC->CCIPR3 ADCDACSEL)*/
|
||||
__HAL_RCC_PWR_CLK_ENABLE();
|
||||
HAL_PWREx_EnableVddA();
|
||||
HAL_PWREx_EnableVddIO2();
|
||||
|
||||
hadc1.Instance = VSENSE_ADC_INSTANCE;
|
||||
hadc1.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV4;
|
||||
hadc1.Init.Resolution = ADC_RESOLUTION_12B;
|
||||
hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT;
|
||||
hadc1.Init.ScanConvMode = ADC_SCAN_ENABLE;
|
||||
hadc1.Init.EOCSelection = ADC_EOC_SINGLE_CONV;
|
||||
hadc1.Init.LowPowerAutoWait = DISABLE;
|
||||
hadc1.Init.LowPowerAutoPowerOff = ADC_LOW_POWER_NONE;
|
||||
hadc1.Init.ContinuousConvMode = ENABLE;
|
||||
hadc1.Init.NbrOfConversion = 1;
|
||||
hadc1.Init.DiscontinuousConvMode = DISABLE;
|
||||
hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START;
|
||||
hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE;
|
||||
hadc1.Init.DMAContinuousRequests = DISABLE;
|
||||
hadc1.Init.Overrun = ADC_OVR_DATA_OVERWRITTEN;
|
||||
hadc1.Init.OversamplingMode = DISABLE;
|
||||
if (HAL_ADC_Init(&hadc1) != HAL_OK)
|
||||
{
|
||||
}
|
||||
|
||||
/* Configure Regular Channel */
|
||||
ADC_ChannelConfTypeDef sConfig = {0};
|
||||
|
||||
sConfig.Channel = VSENSE_ADC_CHANNEL;
|
||||
sConfig.Rank = VSENSE_ADC_RANK;
|
||||
sConfig.SamplingTime = ADC_SAMPLETIME_36CYCLES;
|
||||
sConfig.SingleDiff = ADC_SINGLE_ENDED; /* Single-ended input channel */
|
||||
sConfig.OffsetNumber = ADC_OFFSET_NONE; /* No offset subtraction */
|
||||
sConfig.Offset = 0; /* Parameter discarded because offset correction is disabled */
|
||||
|
||||
if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
|
||||
{
|
||||
}
|
||||
|
||||
if (HAL_ADCEx_Calibration_Start(&hadc1, ADC_CALIB_OFFSET, ADC_SINGLE_ENDED) != HAL_OK)
|
||||
{
|
||||
}
|
||||
|
||||
if (HAL_ADC_Start(&hadc1) != HAL_OK)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,263 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32u5xx_nucleo_usbpd_pwr.h
|
||||
* @author MCD Application Team
|
||||
* @brief Header file for stm32u5xx_nucleo_usbpd_pwr.c file
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2021 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 STM32U5XX_NUCLEO_USBPD_PWR_H
|
||||
#define STM32U5XX_NUCLEO_USBPD_PWR_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32u5xx_nucleo_conf.h"
|
||||
#include "stm32u5xx_nucleo_errno.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32U5XX_NUCLEO
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32U5XX_NUCLEO_USBPD_PWR
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup STM32U5XX_NUCLEO_USBPD_PWR_Exported_Types USBPD PWR Exported Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
#if defined(TCPP0203_SUPPORT)
|
||||
/**
|
||||
* @brief Power role
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
POWER_ROLE_SOURCE = 0,
|
||||
POWER_ROLE_SINK,
|
||||
POWER_ROLE_DUAL
|
||||
}
|
||||
USBPD_PWR_PowerRoleTypeDef;
|
||||
#endif /* TCPP0203_SUPPORT */
|
||||
|
||||
/**
|
||||
* @brief VBUS connection status
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
VBUS_CONNECTED = 0,
|
||||
VBUS_NOT_CONNECTED
|
||||
} USBPD_PWR_VBUSConnectionStatusTypeDef;
|
||||
|
||||
/**
|
||||
* @brief VBUS Detection Callback
|
||||
*/
|
||||
typedef void USBPD_PWR_VBUSDetectCallbackFunc(uint32_t PortNum,
|
||||
USBPD_PWR_VBUSConnectionStatusTypeDef VBUSConnectionStatus);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32U5XX_NUCLEO_USBPD_PWR_Exported_Constants USBPD PWR Exported Constants
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @brief Number of TypeC ports
|
||||
*/
|
||||
#define USBPD_PWR_INSTANCES_NBR (1U)
|
||||
|
||||
/**
|
||||
* @brief Type-C port identifier
|
||||
*/
|
||||
#define USBPD_PWR_TYPE_C_PORT_1 (0U)
|
||||
|
||||
/**
|
||||
* @brief CC pin identifier
|
||||
*/
|
||||
#define USBPD_PWR_TYPE_C_CC1 (1U)
|
||||
#define USBPD_PWR_TYPE_C_CC2 (2U)
|
||||
|
||||
/**
|
||||
* @brief VBUS disconnection threshold values (in mV)
|
||||
*/
|
||||
#define USBPD_PWR_HIGH_VBUS_THRESHOLD (2800U)
|
||||
#define USBPD_PWR_LOW_VBUS_THRESHOLD (750U)
|
||||
#define USBPD_PWR_VBUS_THRESHOLD_5V (2150U)
|
||||
#define USBPD_PWR_VBUS_THRESHOLD_9V (7000U)
|
||||
#define USBPD_PWR_VBUS_THRESHOLD_15V (12500U)
|
||||
#define USBPD_PWR_VBUS_THRESHOLD_20V (17000U)
|
||||
#define USBPD_PWR_VBUS_THRESHOLD_APDO (2150U)
|
||||
|
||||
/**
|
||||
* @brief VBUS discharge parameters
|
||||
*/
|
||||
#define USBPD_PWR_DISCHARGE_MARGIN (500U)
|
||||
#define USBPD_PWR_DISCHARGE_TIME (6U)
|
||||
|
||||
/**
|
||||
* @brief Standard VBUS voltage levels
|
||||
*/
|
||||
#define USBPD_PWR_VBUS_5V 5000U
|
||||
#define USBPD_PWR_VBUS_9V 9000U
|
||||
#define USBPD_PWR_VBUS_15V 15000U
|
||||
|
||||
/**
|
||||
* @brief power timeout
|
||||
*/
|
||||
#define USBPD_PWR_TIMEOUT_PDO 250U /* Timeout for PDO to PDO or PDO to APDO at 250ms */
|
||||
#define USBPD_PWR_TIMEOUT_APDO 25U /* Timeout for APDO to APDO at 25ms */
|
||||
|
||||
/**
|
||||
* @brief Invalid value set during issue with voltage setting
|
||||
*/
|
||||
#define USBPD_PWR_INVALID_VALUE 0xFFFFFFFFU
|
||||
|
||||
/* On STM32U5xx-Nucleo Kit (MB1549), following setup has been used :
|
||||
VSENSE => PC2 */
|
||||
#define VSENSE_GPIO_PORT GPIOC
|
||||
#define VSENSE_GPIO_PIN LL_GPIO_PIN_2
|
||||
#define VSENSE_GPIO_ENABLE_CLOCK() LL_AHB2_GRP1_EnableClock(LL_AHB2_GRP1_PERIPH_GPIOC);
|
||||
|
||||
|
||||
/* PC2 is used as ADC1_IN3 input for ADC measurement of VBUS voltage :
|
||||
ADC1 Channel 3.
|
||||
*/
|
||||
#define VSENSE_ADC_INSTANCE ADC1
|
||||
#define VSENSE_ADC_RANK ADC_REGULAR_RANK_1
|
||||
#define VSENSE_ADC_CHANNEL ADC_CHANNEL_3
|
||||
|
||||
/* Enable ADC clock (core clock) */
|
||||
#define VSENSE_ADC_ENABLE_CLOCK() LL_AHB2_GRP1_EnableClock(LL_AHB2_GRP1_PERIPH_ADC1);
|
||||
|
||||
/* Enable ADC clock (core clock) */
|
||||
#define VSENSE_ADC_DISABLE_CLOCK() do { \
|
||||
LL_AHB2_GRP1_ForceReset(LL_AHB2_GRP1_PERIPH_ADC1); \
|
||||
LL_AHB2_GRP1_ReleaseReset(LL_AHB2_GRP1_PERIPH_ADC1); \
|
||||
LL_AHB2_GRP1_DisableClock(LL_AHB2_GRP1_PERIPH_ADC1); \
|
||||
} while (0);
|
||||
|
||||
/* Clock enabling for TCPP01 DB signal : PB5 */
|
||||
#define GPIO_TCPP01_DB_PORT GPIOB
|
||||
#define GPIO_TCPP01_DB_PIN LL_GPIO_PIN_5
|
||||
#define GPIO_TCPP01_DB_CLK_ENABLE() LL_AHB2_GRP1_EnableClock(LL_AHB2_GRP1_PERIPH_GPIOB);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32U5XX_NUCLEO_USBPD_PWR_Exported_Variables USBPD PWR Exported Variables
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32U5XX_NUCLEO_USBPD_PWR_Exported_Functions USBPD PWR Exported Functions
|
||||
* @{
|
||||
*/
|
||||
/* Common functions */
|
||||
int32_t BSP_USBPD_PWR_Init(uint32_t PortNum);
|
||||
|
||||
int32_t BSP_USBPD_PWR_Deinit(uint32_t PortNum);
|
||||
|
||||
int32_t BSP_USBPD_PWR_VBUSInit(uint32_t PortNum);
|
||||
|
||||
int32_t BSP_USBPD_PWR_VBUSDeInit(uint32_t PortNum);
|
||||
|
||||
int32_t BSP_USBPD_PWR_VBUSOn(uint32_t PortNum);
|
||||
|
||||
int32_t BSP_USBPD_PWR_VBUSOff(uint32_t PortNum);
|
||||
|
||||
int32_t BSP_USBPD_PWR_VBUSIsOn(uint32_t PortNum, uint8_t *pState);
|
||||
|
||||
int32_t BSP_USBPD_PWR_VBUSSetVoltage_Fixed(uint32_t PortNum,
|
||||
uint32_t VbusTargetInmv,
|
||||
uint32_t OperatingCurrent,
|
||||
uint32_t MaxOperatingCurrent);
|
||||
|
||||
int32_t BSP_USBPD_PWR_VBUSSetVoltage_Variable(uint32_t PortNum,
|
||||
uint32_t VbusTargetMaxInmv,
|
||||
uint32_t VbusTargetMinInmv,
|
||||
uint32_t OperatingCurrent,
|
||||
uint32_t MaxOperatingCurrent);
|
||||
|
||||
int32_t BSP_USBPD_PWR_VBUSSetVoltage_Battery(uint32_t PortNum,
|
||||
uint32_t VbusTargetMin,
|
||||
uint32_t VbusTargetMax,
|
||||
uint32_t OperatingPower,
|
||||
uint32_t MaxOperatingPower);
|
||||
|
||||
int32_t BSP_USBPD_PWR_VBUSSetVoltage_APDO(uint32_t PortNum,
|
||||
uint32_t VbusTargetInmv,
|
||||
uint32_t OperatingCurrent,
|
||||
int32_t Delta);
|
||||
|
||||
int32_t BSP_USBPD_PWR_SetVBUSDisconnectionThreshold(uint32_t PortNum,
|
||||
uint32_t VoltageThreshold);
|
||||
|
||||
int32_t BSP_USBPD_PWR_RegisterVBUSDetectCallback(uint32_t PortNum,
|
||||
USBPD_PWR_VBUSDetectCallbackFunc *pfnVBUSDetectCallback);
|
||||
|
||||
int32_t BSP_USBPD_PWR_VBUSGetVoltage(uint32_t PortNum, uint32_t *pVoltage);
|
||||
|
||||
int32_t BSP_USBPD_PWR_VBUSGetCurrent(uint32_t PortNum, int32_t *pCurrent);
|
||||
|
||||
int32_t BSP_USBPD_PWR_VBUSDischargeOn(uint32_t PortNum);
|
||||
|
||||
int32_t BSP_USBPD_PWR_VBUSDischargeOff(uint32_t PortNum);
|
||||
|
||||
int32_t BSP_USBPD_PWR_VCONNInit(uint32_t PortNum,
|
||||
uint32_t CCPinId);
|
||||
int32_t BSP_USBPD_PWR_VCONNDeInit(uint32_t PortNum,
|
||||
uint32_t CCPinId);
|
||||
int32_t BSP_USBPD_PWR_VCONNOn(uint32_t PortNum,
|
||||
uint32_t CCPinId);
|
||||
int32_t BSP_USBPD_PWR_VCONNOff(uint32_t PortNum,
|
||||
uint32_t CCPinId);
|
||||
|
||||
int32_t BSP_USBPD_PWR_VCONNIsOn(uint32_t PortNum,
|
||||
uint32_t CCPinId, uint8_t *pState);
|
||||
|
||||
int32_t BSP_USBPD_PWR_VCONNDischargeOn(uint32_t PortNum);
|
||||
|
||||
int32_t BSP_USBPD_PWR_VCONNDischargeOff(uint32_t PortNum);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* STM32U5XX_NUCLEO_USBPD_PWR_H */
|
||||
@@ -0,0 +1,27 @@
|
||||
Copyright 2022 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,6 @@
|
||||
This software component is provided to you as part of a software package and
|
||||
applicable license terms are in the Package_license file. If you received this
|
||||
software component outside of a package or without applicable license terms,
|
||||
the terms of the BSD-3-Clause license shall apply.
|
||||
You may obtain a copy of the BSD-3-Clause at:
|
||||
https://opensource.org/licenses/BSD-3-Clause
|
||||
@@ -0,0 +1,361 @@
|
||||
<!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 STM32WBAxx Nucleo Drivers</title>
|
||||
<style>
|
||||
code{white-space: pre-wrap;}
|
||||
span.smallcaps{font-variant: small-caps;}
|
||||
div.columns{display: flex; gap: min(4vw, 1.5em);}
|
||||
div.column{flex: auto; overflow-x: auto;}
|
||||
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
|
||||
/* The extra [class] is a hack that increases specificity enough to
|
||||
override a similar rule in reveal.js */
|
||||
ul.task-list[class]{list-style: none;}
|
||||
ul.task-list li input[type="checkbox"] {
|
||||
font-size: inherit;
|
||||
width: 0.8em;
|
||||
margin: 0 0.8em 0.2em -1.6em;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
|
||||
</style>
|
||||
<link rel="stylesheet" href="_htmresc/mini-st_2020.css" />
|
||||
<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="stm32wbaxx_nucleo"><mark>STM32WBAxx_Nucleo</mark></h1>
|
||||
<p>Copyright © 2022-2025 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 to manage:</p>
|
||||
<ul>
|
||||
<li>LEDs</li>
|
||||
<li>Push-buttons</li>
|
||||
<li>COM port</li>
|
||||
</ul>
|
||||
<p>available on STM32WBAxx_Nucleo Kit from STMicroelectronics</p>
|
||||
</div>
|
||||
<section id="update-history" class="col-sm-12 col-lg-8">
|
||||
<h1>Update History</h1>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section6" checked aria-hidden="true">
|
||||
<label for="collapse-section6" aria-hidden="true"><strong>V1.1.1 /
|
||||
07-October-2025</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<h3
|
||||
id="official-release-of-stm32cubewba-firmware-package-supporting-stm32wba5x-and-stm32wba6x-devices">Official
|
||||
Release of <strong>STM32CubeWBA</strong> Firmware package supporting
|
||||
<strong>STM32WBA5x</strong> and <strong>STM32WBA6x</strong> devices</h3>
|
||||
<h2 id="contents">Contents</h2>
|
||||
<h3
|
||||
id="official-release-of-board-drivers-for-nucleo-wba55cg-and-nucleo-wba65ri-boards">Official
|
||||
Release of board drivers for <strong>NUCLEO-WBA55CG</strong> and
|
||||
<strong>NUCLEO-WBA65RI</strong> boards</h3>
|
||||
<ul>
|
||||
<li><strong>BSP Drivers</strong> are available for the boards :
|
||||
<ul>
|
||||
<li>NUCLEO-WBA55CG (MB1801D-01/MB1803-WBA55CGA-B01)</li>
|
||||
<li>NUCLEO-WBA65RI (MB1801-USB-D01/MB2130-WBA65RI-A01)</li>
|
||||
<li>in line with STM32Cube BSP drivers development guidelines (UM2298 -
|
||||
revision 2)</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<p><br />
|
||||
</p>
|
||||
<ul>
|
||||
<li><strong>BSP Drivers</strong> updates
|
||||
<ul>
|
||||
<li>Modify the LED pin configuration with no-pull to reduce extra power
|
||||
consumption</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<p><br />
|
||||
</p>
|
||||
<h2 id="known-limitations">Known Limitations</h2>
|
||||
<ul>
|
||||
<li>None</li>
|
||||
</ul>
|
||||
<h2 id="dependencies">Dependencies</h2>
|
||||
<ul>
|
||||
<li>None</li>
|
||||
</ul>
|
||||
<h2 id="notes">Notes</h2>
|
||||
<ul>
|
||||
<li>stm32wbaxx_nucleo_conf_template.h file must be copied in user
|
||||
application as stm32wbaxx_nucleo_conf.h with optional configuration
|
||||
update</li>
|
||||
</ul>
|
||||
<p><br />
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section5" aria-hidden="true">
|
||||
<label for="collapse-section5" aria-hidden="true"><strong>V1.1.0 /
|
||||
07-February-2025</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-1">Main Changes</h2>
|
||||
<h3
|
||||
id="official-release-of-stm32cubewba-firmware-package-supporting-stm32wba5x-and-stm32wba6x-devices-1">Official
|
||||
Release of <strong>STM32CubeWBA</strong> Firmware package supporting
|
||||
<strong>STM32WBA5x</strong> and <strong>STM32WBA6x</strong> devices</h3>
|
||||
<h2 id="contents-1">Contents</h2>
|
||||
<h3
|
||||
id="official-release-of-board-drivers-for-nucleo-wba55cg-and-nucleo-wba65ri-boards-1">Official
|
||||
Release of board drivers for <strong>NUCLEO-WBA55CG</strong> and
|
||||
<strong>NUCLEO-WBA65RI</strong> boards</h3>
|
||||
<ul>
|
||||
<li><strong>BSP Drivers</strong> are available for the boards :
|
||||
<ul>
|
||||
<li>NUCLEO-WBA55CG (MB1801D-01/MB1803-WBA55CGA-B01)</li>
|
||||
<li><strong>NUCLEO-WBA65RI</strong>
|
||||
(MB1801-USB-D01/MB2130-WBA65RI-A01)</li>
|
||||
<li>in line with STM32Cube BSP drivers development guidelines (UM2298 -
|
||||
revision 2)</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<h2 id="known-limitations-1">Known Limitations</h2>
|
||||
<ul>
|
||||
<li>None</li>
|
||||
</ul>
|
||||
<h2 id="dependencies-1">Dependencies</h2>
|
||||
<ul>
|
||||
<li>None</li>
|
||||
</ul>
|
||||
<h2 id="notes-1">Notes</h2>
|
||||
<ul>
|
||||
<li>stm32wbaxx_nucleo_conf_template.h file must be copied in user
|
||||
application as stm32wbaxx_nucleo_conf.h with optional configuration
|
||||
update</li>
|
||||
</ul>
|
||||
<p><br />
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section4" aria-hidden="true">
|
||||
<label for="collapse-section4" aria-hidden="true"><strong>V1.0.3 /
|
||||
22-October-2024</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-2">Main Changes</h2>
|
||||
<h3
|
||||
id="official-release-of-stm32cubewba-firmware-package-supporting-stm32wba55xx-devices">Official
|
||||
Release of <strong>STM32CubeWBA</strong> Firmware package supporting
|
||||
<strong>STM32WBA55xx</strong> devices</h3>
|
||||
<h2 id="contents-2">Contents</h2>
|
||||
<h3
|
||||
id="official-release-of-board-drivers-for-nucleo-wba55cg-board">Official
|
||||
Release of board drivers for <strong>NUCLEO-WBA55CG</strong> board</h3>
|
||||
<ul>
|
||||
<li><strong>BSP Drivers</strong> are available for the boards :
|
||||
<ul>
|
||||
<li>NUCLEO-WBA55CG (MB1801D-01/MB1803-WBA55CGA-B01)</li>
|
||||
<li>in line with STM32Cube BSP drivers development guidelines (UM2298 -
|
||||
revision 2)</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<p><br />
|
||||
</p>
|
||||
<ul>
|
||||
<li><strong>BSP Drivers</strong> updates
|
||||
<ul>
|
||||
<li>No more support of deprecated board NUCLEO-WBA52CG
|
||||
(MB1801A-02/MB1863-WBA52CGA-A03)</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<p><br />
|
||||
</p>
|
||||
<h2 id="known-limitations-2">Known Limitations</h2>
|
||||
<ul>
|
||||
<li>None</li>
|
||||
</ul>
|
||||
<h2 id="dependencies-2">Dependencies</h2>
|
||||
<ul>
|
||||
<li>None</li>
|
||||
</ul>
|
||||
<h2 id="notes-2">Notes</h2>
|
||||
<ul>
|
||||
<li>stm32wbaxx_nucleo_conf_template.h file must be copied in user
|
||||
application as stm32wbaxx_nucleo_conf.h with optional configuration
|
||||
update</li>
|
||||
</ul>
|
||||
<p><br />
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section3" aria-hidden="true">
|
||||
<label for="collapse-section3" aria-hidden="true"><strong>V1.0.2 /
|
||||
07-February-2024</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-3">Main Changes</h2>
|
||||
<h3
|
||||
id="official-release-of-stm32cubewba-firmware-package-supporting-stm32wba52xx-and-stm32wba55xx-devices">Official
|
||||
Release of <strong>STM32CubeWBA</strong> Firmware package supporting
|
||||
<strong>STM32WBA52xx</strong> and <strong>STM32WBA55xx</strong>
|
||||
devices</h3>
|
||||
<h2 id="contents-3">Contents</h2>
|
||||
<h3
|
||||
id="official-release-of-board-drivers-for-nucleo-wba52cg-board-and-nucleo-wba55cg-board">Official
|
||||
Release of board drivers for <strong>NUCLEO-WBA52CG</strong> board and
|
||||
<strong>NUCLEO-WBA55CG</strong> board</h3>
|
||||
<ul>
|
||||
<li><strong>BSP Drivers</strong> are available for the boards :
|
||||
<ul>
|
||||
<li>NUCLEO-WBA52CG (MB1801A-02/MB1863-WBA52CGA-A03)</li>
|
||||
<li>NUCLEO-WBA55CG (MB1801D-01/MB1803-WBA55CGA-B01)</li>
|
||||
<li>in line with STM32Cube BSP drivers development guidelines (UM2298 -
|
||||
revision 2)</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<p><br />
|
||||
</p>
|
||||
<ul>
|
||||
<li><strong>BSP Drivers</strong> updates
|
||||
<ul>
|
||||
<li>Enable internal pull-up for user push-buttons</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<p><br />
|
||||
</p>
|
||||
<h2 id="known-limitations-3">Known Limitations</h2>
|
||||
<ul>
|
||||
<li>None</li>
|
||||
</ul>
|
||||
<h2 id="dependencies-3">Dependencies</h2>
|
||||
<ul>
|
||||
<li>None</li>
|
||||
</ul>
|
||||
<h2 id="notes-3">Notes</h2>
|
||||
<ul>
|
||||
<li>stm32wbaxx_nucleo_conf_template.h file must be copied in user
|
||||
application as stm32wbaxx_nucleo_conf.h with optional configuration
|
||||
update</li>
|
||||
</ul>
|
||||
<p><br />
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section2" aria-hidden="true">
|
||||
<label for="collapse-section2" aria-hidden="true"><strong>V1.0.1 /
|
||||
02-November-2023</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-4">Main Changes</h2>
|
||||
<h3
|
||||
id="official-release-of-stm32cubewba-firmware-package-supporting-stm32wba52xx-and-stm32wba55xx-devices-1">Official
|
||||
Release of <strong>STM32CubeWBA</strong> Firmware package supporting
|
||||
<strong>STM32WBA52xx</strong> and <strong>STM32WBA55xx</strong>
|
||||
devices</h3>
|
||||
<h2 id="contents-4">Contents</h2>
|
||||
<h3
|
||||
id="official-release-of-board-drivers-for-nucleo-wba52cg-board-and-nucleo-wba55cg-board-1">Official
|
||||
Release of board drivers for <strong>NUCLEO-WBA52CG</strong> board and
|
||||
<strong>NUCLEO-WBA55CG</strong> board</h3>
|
||||
<ul>
|
||||
<li><strong>BSP Drivers</strong> are available for the boards :
|
||||
<ul>
|
||||
<li>NUCLEO-WBA52CG (MB1801A-01/MB1863-WBA52CGA-A03)</li>
|
||||
<li>NUCLEO-WBA55CG (MB1801A-01/MB1803-WBA55CGA-B01)</li>
|
||||
<li>in line with STM32Cube BSP drivers development guidelines (UM2298 -
|
||||
revision 2)</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<p><br />
|
||||
</p>
|
||||
<ul>
|
||||
<li><strong>BSP Drivers</strong> updates
|
||||
<ul>
|
||||
<li>Fix printf() output redirection for MDK-ARM</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<p><br />
|
||||
</p>
|
||||
<h2 id="known-limitations-4">Known Limitations</h2>
|
||||
<ul>
|
||||
<li>None</li>
|
||||
</ul>
|
||||
<h2 id="dependencies-4">Dependencies</h2>
|
||||
<ul>
|
||||
<li>None</li>
|
||||
</ul>
|
||||
<h2 id="notes-4">Notes</h2>
|
||||
<ul>
|
||||
<li>stm32wbaxx_nucleo_conf_template.h file must be copied in user
|
||||
application as stm32wbaxx_nucleo_conf.h with optional configuration
|
||||
update</li>
|
||||
</ul>
|
||||
<p><br />
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section1" aria-hidden="true">
|
||||
<label for="collapse-section1" aria-hidden="true"><strong>V1.0.0 /
|
||||
08-February-2023</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-5">Main Changes</h2>
|
||||
<h3
|
||||
id="first-official-release-of-stm32cubewba-firmware-package-supporting-stm32wba52xx-devices">First
|
||||
Official Release of <strong>STM32CubeWBA</strong> Firmware package
|
||||
supporting <strong>STM32WBA52xx</strong> devices</h3>
|
||||
<h2 id="contents-5">Contents</h2>
|
||||
<h3
|
||||
id="first-official-release-of-board-drivers-for-nucleo-wba52cg-board">First
|
||||
Official Release of board drivers for <strong>NUCLEO-WBA52CG</strong>
|
||||
board</h3>
|
||||
<ul>
|
||||
<li><strong>BSP Drivers</strong> are available for the boards :
|
||||
<ul>
|
||||
<li>NUCLEO-WBA52CG (MB1801A-01/MB1863-WBA52CGA-A03)</li>
|
||||
<li>in line with STM32Cube BSP drivers development guidelines (UM2298 -
|
||||
revision 2)</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<h2 id="known-limitations-5">Known Limitations</h2>
|
||||
<ul>
|
||||
<li>None</li>
|
||||
</ul>
|
||||
<h2 id="dependencies-5">Dependencies</h2>
|
||||
<ul>
|
||||
<li>None</li>
|
||||
</ul>
|
||||
<h2 id="notes-5">Notes</h2>
|
||||
<ul>
|
||||
<li>stm32wbaxx_nucleo_conf_template.h file must be copied in user
|
||||
application as stm32wbaxx_nucleo_conf.h with optional configuration
|
||||
update</li>
|
||||
</ul>
|
||||
<p><br />
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<footer class="sticky">
|
||||
<div class="columns">
|
||||
<div class="column" style="width:95%;">
|
||||
<p>For complete documentation on STM32WBAxx, visit: <a
|
||||
href="http://www.st.com/stm32wba">www.st.com/stm32wba</a></p>
|
||||
<p><em>This release note uses up to date web standards and, for this
|
||||
reason, should not be opened with Internet Explorer but preferably with
|
||||
popular browsers such as Google Chrome, Mozilla Firefox, Opera or
|
||||
Microsoft Edge.</em></p>
|
||||
</div><div class="column" style="width:5%;">
|
||||
<p><abbr title="Based on template cx566953 version 2.0">Info</abbr></p>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,291 @@
|
||||
---
|
||||
pagetitle: Release Notes for STM32WBAxx Nucleo Drivers
|
||||
lang: en
|
||||
header-includes: <link rel="icon" type="image/x-icon" href="_htmresc/favicon.png" />
|
||||
---
|
||||
|
||||
::: {.row}
|
||||
::: {.col-sm-12 .col-lg-4}
|
||||
|
||||
<center>
|
||||
# Release Notes for
|
||||
# <mark>STM32WBAxx_Nucleo</mark>
|
||||
Copyright © 2022-2025 STMicroelectronics\
|
||||
|
||||
[](https://www.st.com){.logo}
|
||||
</center>
|
||||
|
||||
# Purpose
|
||||
|
||||
This driver provides a set of functions to manage:
|
||||
|
||||
- LEDs
|
||||
- Push-buttons
|
||||
- COM port
|
||||
|
||||
available on STM32WBAxx_Nucleo Kit from STMicroelectronics
|
||||
|
||||
:::
|
||||
|
||||
::: {.col-sm-12 .col-lg-8}
|
||||
# Update History
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section6" checked aria-hidden="true">
|
||||
<label for="collapse-section6" aria-hidden="true">__V1.1.1 / 07-October-2025__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
### Official Release of **STM32CubeWBA** Firmware package supporting **STM32WBA5x** and **STM32WBA6x** devices
|
||||
|
||||
## Contents
|
||||
|
||||
### Official Release of board drivers for **NUCLEO-WBA55CG** and **NUCLEO-WBA65RI** boards
|
||||
|
||||
- **BSP Drivers** are available for the boards :
|
||||
- NUCLEO-WBA55CG (MB1801D-01/MB1803-WBA55CGA-B01)
|
||||
- NUCLEO-WBA65RI (MB1801-USB-D01/MB2130-WBA65RI-A01)
|
||||
- in line with STM32Cube BSP drivers development guidelines (UM2298 - revision 2)
|
||||
|
||||
\
|
||||
|
||||
- **BSP Drivers** updates
|
||||
- Modify the LED pin configuration with no-pull to reduce extra power consumption
|
||||
|
||||
\
|
||||
|
||||
## Known Limitations
|
||||
|
||||
- None
|
||||
|
||||
## Dependencies
|
||||
|
||||
- None
|
||||
|
||||
## Notes
|
||||
|
||||
- stm32wbaxx_nucleo_conf_template.h file must be copied in user application as
|
||||
stm32wbaxx_nucleo_conf.h with optional configuration update
|
||||
|
||||
\
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section5" aria-hidden="true">
|
||||
<label for="collapse-section5" aria-hidden="true">__V1.1.0 / 07-February-2025__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
### Official Release of **STM32CubeWBA** Firmware package supporting **STM32WBA5x** and **STM32WBA6x** devices
|
||||
|
||||
## Contents
|
||||
|
||||
### Official Release of board drivers for **NUCLEO-WBA55CG** and **NUCLEO-WBA65RI** boards
|
||||
|
||||
- **BSP Drivers** are available for the boards :
|
||||
- NUCLEO-WBA55CG (MB1801D-01/MB1803-WBA55CGA-B01)
|
||||
- **NUCLEO-WBA65RI** (MB1801-USB-D01/MB2130-WBA65RI-A01)
|
||||
- in line with STM32Cube BSP drivers development guidelines (UM2298 - revision 2)
|
||||
|
||||
|
||||
## Known Limitations
|
||||
|
||||
- None
|
||||
|
||||
## Dependencies
|
||||
|
||||
- None
|
||||
|
||||
## Notes
|
||||
|
||||
- stm32wbaxx_nucleo_conf_template.h file must be copied in user application as
|
||||
stm32wbaxx_nucleo_conf.h with optional configuration update
|
||||
|
||||
\
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section4" aria-hidden="true">
|
||||
<label for="collapse-section4" aria-hidden="true">__V1.0.3 / 22-October-2024__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
### Official Release of **STM32CubeWBA** Firmware package supporting **STM32WBA55xx** devices
|
||||
|
||||
## Contents
|
||||
|
||||
### Official Release of board drivers for **NUCLEO-WBA55CG** board
|
||||
|
||||
- **BSP Drivers** are available for the boards :
|
||||
- NUCLEO-WBA55CG (MB1801D-01/MB1803-WBA55CGA-B01)
|
||||
- in line with STM32Cube BSP drivers development guidelines (UM2298 - revision 2)
|
||||
|
||||
\
|
||||
|
||||
- **BSP Drivers** updates
|
||||
- No more support of deprecated board NUCLEO-WBA52CG (MB1801A-02/MB1863-WBA52CGA-A03)
|
||||
|
||||
\
|
||||
|
||||
## Known Limitations
|
||||
|
||||
- None
|
||||
|
||||
## Dependencies
|
||||
|
||||
- None
|
||||
|
||||
## Notes
|
||||
|
||||
- stm32wbaxx_nucleo_conf_template.h file must be copied in user application as
|
||||
stm32wbaxx_nucleo_conf.h with optional configuration update
|
||||
|
||||
\
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section3" aria-hidden="true">
|
||||
<label for="collapse-section3" aria-hidden="true">__V1.0.2 / 07-February-2024__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
### Official Release of **STM32CubeWBA** Firmware package supporting **STM32WBA52xx** and **STM32WBA55xx** devices
|
||||
|
||||
## Contents
|
||||
|
||||
### Official Release of board drivers for **NUCLEO-WBA52CG** board and **NUCLEO-WBA55CG** board
|
||||
|
||||
- **BSP Drivers** are available for the boards :
|
||||
- NUCLEO-WBA52CG (MB1801A-02/MB1863-WBA52CGA-A03)
|
||||
- NUCLEO-WBA55CG (MB1801D-01/MB1803-WBA55CGA-B01)
|
||||
- in line with STM32Cube BSP drivers development guidelines (UM2298 - revision 2)
|
||||
|
||||
\
|
||||
|
||||
- **BSP Drivers** updates
|
||||
- Enable internal pull-up for user push-buttons
|
||||
|
||||
\
|
||||
|
||||
## Known Limitations
|
||||
|
||||
- None
|
||||
|
||||
## Dependencies
|
||||
|
||||
- None
|
||||
|
||||
## Notes
|
||||
|
||||
- stm32wbaxx_nucleo_conf_template.h file must be copied in user application as
|
||||
stm32wbaxx_nucleo_conf.h with optional configuration update
|
||||
|
||||
\
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section2" aria-hidden="true">
|
||||
<label for="collapse-section2" aria-hidden="true">__V1.0.1 / 02-November-2023__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
### Official Release of **STM32CubeWBA** Firmware package supporting **STM32WBA52xx** and **STM32WBA55xx** devices
|
||||
|
||||
## Contents
|
||||
|
||||
### Official Release of board drivers for **NUCLEO-WBA52CG** board and **NUCLEO-WBA55CG** board
|
||||
|
||||
- **BSP Drivers** are available for the boards :
|
||||
- NUCLEO-WBA52CG (MB1801A-01/MB1863-WBA52CGA-A03)
|
||||
- NUCLEO-WBA55CG (MB1801A-01/MB1803-WBA55CGA-B01)
|
||||
- in line with STM32Cube BSP drivers development guidelines (UM2298 - revision 2)
|
||||
|
||||
\
|
||||
|
||||
- **BSP Drivers** updates
|
||||
- Fix printf() output redirection for MDK-ARM
|
||||
|
||||
\
|
||||
|
||||
## Known Limitations
|
||||
|
||||
- None
|
||||
|
||||
## Dependencies
|
||||
|
||||
- None
|
||||
|
||||
## Notes
|
||||
|
||||
- stm32wbaxx_nucleo_conf_template.h file must be copied in user application as
|
||||
stm32wbaxx_nucleo_conf.h with optional configuration update
|
||||
|
||||
\
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section1" aria-hidden="true">
|
||||
<label for="collapse-section1" aria-hidden="true">__V1.0.0 / 08-February-2023__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
### First Official Release of **STM32CubeWBA** Firmware package supporting **STM32WBA52xx** devices
|
||||
|
||||
## Contents
|
||||
|
||||
### First Official Release of board drivers for **NUCLEO-WBA52CG** board
|
||||
|
||||
- **BSP Drivers** are available for the boards :
|
||||
- NUCLEO-WBA52CG (MB1801A-01/MB1863-WBA52CGA-A03)
|
||||
- in line with STM32Cube BSP drivers development guidelines (UM2298 - revision 2)
|
||||
|
||||
## Known Limitations
|
||||
|
||||
- None
|
||||
|
||||
## Dependencies
|
||||
|
||||
- None
|
||||
|
||||
## Notes
|
||||
|
||||
- stm32wbaxx_nucleo_conf_template.h file must be copied in user application as
|
||||
stm32wbaxx_nucleo_conf.h with optional configuration update
|
||||
|
||||
\
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
:::
|
||||
:::
|
||||
|
||||
<footer class="sticky">
|
||||
::: {.columns}
|
||||
::: {.column width="95%"}
|
||||
For complete documentation on STM32WBAxx,
|
||||
visit: [www.st.com/stm32wba](http://www.st.com/stm32wba)
|
||||
|
||||
*This release note uses up to date web standards and, for this reason, should not be opened with Internet Explorer but preferably with popular browsers such as Google Chrome, Mozilla Firefox, Opera or Microsoft Edge.*
|
||||
:::
|
||||
::: {.column width="5%"}
|
||||
<abbr title="Based on template cx566953 version 2.0">Info</abbr>
|
||||
:::
|
||||
:::
|
||||
</footer>
|
||||
@@ -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: 832 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 |