Sync inav to Gitea
Make sure docs are updated / settings_md (push) Canceled after 0s
Build firmware / test (push) Canceled after 0s
Build firmware / build-SITL-Windows (push) Canceled after 0s
Build firmware / build-SITL-Mac (push) Canceled after 0s
Build firmware / build-SITL-Linux (push) Canceled after 0s
Build firmware / build-SITL-Linux-arm64 (push) Canceled after 0s
Build firmware / upload-artifacts (push) Canceled after 0s
Build firmware / build-single-target (push) Canceled after 0s
Build firmware / build (9) (push) Canceled after 0s
Build firmware / build (8) (push) Canceled after 0s
Build firmware / build (7) (push) Canceled after 0s
Build firmware / build (6) (push) Canceled after 0s
Build firmware / build (5) (push) Canceled after 0s
Build firmware / build (4) (push) Canceled after 0s
Build firmware / build (3) (push) Canceled after 0s
Build firmware / build (2) (push) Canceled after 0s
Build firmware / build (14) (push) Canceled after 0s
Build firmware / build (13) (push) Canceled after 0s
Build firmware / build (12) (push) Canceled after 0s
Build firmware / build (11) (push) Canceled after 0s
Build firmware / build (10) (push) Canceled after 0s
Build firmware / build (1) (push) Canceled after 0s
Build firmware / build (0) (push) Canceled after 0s
Build firmware / detect (push) Canceled after 0s
Build pre-release / build (push) Canceled after 0s
Build pre-release / Release (push) Canceled after 0s

This commit is contained in:
2026-08-03 16:37:40 +08:00
commit dac37fd077
14095 changed files with 5603119 additions and 0 deletions
@@ -0,0 +1,109 @@
<!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 MFXSTM32L152 Component Drivers</title>
<style type="text/css">
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
</style>
<link rel="stylesheet" href="_htmresc/mini-st.css" />
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
</head>
<body>
<div class="row">
<div class="col-sm-12 col-lg-4">
<div class="card fluid">
<div class="sectione dark">
<center>
<h1 id="release-notes-for-mfxstm32l152-component-drivers"><small>Release Notes for </small> <mark>MFXSTM32L152 Component Drivers</mark></h1>
<p>Copyright © 2015 STMicroelectronics<br />
</p>
<a href="https://www.st.com" class="logo"><img src="_htmresc/st_logo.png" alt="ST logo" /></a>
</center>
</div>
</div>
<h1 id="license">License</h1>
<p>This software component is licensed by ST under BSD 3-Clause license, the “License”; You may not use this component except in compliance with the License. You may obtain a copy of the License at:</p>
<p><a href="https://opensource.org/licenses/BSD-3-Clause">https://opensource.org/licenses/BSD-3-Clause</a></p>
<h1 id="purpose">Purpose</h1>
<p>This driver provides a set of functions needed to drive MFXSTM32L152, IO Expander component</p>
</div>
<div class="col-sm-12 col-lg-8">
<h1 id="update-history">Update History</h1>
<div class="collapse">
<input type="checkbox" id="collapse-section5" checked aria-hidden="true"> <label for="collapse-section5" aria-hidden="true"><strong>V3.0.2 / 30-October-2019</strong></label>
<div>
<h2 id="main-changes">Main Changes</h2>
<ul>
<li>Update st_logo.png inclusion path in Release notes.</li>
</ul>
</div>
</div>
<div class="collapse">
<input type="checkbox" id="collapse-section7" checked aria-hidden="true"> <label for="collapse-section7" aria-hidden="true">V3.0.1 / 18-June-2019</label>
<div>
<h2 id="main-changes-1">Main Changes</h2>
<p>Update MFXSTM32L152_DeInit to avoid disabling IO bus that could be used by others components</p>
</div>
</div>
<div class="collapse">
<input type="checkbox" id="collapse-section6" checked aria-hidden="true"> <label for="collapse-section6" aria-hidden="true">V3.0.0 / 12-April-2019</label>
<div>
<h2 id="main-changes-2">Main Changes</h2>
<h3 id="component-release">Component release</h3>
<p>Official release of component drivers for MFXSTM32L152 in line with STM32Cube BSP drivers development guidelines (UM2298)</p>
<h2 id="backward-compatibility">Backward Compatibility</h2>
<p>This release breaks compatibility with previous versions.</p>
<h2 id="dependencies">Dependencies</h2>
<p>STM32Cube BSP Common drivers V6.0.0</p>
</div>
</div>
<div class="collapse">
<input type="checkbox" id="collapse-section5" aria-hidden="true"> <label for="collapse-section5" aria-hidden="true">V2.0.1 / 02-June-2017</label>
<div>
<h2 id="main-changes-3">Main Changes</h2>
<p>Update comments to be used for PDSC generation</p>
</div>
</div>
<div class="collapse">
<input type="checkbox" id="collapse-section4" aria-hidden="true"> <label for="collapse-section4" aria-hidden="true">V2.0.0 / 24-June-2015</label>
<div>
<h2 id="main-changes-4">Main Changes</h2>
<p>Add Shunt management of MFXSTM32L152 component new mfxstm32l152_IDD_ConfigShuntNbLimit() and mfxstm32l152_IDD_GetShuntUsed() APIs Add mfxstm32l152_WriteReg() API Note: This release must be used with BSP Common driver V4.0.0 or later</p>
</div>
</div>
<div class="collapse">
<input type="checkbox" id="collapse-section3" aria-hidden="true"> <label for="collapse-section3" aria-hidden="true">V1.1.0 / 28-April-2015</label>
<div>
<h2 id="main-changes-5">Main Changes</h2>
<p>mfxstm32l152_IO_Config(): remove unnecessary delay mfxstm32l152_TS_DetectTouch(): improve TouchScreen speed mfxstm32l152_IDD_Config(): add configuration of number of measure to be performed, with delay between 2 measures Note: This release must be used with BSP Common driver V3.0.0</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 / 10-February-2015</label>
<div>
<h2 id="main-changes-6">Main Changes</h2>
<p>Low Power management of MFXSTM32L152 component: New mfxstm32l152_DeInit() and mfxstm32l152_WakeUp() API mfxstm32l152_LowPower() API completed to be MFXSTM32L152 in Standby mode Note: This release must be used with BSP Common driver V2.2.0 or later</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 / 5-February-2015</label>
<div>
<h2 id="main-changes-7">Main Changes</h2>
<p>First official release of MFXSTM32L152 IO Expander component driver. Note: This release must be used with BSP Common driver V2.1.0 or later.</p>
</div>
</div>
</div>
</div>
<footer class="sticky">
For complete documentation on STM32 Microcontrollers , visit: <a href="http://www.st.com/STM32">http://www.st.com/STM32</a>
</footer>
</body>
</html>
@@ -0,0 +1,141 @@
---
pagetitle: Release Notes for MFXSTM32L152 Component Drivers
lang: en
---
::: {.row}
::: {.col-sm-12 .col-lg-4}
::: {.card .fluid}
::: {.sectione .dark}
<center>
# <small>Release Notes for </small> <mark>MFXSTM32L152 Component Drivers</mark>
Copyright &copy; 2015 STMicroelectronics\
[![ST logo](_htmresc/st_logo.png)](https://www.st.com){.logo}
</center>
:::
:::
# License
This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this component except in compliance with the License. You may obtain a copy of the License at:
[https://opensource.org/licenses/BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause)
# Purpose
This driver provides a set of functions needed to drive MFXSTM32L152, IO Expander component
:::
::: {.col-sm-12 .col-lg-8}
# Update History
::: {.collapse}
<input type="checkbox" id="collapse-section5" checked aria-hidden="true">
<label for="collapse-section5" aria-hidden="true">__V3.0.2 / 30-October-2019__</label>
<div>
## Main Changes
- Update st_logo.png inclusion path in Release notes.
</div>
:::
::: {.collapse}
<input type="checkbox" id="collapse-section7" checked aria-hidden="true">
<label for="collapse-section7" aria-hidden="true">V3.0.1 / 18-June-2019</label>
<div>
## Main Changes
Update MFXSTM32L152_DeInit to avoid disabling IO bus that could be used by others components
</div>
:::
::: {.collapse}
<input type="checkbox" id="collapse-section6" checked aria-hidden="true">
<label for="collapse-section6" aria-hidden="true">V3.0.0 / 12-April-2019</label>
<div>
## Main Changes
### Component release
Official release of component drivers for MFXSTM32L152 in line with STM32Cube BSP drivers development guidelines (UM2298)
## Backward Compatibility
This release breaks compatibility with previous versions.
## Dependencies
STM32Cube BSP Common drivers V6.0.0
</div>
:::
::: {.collapse}
<input type="checkbox" id="collapse-section5" aria-hidden="true">
<label for="collapse-section5" aria-hidden="true">V2.0.1 / 02-June-2017</label>
<div>
## Main Changes
Update comments to be used for PDSC generation
</div>
:::
::: {.collapse}
<input type="checkbox" id="collapse-section4" aria-hidden="true">
<label for="collapse-section4" aria-hidden="true">V2.0.0 / 24-June-2015</label>
<div>
## Main Changes
Add Shunt management of MFXSTM32L152 component
new mfxstm32l152_IDD_ConfigShuntNbLimit() and mfxstm32l152_IDD_GetShuntUsed() APIs
Add mfxstm32l152_WriteReg() API
Note: This release must be used with BSP Common driver V4.0.0 or later
</div>
:::
::: {.collapse}
<input type="checkbox" id="collapse-section3" aria-hidden="true">
<label for="collapse-section3" aria-hidden="true">V1.1.0 / 28-April-2015</label>
<div>
## Main Changes
mfxstm32l152_IO_Config(): remove unnecessary delay
mfxstm32l152_TS_DetectTouch(): improve TouchScreen speed
mfxstm32l152_IDD_Config(): add configuration of number of measure to be performed, with delay between 2 measures
Note: This release must be used with BSP Common driver V3.0.0
</div>
:::
::: {.collapse}
<input type="checkbox" id="collapse-section2" aria-hidden="true">
<label for="collapse-section2" aria-hidden="true">V1.1.0 / 10-February-2015</label>
<div>
## Main Changes
Low Power management of MFXSTM32L152 component:
New mfxstm32l152_DeInit() and mfxstm32l152_WakeUp() API
mfxstm32l152_LowPower() API completed to be MFXSTM32L152 in Standby mode
Note: This release must be used with BSP Common driver V2.2.0 or later
</div>
:::
::: {.collapse}
<input type="checkbox" id="collapse-section1" aria-hidden="true">
<label for="collapse-section1" aria-hidden="true">V1.0.0 / 5-February-2015</label>
<div>
## Main Changes
First official release of MFXSTM32L152 IO Expander component driver.
Note: This release must be used with BSP Common driver V2.1.0 or later.
</div>
:::
:::
:::
<footer class="sticky">
For complete documentation on STM32 Microcontrollers ,
visit: [http://www.st.com/STM32](http://www.st.com/STM32)
</footer>
File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

File diff suppressed because it is too large Load Diff
@@ -0,0 +1,464 @@
/**
******************************************************************************
* @file mfxstm32l152.h
* @author MCD Application Team
* @brief This file contains all the functions prototypes for the
* mfxstm32l152.c IO expander driver.
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef MFXSTM32L152_H
#define MFXSTM32L152_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "mfxstm32l152_reg.h"
#include <stddef.h>
/** @addtogroup BSP
* @{
*/
/** @addtogroup Component
* @{
*/
/** @defgroup MFXSTM32L152
* @{
*/
/* Exported types ------------------------------------------------------------*/
/** @defgroup MFXSTM32L152_Exported_Types MFXSTM32L152 Exported Types
* @{
*/
typedef struct
{
uint32_t Pin; /*!< Specifies the GPIO pins to be configured.
This parameter can be any value of @ref GPIO_pins_define */
uint32_t Mode; /*!< Specifies the operating mode for the selected pins.
This parameter can be a value of @ref IO_ModeTypedef */
uint32_t Pull; /*!< Specifies the Pull-up or Pull-Down activation for the selected pins.
This parameter can be a value of @ref GPIO_pull_define */
}MFXSTM32L152_IO_Init_t;
typedef struct
{
uint16_t AmpliGain; /*!< Specifies ampli gain value
*/
uint16_t VddMin; /*!< Specifies minimum MCU VDD can reach to protect MCU from reset
*/
uint16_t Shunt0Value; /*!< Specifies value of Shunt 0 if existing
*/
uint16_t Shunt1Value; /*!< Specifies value of Shunt 1 if existing
*/
uint16_t Shunt2Value; /*!< Specifies value of Shunt 2 if existing
*/
uint16_t Shunt3Value; /*!< Specifies value of Shunt 3 if existing
*/
uint16_t Shunt4Value; /*!< Specifies value of Shunt 4 if existing
*/
uint16_t Shunt0StabDelay; /*!< Specifies delay of Shunt 0 stabilization if existing
*/
uint16_t Shunt1StabDelay; /*!< Specifies delay of Shunt 1 stabilization if existing
*/
uint16_t Shunt2StabDelay; /*!< Specifies delay of Shunt 2 stabilization if existing
*/
uint16_t Shunt3StabDelay; /*!< Specifies delay of Shunt 3 stabilization if existing
*/
uint16_t Shunt4StabDelay; /*!< Specifies delay of Shunt 4 stabilization if existing
*/
uint8_t ShuntNbOnBoard; /*!< Specifies number of shunts that are present on board
This parameter can be a value of @ref IDD_shunt_number */
uint8_t ShuntNbUsed; /*!< Specifies number of shunts used for measurement
This parameter can be a value of @ref IDD_shunt_number */
uint8_t VrefMeasurement; /*!< Specifies if Vref is automatically measured before each Idd measurement
This parameter can be a value of @ref IDD_Vref_Measurement */
uint8_t Calibration; /*!< Specifies if calibration is done before each Idd measurement
*/
uint8_t PreDelayUnit; /*!< Specifies Pre delay unit
This parameter can be a value of @ref IDD_PreDelay */
uint8_t PreDelayValue; /*!< Specifies Pre delay value in selected unit
*/
uint8_t MeasureNb; /*!< Specifies number of Measure to be performed
This parameter can be a value between 1 and 256 */
uint8_t DeltaDelayUnit; /*!< Specifies Delta delay unit
This parameter can be a value of @ref IDD_DeltaDelay */
uint8_t DeltaDelayValue; /*!< Specifies Delta delay between 2 measures
value can be between 1 and 128 */
}MFXSTM32L152_IDD_Config_t;
typedef int32_t (*MFXSTM32L152_Init_Func) (void);
typedef int32_t (*MFXSTM32L152_DeInit_Func) (void);
typedef int32_t (*MFXSTM32L152_GetTick_Func) (void);
typedef int32_t (*MFXSTM32L152_Delay_Func) (uint32_t);
typedef int32_t (*MFXSTM32L152_WriteReg_Func)(uint16_t, uint16_t, uint8_t*, uint16_t);
typedef int32_t (*MFXSTM32L152_ReadReg_Func) (uint16_t, uint16_t, uint8_t*, uint16_t);
typedef struct
{
MFXSTM32L152_Init_Func Init;
MFXSTM32L152_DeInit_Func DeInit;
uint16_t Address;
MFXSTM32L152_WriteReg_Func WriteReg;
MFXSTM32L152_ReadReg_Func ReadReg;
MFXSTM32L152_GetTick_Func GetTick;
} MFXSTM32L152_IO_t;
typedef struct
{
MFXSTM32L152_IO_t IO;
mfxstm32l152_ctx_t Ctx;
uint8_t IsInitialized;
} MFXSTM32L152_Object_t;
/* Touch screen driver structure initialization */
typedef struct
{
int32_t ( *Init )(MFXSTM32L152_Object_t *);
int32_t ( *ReadID )(MFXSTM32L152_Object_t *, uint32_t*);
int32_t ( *Reset )(MFXSTM32L152_Object_t *);
int32_t ( *TS_Start )(MFXSTM32L152_Object_t *);
int32_t ( *TS_DetectTouch )(MFXSTM32L152_Object_t *);
int32_t ( *TS_GetXY )(MFXSTM32L152_Object_t *, uint16_t*, uint16_t*);
int32_t ( *TS_EnableIT )(MFXSTM32L152_Object_t *);
int32_t ( *TS_ClearIT )(MFXSTM32L152_Object_t *);
int32_t ( *TS_ITStatus )(MFXSTM32L152_Object_t *);
int32_t ( *TS_DisableIT )(MFXSTM32L152_Object_t *);
}MFXSTM32L152_TS_Mode_t;
/* IO driver structure initialization */
typedef struct
{
int32_t ( *Init )(MFXSTM32L152_Object_t *, MFXSTM32L152_IO_Init_t *);
int32_t ( *DeInit )(MFXSTM32L152_Object_t *);
int32_t ( *ReadID )(MFXSTM32L152_Object_t *, uint32_t*);
int32_t ( *Reset )(MFXSTM32L152_Object_t *);
int32_t ( *IO_Start )(MFXSTM32L152_Object_t *, uint32_t);
int32_t ( *IO_WritePin )(MFXSTM32L152_Object_t *, uint32_t, uint8_t);
int32_t ( *IO_ReadPin )(MFXSTM32L152_Object_t *, uint32_t);
int32_t ( *IO_EnableIT )(MFXSTM32L152_Object_t *);
int32_t ( *IO_DisableIT )(MFXSTM32L152_Object_t *);
int32_t ( *IO_ITStatus )(MFXSTM32L152_Object_t *, uint32_t);
int32_t ( *IO_ClearIT )(MFXSTM32L152_Object_t *, uint32_t);
}MFXSTM32L152_IO_Mode_t;
/* IDD driver structure initialization */
typedef struct
{
int32_t ( *Init )(MFXSTM32L152_Object_t *);
int32_t ( *DeInit )(MFXSTM32L152_Object_t *);
int32_t ( *ReadID )(MFXSTM32L152_Object_t *, uint32_t*);
int32_t ( *Reset )(MFXSTM32L152_Object_t *);
int32_t ( *LowPower )(MFXSTM32L152_Object_t *);
int32_t ( *WakeUp )(MFXSTM32L152_Object_t *);
int32_t ( *IDD_Start )(MFXSTM32L152_Object_t *);
int32_t ( *IDD_Config )(MFXSTM32L152_Object_t *, MFXSTM32L152_IDD_Config_t*);
int32_t ( *IDD_GetValue )(MFXSTM32L152_Object_t *, uint32_t*);
int32_t ( *IDD_EnableIT )(MFXSTM32L152_Object_t *);
int32_t ( *IDD_DisableIT )(MFXSTM32L152_Object_t *);
int32_t ( *IDD_GetITStatus )(MFXSTM32L152_Object_t *);
int32_t ( *IDD_ClearIT )(MFXSTM32L152_Object_t *);
int32_t ( *Error_EnableIT )(MFXSTM32L152_Object_t *);
int32_t ( *Error_ClearIT )(MFXSTM32L152_Object_t *);
int32_t ( *Error_GetITStatus )(MFXSTM32L152_Object_t *);
int32_t ( *Error_DisableIT )(MFXSTM32L152_Object_t *);
int32_t ( *Error_ReadSrc )(MFXSTM32L152_Object_t *);
int32_t ( *Error_ReadMsg )(MFXSTM32L152_Object_t *);
}MFXSTM32L152_IDD_Mode_t;
/**
* @}
*/
/* Exported constants --------------------------------------------------------*/
/** @defgroup MFXSTM32L152_Exported_Constants MFXSTM32L152 Exported Constants
* @{
*/
#define MFXSTM32L152_OK (0)
#define MFXSTM32L152_ERROR (-1)
/* MFXSTM32L152_REG_ADR_ID values */
#define MFXSTM32L152_ID 0x7BU
#define MFXSTM32L152_ID_2 0x79U
/* MFXSTM32L152_REG_ADR_SYS_CTRL values */
#define MFXSTM32L152_SWRST 0x80U
#define MFXSTM32L152_STANDBY 0x40U
#define MFXSTM32L152_ALTERNATE_GPIO_EN 0x08U /* If IDD and TS are enabled they take automatically the AF pins*/
#define MFXSTM32L152_IDD_EN 0x04U
#define MFXSTM32L152_TS_EN 0x02U
#define MFXSTM32L152_GPIO_EN 0x01U
/* MFXSTM32L152_REG_ADR_ERROR_SRC values */
#define MFXSTM32L152_IDD_ERROR_SRC 0x04U /* Error raised by Idd */
#define MFXSTM32L152_TS_ERROR_SRC 0x02U /* Error raised by Touch Screen */
#define MFXSTM32L152_GPIO_ERROR_SRC 0x01U /* Error raised by Gpio */
/* MFXSTM32L152_REG_ADR_MFX_IRQ_OUT values */
#define MFXSTM32L152_OUT_PIN_TYPE_OPENDRAIN 0x00U
#define MFXSTM32L152_OUT_PIN_TYPE_PUSHPULL 0x01U
#define MFXSTM32L152_OUT_PIN_POLARITY_LOW 0x00U
#define MFXSTM32L152_OUT_PIN_POLARITY_HIGH 0x02U
/* REG_ADR_IRQ_SRC_EN, REG_ADR_IRQ_PENDING & REG_ADR_IRQ_ACK values */
#define MFXSTM32L152_IRQ_TS_OVF 0x80U /* TouchScreen FIFO Overflow irq*/
#define MFXSTM32L152_IRQ_TS_FULL 0x40U /* TouchScreen FIFO Full irq*/
#define MFXSTM32L152_IRQ_TS_TH 0x20U /* TouchScreen FIFO threshold triggered irq*/
#define MFXSTM32L152_IRQ_TS_NE 0x10U /* TouchScreen FIFO Not Empty irq*/
#define MFXSTM32L152_IRQ_TS_DET 0x08U /* TouchScreen Detect irq*/
#define MFXSTM32L152_IRQ_ERROR 0x04U /* Error message from MFXSTM32L152 firmware irq */
#define MFXSTM32L152_IRQ_IDD 0x02U /* IDD function irq */
#define MFXSTM32L152_IRQ_GPIO 0x01U /* General GPIO irq (only for SRC_EN and PENDING) */
#define MFXSTM32L152_IRQ_ALL 0xFFU /* All global interrupts */
#define MFXSTM32L152_IRQ_TS (MFXSTM32L152_IRQ_TS_DET | MFXSTM32L152_IRQ_TS_NE | MFXSTM32L152_IRQ_TS_TH | MFXSTM32L152_IRQ_TS_FULL | MFXSTM32L152_IRQ_TS_OVF)
/* GPIO: IO Pins definition */
#define MFXSTM32L152_GPIO_PIN_0 0x0001U
#define MFXSTM32L152_GPIO_PIN_1 0x0002U
#define MFXSTM32L152_GPIO_PIN_2 0x0004U
#define MFXSTM32L152_GPIO_PIN_3 0x0008U
#define MFXSTM32L152_GPIO_PIN_4 0x0010U
#define MFXSTM32L152_GPIO_PIN_5 0x0020U
#define MFXSTM32L152_GPIO_PIN_6 0x0040U
#define MFXSTM32L152_GPIO_PIN_7 0x0080U
#define MFXSTM32L152_GPIO_PIN_8 0x0100U
#define MFXSTM32L152_GPIO_PIN_9 0x0200U
#define MFXSTM32L152_GPIO_PIN_10 0x0400U
#define MFXSTM32L152_GPIO_PIN_11 0x0800U
#define MFXSTM32L152_GPIO_PIN_12 0x1000U
#define MFXSTM32L152_GPIO_PIN_13 0x2000U
#define MFXSTM32L152_GPIO_PIN_14 0x4000U
#define MFXSTM32L152_GPIO_PIN_15 0x8000U
#define MFXSTM32L152_GPIO_PIN_16 0x010000U
#define MFXSTM32L152_GPIO_PIN_17 0x020000U
#define MFXSTM32L152_GPIO_PIN_18 0x040000U
#define MFXSTM32L152_GPIO_PIN_19 0x080000U
#define MFXSTM32L152_GPIO_PIN_20 0x100000U
#define MFXSTM32L152_GPIO_PIN_21 0x200000U
#define MFXSTM32L152_GPIO_PIN_22 0x400000U
#define MFXSTM32L152_GPIO_PIN_23 0x800000U
#define MFXSTM32L152_AGPIO_PIN_0 MFXSTM32L152_GPIO_PIN_16
#define MFXSTM32L152_AGPIO_PIN_1 MFXSTM32L152_GPIO_PIN_17
#define MFXSTM32L152_AGPIO_PIN_2 MFXSTM32L152_GPIO_PIN_18
#define MFXSTM32L152_AGPIO_PIN_3 MFXSTM32L152_GPIO_PIN_19
#define MFXSTM32L152_AGPIO_PIN_4 MFXSTM32L152_GPIO_PIN_20
#define MFXSTM32L152_AGPIO_PIN_5 MFXSTM32L152_GPIO_PIN_21
#define MFXSTM32L152_AGPIO_PIN_6 MFXSTM32L152_GPIO_PIN_22
#define MFXSTM32L152_AGPIO_PIN_7 MFXSTM32L152_GPIO_PIN_23
#define MFXSTM32L152_GPIO_PINS_ALL 0xFFFFFFU
/* GPIO: constant */
#define MFXSTM32L152_GPIO_DIR_IN 0x0U
#define MFXSTM32L152_GPIO_DIR_OUT 0x1U
#define MFXSTM32L152_IRQ_GPI_EVT_LEVEL 0x0U
#define MFXSTM32L152_IRQ_GPI_EVT_EDGE 0x1U
#define MFXSTM32L152_IRQ_GPI_TYPE_LLFE 0x0U /* Low Level Falling Edge */
#define MFXSTM32L152_IRQ_GPI_TYPE_HLRE 0x1U /*High Level Raising Edge */
#define MFXSTM32L152_GPI_WITHOUT_PULL_RESISTOR 0x0U
#define MFXSTM32L152_GPI_WITH_PULL_RESISTOR 0x1U
#define MFXSTM32L152_GPO_PUSH_PULL 0x0U
#define MFXSTM32L152_GPO_OPEN_DRAIN 0x1U
#define MFXSTM32L152_GPIO_PULL_DOWN 0x0U
#define MFXSTM32L152_GPIO_PULL_UP 0x1U
#define MFXSTM32L152_GPIO_NOPULL 0x0U /*!< No Pull-up or Pull-down activation */
#define MFXSTM32L152_GPIO_PULLUP 0x1U /*!< Pull-up activation */
#define MFXSTM32L152_GPIO_PULLDOWN 0x2U /*!< Pull-down activation */
#define MFXSTM32L152_GPIO_MODE_OFF 0x0U /* when pin isn't used*/
#define MFXSTM32L152_GPIO_MODE_ANALOG 0x1U /* analog mode */
#define MFXSTM32L152_GPIO_MODE_INPUT 0x2U /* input floating */
#define MFXSTM32L152_GPIO_MODE_OUTPUT_OD 0x3U /* Open Drain output without internal resistor */
#define MFXSTM32L152_GPIO_MODE_OUTPUT_PP 0x4U /* PushPull output without internal resistor */
#define MFXSTM32L152_GPIO_MODE_IT_RISING_EDGE 0x5U /* float input - irq detect on rising edge */
#define MFXSTM32L152_GPIO_MODE_IT_FALLING_EDGE 0x6U /* float input - irq detect on falling edge */
#define MFXSTM32L152_GPIO_MODE_IT_LOW_LEVEL 0x7U /* float input - irq detect on low level */
#define MFXSTM32L152_GPIO_MODE_IT_HIGH_LEVEL 0x8U /* float input - irq detect on high level */
/* TS registers masks */
#define MFXSTM32L152_TS_CTRL_STATUS 0x08U
#define MFXSTM32L152_TS_CLEAR_FIFO 0x80U
/** @defgroup IDD_Control_Register_Defines IDD Control Register Defines
* @{
*/
/* IDD control register masks */
#define MFXSTM32L152_IDD_CTRL_REQ 0x01U
#define MFXSTM32L152_IDD_CTRL_SHUNT_NB 0x0EU
#define MFXSTM32L152_IDD_CTRL_VREF_DIS 0x40U
#define MFXSTM32L152_IDD_CTRL_CAL_DIS 0x80U
/* IDD Shunt Number */
#define MFXSTM32L152_IDD_SHUNT_NB_1 0x01U
#define MFXSTM32L152_IDD_SHUNT_NB_2 0x02U
#define MFXSTM32L152_IDD_SHUNT_NB_3 0x03U
#define MFXSTM32L152_IDD_SHUNT_NB_4 0x04U
#define MFXSTM32L152_IDD_SHUNT_NB_5 0x05U
/* Vref Measurement */
#define MFXSTM32L152_IDD_VREF_AUTO_MEASUREMENT_ENABLE 0x00U
#define MFXSTM32L152_IDD_VREF_AUTO_MEASUREMENT_DISABLE 0x70U
/* IDD Calibration */
#define MFXSTM32L152_IDD_AUTO_CALIBRATION_ENABLE 0x00U
#define MFXSTM32L152_IDD_AUTO_CALIBRATION_DISABLE 0x80U
/**
* @}
*/
/** @defgroup IDD_PreDelay_Defines IDD PreDelay Defines
* @{
*/
/* IDD PreDelay masks */
#define MFXSTM32L152_IDD_PREDELAY_UNIT 0x80U
#define MFXSTM32L152_IDD_PREDELAY_VALUE 0x7FU
/* IDD PreDelay unit */
#define MFXSTM32L152_IDD_PREDELAY_0_5_MS 0x00U
#define MFXSTM32L152_IDD_PREDELAY_20_MS 0x80U
/**
* @}
*/
/** @defgroup IDD_DeltaDelay_Defines IDD Delta DElay Defines
* @{
*/
/* IDD Delta Delay masks */
#define MFXSTM32L152_IDD_DELTADELAY_UNIT 0x80U
#define MFXSTM32L152_IDD_DELTADELAY_VALUE 0x7FU
/* IDD Delta Delay unit */
#define MFXSTM32L152_IDD_DELTADELAY_0_5_MS 0x00U
#define MFXSTM32L152_IDD_DELTADELAY_20_MS 0x80U
/**
* @}
*/
/**
* @}
*/
/** @addtogroup MFXSTM32L152_Exported_Functions
* @{
*/
/* MFXSTM32L152 Control functions */
int32_t MFXSTM32L152_RegisterBusIO (MFXSTM32L152_Object_t *pObj, MFXSTM32L152_IO_t *pIO);
int32_t MFXSTM32L152_Init(MFXSTM32L152_Object_t *pObj);
int32_t MFXSTM32L152_DeInit(MFXSTM32L152_Object_t *pObj);
int32_t MFXSTM32L152_Reset(MFXSTM32L152_Object_t *pObj);
int32_t MFXSTM32L152_ReadID(MFXSTM32L152_Object_t *pObj, uint32_t *Id);
int32_t MFXSTM32L152_ReadFwVersion(MFXSTM32L152_Object_t *pObj);
int32_t MFXSTM32L152_LowPower(MFXSTM32L152_Object_t *pObj);
int32_t MFXSTM32L152_WakeUp(MFXSTM32L152_Object_t *pObj);
int32_t MFXSTM32L152_EnableITSource(MFXSTM32L152_Object_t *pObj, uint8_t Source);
int32_t MFXSTM32L152_DisableITSource(MFXSTM32L152_Object_t *pObj, uint8_t Source);
int32_t MFXSTM32L152_GlobalITStatus(MFXSTM32L152_Object_t *pObj, uint8_t Source);
int32_t MFXSTM32L152_ClearGlobalIT(MFXSTM32L152_Object_t *pObj, uint8_t Source);
int32_t MFXSTM32L152_SetIrqOutPinPolarity(MFXSTM32L152_Object_t *pObj, uint8_t Polarity);
int32_t MFXSTM32L152_SetIrqOutPinType(MFXSTM32L152_Object_t *pObj, uint8_t Type);
/* MFXSTM32L152 IO functionalities functions */
int32_t MFXSTM32L152_IO_Init(MFXSTM32L152_Object_t *pObj, MFXSTM32L152_IO_Init_t *IoInit);
int32_t MFXSTM32L152_IO_Start(MFXSTM32L152_Object_t *pObj, uint32_t IO_Pin);
int32_t MFXSTM32L152_IO_WritePin(MFXSTM32L152_Object_t *pObj, uint32_t IO_Pin, uint8_t PinState);
int32_t MFXSTM32L152_IO_ReadPin(MFXSTM32L152_Object_t *pObj, uint32_t IO_Pin);
int32_t MFXSTM32L152_IO_EnableIT(MFXSTM32L152_Object_t *pObj);
int32_t MFXSTM32L152_IO_DisableIT(MFXSTM32L152_Object_t *pObj);
int32_t MFXSTM32L152_IO_ITStatus(MFXSTM32L152_Object_t *pObj, uint32_t IO_Pin);
int32_t MFXSTM32L152_IO_ClearIT(MFXSTM32L152_Object_t *pObj, uint32_t IO_Pin);
int32_t MFXSTM32L152_IO_InitPin(MFXSTM32L152_Object_t *pObj, uint32_t IO_Pin, uint8_t Direction);
int32_t MFXSTM32L152_IO_EnableAF(MFXSTM32L152_Object_t *pObj);
int32_t MFXSTM32L152_IO_DisableAF(MFXSTM32L152_Object_t *pObj);
int32_t MFXSTM32L152_IO_SetIrqTypeMode(MFXSTM32L152_Object_t *pObj, uint32_t IO_Pin, uint8_t Type);
int32_t MFXSTM32L152_IO_SetIrqEvtMode(MFXSTM32L152_Object_t *pObj, uint32_t IO_Pin, uint8_t Evt);
int32_t MFXSTM32L152_IO_EnablePinIT(MFXSTM32L152_Object_t *pObj, uint32_t IO_Pin);
int32_t MFXSTM32L152_IO_DisablePinIT(MFXSTM32L152_Object_t *pObj, uint32_t IO_Pin);
/* MFXSTM32L152 Touch screen functionalities functions */
int32_t MFXSTM32L152_TS_Start(MFXSTM32L152_Object_t *pObj);
int32_t MFXSTM32L152_TS_DetectTouch(MFXSTM32L152_Object_t *pObj);
int32_t MFXSTM32L152_TS_GetXY(MFXSTM32L152_Object_t *pObj, uint16_t *X, uint16_t *Y);
int32_t MFXSTM32L152_TS_EnableIT(MFXSTM32L152_Object_t *pObj);
int32_t MFXSTM32L152_TS_DisableIT(MFXSTM32L152_Object_t *pObj);
int32_t MFXSTM32L152_TS_ITStatus (MFXSTM32L152_Object_t *pObj);
int32_t MFXSTM32L152_TS_ClearIT (MFXSTM32L152_Object_t *pObj);
/* MFXSTM32L152 IDD current measurement functionalities functions */
int32_t MFXSTM32L152_IDD_Start(MFXSTM32L152_Object_t *pObj);
int32_t MFXSTM32L152_IDD_Config(MFXSTM32L152_Object_t *pObj, MFXSTM32L152_IDD_Config_t * MfxIddConfig);
int32_t MFXSTM32L152_IDD_ConfigShuntNbLimit(MFXSTM32L152_Object_t *pObj, uint8_t ShuntNbLimit);
int32_t MFXSTM32L152_IDD_GetValue(MFXSTM32L152_Object_t *pObj, uint32_t *ReadValue);
int32_t MFXSTM32L152_IDD_GetShuntUsed(MFXSTM32L152_Object_t *pObj);
int32_t MFXSTM32L152_IDD_EnableIT(MFXSTM32L152_Object_t *pObj);
int32_t MFXSTM32L152_IDD_ClearIT(MFXSTM32L152_Object_t *pObj);
int32_t MFXSTM32L152_IDD_GetITStatus(MFXSTM32L152_Object_t *pObj);
int32_t MFXSTM32L152_IDD_DisableIT(MFXSTM32L152_Object_t *pObj);
/* MFXSTM32L152 Error management functions */
int32_t MFXSTM32L152_Error_ReadSrc(MFXSTM32L152_Object_t *pObj);
int32_t MFXSTM32L152_Error_ReadMsg(MFXSTM32L152_Object_t *pObj);
int32_t MFXSTM32L152_Error_EnableIT(MFXSTM32L152_Object_t *pObj);
int32_t MFXSTM32L152_Error_ClearIT(MFXSTM32L152_Object_t *pObj);
int32_t MFXSTM32L152_Error_GetITStatus(MFXSTM32L152_Object_t *pObj);
int32_t MFXSTM32L152_Error_DisableIT(MFXSTM32L152_Object_t *pObj);
/**
* @}
*/
/* Touch screen driver structure */
extern MFXSTM32L152_TS_Mode_t MFXSTM32L152_TS_Driver;
/* IO driver structure */
extern MFXSTM32L152_IO_Mode_t MFXSTM32L152_IO_Driver;
/* IDD driver structure */
extern MFXSTM32L152_IDD_Mode_t MFXSTM32L152_IDD_Driver;
#ifdef __cplusplus
}
#endif
#endif /* MFXSTM32L152_H */
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
@@ -0,0 +1,78 @@
/**
******************************************************************************
* @file mfxstm32l152_reg.c
* @author MCD Application Team
* @brief This file provides a set of functions needed to manage the MFXSTM32L152
* IO Expander devices.
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "mfxstm32l152_reg.h"
/** @addtogroup BSP
* @{
*/
/** @addtogroup Component
* @{
*/
/** @addtogroup MFXSTM32L152
* @{
*/
/** @addtogroup MFXSTM32L152_Exported_Functions
* @{
*/
/*******************************************************************************
* Function Name : mfxstm32l152_read_reg
* Description : Generic Reading function. It must be fullfilled with either
* I2C or SPI reading functions
* Input : Register Address, length of buffer
* Output : Data Read
*******************************************************************************/
int32_t mfxstm32l152_read_reg(mfxstm32l152_ctx_t *ctx, uint16_t reg, uint8_t* data, uint16_t length)
{
return ctx->ReadReg(ctx->handle, reg, data, length);
}
/*******************************************************************************
* Function Name : mfxstm32l152_write_reg
* Description : Generic Writing function. It must be fullfilled with either
* I2C or SPI writing function
* Input : Register Address, Data to be written, length of buffer
* Output : None
*******************************************************************************/
int32_t mfxstm32l152_write_reg(mfxstm32l152_ctx_t *ctx, uint16_t reg, uint8_t* data, uint16_t length)
{
return ctx->WriteReg(ctx->handle, reg, data, length);
}
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
@@ -0,0 +1,324 @@
/**
******************************************************************************
* @file mfxstm32l152_reg.h
* @author MCD Application Team
* @brief This file contains all the functions prototypes for the
* mfxstm32l152_reg.c IO expander driver.
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef MFXSTM32L152_REG_H
#define MFXSTM32L152_REG_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
/* Includes ------------------------------------------------------------------*/
/** @addtogroup BSP
* @{
*/
/** @addtogroup Component
* @{
*/
/** @defgroup MFXSTM32L152
* @{
*/
/** @addtogroup MFXSTM32L152_Exported_Constants
* @{
*/
/**
* @brief Register address: chip IDs (R)
*/
#define MFXSTM32L152_REG_ADR_ID 0x00U
/**
* @brief Register address: chip FW_VERSION (R)
*/
#define MFXSTM32L152_REG_ADR_FW_VERSION_MSB 0x01U
#define MFXSTM32L152_REG_ADR_FW_VERSION_LSB 0x00U
/**
* @brief Register address: System Control Register (R/W)
*/
#define MFXSTM32L152_REG_ADR_SYS_CTRL 0x40U
/**
* @brief Register address: Vdd monitoring (R)
*/
#define MFXSTM32L152_REG_ADR_VDD_REF_MSB 0x06U
#define MFXSTM32L152_REG_ADR_VDD_REF_LSB 0x07U
/**
* @brief Register address: Error source
*/
#define MFXSTM32L152_REG_ADR_ERROR_SRC 0x03U
/**
* @brief Register address: Error Message
*/
#define MFXSTM32L152_REG_ADR_ERROR_MSG 0x04U
/**
* @brief Reg Addr IRQs: to config the pin that informs Main MCU that MFX events appear
*/
#define MFXSTM32L152_REG_ADR_MFX_IRQ_OUT 0x41U
/**
* @brief Reg Addr IRQs: to select the events which activate the MFXSTM32L152_IRQ_OUT signal
*/
#define MFXSTM32L152_REG_ADR_IRQ_SRC_EN 0x42U
/**
* @brief Reg Addr IRQs: the Main MCU must read the IRQ_PENDING register to know the interrupt reason
*/
#define MFXSTM32L152_REG_ADR_IRQ_PENDING 0x08U
/**
* @brief Reg Addr IRQs: the Main MCU must acknowledge it thanks to a writing access to the IRQ_ACK register
*/
#define MFXSTM32L152_REG_ADR_IRQ_ACK 0x44U
/**
* @brief GPIO: 24 programmable input/output called MFXSTM32L152_GPIO[23:0] are provided
*/
/**
* @brief Reg addr: GPIO DIRECTION (R/W): GPIO pins direction: (0) input, (1) output.
*/
#define MFXSTM32L152_REG_ADR_GPIO_DIR1 0x60U /* gpio [0:7] */
#define MFXSTM32L152_REG_ADR_GPIO_DIR2 0x61U /* gpio [8:15] */
#define MFXSTM32L152_REG_ADR_GPIO_DIR3 0x62U /* agpio [0:7] */
/**
* @brief Reg addr: GPIO TYPE (R/W): If GPIO in output: (0) output push pull, (1) output open drain.
If GPIO in input: (0) input without pull resistor, (1) input with pull resistor.
*/
#define MFXSTM32L152_REG_ADR_GPIO_TYPE1 0x64U /* gpio [0:7] */
#define MFXSTM32L152_REG_ADR_GPIO_TYPE2 0x65U /* gpio [8:15] */
#define MFXSTM32L152_REG_ADR_GPIO_TYPE3 0x66U /* agpio [0:7] */
/**
* @brief Reg addr: GPIO PULL_UP_PULL_DOWN (R/W)
*/
#define MFXSTM32L152_REG_ADR_GPIO_PUPD1 0x68U /* gpio [0:7] */
#define MFXSTM32L152_REG_ADR_GPIO_PUPD2 0x69U /* gpio [8:15] */
#define MFXSTM32L152_REG_ADR_GPIO_PUPD3 0x6AU /* agpio [0:7] */
/**
* @brief Reg addr: GPIO SET (W): When GPIO is in output mode, write (1) puts
the corresponding GPO in High level.
*/
#define MFXSTM32L152_REG_ADR_GPO_SET1 0x6CU /* gpio [0:7] */
#define MFXSTM32L152_REG_ADR_GPO_SET2 0x6DU /* gpio [8:15] */
#define MFXSTM32L152_REG_ADR_GPO_SET3 0x6EU /* agpio [0:7] */
/**
* @brief Reg addr: GPIO CLEAR (W): When GPIO is in output mode, write (1) puts
the corresponding GPO in Low level.
*/
#define MFXSTM32L152_REG_ADR_GPO_CLR1 0x70U /* gpio [0:7] */
#define MFXSTM32L152_REG_ADR_GPO_CLR2 0x71U /* gpio [8:15] */
#define MFXSTM32L152_REG_ADR_GPO_CLR3 0x72U /* agpio [0:7] */
/**
* @brief Reg addr: GPIO STATE (R): Give state of the GPIO pin.
*/
#define MFXSTM32L152_REG_ADR_GPIO_STATE1 0x10U /* gpio [0:7] */
#define MFXSTM32L152_REG_ADR_GPIO_STATE2 0x11U /* gpio [8:15] */
#define MFXSTM32L152_REG_ADR_GPIO_STATE3 0x12U /* agpio [0:7] */
/* GPIOs can INDIVIDUALLY generate interruption to the Main MCU thanks to the MFXSTM32L152_IRQ_OUT signal */
/* the general MFXSTM32L152_IRQ_GPIO_SRC_EN shall be enabled too */
/* GPIO IRQ_GPI_SRC1/2/3 (R/W): registers enable or not the feature to generate irq */
#define MFXSTM32L152_REG_ADR_IRQ_GPI_SRC1 0x48U /* gpio [0:7] */
#define MFXSTM32L152_REG_ADR_IRQ_GPI_SRC2 0x49U /* gpio [8:15] */
#define MFXSTM32L152_REG_ADR_IRQ_GPI_SRC3 0x4AU /* agpio [0:7] */
/**
* @brief GPIO IRQ_GPI_EVT1/2/3 (R/W): Irq generated on level (0) or edge (1).
*/
#define MFXSTM32L152_REG_ADR_IRQ_GPI_EVT1 0x4CU /* gpio [0:7] */
#define MFXSTM32L152_REG_ADR_IRQ_GPI_EVT2 0x4DU /* gpio [8:15] */
#define MFXSTM32L152_REG_ADR_IRQ_GPI_EVT3 0x4EU /* agpio [0:7] */
/**
* @brief GPIO IRQ_GPI_TYPE1/2/3 (R/W): Irq generated on (0) : Low level or Falling edge.
(1) : High level or Rising edge.
*/
#define MFXSTM32L152_REG_ADR_IRQ_GPI_TYPE1 0x50U /* gpio [0:7] */
#define MFXSTM32L152_REG_ADR_IRQ_GPI_TYPE2 0x51U /* gpio [8:15] */
#define MFXSTM32L152_REG_ADR_IRQ_GPI_TYPE3 0x52U /* agpio [0:7] */
/**
* @brief GPIO IRQ_GPI_PENDING1/2/3 (R): irq occurs
*/
#define MFXSTM32L152_REG_ADR_IRQ_GPI_PENDING1 0x0CU /* gpio [0:7] */
#define MFXSTM32L152_REG_ADR_IRQ_GPI_PENDING2 0x0DU /* gpio [8:15] */
#define MFXSTM32L152_REG_ADR_IRQ_GPI_PENDING3 0x0EU /* agpio [0:7] */
/**
* @brief GPIO IRQ_GPI_ACK1/2/3 (W): Write (1) to acknowledge IRQ event
*/
#define MFXSTM32L152_REG_ADR_IRQ_GPI_ACK1 0x54U /* gpio [0:7] */
#define MFXSTM32L152_REG_ADR_IRQ_GPI_ACK2 0x55U /* gpio [8:15] */
#define MFXSTM32L152_REG_ADR_IRQ_GPI_ACK3 0x56U /* agpio [0:7] */
/**
* @brief Touch Screen Registers
*/
#define MFXSTM32L152_TS_SETTLING 0xA0U
#define MFXSTM32L152_TS_TOUCH_DET_DELAY 0xA1U
#define MFXSTM32L152_TS_AVE 0xA2U
#define MFXSTM32L152_TS_TRACK 0xA3U
#define MFXSTM32L152_TS_FIFO_TH 0xA4U
#define MFXSTM32L152_TS_FIFO_STA 0x20U
#define MFXSTM32L152_TS_FIFO_LEVEL 0x21U
#define MFXSTM32L152_TS_XY_DATA 0x24U
/**
* @brief Register address: Idd control register (R/W)
*/
#define MFXSTM32L152_REG_ADR_IDD_CTRL 0x80U
/**
* @brief Register address: Idd pre delay register (R/W)
*/
#define MFXSTM32L152_REG_ADR_IDD_PRE_DELAY 0x81U
/**
* @brief Register address: Idd Shunt registers (R/W)
*/
#define MFXSTM32L152_REG_ADR_IDD_SHUNT0_MSB 0x82U
#define MFXSTM32L152_REG_ADR_IDD_SHUNT0_LSB 0x83U
#define MFXSTM32L152_REG_ADR_IDD_SHUNT1_MSB 0x84U
#define MFXSTM32L152_REG_ADR_IDD_SHUNT1_LSB 0x85U
#define MFXSTM32L152_REG_ADR_IDD_SHUNT2_MSB 0x86U
#define MFXSTM32L152_REG_ADR_IDD_SHUNT2_LSB 0x87U
#define MFXSTM32L152_REG_ADR_IDD_SHUNT3_MSB 0x88U
#define MFXSTM32L152_REG_ADR_IDD_SHUNT3_LSB 0x89U
#define MFXSTM32L152_REG_ADR_IDD_SHUNT4_MSB 0x8AU
#define MFXSTM32L152_REG_ADR_IDD_SHUNT4_LSB 0x8BU
/**
* @brief Register address: Idd ampli gain register (R/W)
*/
#define MFXSTM32L152_REG_ADR_IDD_GAIN_MSB 0x8CU
#define MFXSTM32L152_REG_ADR_IDD_GAIN_LSB 0x8DU
/**
* @brief Register address: Idd VDD min register (R/W)
*/
#define MFXSTM32L152_REG_ADR_IDD_VDD_MIN_MSB 0x8EU
#define MFXSTM32L152_REG_ADR_IDD_VDD_MIN_LSB 0x8FU
/**
* @brief Register address: Idd value register (R)
*/
#define MFXSTM32L152_REG_ADR_IDD_VALUE_MSB 0x14U
#define MFXSTM32L152_REG_ADR_IDD_VALUE_MID 0x15U
#define MFXSTM32L152_REG_ADR_IDD_VALUE_LSB 0x16U
/**
* @brief Register address: Idd calibration offset register (R)
*/
#define MFXSTM32L152_REG_ADR_IDD_CAL_OFFSET_MSB 0x18U
#define MFXSTM32L152_REG_ADR_IDD_CAL_OFFSET_LSB 0x19U
/**
* @brief Register address: Idd shunt used offset register (R)
*/
#define MFXSTM32L152_REG_ADR_IDD_SHUNT_USED 0x1AU
/**
* @brief Register address: shunt stabilisation delay registers (R/W)
*/
#define MFXSTM32L152_REG_ADR_IDD_SH0_STABILIZATION 0x90U
#define MFXSTM32L152_REG_ADR_IDD_SH1_STABILIZATION 0x91U
#define MFXSTM32L152_REG_ADR_IDD_SH2_STABILIZATION 0x92U
#define MFXSTM32L152_REG_ADR_IDD_SH3_STABILIZATION 0x93U
#define MFXSTM32L152_REG_ADR_IDD_SH4_STABILIZATION 0x94U
/**
* @brief Register address: Idd number of measurements register (R/W)
*/
#define MFXSTM32L152_REG_ADR_IDD_NBR_OF_MEAS 0x96U
/**
* @brief Register address: Idd delta delay between 2 measurements register (R/W)
*/
#define MFXSTM32L152_REG_ADR_IDD_MEAS_DELTA_DELAY 0x97U
/**
* @brief Register address: Idd number of shunt on board register (R/W)
*/
#define MFXSTM32L152_REG_ADR_IDD_SHUNTS_ON_BOARD 0x98U
/**
* @}
*/
/** @addtogroup MFXSTM32L152_Exported_Types
* @{
*/
typedef int32_t (*MFXSTM32L152_Write_Func)(void *, uint16_t, uint8_t*, uint16_t);
typedef int32_t (*MFXSTM32L152_Read_Func) (void *, uint16_t, uint8_t*, uint16_t);
typedef struct
{
MFXSTM32L152_Write_Func WriteReg;
MFXSTM32L152_Read_Func ReadReg;
void *handle;
/* Internal resources */
} mfxstm32l152_ctx_t;
/**
* @}
*/
/** @addtogroup MFXSTM32L152_Exported_Functions
* @{
*/
int32_t mfxstm32l152_write_reg(mfxstm32l152_ctx_t *ctx, uint16_t reg, uint8_t *data, uint16_t length);
int32_t mfxstm32l152_read_reg(mfxstm32l152_ctx_t *ctx, uint16_t reg, uint8_t *data, uint16_t length);
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /* MFXSTM32L152_REG_H */
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/