Add the BSP for the STM32F746G-DISCO board
This commit is contained in:
@@ -92,7 +92,7 @@
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Core"/>
|
||||
<entry excluding="Inc/fsdata_custom.c" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Core"/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="LWIP"/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Middlewares"/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Drivers"/>
|
||||
@@ -213,4 +213,12 @@
|
||||
<autodiscovery enabled="false" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
</scannerConfigBuildInfo>
|
||||
</storageModule>
|
||||
<storageModule moduleId="refreshScope" versionNumber="2">
|
||||
<configuration configurationName="Debug">
|
||||
<resource resourceType="PROJECT" workspacePath="/project"/>
|
||||
</configuration>
|
||||
<configuration configurationName="Release">
|
||||
<resource resourceType="PROJECT" workspacePath="/project"/>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
</cproject>
|
||||
File diff suppressed because one or more lines are too long
@@ -56,7 +56,7 @@
|
||||
/* #define HAL_IWDG_MODULE_ENABLED */
|
||||
/* #define HAL_LPTIM_MODULE_ENABLED */
|
||||
#define HAL_LTDC_MODULE_ENABLED
|
||||
/* #define HAL_QSPI_MODULE_ENABLED */
|
||||
#define HAL_QSPI_MODULE_ENABLED
|
||||
/* #define HAL_RNG_MODULE_ENABLED */
|
||||
/* #define HAL_RTC_MODULE_ENABLED */
|
||||
/* #define HAL_SAI_MODULE_ENABLED */
|
||||
|
||||
@@ -46,6 +46,8 @@ DMA2D_HandleTypeDef hdma2d;
|
||||
|
||||
LTDC_HandleTypeDef hltdc;
|
||||
|
||||
QSPI_HandleTypeDef hqspi;
|
||||
|
||||
UART_HandleTypeDef huart1;
|
||||
|
||||
SDRAM_HandleTypeDef hsdram1;
|
||||
@@ -61,6 +63,7 @@ static void MX_LTDC_Init(void);
|
||||
static void MX_USART1_UART_Init(void);
|
||||
static void MX_DMA2D_Init(void);
|
||||
static void MX_FMC_Init(void);
|
||||
static void MX_QUADSPI_Init(void);
|
||||
/* USER CODE BEGIN PFP */
|
||||
|
||||
/* USER CODE END PFP */
|
||||
@@ -103,6 +106,7 @@ int main(void)
|
||||
MX_DMA2D_Init();
|
||||
MX_FMC_Init();
|
||||
MX_LWIP_Init();
|
||||
MX_QUADSPI_Init();
|
||||
/* USER CODE BEGIN 2 */
|
||||
|
||||
/* USER CODE END 2 */
|
||||
@@ -293,6 +297,41 @@ static void MX_LTDC_Init(void)
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QUADSPI Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_QUADSPI_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN QUADSPI_Init 0 */
|
||||
|
||||
/* USER CODE END QUADSPI_Init 0 */
|
||||
|
||||
/* USER CODE BEGIN QUADSPI_Init 1 */
|
||||
|
||||
/* USER CODE END QUADSPI_Init 1 */
|
||||
/* QUADSPI parameter configuration*/
|
||||
hqspi.Instance = QUADSPI;
|
||||
hqspi.Init.ClockPrescaler = 1;
|
||||
hqspi.Init.FifoThreshold = 4;
|
||||
hqspi.Init.SampleShifting = QSPI_SAMPLE_SHIFTING_HALFCYCLE;
|
||||
hqspi.Init.FlashSize = 16;
|
||||
hqspi.Init.ChipSelectHighTime = QSPI_CS_HIGH_TIME_6_CYCLE;
|
||||
hqspi.Init.ClockMode = QSPI_CLOCK_MODE_0;
|
||||
hqspi.Init.FlashID = QSPI_FLASH_ID_1;
|
||||
hqspi.Init.DualFlash = QSPI_DUALFLASH_DISABLE;
|
||||
if (HAL_QSPI_Init(&hqspi) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN QUADSPI_Init 2 */
|
||||
|
||||
/* USER CODE END QUADSPI_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief USART1 Initialization Function
|
||||
* @param None
|
||||
|
||||
@@ -301,6 +301,106 @@ void HAL_LTDC_MspDeInit(LTDC_HandleTypeDef* hltdc)
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QSPI MSP Initialization
|
||||
* This function configures the hardware resources used in this example
|
||||
* @param hqspi: QSPI handle pointer
|
||||
* @retval None
|
||||
*/
|
||||
void HAL_QSPI_MspInit(QSPI_HandleTypeDef* hqspi)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
||||
if(hqspi->Instance==QUADSPI)
|
||||
{
|
||||
/* USER CODE BEGIN QUADSPI_MspInit 0 */
|
||||
|
||||
/* USER CODE END QUADSPI_MspInit 0 */
|
||||
/* Peripheral clock enable */
|
||||
__HAL_RCC_QSPI_CLK_ENABLE();
|
||||
|
||||
__HAL_RCC_GPIOE_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOB_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOD_CLK_ENABLE();
|
||||
/**QUADSPI GPIO Configuration
|
||||
PE2 ------> QUADSPI_BK1_IO2
|
||||
PB6 ------> QUADSPI_BK1_NCS
|
||||
PB2 ------> QUADSPI_CLK
|
||||
PD12 ------> QUADSPI_BK1_IO1
|
||||
PD13 ------> QUADSPI_BK1_IO3
|
||||
PD11 ------> QUADSPI_BK1_IO0
|
||||
*/
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_2;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
GPIO_InitStruct.Alternate = GPIO_AF9_QUADSPI;
|
||||
HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
|
||||
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_6;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
GPIO_InitStruct.Alternate = GPIO_AF10_QUADSPI;
|
||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_2;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
GPIO_InitStruct.Alternate = GPIO_AF9_QUADSPI;
|
||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_11;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
|
||||
GPIO_InitStruct.Alternate = GPIO_AF9_QUADSPI;
|
||||
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
|
||||
|
||||
/* USER CODE BEGIN QUADSPI_MspInit 1 */
|
||||
|
||||
/* USER CODE END QUADSPI_MspInit 1 */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QSPI MSP De-Initialization
|
||||
* This function freeze the hardware resources used in this example
|
||||
* @param hqspi: QSPI handle pointer
|
||||
* @retval None
|
||||
*/
|
||||
void HAL_QSPI_MspDeInit(QSPI_HandleTypeDef* hqspi)
|
||||
{
|
||||
if(hqspi->Instance==QUADSPI)
|
||||
{
|
||||
/* USER CODE BEGIN QUADSPI_MspDeInit 0 */
|
||||
|
||||
/* USER CODE END QUADSPI_MspDeInit 0 */
|
||||
/* Peripheral clock disable */
|
||||
__HAL_RCC_QSPI_CLK_DISABLE();
|
||||
|
||||
/**QUADSPI GPIO Configuration
|
||||
PE2 ------> QUADSPI_BK1_IO2
|
||||
PB6 ------> QUADSPI_BK1_NCS
|
||||
PB2 ------> QUADSPI_CLK
|
||||
PD12 ------> QUADSPI_BK1_IO1
|
||||
PD13 ------> QUADSPI_BK1_IO3
|
||||
PD11 ------> QUADSPI_BK1_IO0
|
||||
*/
|
||||
HAL_GPIO_DeInit(GPIOE, GPIO_PIN_2);
|
||||
|
||||
HAL_GPIO_DeInit(GPIOB, GPIO_PIN_6|GPIO_PIN_2);
|
||||
|
||||
HAL_GPIO_DeInit(GPIOD, GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_11);
|
||||
|
||||
/* USER CODE BEGIN QUADSPI_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END QUADSPI_MspDeInit 1 */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief UART MSP Initialization
|
||||
* This function configures the hardware resources used in this example
|
||||
|
||||
759
project/Drivers/BSP/Components/Common/Release_Notes.html
Normal file
759
project/Drivers/BSP/Components/Common/Release_Notes.html
Normal file
@@ -0,0 +1,759 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
|
||||
|
||||
<link rel="File-List" href="Library_files/filelist.xml">
|
||||
|
||||
|
||||
<link rel="Edit-Time-Data" href="Library_files/editdata.mso"><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><title>Release Notes for BSP Components Common Drivers</title><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>STMicroelectronics</o:Author> <o:LastAuthor>STMicroelectronics</o:LastAuthor> <o:Revision>37</o:Revision> <o:TotalTime>136</o:TotalTime> <o:Created>2009-02-27T19:26:00Z</o:Created> <o:LastSaved>2009-03-01T17:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>522</o:Words> <o:Characters>2977</o:Characters> <o:Company>STMicroelectronics</o:Company> <o:Lines>24</o:Lines> <o:Paragraphs>6</o:Paragraphs> <o:CharactersWithSpaces>3493</o:CharactersWithSpaces> <o:Version>11.6568</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>110</w:Zoom> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
<!--
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
h2
|
||||
{mso-style-next:Normal;
|
||||
margin-top:12.0pt;
|
||||
margin-right:0in;
|
||||
margin-bottom:3.0pt;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
page-break-after:avoid;
|
||||
mso-outline-level:2;
|
||||
font-size:14.0pt;
|
||||
font-family:Arial;
|
||||
font-weight:bold;
|
||||
font-style:italic;}
|
||||
a:link, span.MsoHyperlink
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
a:visited, span.MsoHyperlinkFollowed
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
p
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="5122"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]-->
|
||||
<meta content="MCD Application Team" name="author"></head>
|
||||
<body link="blue" vlink="blue">
|
||||
<div class="Section1">
|
||||
<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
|
||||
</o:p></span></p>
|
||||
<div align="center">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Arial; color: blue;"><a href="../../../../Release_Notes.html">Back to Release page</a><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="">
|
||||
<td style="padding: 1.5pt;">
|
||||
|
||||
<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release
|
||||
Notes for BSP Components Common Drivers</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
|
||||
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
|
||||
2015 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="../../../../_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p> </o:p></span></p>
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" width="900">
|
||||
<tbody>
|
||||
<tr style="">
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<span style="font-family: "Times New Roman";">
|
||||
</span>
|
||||
<h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2>
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 210px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V4.0.1 / 21-July-2015 <o:p></o:p></span></h3><p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;">tsensor.h: Fix compilation issue on TSENSOR_InitTypeDef</span></li></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 210px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V4.0.0 / 22-June-2015 <o:p></o:p></span></h3><p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;">accelero.h: add <span style="font-style: italic;">*DeInit</span> field in <span style="font-style: italic;">ACCELERO_DrvTypeDef</span> structure</span></li><li><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;">audio.h: add <span style="font-style: italic;">*DeInit</span> field in <span style="font-style: italic;">AUDIO_DrvTypeDef</span> structure</span></li><li><span style="font-size: 10pt; font-family: Verdana;">idd.h: </span></li><ul><li><span style="font-size: 10pt; font-family: Verdana;">add <span style="font-style: italic;">Shunt0StabDelay, Shunt1StabDelay, Shunt2StabDelay, Shunt3StabDelay, Shunt4StabDelay and ShuntNbOnBoard </span></span><span style="font-size: 10pt; font-family: Verdana;">fields in <span style="font-style: italic;">IDD_ConfigTypeDef</span> </span><span style="font-size: 10pt; font-family: Verdana;">structure</span></li><li><span style="font-size: 10pt; font-family: Verdana;">rename <span style="font-style: italic;">ShuntNumber</span> field to <span style="font-style: italic;">ShuntNbUsed</span> in </span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic;">IDD_ConfigTypeDef</span> structure</span></li></ul><li><span style="font-size: 10pt; font-family: Verdana;">magneto.h: add <span style="font-style: italic;">*DeInit</span> field in <span style="font-style: italic;">MAGNETO_DrvTypeDef</span> structure</span></li><li><span style="font-size: 10pt; font-family: Verdana;"><span style="font-weight: bold;">Important Note:</span> this release V4.0.0 is not backward compatible with V3.0.0</span></li></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 210px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V3.0.0 / 28-April-2015 <o:p></o:p></span></h3><p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;">accelero.h: </span><span style="font-size: 10pt; font-family: Verdana;">add <span style="font-style: italic;">*LowPower</span> field in <span style="font-style: italic;">ACCELERO_DrvTypeDef</span> structure</span><span style="font-size: 10pt; font-family: Verdana;"></span></li><li><span style="font-size: 10pt; font-family: Verdana;">magneto.h: </span><span style="font-size: 10pt; font-family: Verdana;">add <span style="font-style: italic;">*LowPower</span> field in <span style="font-style: italic;">MAGNETO_DrvTypeDef</span> structure</span></li><li><span style="font-size: 10pt; font-family: Verdana;">gyro.h: add <span style="font-style: italic;">*DeInit</span> and <span style="font-style: italic;">*LowPower</span> fields in <span style="font-style: italic;">GYRO_DrvTypeDef</span> structure<br></span></li><li><span style="font-size: 10pt; font-family: Verdana;">camera.h: add <span style="font-style: italic;">CAMERA_COLOR_EFFECT_NONE</span> define</span></li><li><span style="font-size: 10pt; font-family: Verdana;">idd.h: </span></li><ul><li><span style="font-size: 10pt; font-family: Verdana;">add <span style="font-style: italic;">MeasureNb</span>, <span style="font-style: italic;">DeltaDelayUnit</span> and <span style="font-style: italic;">DeltaDelayValue</span> fields in <span style="font-style: italic;">IDD_ConfigTypeDef</span> structure</span></li><li><span style="font-size: 10pt; font-family: Verdana;">rename <span style="font-style: italic;">PreDelay</span> field to <span style="font-style: italic;">PreDelayUnit</span> in </span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic;">IDD_ConfigTypeDef</span> structure</span></li></ul>
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;"><span style="font-weight: bold;">Important Note:</span> this release V3.0.0 is not backward compatible with V2.2.0<br>
|
||||
</span></li>
|
||||
</ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 210px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V2.2.0 / 09-February-2015 <o:p></o:p></span></h3><p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;">Magnetometer </span><span style="font-size: 10pt; font-family: Verdana;">driver function prototypes added (magneto.h file)</span></li><li><span style="font-size: 10pt; font-family: Verdana;">Update "idd.h" file to provide DeInit() and WakeUp() services in IDD current measurement driver</span></li></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 210px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V2.1.0 / 06-February-2015 <o:p></o:p></span></h3><p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;">IDD current measurement </span><span style="font-size: 10pt; font-family: Verdana;">driver function prototypes added (idd.h file)</span></li><li><span style="font-size: 10pt; font-family: Verdana;">io.h: add new typedef enum IO_PinState with IO_PIN_RESET and IO_PIN_SET values<br></span></li></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 210px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V2.0.0 / 15-December-2014 <o:p></o:p></span></h3><p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;">Update "io.h" file to support MFX (Multi Function eXpander) device available on some STM32 boards</span></li><ul><li><span style="font-size: 10pt; font-family: Verdana;">add new entries for IO_ModeTypedef enumeration structure</span><span style="font-size: 10pt; font-family: Verdana;"></span></li><li><span style="font-size: 10pt; font-family: Verdana;">update the IO_DrvTypeDef structure</span></li><ul><li><span style="font-size: 10pt; font-family: Verdana;">Update all return values and function parameters to uint32_t</span></li><li><span style="font-size: 10pt; font-family: Verdana;">Add a return value for Config field</span></li></ul></ul><li style="font-family: Verdana;"><small><span style="font-weight: bold;">Important Note</span>: this version V2.0.0 is not backward compatible with V1.2.1</small></li></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.2.1 / 02-December-2014 <o:p></o:p></span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;">gyro.h: change “__GIRO_H” by “__GYRO_H” to fix compilation issue under Mac OS</span><span style="font-size: 10pt; font-family: Verdana;"></span></li></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.2.0 / 18-June-2014 <o:p></o:p></span></h3><p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;">EPD (</span><span style="font-size: 10pt; font-family: Verdana;">E Paper Display) driver function prototype added (epd.h file)<br>
|
||||
</span></li></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.1.0 / 21-March-2014 <o:p></o:p></span></h3><p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;">Temperature Sensor driver function prototype added</span></li></ul><span style="font-size: 10pt; font-family: Verdana;"></span><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0 / 18-February-2014 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;">First official release with </span><span style="font-size: 10pt; font-family: Verdana;">Accelerometer, </span><span style="font-size: 10pt; font-family: Verdana;">Audio, Camera, Gyroscope, IO, LCD and Touch Screen drivers function prototypes </span><span style="font-size: 10pt; font-family: Verdana;"></span></li></ul><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="License"></a><span style="font-size: 12pt; color: white;">License<o:p></o:p></span><br></h2>
|
||||
<div style="text-align: justify;"><font size="-1"><span style="font-family: "Verdana","sans-serif";">
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:</span><br>
|
||||
</font>
|
||||
<ol><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions
|
||||
in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in </span><span style="font-family: "Verdana","sans-serif";">the documentation and/or other materials provided with the distribution.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived </span><br>
|
||||
</font>
|
||||
</li></ol>
|
||||
<font size="-1"><span style="font-family: "Verdana","sans-serif";"> from this software without specific prior written permission.</span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";"></span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED</span><span style="font-family: "Verdana","sans-serif";"> WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A </span><span style="font-family: "Verdana","sans-serif";">PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY </span><span style="font-family: "Verdana","sans-serif";">DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, </span><span style="font-family: "Verdana","sans-serif";">PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER</span><span style="font-family: "Verdana","sans-serif";"> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR </span><span style="font-family: "Verdana","sans-serif";">OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></font>
|
||||
|
||||
</div>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;"><font size="-1"></font><o:p></o:p></span></p>
|
||||
<b><span style="font-size: 10pt; font-family: Verdana; color: black;"></span></b>
|
||||
|
||||
<div class="MsoNormal" style="text-align: center;" align="center"><span style="color: black;">
|
||||
<hr align="center" size="2" width="100%"></span></div>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt; text-align: center;" align="center"><span style="font-size: 10pt; font-family: Verdana; color: black;">For
|
||||
complete documentation on </span><span style="font-size: 10pt; font-family: Verdana;">STM32<span style="color: black;"> Microcontrollers
|
||||
visit </span><u><span style="color: blue;"><a href="http://www.st.com/internet/mcu/class/1734.jsp" target="_blank">www.st.com/STM32</a></span></u></span><span style="font-size: 10pt; font-family: Verdana;"><a target="_blank" href="http://www.st.com/internet/mcu/family/141.jsp"><u><span style="color: blue;"></span></u></a></span><span style="font-size: 10pt; font-family: Verdana;"><u><span style="color: blue;"></span></u></span><span style="color: black;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="MsoNormal"><o:p> </o:p></p>
|
||||
</div>
|
||||
|
||||
</body></html>
|
||||
143
project/Drivers/BSP/Components/Common/accelero.h
Normal file
143
project/Drivers/BSP/Components/Common/accelero.h
Normal file
@@ -0,0 +1,143 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file accelero.h
|
||||
* @author MCD Application Team
|
||||
* @version V4.0.1
|
||||
* @date 21-July-2015
|
||||
* @brief This header file contains the functions prototypes for the Accelerometer driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __ACCELERO_H
|
||||
#define __ACCELERO_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup ACCELERO
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup ACCELERO_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup ACCELERO_Driver_structure Accelerometer Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
void (*Init)(uint16_t);
|
||||
void (*DeInit)(void);
|
||||
uint8_t (*ReadID)(void);
|
||||
void (*Reset)(void);
|
||||
void (*LowPower)(void);
|
||||
void (*ConfigIT)(void);
|
||||
void (*EnableIT)(uint8_t);
|
||||
void (*DisableIT)(uint8_t);
|
||||
uint8_t (*ITStatus)(uint16_t);
|
||||
void (*ClearIT)(void);
|
||||
void (*FilterConfig)(uint8_t);
|
||||
void (*FilterCmd)(uint8_t);
|
||||
void (*GetXYZ)(int16_t *);
|
||||
}ACCELERO_DrvTypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup ACCELERO_Configuration_structure Accelerometer Configuration structure
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* ACCELERO struct */
|
||||
typedef struct
|
||||
{
|
||||
uint8_t Power_Mode; /* Power-down/Normal Mode */
|
||||
uint8_t AccOutput_DataRate; /* OUT data rate */
|
||||
uint8_t Axes_Enable; /* Axes enable */
|
||||
uint8_t High_Resolution; /* High Resolution enabling/disabling */
|
||||
uint8_t BlockData_Update; /* Block Data Update */
|
||||
uint8_t Endianness; /* Endian Data selection */
|
||||
uint8_t AccFull_Scale; /* Full Scale selection */
|
||||
uint8_t Communication_Mode;
|
||||
}ACCELERO_InitTypeDef;
|
||||
|
||||
/* ACCELERO High Pass Filter struct */
|
||||
typedef struct
|
||||
{
|
||||
uint8_t HighPassFilter_Mode_Selection; /* Internal filter mode */
|
||||
uint8_t HighPassFilter_CutOff_Frequency; /* High pass filter cut-off frequency */
|
||||
uint8_t HighPassFilter_AOI1; /* HPF_enabling/disabling for AOI function on interrupt 1 */
|
||||
uint8_t HighPassFilter_AOI2; /* HPF_enabling/disabling for AOI function on interrupt 2 */
|
||||
uint8_t HighPassFilter_Data_Sel;
|
||||
uint8_t HighPassFilter_Stat;
|
||||
}ACCELERO_FilterConfigTypeDef;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ACCELERO_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
122
project/Drivers/BSP/Components/Common/audio.h
Normal file
122
project/Drivers/BSP/Components/Common/audio.h
Normal file
@@ -0,0 +1,122 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file audio.h
|
||||
* @author MCD Application Team
|
||||
* @version V4.0.1
|
||||
* @date 21-July-2015
|
||||
* @brief This header file contains the common defines and functions prototypes
|
||||
* for the Audio driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __AUDIO_H
|
||||
#define __AUDIO_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup AUDIO
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup AUDIO_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Codec audio Standards */
|
||||
#define CODEC_STANDARD 0x04
|
||||
#define I2S_STANDARD I2S_STANDARD_PHILIPS
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup AUDIO_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup AUDIO_Driver_structure Audio Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t (*Init)(uint16_t, uint16_t, uint8_t, uint32_t);
|
||||
void (*DeInit)(void);
|
||||
uint32_t (*ReadID)(uint16_t);
|
||||
uint32_t (*Play)(uint16_t, uint16_t*, uint16_t);
|
||||
uint32_t (*Pause)(uint16_t);
|
||||
uint32_t (*Resume)(uint16_t);
|
||||
uint32_t (*Stop)(uint16_t, uint32_t);
|
||||
uint32_t (*SetFrequency)(uint16_t, uint32_t);
|
||||
uint32_t (*SetVolume)(uint16_t, uint8_t);
|
||||
uint32_t (*SetMute)(uint16_t, uint32_t);
|
||||
uint32_t (*SetOutputMode)(uint16_t, uint8_t);
|
||||
uint32_t (*Reset)(uint16_t);
|
||||
}AUDIO_DrvTypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __AUDIO_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
141
project/Drivers/BSP/Components/Common/camera.h
Normal file
141
project/Drivers/BSP/Components/Common/camera.h
Normal file
@@ -0,0 +1,141 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file camera.h
|
||||
* @author MCD Application Team
|
||||
* @version V4.0.1
|
||||
* @date 21-July-2015
|
||||
* @brief This header file contains the common defines and functions prototypes
|
||||
* for the camera driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __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
|
||||
{
|
||||
void (*Init)(uint16_t, uint32_t);
|
||||
uint16_t (*ReadID)(uint16_t);
|
||||
void (*Config)(uint16_t, uint32_t, uint32_t, uint32_t);
|
||||
}CAMERA_DrvTypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup CAMERA_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
#define CAMERA_R160x120 0x00 /* QQVGA Resolution */
|
||||
#define CAMERA_R320x240 0x01 /* QVGA Resolution */
|
||||
#define CAMERA_R480x272 0x02 /* 480x272 Resolution */
|
||||
#define CAMERA_R640x480 0x03 /* VGA Resolution */
|
||||
|
||||
#define CAMERA_CONTRAST_BRIGHTNESS 0x00 /* Camera contrast brightness features */
|
||||
#define CAMERA_BLACK_WHITE 0x01 /* Camera black white feature */
|
||||
#define CAMERA_COLOR_EFFECT 0x03 /* Camera color effect feature */
|
||||
|
||||
#define CAMERA_BRIGHTNESS_LEVEL0 0x00 /* Brightness level -2 */
|
||||
#define CAMERA_BRIGHTNESS_LEVEL1 0x01 /* Brightness level -1 */
|
||||
#define CAMERA_BRIGHTNESS_LEVEL2 0x02 /* Brightness level 0 */
|
||||
#define CAMERA_BRIGHTNESS_LEVEL3 0x03 /* Brightness level +1 */
|
||||
#define CAMERA_BRIGHTNESS_LEVEL4 0x04 /* Brightness level +2 */
|
||||
|
||||
#define CAMERA_CONTRAST_LEVEL0 0x05 /* Contrast level -2 */
|
||||
#define CAMERA_CONTRAST_LEVEL1 0x06 /* Contrast level -1 */
|
||||
#define CAMERA_CONTRAST_LEVEL2 0x07 /* Contrast level 0 */
|
||||
#define CAMERA_CONTRAST_LEVEL3 0x08 /* Contrast level +1 */
|
||||
#define CAMERA_CONTRAST_LEVEL4 0x09 /* Contrast level +2 */
|
||||
|
||||
#define CAMERA_BLACK_WHITE_BW 0x00 /* Black and white effect */
|
||||
#define CAMERA_BLACK_WHITE_NEGATIVE 0x01 /* Negative effect */
|
||||
#define CAMERA_BLACK_WHITE_BW_NEGATIVE 0x02 /* BW and Negative effect */
|
||||
#define CAMERA_BLACK_WHITE_NORMAL 0x03 /* Normal effect */
|
||||
|
||||
#define CAMERA_COLOR_EFFECT_NONE 0x00 /* No effects */
|
||||
#define CAMERA_COLOR_EFFECT_BLUE 0x01 /* Blue effect */
|
||||
#define CAMERA_COLOR_EFFECT_GREEN 0x02 /* Green effect */
|
||||
#define CAMERA_COLOR_EFFECT_RED 0x03 /* Red effect */
|
||||
#define CAMERA_COLOR_EFFECT_ANTIQUE 0x04 /* Antique effect */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __CAMERA_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
115
project/Drivers/BSP/Components/Common/epd.h
Normal file
115
project/Drivers/BSP/Components/Common/epd.h
Normal file
@@ -0,0 +1,115 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file epd.h
|
||||
* @author MCD Application Team
|
||||
* @version V4.0.1
|
||||
* @date 21-July-2015
|
||||
* @brief This file contains all the functions prototypes for the
|
||||
* EPD (E Paper Display) driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __EPD_H
|
||||
#define __EPD_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Common
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup EPD
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup EPD_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup EPD_Driver_structure E Paper Display Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
void (*Init)(void);
|
||||
void (*WritePixel)(uint8_t);
|
||||
|
||||
/* Optimized operation */
|
||||
void (*SetDisplayWindow)(uint16_t, uint16_t, uint16_t, uint16_t);
|
||||
void (*RefreshDisplay)(void);
|
||||
void (*CloseChargePump)(void);
|
||||
|
||||
uint16_t (*GetEpdPixelWidth)(void);
|
||||
uint16_t (*GetEpdPixelHeight)(void);
|
||||
void (*DrawImage)(uint16_t, uint16_t, uint16_t, uint16_t, uint8_t*);
|
||||
}
|
||||
EPD_DrvTypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* EPD_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
145
project/Drivers/BSP/Components/Common/gyro.h
Normal file
145
project/Drivers/BSP/Components/Common/gyro.h
Normal file
@@ -0,0 +1,145 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file gyro.h
|
||||
* @author MCD Application Team
|
||||
* @version V4.0.1
|
||||
* @date 21-July-2015
|
||||
* @brief This header file contains the functions prototypes for the gyroscope driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __GYRO_H
|
||||
#define __GYRO_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup GYRO
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup GYRO_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup GYRO_Driver_structure Gyroscope Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
void (*Init)(uint16_t);
|
||||
void (*DeInit)(void);
|
||||
uint8_t (*ReadID)(void);
|
||||
void (*Reset)(void);
|
||||
void (*LowPower)(uint16_t);
|
||||
void (*ConfigIT)(uint16_t);
|
||||
void (*EnableIT)(uint8_t);
|
||||
void (*DisableIT)(uint8_t);
|
||||
uint8_t (*ITStatus)(uint16_t, uint16_t);
|
||||
void (*ClearIT)(uint16_t, uint16_t);
|
||||
void (*FilterConfig)(uint8_t);
|
||||
void (*FilterCmd)(uint8_t);
|
||||
void (*GetXYZ)(float *);
|
||||
}GYRO_DrvTypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup GYRO_Config_structure Gyroscope Configuration structure
|
||||
* @{
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t Power_Mode; /* Power-down/Sleep/Normal Mode */
|
||||
uint8_t Output_DataRate; /* OUT data rate */
|
||||
uint8_t Axes_Enable; /* Axes enable */
|
||||
uint8_t Band_Width; /* Bandwidth selection */
|
||||
uint8_t BlockData_Update; /* Block Data Update */
|
||||
uint8_t Endianness; /* Endian Data selection */
|
||||
uint8_t Full_Scale; /* Full Scale selection */
|
||||
}GYRO_InitTypeDef;
|
||||
|
||||
/* GYRO High Pass Filter struct */
|
||||
typedef struct
|
||||
{
|
||||
uint8_t HighPassFilter_Mode_Selection; /* Internal filter mode */
|
||||
uint8_t HighPassFilter_CutOff_Frequency; /* High pass filter cut-off frequency */
|
||||
}GYRO_FilterConfigTypeDef;
|
||||
|
||||
/*GYRO Interrupt struct */
|
||||
typedef struct
|
||||
{
|
||||
uint8_t Latch_Request; /* Latch interrupt request into CLICK_SRC register */
|
||||
uint8_t Interrupt_Axes; /* X, Y, Z Axes Interrupts */
|
||||
uint8_t Interrupt_ActiveEdge; /* Interrupt Active edge */
|
||||
}GYRO_InterruptConfigTypeDef;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __GYRO_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
168
project/Drivers/BSP/Components/Common/idd.h
Normal file
168
project/Drivers/BSP/Components/Common/idd.h
Normal file
@@ -0,0 +1,168 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file idd.h
|
||||
* @author MCD Application Team
|
||||
* @version V4.0.1
|
||||
* @date 21-July-2015
|
||||
* @brief This file contains all the functions prototypes for the IDD driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __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_Config_structure IDD Configuration structure
|
||||
* @{
|
||||
*/
|
||||
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 */
|
||||
}IDD_ConfigTypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup IDD_Driver_structure IDD Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
void (*Init)(uint16_t);
|
||||
void (*DeInit)(uint16_t);
|
||||
uint16_t (*ReadID)(uint16_t);
|
||||
void (*Reset)(uint16_t);
|
||||
void (*LowPower)(uint16_t);
|
||||
void (*WakeUp)(uint16_t);
|
||||
void (*Start)(uint16_t);
|
||||
void (*Config)(uint16_t,IDD_ConfigTypeDef);
|
||||
void (*GetValue)(uint16_t, uint32_t *);
|
||||
void (*EnableIT)(uint16_t);
|
||||
void (*ClearIT)(uint16_t);
|
||||
uint8_t (*GetITStatus)(uint16_t);
|
||||
void (*DisableIT)(uint16_t);
|
||||
void (*ErrorEnableIT)(uint16_t);
|
||||
void (*ErrorClearIT)(uint16_t);
|
||||
uint8_t (*ErrorGetITStatus)(uint16_t);
|
||||
void (*ErrorDisableIT)(uint16_t);
|
||||
uint8_t (*ErrorGetSrc)(uint16_t);
|
||||
uint8_t (*ErrorGetCode)(uint16_t);
|
||||
}IDD_DrvTypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __IDD_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
150
project/Drivers/BSP/Components/Common/io.h
Normal file
150
project/Drivers/BSP/Components/Common/io.h
Normal file
@@ -0,0 +1,150 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file io.h
|
||||
* @author MCD Application Team
|
||||
* @version V4.0.1
|
||||
* @date 21-July-2015
|
||||
* @brief This file contains all the functions prototypes for the IO driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __IO_H
|
||||
#define __IO_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup IO
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup IO_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief IO Bit SET and Bit RESET enumeration
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
IO_PIN_RESET = 0,
|
||||
IO_PIN_SET
|
||||
}IO_PinState;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
IO_MODE_INPUT = 0, /* input floating */
|
||||
IO_MODE_OUTPUT, /* output Push Pull */
|
||||
IO_MODE_IT_RISING_EDGE, /* float input - irq detect on rising edge */
|
||||
IO_MODE_IT_FALLING_EDGE, /* float input - irq detect on falling edge */
|
||||
IO_MODE_IT_LOW_LEVEL, /* float input - irq detect on low level */
|
||||
IO_MODE_IT_HIGH_LEVEL, /* float input - irq detect on high level */
|
||||
/* following modes only available on MFX*/
|
||||
IO_MODE_ANALOG, /* analog mode */
|
||||
IO_MODE_OFF, /* when pin isn't used*/
|
||||
IO_MODE_INPUT_PU, /* input with internal pull up resistor */
|
||||
IO_MODE_INPUT_PD, /* input with internal pull down resistor */
|
||||
IO_MODE_OUTPUT_OD, /* Open Drain output without internal resistor */
|
||||
IO_MODE_OUTPUT_OD_PU, /* Open Drain output with internal pullup resistor */
|
||||
IO_MODE_OUTPUT_OD_PD, /* Open Drain output with internal pulldown resistor */
|
||||
IO_MODE_OUTPUT_PP, /* PushPull output without internal resistor */
|
||||
IO_MODE_OUTPUT_PP_PU, /* PushPull output with internal pullup resistor */
|
||||
IO_MODE_OUTPUT_PP_PD, /* PushPull output with internal pulldown resistor */
|
||||
IO_MODE_IT_RISING_EDGE_PU, /* push up resistor input - irq on rising edge */
|
||||
IO_MODE_IT_RISING_EDGE_PD, /* push dw resistor input - irq on rising edge */
|
||||
IO_MODE_IT_FALLING_EDGE_PU, /* push up resistor input - irq on falling edge */
|
||||
IO_MODE_IT_FALLING_EDGE_PD, /* push dw resistor input - irq on falling edge */
|
||||
IO_MODE_IT_LOW_LEVEL_PU, /* push up resistor input - irq detect on low level */
|
||||
IO_MODE_IT_LOW_LEVEL_PD, /* push dw resistor input - irq detect on low level */
|
||||
IO_MODE_IT_HIGH_LEVEL_PU, /* push up resistor input - irq detect on high level */
|
||||
IO_MODE_IT_HIGH_LEVEL_PD, /* push dw resistor input - irq detect on high level */
|
||||
|
||||
}IO_ModeTypedef;
|
||||
|
||||
/** @defgroup IO_Driver_structure IO Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
void (*Init)(uint16_t);
|
||||
uint16_t (*ReadID)(uint16_t);
|
||||
void (*Reset)(uint16_t);
|
||||
|
||||
void (*Start)(uint16_t, uint32_t);
|
||||
uint8_t (*Config)(uint16_t, uint32_t, IO_ModeTypedef);
|
||||
void (*WritePin)(uint16_t, uint32_t, uint8_t);
|
||||
uint32_t (*ReadPin)(uint16_t, uint32_t);
|
||||
|
||||
void (*EnableIT)(uint16_t);
|
||||
void (*DisableIT)(uint16_t);
|
||||
uint32_t (*ITStatus)(uint16_t, uint32_t);
|
||||
void (*ClearIT)(uint16_t, uint32_t);
|
||||
|
||||
}IO_DrvTypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __IO_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
114
project/Drivers/BSP/Components/Common/lcd.h
Normal file
114
project/Drivers/BSP/Components/Common/lcd.h
Normal file
@@ -0,0 +1,114 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file lcd.h
|
||||
* @author MCD Application Team
|
||||
* @version V4.0.1
|
||||
* @date 21-July-2015
|
||||
* @brief This file contains all the functions prototypes for the LCD driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __LCD_H
|
||||
#define __LCD_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup LCD
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup LCD_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup LCD_Driver_structure LCD Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
void (*Init)(void);
|
||||
uint16_t (*ReadID)(void);
|
||||
void (*DisplayOn)(void);
|
||||
void (*DisplayOff)(void);
|
||||
void (*SetCursor)(uint16_t, uint16_t);
|
||||
void (*WritePixel)(uint16_t, uint16_t, uint16_t);
|
||||
uint16_t (*ReadPixel)(uint16_t, uint16_t);
|
||||
|
||||
/* Optimized operation */
|
||||
void (*SetDisplayWindow)(uint16_t, uint16_t, uint16_t, uint16_t);
|
||||
void (*DrawHLine)(uint16_t, uint16_t, uint16_t, uint16_t);
|
||||
void (*DrawVLine)(uint16_t, uint16_t, uint16_t, uint16_t);
|
||||
|
||||
uint16_t (*GetLcdPixelWidth)(void);
|
||||
uint16_t (*GetLcdPixelHeight)(void);
|
||||
void (*DrawBitmap)(uint16_t, uint16_t, uint8_t*);
|
||||
void (*DrawRGBImage)(uint16_t, uint16_t, uint16_t, uint16_t, uint8_t*);
|
||||
}LCD_DrvTypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __LCD_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
125
project/Drivers/BSP/Components/Common/magneto.h
Normal file
125
project/Drivers/BSP/Components/Common/magneto.h
Normal file
@@ -0,0 +1,125 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file magneto.h
|
||||
* @author MCD Application Team
|
||||
* @version V4.0.1
|
||||
* @date 21-July-2015
|
||||
* @brief This header file contains the functions prototypes for the MAGNETO driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __MAGNETO_H
|
||||
#define __MAGNETO_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup MAGNETO
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup MAGNETO_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup MAGNETO_Config_structure Magnetometer Configuration structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint8_t Register1;
|
||||
uint8_t Register2;
|
||||
uint8_t Register3;
|
||||
uint8_t Register4;
|
||||
uint8_t Register5;
|
||||
}MAGNETO_InitTypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup MAGNETO_Driver_structure Magnetometer Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
void (*Init)(MAGNETO_InitTypeDef);
|
||||
void (*DeInit)(void);
|
||||
uint8_t (*ReadID)(void);
|
||||
void (*Reset)(void);
|
||||
void (*LowPower)(void);
|
||||
void (*ConfigIT)(void);
|
||||
void (*EnableIT)(uint8_t);
|
||||
void (*DisableIT)(uint8_t);
|
||||
uint8_t (*ITStatus)(uint16_t);
|
||||
void (*ClearIT)(void);
|
||||
void (*FilterConfig)(uint8_t);
|
||||
void (*FilterCmd)(uint8_t);
|
||||
void (*GetXYZ)(int16_t *);
|
||||
}MAGNETO_DrvTypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __MAGNETO_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
107
project/Drivers/BSP/Components/Common/ts.h
Normal file
107
project/Drivers/BSP/Components/Common/ts.h
Normal file
@@ -0,0 +1,107 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file ts.h
|
||||
* @author MCD Application Team
|
||||
* @version V4.0.1
|
||||
* @date 21-July-2015
|
||||
* @brief This file contains all the functions prototypes for the Touch Screen driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __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
|
||||
{
|
||||
void (*Init)(uint16_t);
|
||||
uint16_t (*ReadID)(uint16_t);
|
||||
void (*Reset)(uint16_t);
|
||||
void (*Start)(uint16_t);
|
||||
uint8_t (*DetectTouch)(uint16_t);
|
||||
void (*GetXY)(uint16_t, uint16_t*, uint16_t*);
|
||||
void (*EnableIT)(uint16_t);
|
||||
void (*ClearIT)(uint16_t);
|
||||
uint8_t (*GetITStatus)(uint16_t);
|
||||
void (*DisableIT)(uint16_t);
|
||||
}TS_DrvTypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __TS_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
118
project/Drivers/BSP/Components/Common/tsensor.h
Normal file
118
project/Drivers/BSP/Components/Common/tsensor.h
Normal file
@@ -0,0 +1,118 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file tsensor.h
|
||||
* @author MCD Application Team
|
||||
* @version V4.0.1
|
||||
* @date 21-July-2015
|
||||
* @brief This header file contains the functions prototypes for the
|
||||
* Temperature Sensor driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __TSENSOR_H
|
||||
#define __TSENSOR_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup TSENSOR
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup TSENSOR_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup TSENSOR_Config_structure Temperature Sensor Configuration structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint8_t AlertMode; /* Alert Mode Temperature out of range*/
|
||||
uint8_t ConversionMode; /* Continuous/One Shot Mode */
|
||||
uint8_t ConversionResolution; /* Temperature Resolution */
|
||||
uint8_t ConversionRate; /* Number of measure per second */
|
||||
uint8_t TemperatureLimitHigh; /* High Temperature Limit Range */
|
||||
uint8_t TemperatureLimitLow; /* Low Temperature Limit Range */
|
||||
}TSENSOR_InitTypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup TSENSOR_Driver_structure Temperature Sensor Driver structure
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
void (*Init)(uint16_t, TSENSOR_InitTypeDef *);
|
||||
uint8_t (*IsReady)(uint16_t, uint32_t);
|
||||
uint8_t (*ReadStatus)(uint16_t);
|
||||
uint16_t (*ReadTemp)(uint16_t);
|
||||
}TSENSOR_DrvTypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __TSENSOR_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
215
project/Drivers/BSP/Components/ft5336/Release_Notes.html
Normal file
215
project/Drivers/BSP/Components/ft5336/Release_Notes.html
Normal file
@@ -0,0 +1,215 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
|
||||
|
||||
<link rel="File-List" href="Library_files/filelist.xml">
|
||||
|
||||
|
||||
<link rel="Edit-Time-Data" href="Library_files/editdata.mso"><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><title>Release Notes for FT5336GQQ Component Driver</title><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>STMicroelectronics</o:Author> <o:LastAuthor>STMicroelectronics</o:LastAuthor> <o:Revision>37</o:Revision> <o:TotalTime>136</o:TotalTime> <o:Created>2009-02-27T19:26:00Z</o:Created> <o:LastSaved>2009-03-01T17:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>522</o:Words> <o:Characters>2977</o:Characters> <o:Company>STMicroelectronics</o:Company> <o:Lines>24</o:Lines> <o:Paragraphs>6</o:Paragraphs> <o:CharactersWithSpaces>3493</o:CharactersWithSpaces> <o:Version>11.6568</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>110</w:Zoom> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
<!--
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
h2
|
||||
{mso-style-next:Normal;
|
||||
margin-top:12.0pt;
|
||||
margin-right:0in;
|
||||
margin-bottom:3.0pt;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
page-break-after:avoid;
|
||||
mso-outline-level:2;
|
||||
font-size:14.0pt;
|
||||
font-family:Arial;
|
||||
font-weight:bold;
|
||||
font-style:italic;}
|
||||
a:link, span.MsoHyperlink
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
a:visited, span.MsoHyperlinkFollowed
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
p
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="5122"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]-->
|
||||
<meta content="MCD Application Team" name="author"></head>
|
||||
<body link="blue" vlink="blue">
|
||||
<div class="Section1">
|
||||
<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
|
||||
</o:p></span></p>
|
||||
<div align="center">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Arial; color: blue;"><a href="../../../../Release_Notes.html">Back to Release page</a><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="">
|
||||
<td style="padding: 1.5pt;">
|
||||
<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release
|
||||
Notes for FT5336GQQ Component Driver</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
|
||||
2015 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="../../../../_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p> </o:p></span></p>
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" width="900">
|
||||
<tbody>
|
||||
<tr style="">
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<span style="font-family: "Times New Roman";">
|
||||
</span>
|
||||
<h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; width: 180px; margin-right: 500pt;"><span style="color: white; font-family: Arial; font-size: 10pt;">V1.0.1 / 07-April-2017 <o:p></o:p></span></h3><p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b><u><span style="color: black; font-family: Verdana; font-size: 10pt;">Main Changes<o:p></o:p></span></u></b></p><span style="font-family: Verdana; font-size: 10pt;"></span> <span style="font-family: Verdana; font-size: 10pt;"></span> <span style="font-family: Verdana; font-size: 10pt;"></span><span style="font-family: Verdana; font-size: 10pt;"></span> <span style="font-family: Verdana; font-size: 10pt;"></span> <span style="font-family: Verdana; font-size: 10pt;"></span> <span style="font-family: Verdana; font-size: 10pt;"></span> <span style="font-family: Verdana; font-size: 10pt;"></span> <span style="font-family: Verdana; font-size: 10pt;"></span> <span style="font-family: Verdana; font-size: 10pt;"></span> <ul style="list-style-type: square;"><li><span style="font-family: Verdana; font-size: 10pt;"></span><span style="font-family: Verdana;"></span><span style="font-family: Verdana; font-size: 10pt;">Update comments to be used for PDSC generation</span></li></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0 / 25-June-2015 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">First official release of FT5336 TS driver </span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="License"></a><span style="font-size: 12pt; color: white;">License<o:p></o:p></span><br></h2>
|
||||
<div style="text-align: justify;"><font size="-1"><span style="font-family: "Verdana","sans-serif";">
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:</span><br>
|
||||
</font>
|
||||
<ol><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions
|
||||
in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in </span><span style="font-family: "Verdana","sans-serif";">the documentation and/or other materials provided with the distribution.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived </span><br>
|
||||
</font>
|
||||
</li></ol>
|
||||
<font size="-1"><span style="font-family: "Verdana","sans-serif";"> from this software without specific prior written permission.</span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";"></span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED</span><span style="font-family: "Verdana","sans-serif";"> WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A </span><span style="font-family: "Verdana","sans-serif";">PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY </span><span style="font-family: "Verdana","sans-serif";">DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, </span><span style="font-family: "Verdana","sans-serif";">PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER</span><span style="font-family: "Verdana","sans-serif";"> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR </span><span style="font-family: "Verdana","sans-serif";">OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></font>
|
||||
|
||||
</div>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;"><font size="-1"></font><o:p></o:p></span></p>
|
||||
<b><span style="font-size: 10pt; font-family: Verdana; color: black;"></span></b>
|
||||
|
||||
<div class="MsoNormal" style="text-align: center;" align="center"><span style="color: black;">
|
||||
<hr align="center" size="2" width="100%"></span></div>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt; text-align: center;" align="center"><span style="font-size: 10pt; font-family: Verdana; color: black;">For
|
||||
complete documentation on </span><span style="font-size: 10pt; font-family: Verdana;">STM32<span style="color: black;"> Microcontrollers
|
||||
visit </span><u><span style="color: blue;"><a href="http://www.st.com/internet/mcu/class/1734.jsp" target="_blank">www.st.com/STM32</a></span></u></span><span style="font-size: 10pt; font-family: Verdana;"><a target="_blank" href="http://www.st.com/internet/mcu/family/141.jsp"><u><span style="color: blue;"></span></u></a></span><span style="font-size: 10pt; font-family: Verdana;"><u><span style="color: blue;"></span></u></span><span style="color: black;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="MsoNormal"><o:p> </o:p></p>
|
||||
</div>
|
||||
|
||||
</body></html>
|
||||
623
project/Drivers/BSP/Components/ft5336/ft5336.c
Normal file
623
project/Drivers/BSP/Components/ft5336/ft5336.c
Normal file
@@ -0,0 +1,623 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file ft5336.c
|
||||
* @author MCD Application Team
|
||||
* @brief This file provides a set of functions needed to manage the FT5336
|
||||
* touch screen devices.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "ft5336.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup FT5336
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
|
||||
/** @defgroup FT5336_Private_Types_Definitions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Private define ------------------------------------------------------------*/
|
||||
|
||||
/** @defgroup FT5336_Private_Defines
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Private macro -------------------------------------------------------------*/
|
||||
|
||||
/** @defgroup FT5336_Private_Macros
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
|
||||
/** @defgroup FT5336_Private_Variables
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Touch screen driver structure initialization */
|
||||
TS_DrvTypeDef ft5336_ts_drv =
|
||||
{
|
||||
ft5336_Init,
|
||||
ft5336_ReadID,
|
||||
ft5336_Reset,
|
||||
|
||||
ft5336_TS_Start,
|
||||
ft5336_TS_DetectTouch,
|
||||
ft5336_TS_GetXY,
|
||||
|
||||
ft5336_TS_EnableIT,
|
||||
ft5336_TS_ClearIT,
|
||||
ft5336_TS_ITStatus,
|
||||
ft5336_TS_DisableIT
|
||||
|
||||
};
|
||||
|
||||
/* Global ft5336 handle */
|
||||
static ft5336_handle_TypeDef ft5336_handle = { FT5336_I2C_NOT_INITIALIZED, 0, 0};
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup ft5336_Private_Function_Prototypes
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Private functions prototypes-----------------------------------------------*/
|
||||
|
||||
/**
|
||||
* @brief Return the status of I2C was initialized or not.
|
||||
* @param None.
|
||||
* @retval : I2C initialization status.
|
||||
*/
|
||||
static uint8_t ft5336_Get_I2C_InitializedStatus(void);
|
||||
|
||||
/**
|
||||
* @brief I2C initialize if needed.
|
||||
* @param None.
|
||||
* @retval : None.
|
||||
*/
|
||||
static void ft5336_I2C_InitializeIfRequired(void);
|
||||
|
||||
/**
|
||||
* @brief Basic static configuration of TouchScreen
|
||||
* @param DeviceAddr: FT5336 Device address for communication on I2C Bus.
|
||||
* @retval Status FT5336_STATUS_OK or FT5336_STATUS_NOT_OK.
|
||||
*/
|
||||
static uint32_t ft5336_TS_Configure(uint16_t DeviceAddr);
|
||||
|
||||
/** @defgroup ft5336_Private_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup ft5336_Public_Function_Body
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Public functions bodies-----------------------------------------------*/
|
||||
|
||||
|
||||
/**
|
||||
* @brief Initialize the ft5336 communication bus
|
||||
* from MCU to FT5336 : ie I2C channel initialization (if required).
|
||||
* @param DeviceAddr: Device address on communication Bus (I2C slave address of FT5336).
|
||||
* @retval None
|
||||
*/
|
||||
void ft5336_Init(uint16_t DeviceAddr)
|
||||
{
|
||||
/* Wait at least 200ms after power up before accessing registers
|
||||
* Trsi timing (Time of starting to report point after resetting) from FT5336GQQ datasheet */
|
||||
TS_IO_Delay(200);
|
||||
|
||||
/* Initialize I2C link if needed */
|
||||
ft5336_I2C_InitializeIfRequired();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Software Reset the ft5336.
|
||||
* @note : Not applicable to FT5336.
|
||||
* @param DeviceAddr: Device address on communication Bus (I2C slave address of FT5336).
|
||||
* @retval None
|
||||
*/
|
||||
void ft5336_Reset(uint16_t DeviceAddr)
|
||||
{
|
||||
/* Do nothing */
|
||||
/* No software reset sequence available in FT5336 IC */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Read the ft5336 device ID, pre initialize I2C in case of need to be
|
||||
* able to read the FT5336 device ID, and verify this is a FT5336.
|
||||
* @param DeviceAddr: I2C FT5336 Slave address.
|
||||
* @retval The Device ID (two bytes).
|
||||
*/
|
||||
uint16_t ft5336_ReadID(uint16_t DeviceAddr)
|
||||
{
|
||||
volatile uint8_t ucReadId = 0;
|
||||
uint8_t nbReadAttempts = 0;
|
||||
uint8_t bFoundDevice = 0; /* Device not found by default */
|
||||
|
||||
/* Initialize I2C link if needed */
|
||||
ft5336_I2C_InitializeIfRequired();
|
||||
|
||||
/* At maximum 4 attempts to read ID : exit at first finding of the searched device ID */
|
||||
for(nbReadAttempts = 0; ((nbReadAttempts < 3) && !(bFoundDevice)); nbReadAttempts++)
|
||||
{
|
||||
/* Read register FT5336_CHIP_ID_REG as DeviceID detection */
|
||||
ucReadId = TS_IO_Read(DeviceAddr, FT5336_CHIP_ID_REG);
|
||||
|
||||
/* Found the searched device ID ? */
|
||||
if(ucReadId == FT5336_ID_VALUE)
|
||||
{
|
||||
/* Set device as found */
|
||||
bFoundDevice = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Return the device ID value */
|
||||
return (ucReadId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configures the touch Screen IC device to start detecting touches
|
||||
* @param DeviceAddr: Device address on communication Bus (I2C slave address).
|
||||
* @retval None.
|
||||
*/
|
||||
void ft5336_TS_Start(uint16_t DeviceAddr)
|
||||
{
|
||||
/* Minimum static configuration of FT5336 */
|
||||
FT5336_ASSERT(ft5336_TS_Configure(DeviceAddr));
|
||||
|
||||
/* By default set FT5336 IC in Polling mode : no INT generation on FT5336 for new touch available */
|
||||
/* Note TS_INT is active low */
|
||||
ft5336_TS_DisableIT(DeviceAddr);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return if there is touches detected or not.
|
||||
* Try to detect new touches and forget the old ones (reset internal global
|
||||
* variables).
|
||||
* @param DeviceAddr: Device address on communication Bus.
|
||||
* @retval : Number of active touches detected (can be 0, 1 or 2).
|
||||
*/
|
||||
uint8_t ft5336_TS_DetectTouch(uint16_t DeviceAddr)
|
||||
{
|
||||
volatile uint8_t nbTouch = 0;
|
||||
|
||||
/* Read register FT5336_TD_STAT_REG to check number of touches detection */
|
||||
nbTouch = TS_IO_Read(DeviceAddr, FT5336_TD_STAT_REG);
|
||||
nbTouch &= FT5336_TD_STAT_MASK;
|
||||
|
||||
if(nbTouch > FT5336_MAX_DETECTABLE_TOUCH)
|
||||
{
|
||||
/* If invalid number of touch detected, set it to zero */
|
||||
nbTouch = 0;
|
||||
}
|
||||
|
||||
/* Update ft5336 driver internal global : current number of active touches */
|
||||
ft5336_handle.currActiveTouchNb = nbTouch;
|
||||
|
||||
/* Reset current active touch index on which to work on */
|
||||
ft5336_handle.currActiveTouchIdx = 0;
|
||||
|
||||
return(nbTouch);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the touch screen X and Y positions values
|
||||
* Manage multi touch thanks to touch Index global
|
||||
* variable 'ft5336_handle.currActiveTouchIdx'.
|
||||
* @param DeviceAddr: Device address on communication Bus.
|
||||
* @param X: Pointer to X position value
|
||||
* @param Y: Pointer to Y position value
|
||||
* @retval None.
|
||||
*/
|
||||
void ft5336_TS_GetXY(uint16_t DeviceAddr, uint16_t *X, uint16_t *Y)
|
||||
{
|
||||
volatile uint8_t ucReadData = 0;
|
||||
static uint16_t coord;
|
||||
uint8_t regAddressXLow = 0;
|
||||
uint8_t regAddressXHigh = 0;
|
||||
uint8_t regAddressYLow = 0;
|
||||
uint8_t regAddressYHigh = 0;
|
||||
|
||||
if(ft5336_handle.currActiveTouchIdx < ft5336_handle.currActiveTouchNb)
|
||||
{
|
||||
switch(ft5336_handle.currActiveTouchIdx)
|
||||
{
|
||||
case 0 :
|
||||
regAddressXLow = FT5336_P1_XL_REG;
|
||||
regAddressXHigh = FT5336_P1_XH_REG;
|
||||
regAddressYLow = FT5336_P1_YL_REG;
|
||||
regAddressYHigh = FT5336_P1_YH_REG;
|
||||
break;
|
||||
|
||||
case 1 :
|
||||
regAddressXLow = FT5336_P2_XL_REG;
|
||||
regAddressXHigh = FT5336_P2_XH_REG;
|
||||
regAddressYLow = FT5336_P2_YL_REG;
|
||||
regAddressYHigh = FT5336_P2_YH_REG;
|
||||
break;
|
||||
|
||||
case 2 :
|
||||
regAddressXLow = FT5336_P3_XL_REG;
|
||||
regAddressXHigh = FT5336_P3_XH_REG;
|
||||
regAddressYLow = FT5336_P3_YL_REG;
|
||||
regAddressYHigh = FT5336_P3_YH_REG;
|
||||
break;
|
||||
|
||||
case 3 :
|
||||
regAddressXLow = FT5336_P4_XL_REG;
|
||||
regAddressXHigh = FT5336_P4_XH_REG;
|
||||
regAddressYLow = FT5336_P4_YL_REG;
|
||||
regAddressYHigh = FT5336_P4_YH_REG;
|
||||
break;
|
||||
|
||||
case 4 :
|
||||
regAddressXLow = FT5336_P5_XL_REG;
|
||||
regAddressXHigh = FT5336_P5_XH_REG;
|
||||
regAddressYLow = FT5336_P5_YL_REG;
|
||||
regAddressYHigh = FT5336_P5_YH_REG;
|
||||
break;
|
||||
|
||||
case 5 :
|
||||
regAddressXLow = FT5336_P6_XL_REG;
|
||||
regAddressXHigh = FT5336_P6_XH_REG;
|
||||
regAddressYLow = FT5336_P6_YL_REG;
|
||||
regAddressYHigh = FT5336_P6_YH_REG;
|
||||
break;
|
||||
|
||||
case 6 :
|
||||
regAddressXLow = FT5336_P7_XL_REG;
|
||||
regAddressXHigh = FT5336_P7_XH_REG;
|
||||
regAddressYLow = FT5336_P7_YL_REG;
|
||||
regAddressYHigh = FT5336_P7_YH_REG;
|
||||
break;
|
||||
|
||||
case 7 :
|
||||
regAddressXLow = FT5336_P8_XL_REG;
|
||||
regAddressXHigh = FT5336_P8_XH_REG;
|
||||
regAddressYLow = FT5336_P8_YL_REG;
|
||||
regAddressYHigh = FT5336_P8_YH_REG;
|
||||
break;
|
||||
|
||||
case 8 :
|
||||
regAddressXLow = FT5336_P9_XL_REG;
|
||||
regAddressXHigh = FT5336_P9_XH_REG;
|
||||
regAddressYLow = FT5336_P9_YL_REG;
|
||||
regAddressYHigh = FT5336_P9_YH_REG;
|
||||
break;
|
||||
|
||||
case 9 :
|
||||
regAddressXLow = FT5336_P10_XL_REG;
|
||||
regAddressXHigh = FT5336_P10_XH_REG;
|
||||
regAddressYLow = FT5336_P10_YL_REG;
|
||||
regAddressYHigh = FT5336_P10_YH_REG;
|
||||
break;
|
||||
|
||||
default :
|
||||
break;
|
||||
|
||||
} /* end switch(ft5336_handle.currActiveTouchIdx) */
|
||||
|
||||
/* Read low part of X position */
|
||||
ucReadData = TS_IO_Read(DeviceAddr, regAddressXLow);
|
||||
coord = (ucReadData & FT5336_TOUCH_POS_LSB_MASK) >> FT5336_TOUCH_POS_LSB_SHIFT;
|
||||
|
||||
/* Read high part of X position */
|
||||
ucReadData = TS_IO_Read(DeviceAddr, regAddressXHigh);
|
||||
coord |= ((ucReadData & FT5336_TOUCH_POS_MSB_MASK) >> FT5336_TOUCH_POS_MSB_SHIFT) << 8;
|
||||
|
||||
/* Send back ready X position to caller */
|
||||
*X = coord;
|
||||
|
||||
/* Read low part of Y position */
|
||||
ucReadData = TS_IO_Read(DeviceAddr, regAddressYLow);
|
||||
coord = (ucReadData & FT5336_TOUCH_POS_LSB_MASK) >> FT5336_TOUCH_POS_LSB_SHIFT;
|
||||
|
||||
/* Read high part of Y position */
|
||||
ucReadData = TS_IO_Read(DeviceAddr, regAddressYHigh);
|
||||
coord |= ((ucReadData & FT5336_TOUCH_POS_MSB_MASK) >> FT5336_TOUCH_POS_MSB_SHIFT) << 8;
|
||||
|
||||
/* Send back ready Y position to caller */
|
||||
*Y = coord;
|
||||
|
||||
ft5336_handle.currActiveTouchIdx++; /* next call will work on next touch */
|
||||
|
||||
} /* of if(ft5336_handle.currActiveTouchIdx < ft5336_handle.currActiveTouchNb) */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configure the FT5336 device to generate IT on given INT pin
|
||||
* connected to MCU as EXTI.
|
||||
* @param DeviceAddr: Device address on communication Bus (Slave I2C address of FT5336).
|
||||
* @retval None
|
||||
*/
|
||||
void ft5336_TS_EnableIT(uint16_t DeviceAddr)
|
||||
{
|
||||
uint8_t regValue = 0;
|
||||
regValue = (FT5336_G_MODE_INTERRUPT_TRIGGER & (FT5336_G_MODE_INTERRUPT_MASK >> FT5336_G_MODE_INTERRUPT_SHIFT)) << FT5336_G_MODE_INTERRUPT_SHIFT;
|
||||
|
||||
/* Set interrupt trigger mode in FT5336_GMODE_REG */
|
||||
TS_IO_Write(DeviceAddr, FT5336_GMODE_REG, regValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configure the FT5336 device to stop generating IT on the given INT pin
|
||||
* connected to MCU as EXTI.
|
||||
* @param DeviceAddr: Device address on communication Bus (Slave I2C address of FT5336).
|
||||
* @retval None
|
||||
*/
|
||||
void ft5336_TS_DisableIT(uint16_t DeviceAddr)
|
||||
{
|
||||
uint8_t regValue = 0;
|
||||
regValue = (FT5336_G_MODE_INTERRUPT_POLLING & (FT5336_G_MODE_INTERRUPT_MASK >> FT5336_G_MODE_INTERRUPT_SHIFT)) << FT5336_G_MODE_INTERRUPT_SHIFT;
|
||||
|
||||
/* Set interrupt polling mode in FT5336_GMODE_REG */
|
||||
TS_IO_Write(DeviceAddr, FT5336_GMODE_REG, regValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get IT status from FT5336 interrupt status registers
|
||||
* Should be called Following an EXTI coming to the MCU to know the detailed
|
||||
* reason of the interrupt.
|
||||
* @note : This feature is not applicable to FT5336.
|
||||
* @param DeviceAddr: Device address on communication Bus (I2C slave address of FT5336).
|
||||
* @retval TS interrupts status : always return 0 here
|
||||
*/
|
||||
uint8_t ft5336_TS_ITStatus(uint16_t DeviceAddr)
|
||||
{
|
||||
/* Always return 0 as feature not applicable to FT5336 */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clear IT status in FT5336 interrupt status clear registers
|
||||
* Should be called Following an EXTI coming to the MCU.
|
||||
* @note : This feature is not applicable to FT5336.
|
||||
* @param DeviceAddr: Device address on communication Bus (I2C slave address of FT5336).
|
||||
* @retval None
|
||||
*/
|
||||
void ft5336_TS_ClearIT(uint16_t DeviceAddr)
|
||||
{
|
||||
/* Nothing to be done here for FT5336 */
|
||||
}
|
||||
|
||||
/**** NEW FEATURES enabled when Multi-touch support is enabled ****/
|
||||
|
||||
#if (TS_MULTI_TOUCH_SUPPORTED == 1)
|
||||
|
||||
/**
|
||||
* @brief Get the last touch gesture identification (zoom, move up/down...).
|
||||
* @param DeviceAddr: Device address on communication Bus (I2C slave address of FT5336).
|
||||
* @param pGestureId : Pointer to get last touch gesture Identification.
|
||||
* @retval None.
|
||||
*/
|
||||
void ft5336_TS_GetGestureID(uint16_t DeviceAddr, uint32_t * pGestureId)
|
||||
{
|
||||
volatile uint8_t ucReadData = 0;
|
||||
|
||||
ucReadData = TS_IO_Read(DeviceAddr, FT5336_GEST_ID_REG);
|
||||
|
||||
* pGestureId = ucReadData;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the touch detailed informations on touch number 'touchIdx' (0..1)
|
||||
* This touch detailed information contains :
|
||||
* - weight that was applied to this touch
|
||||
* - sub-area of the touch in the touch panel
|
||||
* - event of linked to the touch (press down, lift up, ...)
|
||||
* @param DeviceAddr: Device address on communication Bus (I2C slave address of FT5336).
|
||||
* @param touchIdx : Passed index of the touch (0..1) on which we want to get the
|
||||
* detailed information.
|
||||
* @param pWeight : Pointer to to get the weight information of 'touchIdx'.
|
||||
* @param pArea : Pointer to to get the sub-area information of 'touchIdx'.
|
||||
* @param pEvent : Pointer to to get the event information of 'touchIdx'.
|
||||
|
||||
* @retval None.
|
||||
*/
|
||||
void ft5336_TS_GetTouchInfo(uint16_t DeviceAddr,
|
||||
uint32_t touchIdx,
|
||||
uint32_t * pWeight,
|
||||
uint32_t * pArea,
|
||||
uint32_t * pEvent)
|
||||
{
|
||||
volatile uint8_t ucReadData = 0;
|
||||
uint8_t regAddressXHigh = 0;
|
||||
uint8_t regAddressPWeight = 0;
|
||||
uint8_t regAddressPMisc = 0;
|
||||
|
||||
if(touchIdx < ft5336_handle.currActiveTouchNb)
|
||||
{
|
||||
switch(touchIdx)
|
||||
{
|
||||
case 0 :
|
||||
regAddressXHigh = FT5336_P1_XH_REG;
|
||||
regAddressPWeight = FT5336_P1_WEIGHT_REG;
|
||||
regAddressPMisc = FT5336_P1_MISC_REG;
|
||||
break;
|
||||
|
||||
case 1 :
|
||||
regAddressXHigh = FT5336_P2_XH_REG;
|
||||
regAddressPWeight = FT5336_P2_WEIGHT_REG;
|
||||
regAddressPMisc = FT5336_P2_MISC_REG;
|
||||
break;
|
||||
|
||||
case 2 :
|
||||
regAddressXHigh = FT5336_P3_XH_REG;
|
||||
regAddressPWeight = FT5336_P3_WEIGHT_REG;
|
||||
regAddressPMisc = FT5336_P3_MISC_REG;
|
||||
break;
|
||||
|
||||
case 3 :
|
||||
regAddressXHigh = FT5336_P4_XH_REG;
|
||||
regAddressPWeight = FT5336_P4_WEIGHT_REG;
|
||||
regAddressPMisc = FT5336_P4_MISC_REG;
|
||||
break;
|
||||
|
||||
case 4 :
|
||||
regAddressXHigh = FT5336_P5_XH_REG;
|
||||
regAddressPWeight = FT5336_P5_WEIGHT_REG;
|
||||
regAddressPMisc = FT5336_P5_MISC_REG;
|
||||
break;
|
||||
|
||||
case 5 :
|
||||
regAddressXHigh = FT5336_P6_XH_REG;
|
||||
regAddressPWeight = FT5336_P6_WEIGHT_REG;
|
||||
regAddressPMisc = FT5336_P6_MISC_REG;
|
||||
break;
|
||||
|
||||
case 6 :
|
||||
regAddressXHigh = FT5336_P7_XH_REG;
|
||||
regAddressPWeight = FT5336_P7_WEIGHT_REG;
|
||||
regAddressPMisc = FT5336_P7_MISC_REG;
|
||||
break;
|
||||
|
||||
case 7 :
|
||||
regAddressXHigh = FT5336_P8_XH_REG;
|
||||
regAddressPWeight = FT5336_P8_WEIGHT_REG;
|
||||
regAddressPMisc = FT5336_P8_MISC_REG;
|
||||
break;
|
||||
|
||||
case 8 :
|
||||
regAddressXHigh = FT5336_P9_XH_REG;
|
||||
regAddressPWeight = FT5336_P9_WEIGHT_REG;
|
||||
regAddressPMisc = FT5336_P9_MISC_REG;
|
||||
break;
|
||||
|
||||
case 9 :
|
||||
regAddressXHigh = FT5336_P10_XH_REG;
|
||||
regAddressPWeight = FT5336_P10_WEIGHT_REG;
|
||||
regAddressPMisc = FT5336_P10_MISC_REG;
|
||||
break;
|
||||
|
||||
default :
|
||||
break;
|
||||
|
||||
} /* end switch(touchIdx) */
|
||||
|
||||
/* Read Event Id of touch index */
|
||||
ucReadData = TS_IO_Read(DeviceAddr, regAddressXHigh);
|
||||
* pEvent = (ucReadData & FT5336_TOUCH_EVT_FLAG_MASK) >> FT5336_TOUCH_EVT_FLAG_SHIFT;
|
||||
|
||||
/* Read weight of touch index */
|
||||
ucReadData = TS_IO_Read(DeviceAddr, regAddressPWeight);
|
||||
* pWeight = (ucReadData & FT5336_TOUCH_WEIGHT_MASK) >> FT5336_TOUCH_WEIGHT_SHIFT;
|
||||
|
||||
/* Read area of touch index */
|
||||
ucReadData = TS_IO_Read(DeviceAddr, regAddressPMisc);
|
||||
* pArea = (ucReadData & FT5336_TOUCH_AREA_MASK) >> FT5336_TOUCH_AREA_SHIFT;
|
||||
|
||||
} /* of if(touchIdx < ft5336_handle.currActiveTouchNb) */
|
||||
}
|
||||
|
||||
#endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
|
||||
|
||||
/** @defgroup ft5336_Static_Function_Body
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Static functions bodies-----------------------------------------------*/
|
||||
|
||||
|
||||
/**
|
||||
* @brief Return the status of I2C was initialized or not.
|
||||
* @param None.
|
||||
* @retval : I2C initialization status.
|
||||
*/
|
||||
static uint8_t ft5336_Get_I2C_InitializedStatus(void)
|
||||
{
|
||||
return(ft5336_handle.i2cInitialized);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief I2C initialize if needed.
|
||||
* @param None.
|
||||
* @retval : None.
|
||||
*/
|
||||
static void ft5336_I2C_InitializeIfRequired(void)
|
||||
{
|
||||
if(ft5336_Get_I2C_InitializedStatus() == FT5336_I2C_NOT_INITIALIZED)
|
||||
{
|
||||
/* Initialize TS IO BUS layer (I2C) */
|
||||
TS_IO_Init();
|
||||
|
||||
/* Set state to initialized */
|
||||
ft5336_handle.i2cInitialized = FT5336_I2C_INITIALIZED;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Basic static configuration of TouchScreen
|
||||
* @param DeviceAddr: FT5336 Device address for communication on I2C Bus.
|
||||
* @retval Status FT5336_STATUS_OK or FT5336_STATUS_NOT_OK.
|
||||
*/
|
||||
static uint32_t ft5336_TS_Configure(uint16_t DeviceAddr)
|
||||
{
|
||||
uint32_t status = FT5336_STATUS_OK;
|
||||
|
||||
/* Nothing special to be done for FT5336 */
|
||||
|
||||
return(status);
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
538
project/Drivers/BSP/Components/ft5336/ft5336.h
Normal file
538
project/Drivers/BSP/Components/ft5336/ft5336.h
Normal file
@@ -0,0 +1,538 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file ft5336.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the functions prototypes for the
|
||||
* ft5336.c Touch screen driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __FT5336_H
|
||||
#define __FT5336_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Set Multi-touch as supported */
|
||||
#if !defined(TS_MONO_TOUCH_SUPPORTED)
|
||||
#define TS_MULTI_TOUCH_SUPPORTED 1
|
||||
#endif /* TS_MONO_TOUCH_SUPPORTED */
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "../Common/ts.h"
|
||||
|
||||
/* Macros --------------------------------------------------------------------*/
|
||||
|
||||
#if defined(FT5336_ENABLE_ASSERT)
|
||||
/* Assert activated */
|
||||
#define FT5336_ASSERT(__condition__) do { if(__condition__) \
|
||||
{ \
|
||||
while(1); \
|
||||
} \
|
||||
}while(0)
|
||||
#else
|
||||
/* Assert not activated : macro has no effect */
|
||||
#define FT5336_ASSERT(__condition__) do { if(__condition__) \
|
||||
{ \
|
||||
; \
|
||||
} \
|
||||
}while(0)
|
||||
#endif /* FT5336_ENABLE_ASSERT == 1 */
|
||||
|
||||
/** @typedef ft5336_handle_TypeDef
|
||||
* ft5336 Handle definition.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint8_t i2cInitialized;
|
||||
|
||||
/* field holding the current number of simultaneous active touches */
|
||||
uint8_t currActiveTouchNb;
|
||||
|
||||
/* field holding the touch index currently managed */
|
||||
uint8_t currActiveTouchIdx;
|
||||
|
||||
} ft5336_handle_TypeDef;
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup FT5336
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
|
||||
/** @defgroup FT5336_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/** @defgroup FT5336_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* I2C Slave address of touchscreen FocalTech FT5336 */
|
||||
#define FT5336_I2C_SLAVE_ADDRESS ((uint8_t)0x70)
|
||||
|
||||
/* Maximum border values of the touchscreen pad */
|
||||
#define FT5336_MAX_WIDTH ((uint16_t)480) /* Touchscreen pad max width */
|
||||
#define FT5336_MAX_HEIGHT ((uint16_t)272) /* Touchscreen pad max height */
|
||||
|
||||
/* Possible values of driver functions return status */
|
||||
#define FT5336_STATUS_OK ((uint8_t)0x00)
|
||||
#define FT5336_STATUS_NOT_OK ((uint8_t)0x01)
|
||||
|
||||
/* Possible values of global variable 'TS_I2C_Initialized' */
|
||||
#define FT5336_I2C_NOT_INITIALIZED ((uint8_t)0x00)
|
||||
#define FT5336_I2C_INITIALIZED ((uint8_t)0x01)
|
||||
|
||||
/* Max detectable simultaneous touches */
|
||||
#define FT5336_MAX_DETECTABLE_TOUCH ((uint8_t)0x05)
|
||||
|
||||
/**
|
||||
* @brief : Definitions for FT5336 I2C register addresses on 8 bit
|
||||
**/
|
||||
|
||||
/* Current mode register of the FT5336 (R/W) */
|
||||
#define FT5336_DEV_MODE_REG ((uint8_t)0x00)
|
||||
|
||||
/* Possible values of FT5336_DEV_MODE_REG */
|
||||
#define FT5336_DEV_MODE_WORKING ((uint8_t)0x00)
|
||||
#define FT5336_DEV_MODE_FACTORY ((uint8_t)0x04)
|
||||
|
||||
#define FT5336_DEV_MODE_MASK ((uint8_t)0x07)
|
||||
#define FT5336_DEV_MODE_SHIFT ((uint8_t)0x04)
|
||||
|
||||
/* Gesture ID register */
|
||||
#define FT5336_GEST_ID_REG ((uint8_t)0x01)
|
||||
|
||||
/* Possible values of FT5336_GEST_ID_REG */
|
||||
#define FT5336_GEST_ID_NO_GESTURE ((uint8_t)0x00)
|
||||
#define FT5336_GEST_ID_MOVE_UP ((uint8_t)0x10)
|
||||
#define FT5336_GEST_ID_MOVE_RIGHT ((uint8_t)0x14)
|
||||
#define FT5336_GEST_ID_MOVE_DOWN ((uint8_t)0x18)
|
||||
#define FT5336_GEST_ID_MOVE_LEFT ((uint8_t)0x1C)
|
||||
#define FT5336_GEST_ID_SINGLE_CLICK ((uint8_t)0x20)
|
||||
#define FT5336_GEST_ID_DOUBLE_CLICK ((uint8_t)0x22)
|
||||
#define FT5336_GEST_ID_ROTATE_CLOCKWISE ((uint8_t)0x28)
|
||||
#define FT5336_GEST_ID_ROTATE_C_CLOCKWISE ((uint8_t)0x29)
|
||||
#define FT5336_GEST_ID_ZOOM_IN ((uint8_t)0x40)
|
||||
#define FT5336_GEST_ID_ZOOM_OUT ((uint8_t)0x49)
|
||||
|
||||
/* Touch Data Status register : gives number of active touch points (0..5) */
|
||||
#define FT5336_TD_STAT_REG ((uint8_t)0x02)
|
||||
|
||||
/* Values related to FT5336_TD_STAT_REG */
|
||||
#define FT5336_TD_STAT_MASK ((uint8_t)0x0F)
|
||||
#define FT5336_TD_STAT_SHIFT ((uint8_t)0x00)
|
||||
|
||||
/* Values Pn_XH and Pn_YH related */
|
||||
#define FT5336_TOUCH_EVT_FLAG_PRESS_DOWN ((uint8_t)0x00)
|
||||
#define FT5336_TOUCH_EVT_FLAG_LIFT_UP ((uint8_t)0x01)
|
||||
#define FT5336_TOUCH_EVT_FLAG_CONTACT ((uint8_t)0x02)
|
||||
#define FT5336_TOUCH_EVT_FLAG_NO_EVENT ((uint8_t)0x03)
|
||||
|
||||
#define FT5336_TOUCH_EVT_FLAG_SHIFT ((uint8_t)0x06)
|
||||
#define FT5336_TOUCH_EVT_FLAG_MASK ((uint8_t)(3 << FT5336_TOUCH_EVT_FLAG_SHIFT))
|
||||
|
||||
#define FT5336_TOUCH_POS_MSB_MASK ((uint8_t)0x0F)
|
||||
#define FT5336_TOUCH_POS_MSB_SHIFT ((uint8_t)0x00)
|
||||
|
||||
/* Values Pn_XL and Pn_YL related */
|
||||
#define FT5336_TOUCH_POS_LSB_MASK ((uint8_t)0xFF)
|
||||
#define FT5336_TOUCH_POS_LSB_SHIFT ((uint8_t)0x00)
|
||||
|
||||
#define FT5336_P1_XH_REG ((uint8_t)0x03)
|
||||
#define FT5336_P1_XL_REG ((uint8_t)0x04)
|
||||
#define FT5336_P1_YH_REG ((uint8_t)0x05)
|
||||
#define FT5336_P1_YL_REG ((uint8_t)0x06)
|
||||
|
||||
/* Touch Pressure register value (R) */
|
||||
#define FT5336_P1_WEIGHT_REG ((uint8_t)0x07)
|
||||
|
||||
/* Values Pn_WEIGHT related */
|
||||
#define FT5336_TOUCH_WEIGHT_MASK ((uint8_t)0xFF)
|
||||
#define FT5336_TOUCH_WEIGHT_SHIFT ((uint8_t)0x00)
|
||||
|
||||
/* Touch area register */
|
||||
#define FT5336_P1_MISC_REG ((uint8_t)0x08)
|
||||
|
||||
/* Values related to FT5336_Pn_MISC_REG */
|
||||
#define FT5336_TOUCH_AREA_MASK ((uint8_t)(0x04 << 4))
|
||||
#define FT5336_TOUCH_AREA_SHIFT ((uint8_t)0x04)
|
||||
|
||||
#define FT5336_P2_XH_REG ((uint8_t)0x09)
|
||||
#define FT5336_P2_XL_REG ((uint8_t)0x0A)
|
||||
#define FT5336_P2_YH_REG ((uint8_t)0x0B)
|
||||
#define FT5336_P2_YL_REG ((uint8_t)0x0C)
|
||||
#define FT5336_P2_WEIGHT_REG ((uint8_t)0x0D)
|
||||
#define FT5336_P2_MISC_REG ((uint8_t)0x0E)
|
||||
|
||||
#define FT5336_P3_XH_REG ((uint8_t)0x0F)
|
||||
#define FT5336_P3_XL_REG ((uint8_t)0x10)
|
||||
#define FT5336_P3_YH_REG ((uint8_t)0x11)
|
||||
#define FT5336_P3_YL_REG ((uint8_t)0x12)
|
||||
#define FT5336_P3_WEIGHT_REG ((uint8_t)0x13)
|
||||
#define FT5336_P3_MISC_REG ((uint8_t)0x14)
|
||||
|
||||
#define FT5336_P4_XH_REG ((uint8_t)0x15)
|
||||
#define FT5336_P4_XL_REG ((uint8_t)0x16)
|
||||
#define FT5336_P4_YH_REG ((uint8_t)0x17)
|
||||
#define FT5336_P4_YL_REG ((uint8_t)0x18)
|
||||
#define FT5336_P4_WEIGHT_REG ((uint8_t)0x19)
|
||||
#define FT5336_P4_MISC_REG ((uint8_t)0x1A)
|
||||
|
||||
#define FT5336_P5_XH_REG ((uint8_t)0x1B)
|
||||
#define FT5336_P5_XL_REG ((uint8_t)0x1C)
|
||||
#define FT5336_P5_YH_REG ((uint8_t)0x1D)
|
||||
#define FT5336_P5_YL_REG ((uint8_t)0x1E)
|
||||
#define FT5336_P5_WEIGHT_REG ((uint8_t)0x1F)
|
||||
#define FT5336_P5_MISC_REG ((uint8_t)0x20)
|
||||
|
||||
#define FT5336_P6_XH_REG ((uint8_t)0x21)
|
||||
#define FT5336_P6_XL_REG ((uint8_t)0x22)
|
||||
#define FT5336_P6_YH_REG ((uint8_t)0x23)
|
||||
#define FT5336_P6_YL_REG ((uint8_t)0x24)
|
||||
#define FT5336_P6_WEIGHT_REG ((uint8_t)0x25)
|
||||
#define FT5336_P6_MISC_REG ((uint8_t)0x26)
|
||||
|
||||
#define FT5336_P7_XH_REG ((uint8_t)0x27)
|
||||
#define FT5336_P7_XL_REG ((uint8_t)0x28)
|
||||
#define FT5336_P7_YH_REG ((uint8_t)0x29)
|
||||
#define FT5336_P7_YL_REG ((uint8_t)0x2A)
|
||||
#define FT5336_P7_WEIGHT_REG ((uint8_t)0x2B)
|
||||
#define FT5336_P7_MISC_REG ((uint8_t)0x2C)
|
||||
|
||||
#define FT5336_P8_XH_REG ((uint8_t)0x2D)
|
||||
#define FT5336_P8_XL_REG ((uint8_t)0x2E)
|
||||
#define FT5336_P8_YH_REG ((uint8_t)0x2F)
|
||||
#define FT5336_P8_YL_REG ((uint8_t)0x30)
|
||||
#define FT5336_P8_WEIGHT_REG ((uint8_t)0x31)
|
||||
#define FT5336_P8_MISC_REG ((uint8_t)0x32)
|
||||
|
||||
#define FT5336_P9_XH_REG ((uint8_t)0x33)
|
||||
#define FT5336_P9_XL_REG ((uint8_t)0x34)
|
||||
#define FT5336_P9_YH_REG ((uint8_t)0x35)
|
||||
#define FT5336_P9_YL_REG ((uint8_t)0x36)
|
||||
#define FT5336_P9_WEIGHT_REG ((uint8_t)0x37)
|
||||
#define FT5336_P9_MISC_REG ((uint8_t)0x38)
|
||||
|
||||
#define FT5336_P10_XH_REG ((uint8_t)0x39)
|
||||
#define FT5336_P10_XL_REG ((uint8_t)0x3A)
|
||||
#define FT5336_P10_YH_REG ((uint8_t)0x3B)
|
||||
#define FT5336_P10_YL_REG ((uint8_t)0x3C)
|
||||
#define FT5336_P10_WEIGHT_REG ((uint8_t)0x3D)
|
||||
#define FT5336_P10_MISC_REG ((uint8_t)0x3E)
|
||||
|
||||
/* Threshold for touch detection */
|
||||
#define FT5336_TH_GROUP_REG ((uint8_t)0x80)
|
||||
|
||||
/* Values FT5336_TH_GROUP_REG : threshold related */
|
||||
#define FT5336_THRESHOLD_MASK ((uint8_t)0xFF)
|
||||
#define FT5336_THRESHOLD_SHIFT ((uint8_t)0x00)
|
||||
|
||||
/* Filter function coefficients */
|
||||
#define FT5336_TH_DIFF_REG ((uint8_t)0x85)
|
||||
|
||||
/* Control register */
|
||||
#define FT5336_CTRL_REG ((uint8_t)0x86)
|
||||
|
||||
/* Values related to FT5336_CTRL_REG */
|
||||
|
||||
/* Will keep the Active mode when there is no touching */
|
||||
#define FT5336_CTRL_KEEP_ACTIVE_MODE ((uint8_t)0x00)
|
||||
|
||||
/* Switching from Active mode to Monitor mode automatically when there is no touching */
|
||||
#define FT5336_CTRL_KEEP_AUTO_SWITCH_MONITOR_MODE ((uint8_t)0x01
|
||||
|
||||
/* The time period of switching from Active mode to Monitor mode when there is no touching */
|
||||
#define FT5336_TIMEENTERMONITOR_REG ((uint8_t)0x87)
|
||||
|
||||
/* Report rate in Active mode */
|
||||
#define FT5336_PERIODACTIVE_REG ((uint8_t)0x88)
|
||||
|
||||
/* Report rate in Monitor mode */
|
||||
#define FT5336_PERIODMONITOR_REG ((uint8_t)0x89)
|
||||
|
||||
/* The value of the minimum allowed angle while Rotating gesture mode */
|
||||
#define FT5336_RADIAN_VALUE_REG ((uint8_t)0x91)
|
||||
|
||||
/* Maximum offset while Moving Left and Moving Right gesture */
|
||||
#define FT5336_OFFSET_LEFT_RIGHT_REG ((uint8_t)0x92)
|
||||
|
||||
/* Maximum offset while Moving Up and Moving Down gesture */
|
||||
#define FT5336_OFFSET_UP_DOWN_REG ((uint8_t)0x93)
|
||||
|
||||
/* Minimum distance while Moving Left and Moving Right gesture */
|
||||
#define FT5336_DISTANCE_LEFT_RIGHT_REG ((uint8_t)0x94)
|
||||
|
||||
/* Minimum distance while Moving Up and Moving Down gesture */
|
||||
#define FT5336_DISTANCE_UP_DOWN_REG ((uint8_t)0x95)
|
||||
|
||||
/* Maximum distance while Zoom In and Zoom Out gesture */
|
||||
#define FT5336_DISTANCE_ZOOM_REG ((uint8_t)0x96)
|
||||
|
||||
/* High 8-bit of LIB Version info */
|
||||
#define FT5336_LIB_VER_H_REG ((uint8_t)0xA1)
|
||||
|
||||
/* Low 8-bit of LIB Version info */
|
||||
#define FT5336_LIB_VER_L_REG ((uint8_t)0xA2)
|
||||
|
||||
/* Chip Selecting */
|
||||
#define FT5336_CIPHER_REG ((uint8_t)0xA3)
|
||||
|
||||
/* Interrupt mode register (used when in interrupt mode) */
|
||||
#define FT5336_GMODE_REG ((uint8_t)0xA4)
|
||||
|
||||
#define FT5336_G_MODE_INTERRUPT_MASK ((uint8_t)0x03)
|
||||
#define FT5336_G_MODE_INTERRUPT_SHIFT ((uint8_t)0x00)
|
||||
|
||||
/* Possible values of FT5336_GMODE_REG */
|
||||
#define FT5336_G_MODE_INTERRUPT_POLLING ((uint8_t)0x00)
|
||||
#define FT5336_G_MODE_INTERRUPT_TRIGGER ((uint8_t)0x01)
|
||||
|
||||
/* Current power mode the FT5336 system is in (R) */
|
||||
#define FT5336_PWR_MODE_REG ((uint8_t)0xA5)
|
||||
|
||||
/* FT5336 firmware version */
|
||||
#define FT5336_FIRMID_REG ((uint8_t)0xA6)
|
||||
|
||||
/* FT5336 Chip identification register */
|
||||
#define FT5336_CHIP_ID_REG ((uint8_t)0xA8)
|
||||
|
||||
/* Possible values of FT5336_CHIP_ID_REG */
|
||||
#define FT5336_ID_VALUE ((uint8_t)0x51)
|
||||
|
||||
/* Release code version */
|
||||
#define FT5336_RELEASE_CODE_ID_REG ((uint8_t)0xAF)
|
||||
|
||||
/* Current operating mode the FT5336 system is in (R) */
|
||||
#define FT5336_STATE_REG ((uint8_t)0xBC)
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
|
||||
/** @defgroup ft5336_Exported_Macros
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
|
||||
/** @defgroup ft5336_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief ft5336 Control functions
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @brief Initialize the ft5336 communication bus
|
||||
* from MCU to FT5336 : ie I2C channel initialization (if required).
|
||||
* @param DeviceAddr: Device address on communication Bus (I2C slave address of FT5336).
|
||||
* @retval None
|
||||
*/
|
||||
void ft5336_Init(uint16_t DeviceAddr);
|
||||
|
||||
/**
|
||||
* @brief Software Reset the ft5336.
|
||||
* @param DeviceAddr: Device address on communication Bus (I2C slave address of FT5336).
|
||||
* @retval None
|
||||
*/
|
||||
void ft5336_Reset(uint16_t DeviceAddr);
|
||||
|
||||
/**
|
||||
* @brief Read the ft5336 device ID, pre initialize I2C in case of need to be
|
||||
* able to read the FT5336 device ID, and verify this is a FT5336.
|
||||
* @param DeviceAddr: I2C FT5336 Slave address.
|
||||
* @retval The Device ID (two bytes).
|
||||
*/
|
||||
uint16_t ft5336_ReadID(uint16_t DeviceAddr);
|
||||
|
||||
/**
|
||||
* @brief Configures the touch Screen IC device to start detecting touches
|
||||
* @param DeviceAddr: Device address on communication Bus (I2C slave address).
|
||||
* @retval None.
|
||||
*/
|
||||
void ft5336_TS_Start(uint16_t DeviceAddr);
|
||||
|
||||
/**
|
||||
* @brief Return if there is touches detected or not.
|
||||
* Try to detect new touches and forget the old ones (reset internal global
|
||||
* variables).
|
||||
* @param DeviceAddr: Device address on communication Bus.
|
||||
* @retval : Number of active touches detected (can be 0, 1 or 2).
|
||||
*/
|
||||
uint8_t ft5336_TS_DetectTouch(uint16_t DeviceAddr);
|
||||
|
||||
/**
|
||||
* @brief Get the touch screen X and Y positions values
|
||||
* Manage multi touch thanks to touch Index global
|
||||
* variable 'ft5336_handle.currActiveTouchIdx'.
|
||||
* @param DeviceAddr: Device address on communication Bus.
|
||||
* @param X: Pointer to X position value
|
||||
* @param Y: Pointer to Y position value
|
||||
* @retval None.
|
||||
*/
|
||||
void ft5336_TS_GetXY(uint16_t DeviceAddr, uint16_t *X, uint16_t *Y);
|
||||
|
||||
/**
|
||||
* @brief Configure the FT5336 device to generate IT on given INT pin
|
||||
* connected to MCU as EXTI.
|
||||
* @param DeviceAddr: Device address on communication Bus (Slave I2C address of FT5336).
|
||||
* @retval None
|
||||
*/
|
||||
void ft5336_TS_EnableIT(uint16_t DeviceAddr);
|
||||
|
||||
/**
|
||||
* @brief Configure the FT5336 device to stop generating IT on the given INT pin
|
||||
* connected to MCU as EXTI.
|
||||
* @param DeviceAddr: Device address on communication Bus (Slave I2C address of FT5336).
|
||||
* @retval None
|
||||
*/
|
||||
void ft5336_TS_DisableIT(uint16_t DeviceAddr);
|
||||
|
||||
/**
|
||||
* @brief Get IT status from FT5336 interrupt status registers
|
||||
* Should be called Following an EXTI coming to the MCU to know the detailed
|
||||
* reason of the interrupt.
|
||||
* @param DeviceAddr: Device address on communication Bus (I2C slave address of FT5336).
|
||||
* @retval TS interrupts status
|
||||
*/
|
||||
uint8_t ft5336_TS_ITStatus (uint16_t DeviceAddr);
|
||||
|
||||
/**
|
||||
* @brief Clear IT status in FT5336 interrupt status clear registers
|
||||
* Should be called Following an EXTI coming to the MCU.
|
||||
* @param DeviceAddr: Device address on communication Bus (I2C slave address of FT5336).
|
||||
* @retval TS interrupts status
|
||||
*/
|
||||
void ft5336_TS_ClearIT (uint16_t DeviceAddr);
|
||||
|
||||
/**** NEW FEATURES enabled when Multi-touch support is enabled ****/
|
||||
|
||||
#if (TS_MULTI_TOUCH_SUPPORTED == 1)
|
||||
|
||||
/**
|
||||
* @brief Get the last touch gesture identification (zoom, move up/down...).
|
||||
* @param DeviceAddr: Device address on communication Bus (I2C slave address of FT5336).
|
||||
* @param pGestureId : Pointer to get last touch gesture Identification.
|
||||
* @retval None.
|
||||
*/
|
||||
void ft5336_TS_GetGestureID(uint16_t DeviceAddr, uint32_t * pGestureId);
|
||||
|
||||
/**
|
||||
* @brief Get the touch detailed informations on touch number 'touchIdx' (0..1)
|
||||
* This touch detailed information contains :
|
||||
* - weight that was applied to this touch
|
||||
* - sub-area of the touch in the touch panel
|
||||
* - event of linked to the touch (press down, lift up, ...)
|
||||
* @param DeviceAddr: Device address on communication Bus (I2C slave address of FT5336).
|
||||
* @param touchIdx : Passed index of the touch (0..1) on which we want to get the
|
||||
* detailed information.
|
||||
* @param pWeight : Pointer to to get the weight information of 'touchIdx'.
|
||||
* @param pArea : Pointer to to get the sub-area information of 'touchIdx'.
|
||||
* @param pEvent : Pointer to to get the event information of 'touchIdx'.
|
||||
|
||||
* @retval None.
|
||||
*/
|
||||
void ft5336_TS_GetTouchInfo(uint16_t DeviceAddr,
|
||||
uint32_t touchIdx,
|
||||
uint32_t * pWeight,
|
||||
uint32_t * pArea,
|
||||
uint32_t * pEvent);
|
||||
|
||||
#endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
|
||||
|
||||
/* Imported TS IO functions --------------------------------------------------------*/
|
||||
|
||||
/** @defgroup ft5336_Imported_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* TouchScreen (TS) external IO functions */
|
||||
extern void TS_IO_Init(void);
|
||||
extern void TS_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value);
|
||||
extern uint8_t TS_IO_Read(uint8_t Addr, uint8_t Reg);
|
||||
extern void TS_IO_Delay(uint32_t Delay);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Imported global variables --------------------------------------------------------*/
|
||||
|
||||
/** @defgroup ft5336_Imported_Globals
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/* Touch screen driver structure */
|
||||
extern TS_DrvTypeDef ft5336_ts_drv;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __FT5336_H */
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
172
project/Drivers/BSP/Components/n25q128a/Release_Notes.html
Normal file
172
project/Drivers/BSP/Components/n25q128a/Release_Notes.html
Normal file
@@ -0,0 +1,172 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
|
||||
|
||||
<link rel="File-List" href="Library_files/filelist.xml">
|
||||
|
||||
|
||||
<link rel="Edit-Time-Data" href="Library_files/editdata.mso"><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><title>Release Notes for STM32 BSP Components Drivers</title><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>STMicroelectronics</o:Author> <o:LastAuthor>STMicroelectronics</o:LastAuthor> <o:Revision>37</o:Revision> <o:TotalTime>136</o:TotalTime> <o:Created>2009-02-27T19:26:00Z</o:Created> <o:LastSaved>2009-03-01T17:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>522</o:Words> <o:Characters>2977</o:Characters> <o:Company>STMicroelectronics</o:Company> <o:Lines>24</o:Lines> <o:Paragraphs>6</o:Paragraphs> <o:CharactersWithSpaces>3493</o:CharactersWithSpaces> <o:Version>11.6568</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>110</w:Zoom> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
<!--
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
h2
|
||||
{mso-style-next:Normal;
|
||||
margin-top:12.0pt;
|
||||
margin-right:0in;
|
||||
margin-bottom:3.0pt;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
page-break-after:avoid;
|
||||
mso-outline-level:2;
|
||||
font-size:14.0pt;
|
||||
font-family:Arial;
|
||||
font-weight:bold;
|
||||
font-style:italic;}
|
||||
a:link, span.MsoHyperlink
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
a:visited, span.MsoHyperlinkFollowed
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
p
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="5122"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]-->
|
||||
<meta content="MCD Application Team" name="author"></head>
|
||||
<body link="blue" vlink="blue">
|
||||
<div class="Section1">
|
||||
<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
|
||||
</o:p></span></p>
|
||||
<div align="center">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Arial; color: blue;"><a href="../../../../Release_Notes.html">Back to Release page</a><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="">
|
||||
<td style="padding: 1.5pt;">
|
||||
<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release
|
||||
Notes for N25Q128A Component Driver</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
|
||||
2015 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="../../../../_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p> </o:p></span></p>
|
||||
<table style="width: 675pt;" class="MsoNormalTable" border="0" cellpadding="0" width="900">
|
||||
<tbody>
|
||||
<tr style="">
|
||||
<td style="padding: 0cm;" valign="top"><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 201px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.1
|
||||
/ 25-August-2017 <o:p></o:p></span></h3>
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;">Update comments to be used for PDSC generation</span></li></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0
|
||||
/ 29-May-2015 <o:p></o:p></span></h3>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-family: Verdana;"></span><span style="font-family: Verdana; font-size: 10pt;">First official
|
||||
release</span><span style="font-size: 10pt; font-family: Verdana;"> of </span><span style="font-size: 10pt; font-family: Verdana;">N25Q128A QuadSPI Flash Component</span><span style="font-size: 10pt; font-family: Verdana;"> driver</span></li></ul><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="License"></a><span style="font-size: 12pt; color: white;">License<o:p></o:p></span><br></h2><div style="text-align: justify;"><font size="-1"><span style="font-family: "Verdana","sans-serif";">
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:</span><br>
|
||||
</font>
|
||||
<ol><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions
|
||||
in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in </span><span style="font-family: "Verdana","sans-serif";">the documentation and/or other materials provided with the distribution.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived </span><br>
|
||||
</font>
|
||||
</li></ol>
|
||||
<font size="-1"><span style="font-family: "Verdana","sans-serif";"> from this software without specific prior written permission.</span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";"></span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED</span><span style="font-family: "Verdana","sans-serif";"> WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A </span><span style="font-family: "Verdana","sans-serif";">PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY </span><span style="font-family: "Verdana","sans-serif";">DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, </span><span style="font-family: "Verdana","sans-serif";">PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER</span><span style="font-family: "Verdana","sans-serif";"> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR </span><span style="font-family: "Verdana","sans-serif";">OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></font>
|
||||
|
||||
</div>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;"><o:p></o:p></span></p>
|
||||
<b><span style="font-size: 10pt; font-family: Verdana; color: black;"></span></b>
|
||||
|
||||
<div class="MsoNormal" style="text-align: center;" align="center"><span style="color: black;">
|
||||
<hr align="center" size="2" width="100%"></span></div>
|
||||
<div style="margin-left: 120px;"><span style="font-size: 10pt; font-family: Verdana; color: black;">For
|
||||
complete documentation on </span><span style="font-size: 10pt; font-family: Verdana;">STM32<span style="color: black;"> Microcontrollers
|
||||
visit </span><u><span style="color: blue;"><a href="http://www.st.com/internet/mcu/class/1734.jsp" target="_blank">www.st.com/STM32</a></span></u></span></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td style="padding: 0cm;" valign="top"></td></tr></tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="MsoNormal"><o:p> </o:p></p>
|
||||
</div>
|
||||
|
||||
</body></html>
|
||||
217
project/Drivers/BSP/Components/n25q128a/n25q128a.h
Normal file
217
project/Drivers/BSP/Components/n25q128a/n25q128a.h
Normal file
@@ -0,0 +1,217 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file n25q128a.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the description of the N25Q128A QSPI memory.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __N25Q128A_H
|
||||
#define __N25Q128A_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup n25q128a
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup N25Q128A_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup N25Q128A_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief N25Q128A Configuration
|
||||
*/
|
||||
#define N25Q128A_FLASH_SIZE 0x1000000 /* 128 MBits => 16MBytes */
|
||||
#define N25Q128A_SECTOR_SIZE 0x10000 /* 256 sectors of 64KBytes */
|
||||
#define N25Q128A_SUBSECTOR_SIZE 0x1000 /* 4096 subsectors of 4kBytes */
|
||||
#define N25Q128A_PAGE_SIZE 0x100 /* 65536 pages of 256 bytes */
|
||||
|
||||
#define N25Q128A_DUMMY_CYCLES_READ 8
|
||||
#define N25Q128A_DUMMY_CYCLES_READ_QUAD 10
|
||||
|
||||
#define N25Q128A_BULK_ERASE_MAX_TIME 250000
|
||||
#define N25Q128A_SECTOR_ERASE_MAX_TIME 3000
|
||||
#define N25Q128A_SUBSECTOR_ERASE_MAX_TIME 800
|
||||
|
||||
/**
|
||||
* @brief N25Q128A Commands
|
||||
*/
|
||||
/* Reset Operations */
|
||||
#define RESET_ENABLE_CMD 0x66
|
||||
#define RESET_MEMORY_CMD 0x99
|
||||
|
||||
/* Identification Operations */
|
||||
#define READ_ID_CMD 0x9E
|
||||
#define READ_ID_CMD2 0x9F
|
||||
#define MULTIPLE_IO_READ_ID_CMD 0xAF
|
||||
#define READ_SERIAL_FLASH_DISCO_PARAM_CMD 0x5A
|
||||
|
||||
/* Read Operations */
|
||||
#define READ_CMD 0x03
|
||||
#define FAST_READ_CMD 0x0B
|
||||
#define DUAL_OUT_FAST_READ_CMD 0x3B
|
||||
#define DUAL_INOUT_FAST_READ_CMD 0xBB
|
||||
#define QUAD_OUT_FAST_READ_CMD 0x6B
|
||||
#define QUAD_INOUT_FAST_READ_CMD 0xEB
|
||||
|
||||
/* Write Operations */
|
||||
#define WRITE_ENABLE_CMD 0x06
|
||||
#define WRITE_DISABLE_CMD 0x04
|
||||
|
||||
/* Register Operations */
|
||||
#define READ_STATUS_REG_CMD 0x05
|
||||
#define WRITE_STATUS_REG_CMD 0x01
|
||||
|
||||
#define READ_LOCK_REG_CMD 0xE8
|
||||
#define WRITE_LOCK_REG_CMD 0xE5
|
||||
|
||||
#define READ_FLAG_STATUS_REG_CMD 0x70
|
||||
#define CLEAR_FLAG_STATUS_REG_CMD 0x50
|
||||
|
||||
#define READ_NONVOL_CFG_REG_CMD 0xB5
|
||||
#define WRITE_NONVOL_CFG_REG_CMD 0xB1
|
||||
|
||||
#define READ_VOL_CFG_REG_CMD 0x85
|
||||
#define WRITE_VOL_CFG_REG_CMD 0x81
|
||||
|
||||
#define READ_ENHANCED_VOL_CFG_REG_CMD 0x65
|
||||
#define WRITE_ENHANCED_VOL_CFG_REG_CMD 0x61
|
||||
|
||||
/* Program Operations */
|
||||
#define PAGE_PROG_CMD 0x02
|
||||
#define DUAL_IN_FAST_PROG_CMD 0xA2
|
||||
#define EXT_DUAL_IN_FAST_PROG_CMD 0xD2
|
||||
#define QUAD_IN_FAST_PROG_CMD 0x32
|
||||
#define EXT_QUAD_IN_FAST_PROG_CMD 0x12
|
||||
|
||||
/* Erase Operations */
|
||||
#define SUBSECTOR_ERASE_CMD 0x20
|
||||
#define SECTOR_ERASE_CMD 0xD8
|
||||
#define BULK_ERASE_CMD 0xC7
|
||||
|
||||
#define PROG_ERASE_RESUME_CMD 0x7A
|
||||
#define PROG_ERASE_SUSPEND_CMD 0x75
|
||||
|
||||
/* One-Time Programmable Operations */
|
||||
#define READ_OTP_ARRAY_CMD 0x4B
|
||||
#define PROG_OTP_ARRAY_CMD 0x42
|
||||
|
||||
/**
|
||||
* @brief N25Q128A Registers
|
||||
*/
|
||||
/* Status Register */
|
||||
#define N25Q128A_SR_WIP ((uint8_t)0x01) /*!< Write in progress */
|
||||
#define N25Q128A_SR_WREN ((uint8_t)0x02) /*!< Write enable latch */
|
||||
#define N25Q128A_SR_BLOCKPR ((uint8_t)0x5C) /*!< Block protected against program and erase operations */
|
||||
#define N25Q128A_SR_PRBOTTOM ((uint8_t)0x20) /*!< Protected memory area defined by BLOCKPR starts from top or bottom */
|
||||
#define N25Q128A_SR_SRWREN ((uint8_t)0x80) /*!< Status register write enable/disable */
|
||||
|
||||
/* Nonvolatile Configuration Register */
|
||||
#define N25Q128A_NVCR_LOCK ((uint16_t)0x0001) /*!< Lock nonvolatile configuration register */
|
||||
#define N25Q128A_NVCR_DUAL ((uint16_t)0x0004) /*!< Dual I/O protocol */
|
||||
#define N25Q128A_NVCR_QUAB ((uint16_t)0x0008) /*!< Quad I/O protocol */
|
||||
#define N25Q128A_NVCR_RH ((uint16_t)0x0010) /*!< Reset/hold */
|
||||
#define N25Q128A_NVCR_ODS ((uint16_t)0x01C0) /*!< Output driver strength */
|
||||
#define N25Q128A_NVCR_XIP ((uint16_t)0x0E00) /*!< XIP mode at power-on reset */
|
||||
#define N25Q128A_NVCR_NB_DUMMY ((uint16_t)0xF000) /*!< Number of dummy clock cycles */
|
||||
|
||||
/* Volatile Configuration Register */
|
||||
#define N25Q128A_VCR_WRAP ((uint8_t)0x03) /*!< Wrap */
|
||||
#define N25Q128A_VCR_XIP ((uint8_t)0x08) /*!< XIP */
|
||||
#define N25Q128A_VCR_NB_DUMMY ((uint8_t)0xF0) /*!< Number of dummy clock cycles */
|
||||
|
||||
/* Enhanced Volatile Configuration Register */
|
||||
#define N25Q128A_EVCR_ODS ((uint8_t)0x07) /*!< Output driver strength */
|
||||
#define N25Q128A_EVCR_VPPA ((uint8_t)0x08) /*!< Vpp accelerator */
|
||||
#define N25Q128A_EVCR_RH ((uint8_t)0x10) /*!< Reset/hold */
|
||||
#define N25Q128A_EVCR_DUAL ((uint8_t)0x40) /*!< Dual I/O protocol */
|
||||
#define N25Q128A_EVCR_QUAD ((uint8_t)0x80) /*!< Quad I/O protocol */
|
||||
|
||||
/* Flag Status Register */
|
||||
#define N25Q128A_FSR_PRERR ((uint8_t)0x02) /*!< Protection error */
|
||||
#define N25Q128A_FSR_PGSUS ((uint8_t)0x04) /*!< Program operation suspended */
|
||||
#define N25Q128A_FSR_VPPERR ((uint8_t)0x08) /*!< Invalid voltage during program or erase */
|
||||
#define N25Q128A_FSR_PGERR ((uint8_t)0x10) /*!< Program error */
|
||||
#define N25Q128A_FSR_ERERR ((uint8_t)0x20) /*!< Erase error */
|
||||
#define N25Q128A_FSR_ERSUS ((uint8_t)0x40) /*!< Erase operation suspended */
|
||||
#define N25Q128A_FSR_READY ((uint8_t)0x80) /*!< Ready or command in progress */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup N25Q128A_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __N25Q128A_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
246
project/Drivers/BSP/Components/rk043fn48h/Release_Notes.html
Normal file
246
project/Drivers/BSP/Components/rk043fn48h/Release_Notes.html
Normal file
@@ -0,0 +1,246 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
|
||||
|
||||
<link rel="File-List" href="Library_files/filelist.xml">
|
||||
|
||||
|
||||
<link rel="Edit-Time-Data" href="Library_files/editdata.mso"><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><title>Release Notes for RK043FN48H-CT672B LCD Component Driver</title><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>STMicroelectronics</o:Author> <o:LastAuthor>STMicroelectronics</o:LastAuthor> <o:Revision>37</o:Revision> <o:TotalTime>136</o:TotalTime> <o:Created>2009-02-27T19:26:00Z</o:Created> <o:LastSaved>2009-03-01T17:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>522</o:Words> <o:Characters>2977</o:Characters> <o:Company>STMicroelectronics</o:Company> <o:Lines>24</o:Lines> <o:Paragraphs>6</o:Paragraphs> <o:CharactersWithSpaces>3493</o:CharactersWithSpaces> <o:Version>11.6568</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>110</w:Zoom> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
<!--
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
h2
|
||||
{mso-style-next:Normal;
|
||||
margin-top:12.0pt;
|
||||
margin-right:0in;
|
||||
margin-bottom:3.0pt;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
page-break-after:avoid;
|
||||
mso-outline-level:2;
|
||||
font-size:14.0pt;
|
||||
font-family:Arial;
|
||||
font-weight:bold;
|
||||
font-style:italic;}
|
||||
a:link, span.MsoHyperlink
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
a:visited, span.MsoHyperlinkFollowed
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
p
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="5122"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]-->
|
||||
<meta content="MCD Application Team" name="author"></head>
|
||||
<body link="blue" vlink="blue">
|
||||
<div class="Section1">
|
||||
<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
|
||||
</o:p></span></p>
|
||||
<div align="center">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Arial; color: blue;"><a href="../../../../Release_Notes.html">Back to Release page</a><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="">
|
||||
<td style="padding: 1.5pt;">
|
||||
<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release
|
||||
Notes for RK043FN48H-CT672B LCD Component Driver</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
|
||||
2015 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="../../../../_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p> </o:p></span></p>
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" width="900">
|
||||
<tbody>
|
||||
<tr style="">
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<span style="font-family: "Times New Roman";">
|
||||
</span>
|
||||
<h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.1
|
||||
/ 02-June-2017 <o:p></o:p></span></h3>
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;">Update comments to be used for PDSC generation</span></li></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0 / 25-June-2015 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;">
|
||||
<li>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;">First official release of RK043FN48H LCD component driver </span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="License"></a><span style="font-size: 12pt; color: white;">License<o:p></o:p></span><br></h2>
|
||||
<div style="text-align: justify;"><font size="-1"><span style="font-family: "Verdana","sans-serif";">
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:</span><br>
|
||||
</font>
|
||||
<ol><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions
|
||||
in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in </span><span style="font-family: "Verdana","sans-serif";">the documentation and/or other materials provided with the distribution.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived </span><br>
|
||||
</font>
|
||||
</li></ol>
|
||||
<font size="-1"><span style="font-family: "Verdana","sans-serif";"> from this software without specific prior written permission.</span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";"></span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED</span><span style="font-family: "Verdana","sans-serif";"> WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A </span><span style="font-family: "Verdana","sans-serif";">PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY </span><span style="font-family: "Verdana","sans-serif";">DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, </span><span style="font-family: "Verdana","sans-serif";">PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER</span><span style="font-family: "Verdana","sans-serif";"> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR </span><span style="font-family: "Verdana","sans-serif";">OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></font>
|
||||
|
||||
</div>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;"><font size="-1"></font><o:p></o:p></span></p>
|
||||
<b><span style="font-size: 10pt; font-family: Verdana; color: black;"></span></b>
|
||||
|
||||
<div class="MsoNormal" style="text-align: center;" align="center"><span style="color: black;">
|
||||
<hr align="center" size="2" width="100%"></span></div>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt; text-align: center;" align="center"><span style="font-size: 10pt; font-family: Verdana; color: black;">For
|
||||
complete documentation on </span><span style="font-size: 10pt; font-family: Verdana;">STM32<span style="color: black;"> Microcontrollers
|
||||
visit </span><u><span style="color: blue;"><a href="http://www.st.com/internet/mcu/class/1734.jsp" target="_blank">www.st.com/STM32</a></span></u></span><span style="font-size: 10pt; font-family: Verdana;"><u><span style="color: blue;"><a href="http://www.st.com/internet/mcu/class/1734.jsp" target="_blank"></a></span></u></span><span style="font-size: 10pt; font-family: Verdana;"><a target="_blank" href="http://www.st.com/internet/mcu/family/141.jsp"><u><span style="color: blue;"></span></u></a></span><span style="font-size: 10pt; font-family: Verdana;"><u><span style="color: blue;"></span></u></span><span style="color: black;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="MsoNormal"><o:p> </o:p></p>
|
||||
</div>
|
||||
|
||||
</body></html>
|
||||
119
project/Drivers/BSP/Components/rk043fn48h/rk043fn48h.h
Normal file
119
project/Drivers/BSP/Components/rk043fn48h/rk043fn48h.h
Normal file
@@ -0,0 +1,119 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file rk043fn48h.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the constants parameters for the RK043FN48H-CT672B
|
||||
* LCD component.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __RK043FN48H_H
|
||||
#define __RK043FN48H_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup rk043fn48h
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup RK043FN48H_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup RK043FN48H_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief RK043FN48H Size
|
||||
*/
|
||||
#define RK043FN48H_WIDTH ((uint16_t)480) /* LCD PIXEL WIDTH */
|
||||
#define RK043FN48H_HEIGHT ((uint16_t)272) /* LCD PIXEL HEIGHT */
|
||||
|
||||
/**
|
||||
* @brief RK043FN48H Timing
|
||||
*/
|
||||
#define RK043FN48H_HSYNC ((uint16_t)41) /* Horizontal synchronization */
|
||||
#define RK043FN48H_HBP ((uint16_t)13) /* Horizontal back porch */
|
||||
#define RK043FN48H_HFP ((uint16_t)32) /* Horizontal front porch */
|
||||
#define RK043FN48H_VSYNC ((uint16_t)10) /* Vertical synchronization */
|
||||
#define RK043FN48H_VBP ((uint16_t)2) /* Vertical back porch */
|
||||
#define RK043FN48H_VFP ((uint16_t)2) /* Vertical front porch */
|
||||
|
||||
/**
|
||||
* @brief RK043FN48H frequency divider
|
||||
*/
|
||||
#define RK043FN48H_FREQUENCY_DIVIDER 5 /* LCD Frequency divider */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup RK043FN48H_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __RK043FN48H_H */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
6
project/Drivers/BSP/STM32746G-Discovery/LICENSE.txt
Normal file
6
project/Drivers/BSP/STM32746G-Discovery/LICENSE.txt
Normal file
@@ -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
|
||||
41
project/Drivers/BSP/STM32746G-Discovery/README.md
Normal file
41
project/Drivers/BSP/STM32746G-Discovery/README.md
Normal file
@@ -0,0 +1,41 @@
|
||||
# BSP 32F746GDISCOVERY Component
|
||||
|
||||

|
||||
|
||||
## Overview
|
||||
|
||||
**STM32Cube** is an STMicroelectronics original initiative to ease developers' life by reducing efforts, time and cost.
|
||||
|
||||
**STM32Cube** covers the overall STM32 products portfolio. It includes a comprehensive embedded software platform delivered for each STM32 series.
|
||||
* The CMSIS modules (core and device) corresponding to the ARM(tm) core implemented in this STM32 product.
|
||||
* The STM32 HAL-LL drivers, an abstraction layer offering a set of APIs ensuring maximized portability across the STM32 portfolio.
|
||||
* The BSP drivers of each evaluation, demonstration or nucleo board provided for this STM32 series.
|
||||
* A consistent set of middleware libraries such as RTOS, USB, FatFS, graphics, touch sensing library...
|
||||
* A full set of software projects (basic examples, applications, and demonstrations) for each board provided for this STM32 series.
|
||||
|
||||
Two models of publication are proposed for the STM32Cube embedded software:
|
||||
* The monolithic **MCU Package**: all STM32Cube software modules of one STM32 series are present (Drivers, Middleware, Projects, Utilities) in the repository (usual name **STM32Cubexx**, xx corresponding to the STM32 series).
|
||||
* The **MCU component**: each STM32Cube software module being part of the STM32Cube MCU Package, is delivered as an individual repository, allowing the user to select and get only the required software functions.
|
||||
|
||||
## Description
|
||||
|
||||
This **32f746gdiscovery** MCU component repository is one element of the **STM32CubeF7** MCU embedded software package, providing the **32F746GDISCOVERY** BSP BOARD component part.
|
||||
|
||||
## Release note
|
||||
|
||||
Details about the content of this release are available in the release note [here](https://htmlpreview.github.io/?https://github.com/STMicroelectronics/32f746gdiscovery/blob/main/Release_Notes.html).
|
||||
|
||||
## Compatibility information
|
||||
|
||||
Below is the list of the BSP *component* drivers to be used with this BSP *board* driver. It is **crucial** that you use a consistent set of CMSIS - HAL - BSP versions, as mentioned in [this](https://htmlpreview.github.io/?https://github.com/STMicroelectronics/STM32CubeF7/blob/master/Release_Notes.html) release note.
|
||||
|
||||
* [stm32-bsp-common](https://github.com/STMicroelectronics/stm32-bsp-common)
|
||||
* [stm32-ft5336](https://github.com/STMicroelectronics/stm32-ft5336)
|
||||
* [stm32-n25q128a](https://github.com/STMicroelectronics/stm32-n25q128a)
|
||||
* [stm32-ov9655](https://github.com/STMicroelectronics/stm32-ov9655)
|
||||
* [stm32-rk043fn48h](https://github.com/STMicroelectronics/stm32-rk043fn48h)
|
||||
* [stm32-wm8994](https://github.com/STMicroelectronics/stm32-wm8994)
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) guide.
|
||||
887
project/Drivers/BSP/STM32746G-Discovery/Release_Notes.html
Normal file
887
project/Drivers/BSP/STM32746G-Discovery/Release_Notes.html
Normal file
@@ -0,0 +1,887 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
|
||||
|
||||
<link rel="File-List" href="Library_files/filelist.xml">
|
||||
|
||||
|
||||
<link rel="Edit-Time-Data" href="Library_files/editdata.mso"><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><title>Release Notes for STM32746G-Discovery BSP Driver</title><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>STMicroelectronics</o:Author> <o:LastAuthor>STMicroelectronics</o:LastAuthor> <o:Revision>37</o:Revision> <o:TotalTime>136</o:TotalTime> <o:Created>2009-02-27T19:26:00Z</o:Created> <o:LastSaved>2009-03-01T17:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>522</o:Words> <o:Characters>2977</o:Characters> <o:Company>STMicroelectronics</o:Company> <o:Lines>24</o:Lines> <o:Paragraphs>6</o:Paragraphs> <o:CharactersWithSpaces>3493</o:CharactersWithSpaces> <o:Version>11.6568</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>110</w:Zoom> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
<!--
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
h2
|
||||
{mso-style-next:Normal;
|
||||
margin-top:12.0pt;
|
||||
margin-right:0in;
|
||||
margin-bottom:3.0pt;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
page-break-after:avoid;
|
||||
mso-outline-level:2;
|
||||
font-size:14.0pt;
|
||||
font-family:Arial;
|
||||
font-weight:bold;
|
||||
font-style:italic;}
|
||||
a:link, span.MsoHyperlink
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
a:visited, span.MsoHyperlinkFollowed
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
p
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="5122"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]-->
|
||||
<meta content="MCD Application Team" name="author"></head>
|
||||
<body link="blue" vlink="blue">
|
||||
<div class="Section1">
|
||||
<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
|
||||
</o:p></span></p>
|
||||
<div align="center">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Arial; color: blue;"><a href="../../../../Release_Notes.html">Back to Release page</a><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="">
|
||||
<td style="padding: 1.5pt;">
|
||||
<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);"></span><span style="font-family: Verdana; color: rgb(51, 102, 255); font-size: 20pt;">Release
|
||||
Notes for STM32746G-Discovery BSP Driver</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
|
||||
2016 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="./_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p> </o:p></span></p>
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" width="900">
|
||||
<tbody>
|
||||
<tr style="">
|
||||
<td style="padding: 0cm;" valign="top"><span style="font-family: "Times New Roman";"></span><p class="MsoListParagraph" style="text-align: left;"><span style="font-size: 11pt; font-family: "Arial",sans-serif;">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 serie.</span></p>
|
||||
<p class="MsoListParagraph" style="text-align: left;"><span style="font-size: 11pt; font-family: "Arial",sans-serif;">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. <br>
|
||||
</span></p>
|
||||
<p class="MsoListParagraph" style="text-align: left;"><span style="font-size: 11pt; font-family: "Arial",sans-serif;">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.</span></p>
|
||||
|
||||
|
||||
<h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><span style="font-size: 12pt; color: white;"> Update History</span></h2>
|
||||
<span style="font-size: 10pt; font-family: "Verdana","sans-serif";"></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span>
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V2.0.4 / 10-June-2022 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">All source files: update disclaimer to add reference to the new license agreement</span></li>
|
||||
</ul>
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V2.0.3 / 12-February-2021 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
<ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;">stm32746g_discovery_lcd.c:</span></li><ul><li><span style="font-size: 10pt; font-family: Verdana;">Remove GPIO PIN 13 (LCD VSYNC) configuration from BSP_LCD_MspInit() API to avoid conflict with stm32746g_discovery_ts.c driver.<br></span></li></ul></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V2.0.2 / 24-August-2017 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
<ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;">stm32746g_discovery_lcd.c:</span></li><ul><li><span style="font-size: 10pt; font-family: Verdana;">Fix compilation errors with SW4STM32 toolchain</span>.</li></ul><li><span style="font-size: 10pt; font-family: Verdana;">stm32746g_discovery</span><span style="font-size: 10pt; font-family: Verdana;">.c:</span></li><ul><li><span style="font-size: 10pt; font-family: Verdana;">Upgrade version to v2.0.2</span></li></ul></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V2.0.1 / 26-May-2017 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
<ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;">Add general description of BSP drivers<br>
|
||||
</span></li><li><span style="font-size: 10pt; font-family: Verdana;">Add Dependencies section<br>
|
||||
</span></li><li><span style="font-size: 10pt; font-family: Verdana;">Support of PDSC</span></li></ul>
|
||||
|
||||
|
||||
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 247px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V2.0.0 / 30-December-2016</span></h3>
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">stm32f746g_discovery_sd.c/.h:</span></li><ul><li><span style="font-size: 10pt; font-family: Verdana;">Update BSP SD APIs </span><span style="font-family: Verdana; font-size: 10pt;">following new HAL SD drivers implementation</span></li><li><span style="font-size: 10pt; font-family: Verdana;">Fix BlockSize to 512 bytes<br>
|
||||
</span></li></ul><li><span style="font-size: 10pt; font-family: Verdana;">stm32f746g_discovery</span><span style="font-size: 10pt; font-family: Verdana;">_audio.c/.h:</span></li><ul><li><span style="font-size: 10pt; font-family: Verdana;">Update BSP_AUDIO_IN_Init parameters</span><br>
|
||||
</li></ul><li><span style="font-size: 10pt; font-family: Verdana;">stm32f746g_discovery</span><span style="font-size: 10pt; font-family: Verdana;">_lcd.c/.h:</span></li><ul><li><span style="font-size: 10pt; font-family: Verdana;">Update BSP_LCD_ReadPixel to read correctely ARGB8888 and RGB888 pixels</span></li></ul><li><span style="font-size: 10pt; font-family: Verdana;">stm32f746g_discovery</span><span style="font-size: 10pt; font-family: Verdana;">_qspi.c/.h:</span></li><ul><li><span style="font-size: 10pt; font-family: Verdana;">QSPI write operation improvement</span></li><li><span style="font-size: 10pt; font-family: Verdana;">Update CS High Time</span></li></ul>
|
||||
</ul>
|
||||
<ul style="list-style-type: square;"><li><span style="font-family: Verdana; font-size: 10pt;"><span style="font-style: italic; font-weight: bold; text-decoration: underline;">Notes:</span> <br>
|
||||
</span></li>
|
||||
<ul>
|
||||
<li><span style="font-family: Verdana; font-size: 10pt;">These</span><span style="font-family: Verdana; font-size: 10pt;"> BSP drivers</span><span style="font-family: Verdana; font-size: 10pt;"> break the compatibility with previous versions.</span></li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><span style="font-family: Verdana; font-size: 10pt;">If FatFs is required, </span><span style="font-family: Verdana; font-size: 10pt; font-style: italic;">"FatFS R0.11<span class="Apple-converted-space"> </span> </span><span style="font-family: Verdana; font-size: 10pt;"><span style="font-style: italic;">ST modified 20161223"</span><span style="color: red;"><span style="color: black;"></span></span></span><span style="font-family: Verdana; font-size: 10pt;"> must be used with </span><span style="font-family: Verdana; font-size: 10pt;">this version of BSP drivers.</span></li>
|
||||
</ul>
|
||||
|
||||
</ul>
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.1.1 / 02-June-2016 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;">Update typos in drivers comments</span><span style="font-size: 10pt; font-family: Verdana;">.</span></li></ul><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.1.0 / 22-April-2016 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-family: Verdana; font-size: 10pt;">Update overall drivers
|
||||
by removing BSP_PPP_IRQHandler, </span><span style="font-family: Verdana; font-size: 10pt;">BSP_PPP_DMA_TX_IRQHandler</span><span style="font-family: Verdana; font-size: 10pt;"> and BSP_PPP_DMA_RX_IRQHandler to
|
||||
avoid possible conflict when the same Handler is used by different
|
||||
IPs.</span></li><li><span style="font-family: Verdana; font-size: 10pt;">These Handlers should be
|
||||
defined by user at application level, inducing a break of compatibility versus
|
||||
V1.0.0 of the STM32F46G-Discovery BSP drivers</span></li><li><span style="font-family: Verdana; font-size: 10pt;">Update </span><span style="font-family: Verdana; font-size: 10pt;">NVIC priority configuration to the lowest priority 0x0F in overall drivers</span></li><li><span style="font-size: 10pt; font-family: "Verdana",sans-serif;">stm32f746g_discovery_camera.c:</span></li><ul><li><span style="font-size: 10pt; font-family: "Verdana",sans-serif;">Update BSP_CAMERA_Suspend() and BSP_CAMERA_Resume() APIs to use HAL API HAL_DCMI_Suspend() and HAL_DCMI_Resume()</span></li></ul><li><span style="font-size: 10pt; font-family: Verdana;">stm32746g_discovery_lcd.c: Add the following APIs:</span></li><ul><li><span style="font-size: 10pt; font-family: Verdana;">BSP_LCD_SetTransparency_NoReload()</span></li><li><span style="font-size: 10pt; font-family: Verdana;">BSP_LCD_SetLayerAddress_NoReload()</span></li><li><span style="font-size: 10pt; font-family: Verdana;">BSP_LCD_SetColorKeying_NoReload()</span></li><li><span style="font-size: 10pt; font-family: Verdana;">BSP_LCD_ResetColorKeying_NoReload()</span></li><li><span style="font-size: 10pt; font-family: Verdana;">BSP_LCD_SetLayerWindow_NoReload()</span></li><li><span style="font-size: 10pt; font-family: Verdana;">BSP_LCD_SetLayerVisible_NoReload()</span></li><li><span style="font-size: 10pt; font-family: Verdana;">BSP_LCD_Relaod()</span></li></ul></ul>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0 / 25-June-2015 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-family: Verdana; font-size: 10pt;">First official release
|
||||
of the <span style="font-weight: bold;">STM32746G-DISCO</span> board BSP
|
||||
drivers</span></li>
|
||||
</ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px; color: white;"><b style=""><span style="font-size: 10pt; font-family: Verdana;">Dependencies</span></b></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="margin-top: 0cm;" type="square"><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">STM32F7xx_HAL_Driver V1.2.0<br>
|
||||
</span></li><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">BSP Common V4.0.1</span></li></ul><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<b><span style="font-size: 10pt; font-family: Verdana; color: black;"></span></b>
|
||||
|
||||
<div class="MsoNormal" style="text-align: center;" align="center"><span style="color: black;">
|
||||
<hr align="center" size="2" width="100%"></span></div>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt; text-align: center;" align="center"><span style="font-size: 10pt; font-family: Verdana; color: black;">For
|
||||
complete documentation on </span><span style="font-size: 10pt; font-family: Verdana;">STM32<span style="color: black;"> Microcontrollers
|
||||
visit </span><u><span style="color: blue;"><a href="http://www.st.com/internet/mcu/class/1734.jsp" target="_blank">www.st.com/STM32</a></span></u></span><span style="font-size: 10pt; font-family: Verdana;"><a target="_blank" href="http://www.st.com/internet/mcu/family/141.jsp"><u><span style="color: blue;"></span></u></a></span><span style="font-size: 10pt; font-family: Verdana;"><u><span style="color: blue;"></span></u></span><span style="color: black;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td style="padding: 0cm;" valign="top"><br>
|
||||
</td></tr></tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="MsoNormal"><o:p> </o:p></p>
|
||||
</div>
|
||||
|
||||
</body></html>
|
||||
Binary file not shown.
1700
project/Drivers/BSP/STM32746G-Discovery/_htmresc/mini-st.css
Normal file
1700
project/Drivers/BSP/STM32746G-Discovery/_htmresc/mini-st.css
Normal file
File diff suppressed because it is too large
Load Diff
BIN
project/Drivers/BSP/STM32746G-Discovery/_htmresc/st_logo.png
Normal file
BIN
project/Drivers/BSP/STM32746G-Discovery/_htmresc/st_logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
884
project/Drivers/BSP/STM32746G-Discovery/stm32746g_discovery.c
Normal file
884
project/Drivers/BSP/STM32746G-Discovery/stm32746g_discovery.c
Normal file
@@ -0,0 +1,884 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32746g_discovery.c
|
||||
* @author MCD Application Team
|
||||
* @brief This file provides a set of firmware functions to manage LEDs,
|
||||
* push-buttons and COM ports available on STM32746G-Discovery
|
||||
* board(MB1191) from STMicroelectronics.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2016 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.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Dependencies
|
||||
- stm32f7xx_hal_cortex.c
|
||||
- stm32f7xx_hal_gpio.c
|
||||
- stm32f7xx_hal_uart.c
|
||||
- stm32f7xx_hal_i2c.c
|
||||
EndDependencies */
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32746g_discovery.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32746G_DISCOVERY
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_LOW_LEVEL STM32746G_DISCOVERY_LOW_LEVEL
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_LOW_LEVEL_Private_TypesDefinitions STM32746G_DISCOVERY_LOW_LEVEL Private Types Definitions
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_LOW_LEVEL_Private_Defines STM32746G_DISCOVERY_LOW_LEVEL Private Defines
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @brief STM32746G DISCOVERY BSP Driver version number V2.0.4
|
||||
*/
|
||||
#define __STM32746G_DISCO_BSP_VERSION_MAIN (0x02) /*!< [31:24] main version */
|
||||
#define __STM32746G_DISCO_BSP_VERSION_SUB1 (0x00) /*!< [23:16] sub1 version */
|
||||
#define __STM32746G_DISCO_BSP_VERSION_SUB2 (0x04) /*!< [15:8] sub2 version */
|
||||
#define __STM32746G_DISCO_BSP_VERSION_RC (0x00) /*!< [7:0] release candidate */
|
||||
#define __STM32746G_DISCO_BSP_VERSION ((__STM32746G_DISCO_BSP_VERSION_MAIN << 24)\
|
||||
|(__STM32746G_DISCO_BSP_VERSION_SUB1 << 16)\
|
||||
|(__STM32746G_DISCO_BSP_VERSION_SUB2 << 8 )\
|
||||
|(__STM32746G_DISCO_BSP_VERSION_RC))
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_LOW_LEVEL_Private_Macros STM32746G_DISCOVERY_LOW_LEVEL Private Macros
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_LOW_LEVEL_Private_Variables STM32746G_DISCOVERY_LOW_LEVEL Private Variables
|
||||
* @{
|
||||
*/
|
||||
|
||||
const uint32_t GPIO_PIN[LEDn] = {LED1_PIN};
|
||||
|
||||
GPIO_TypeDef* BUTTON_PORT[BUTTONn] = {WAKEUP_BUTTON_GPIO_PORT,
|
||||
TAMPER_BUTTON_GPIO_PORT,
|
||||
KEY_BUTTON_GPIO_PORT};
|
||||
|
||||
const uint16_t BUTTON_PIN[BUTTONn] = {WAKEUP_BUTTON_PIN,
|
||||
TAMPER_BUTTON_PIN,
|
||||
KEY_BUTTON_PIN};
|
||||
|
||||
const uint16_t BUTTON_IRQn[BUTTONn] = {WAKEUP_BUTTON_EXTI_IRQn,
|
||||
TAMPER_BUTTON_EXTI_IRQn,
|
||||
KEY_BUTTON_EXTI_IRQn};
|
||||
|
||||
USART_TypeDef* COM_USART[COMn] = {DISCOVERY_COM1};
|
||||
|
||||
GPIO_TypeDef* COM_TX_PORT[COMn] = {DISCOVERY_COM1_TX_GPIO_PORT};
|
||||
|
||||
GPIO_TypeDef* COM_RX_PORT[COMn] = {DISCOVERY_COM1_RX_GPIO_PORT};
|
||||
|
||||
const uint16_t COM_TX_PIN[COMn] = {DISCOVERY_COM1_TX_PIN};
|
||||
|
||||
const uint16_t COM_RX_PIN[COMn] = {DISCOVERY_COM1_RX_PIN};
|
||||
|
||||
const uint16_t COM_TX_AF[COMn] = {DISCOVERY_COM1_TX_AF};
|
||||
|
||||
const uint16_t COM_RX_AF[COMn] = {DISCOVERY_COM1_RX_AF};
|
||||
|
||||
static I2C_HandleTypeDef hI2cAudioHandler = {0};
|
||||
static I2C_HandleTypeDef hI2cExtHandler = {0};
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_LOW_LEVEL_Private_FunctionPrototypes STM32746G_DISCOVERY_LOW_LEVEL Private Function Prototypes
|
||||
* @{
|
||||
*/
|
||||
static void I2Cx_MspInit(I2C_HandleTypeDef *i2c_handler);
|
||||
static void I2Cx_Init(I2C_HandleTypeDef *i2c_handler);
|
||||
|
||||
static HAL_StatusTypeDef I2Cx_ReadMultiple(I2C_HandleTypeDef *i2c_handler, uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length);
|
||||
static HAL_StatusTypeDef I2Cx_WriteMultiple(I2C_HandleTypeDef *i2c_handler, uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length);
|
||||
static HAL_StatusTypeDef I2Cx_IsDeviceReady(I2C_HandleTypeDef *i2c_handler, uint16_t DevAddress, uint32_t Trials);
|
||||
static void I2Cx_Error(I2C_HandleTypeDef *i2c_handler, uint8_t Addr);
|
||||
|
||||
/* AUDIO IO functions */
|
||||
void AUDIO_IO_Init(void);
|
||||
void AUDIO_IO_DeInit(void);
|
||||
void AUDIO_IO_Write(uint8_t Addr, uint16_t Reg, uint16_t Value);
|
||||
uint16_t AUDIO_IO_Read(uint8_t Addr, uint16_t Reg);
|
||||
void AUDIO_IO_Delay(uint32_t Delay);
|
||||
|
||||
/* TOUCHSCREEN IO functions */
|
||||
void TS_IO_Init(void);
|
||||
void TS_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value);
|
||||
uint8_t TS_IO_Read(uint8_t Addr, uint8_t Reg);
|
||||
void TS_IO_Delay(uint32_t Delay);
|
||||
|
||||
/* CAMERA IO functions */
|
||||
void CAMERA_IO_Init(void);
|
||||
void CAMERA_Delay(uint32_t Delay);
|
||||
void CAMERA_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value);
|
||||
uint8_t CAMERA_IO_Read(uint8_t Addr, uint8_t Reg);
|
||||
|
||||
/* I2C EEPROM IO function */
|
||||
void EEPROM_IO_Init(void);
|
||||
HAL_StatusTypeDef EEPROM_IO_WriteData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize);
|
||||
HAL_StatusTypeDef EEPROM_IO_ReadData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize);
|
||||
HAL_StatusTypeDef EEPROM_IO_IsDeviceReady(uint16_t DevAddress, uint32_t Trials);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_LOW_LEVEL_Exported_Functions STM32746G_DISCOVERY_LOW_LEVELSTM32746G_DISCOVERY_LOW_LEVEL Exported Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief This method returns the STM32746G DISCOVERY BSP Driver revision
|
||||
* @retval version: 0xXYZR (8bits for each decimal, R for RC)
|
||||
*/
|
||||
uint32_t BSP_GetVersion(void)
|
||||
{
|
||||
return __STM32746G_DISCO_BSP_VERSION;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configures LED on GPIO.
|
||||
* @param Led: LED to be configured.
|
||||
* This parameter can be one of the following values:
|
||||
* @arg LED1
|
||||
* @retval None
|
||||
*/
|
||||
void BSP_LED_Init(Led_TypeDef Led)
|
||||
{
|
||||
GPIO_InitTypeDef gpio_init_structure;
|
||||
GPIO_TypeDef* gpio_led;
|
||||
|
||||
if (Led == LED1)
|
||||
{
|
||||
gpio_led = LED1_GPIO_PORT;
|
||||
/* Enable the GPIO_LED clock */
|
||||
LED1_GPIO_CLK_ENABLE();
|
||||
|
||||
/* Configure the GPIO_LED pin */
|
||||
gpio_init_structure.Pin = GPIO_PIN[Led];
|
||||
gpio_init_structure.Mode = GPIO_MODE_OUTPUT_PP;
|
||||
gpio_init_structure.Pull = GPIO_PULLUP;
|
||||
gpio_init_structure.Speed = GPIO_SPEED_HIGH;
|
||||
|
||||
HAL_GPIO_Init(gpio_led, &gpio_init_structure);
|
||||
|
||||
/* By default, turn off LED */
|
||||
HAL_GPIO_WritePin(gpio_led, GPIO_PIN[Led], GPIO_PIN_RESET);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DeInit LEDs.
|
||||
* @param Led: LED to be configured.
|
||||
* This parameter can be one of the following values:
|
||||
* @arg LED1
|
||||
* @note Led DeInit does not disable the GPIO clock
|
||||
* @retval None
|
||||
*/
|
||||
void BSP_LED_DeInit(Led_TypeDef Led)
|
||||
{
|
||||
GPIO_InitTypeDef gpio_init_structure;
|
||||
GPIO_TypeDef* gpio_led;
|
||||
|
||||
if (Led == LED1)
|
||||
{
|
||||
gpio_led = LED1_GPIO_PORT;
|
||||
/* Turn off LED */
|
||||
HAL_GPIO_WritePin(gpio_led, GPIO_PIN[Led], GPIO_PIN_RESET);
|
||||
/* Configure the GPIO_LED pin */
|
||||
gpio_init_structure.Pin = GPIO_PIN[Led];
|
||||
HAL_GPIO_DeInit(gpio_led, gpio_init_structure.Pin);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Turns selected LED On.
|
||||
* @param Led: LED to be set on
|
||||
* This parameter can be one of the following values:
|
||||
* @arg LED1
|
||||
* @retval None
|
||||
*/
|
||||
void BSP_LED_On(Led_TypeDef Led)
|
||||
{
|
||||
GPIO_TypeDef* gpio_led;
|
||||
|
||||
if (Led == LED1) /* Switch On LED connected to GPIO */
|
||||
{
|
||||
gpio_led = LED1_GPIO_PORT;
|
||||
HAL_GPIO_WritePin(gpio_led, GPIO_PIN[Led], GPIO_PIN_SET);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Turns selected LED Off.
|
||||
* @param Led: LED to be set off
|
||||
* This parameter can be one of the following values:
|
||||
* @arg LED1
|
||||
* @retval None
|
||||
*/
|
||||
void BSP_LED_Off(Led_TypeDef Led)
|
||||
{
|
||||
GPIO_TypeDef* gpio_led;
|
||||
|
||||
if (Led == LED1) /* Switch Off LED connected to GPIO */
|
||||
{
|
||||
gpio_led = LED1_GPIO_PORT;
|
||||
HAL_GPIO_WritePin(gpio_led, GPIO_PIN[Led], GPIO_PIN_RESET);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Toggles the selected LED.
|
||||
* @param Led: LED to be toggled
|
||||
* This parameter can be one of the following values:
|
||||
* @arg LED1
|
||||
* @retval None
|
||||
*/
|
||||
void BSP_LED_Toggle(Led_TypeDef Led)
|
||||
{
|
||||
GPIO_TypeDef* gpio_led;
|
||||
|
||||
if (Led == LED1) /* Toggle LED connected to GPIO */
|
||||
{
|
||||
gpio_led = LED1_GPIO_PORT;
|
||||
HAL_GPIO_TogglePin(gpio_led, GPIO_PIN[Led]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configures button GPIO and EXTI Line.
|
||||
* @param Button: Button to be configured
|
||||
* This parameter can be one of the following values:
|
||||
* @arg BUTTON_WAKEUP: Wakeup Push Button
|
||||
* @arg BUTTON_TAMPER: Tamper Push Button
|
||||
* @arg BUTTON_KEY: Key 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
|
||||
* @note On STM32746G-Discovery board, the three buttons (Wakeup, Tamper and key buttons)
|
||||
* are mapped on the same push button named "User"
|
||||
* on the board serigraphy.
|
||||
* @retval None
|
||||
*/
|
||||
void BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef ButtonMode)
|
||||
{
|
||||
GPIO_InitTypeDef gpio_init_structure;
|
||||
|
||||
/* Enable the BUTTON clock */
|
||||
BUTTONx_GPIO_CLK_ENABLE(Button);
|
||||
|
||||
if(ButtonMode == BUTTON_MODE_GPIO)
|
||||
{
|
||||
/* Configure Button pin as input */
|
||||
gpio_init_structure.Pin = BUTTON_PIN[Button];
|
||||
gpio_init_structure.Mode = GPIO_MODE_INPUT;
|
||||
gpio_init_structure.Pull = GPIO_NOPULL;
|
||||
gpio_init_structure.Speed = GPIO_SPEED_FAST;
|
||||
HAL_GPIO_Init(BUTTON_PORT[Button], &gpio_init_structure);
|
||||
}
|
||||
|
||||
if(ButtonMode == BUTTON_MODE_EXTI)
|
||||
{
|
||||
/* Configure Button pin as input with External interrupt */
|
||||
gpio_init_structure.Pin = BUTTON_PIN[Button];
|
||||
gpio_init_structure.Pull = GPIO_NOPULL;
|
||||
gpio_init_structure.Speed = GPIO_SPEED_FAST;
|
||||
|
||||
if(Button != BUTTON_WAKEUP)
|
||||
{
|
||||
gpio_init_structure.Mode = GPIO_MODE_IT_FALLING;
|
||||
}
|
||||
else
|
||||
{
|
||||
gpio_init_structure.Mode = GPIO_MODE_IT_RISING;
|
||||
}
|
||||
|
||||
HAL_GPIO_Init(BUTTON_PORT[Button], &gpio_init_structure);
|
||||
|
||||
/* Enable and set Button EXTI Interrupt to the lowest priority */
|
||||
HAL_NVIC_SetPriority((IRQn_Type)(BUTTON_IRQn[Button]), 0x0F, 0x00);
|
||||
HAL_NVIC_EnableIRQ((IRQn_Type)(BUTTON_IRQn[Button]));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Push Button DeInit.
|
||||
* @param Button: Button to be configured
|
||||
* This parameter can be one of the following values:
|
||||
* @arg BUTTON_WAKEUP: Wakeup Push Button
|
||||
* @arg BUTTON_TAMPER: Tamper Push Button
|
||||
* @arg BUTTON_KEY: Key Push Button
|
||||
* @note On STM32746G-Discovery board, the three buttons (Wakeup, Tamper and key buttons)
|
||||
* are mapped on the same push button named "User"
|
||||
* on the board serigraphy.
|
||||
* @note PB DeInit does not disable the GPIO clock
|
||||
* @retval None
|
||||
*/
|
||||
void 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);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Returns the selected button state.
|
||||
* @param Button: Button to be checked
|
||||
* This parameter can be one of the following values:
|
||||
* @arg BUTTON_WAKEUP: Wakeup Push Button
|
||||
* @arg BUTTON_TAMPER: Tamper Push Button
|
||||
* @arg BUTTON_KEY: Key Push Button
|
||||
* @note On STM32746G-Discovery board, the three buttons (Wakeup, Tamper and key buttons)
|
||||
* are mapped on the same push button named "User"
|
||||
* on the board serigraphy.
|
||||
* @retval The Button GPIO pin value
|
||||
*/
|
||||
uint32_t BSP_PB_GetState(Button_TypeDef Button)
|
||||
{
|
||||
return HAL_GPIO_ReadPin(BUTTON_PORT[Button], BUTTON_PIN[Button]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configures COM port.
|
||||
* @param COM: COM port to be configured.
|
||||
* This parameter can be one of the following values:
|
||||
* @arg COM1
|
||||
* @arg COM2
|
||||
* @param huart: Pointer to a UART_HandleTypeDef structure that contains the
|
||||
* configuration information for the specified USART peripheral.
|
||||
* @retval None
|
||||
*/
|
||||
void BSP_COM_Init(COM_TypeDef COM, UART_HandleTypeDef *huart)
|
||||
{
|
||||
GPIO_InitTypeDef gpio_init_structure;
|
||||
|
||||
/* Enable GPIO clock */
|
||||
DISCOVERY_COMx_TX_GPIO_CLK_ENABLE(COM);
|
||||
DISCOVERY_COMx_RX_GPIO_CLK_ENABLE(COM);
|
||||
|
||||
/* Enable USART clock */
|
||||
DISCOVERY_COMx_CLK_ENABLE(COM);
|
||||
|
||||
/* Configure USART Tx as alternate function */
|
||||
gpio_init_structure.Pin = COM_TX_PIN[COM];
|
||||
gpio_init_structure.Mode = GPIO_MODE_AF_PP;
|
||||
gpio_init_structure.Speed = GPIO_SPEED_FAST;
|
||||
gpio_init_structure.Pull = GPIO_PULLUP;
|
||||
gpio_init_structure.Alternate = COM_TX_AF[COM];
|
||||
HAL_GPIO_Init(COM_TX_PORT[COM], &gpio_init_structure);
|
||||
|
||||
/* Configure USART Rx as alternate function */
|
||||
gpio_init_structure.Pin = COM_RX_PIN[COM];
|
||||
gpio_init_structure.Mode = GPIO_MODE_AF_PP;
|
||||
gpio_init_structure.Alternate = COM_RX_AF[COM];
|
||||
HAL_GPIO_Init(COM_RX_PORT[COM], &gpio_init_structure);
|
||||
|
||||
/* USART configuration */
|
||||
huart->Instance = COM_USART[COM];
|
||||
HAL_UART_Init(huart);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DeInit COM port.
|
||||
* @param COM: COM port to be configured.
|
||||
* This parameter can be one of the following values:
|
||||
* @arg COM1
|
||||
* @arg COM2
|
||||
* @param huart: Pointer to a UART_HandleTypeDef structure that contains the
|
||||
* configuration information for the specified USART peripheral.
|
||||
* @retval None
|
||||
*/
|
||||
void BSP_COM_DeInit(COM_TypeDef COM, UART_HandleTypeDef *huart)
|
||||
{
|
||||
/* USART configuration */
|
||||
huart->Instance = COM_USART[COM];
|
||||
HAL_UART_DeInit(huart);
|
||||
|
||||
/* Enable USART clock */
|
||||
DISCOVERY_COMx_CLK_DISABLE(COM);
|
||||
|
||||
/* DeInit GPIO pins can be done in the application
|
||||
(by surcharging this __weak function) */
|
||||
|
||||
/* GPIO pins clock, DMA clock can be shut down in the application
|
||||
by surcharging this __weak function */
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
BUS OPERATIONS
|
||||
*******************************************************************************/
|
||||
|
||||
/******************************* I2C Routines *********************************/
|
||||
/**
|
||||
* @brief Initializes I2C MSP.
|
||||
* @param i2c_handler : I2C handler
|
||||
* @retval None
|
||||
*/
|
||||
static void I2Cx_MspInit(I2C_HandleTypeDef *i2c_handler)
|
||||
{
|
||||
GPIO_InitTypeDef gpio_init_structure;
|
||||
|
||||
if (i2c_handler == (I2C_HandleTypeDef*)(&hI2cAudioHandler))
|
||||
{
|
||||
/* AUDIO and LCD I2C MSP init */
|
||||
|
||||
/*** Configure the GPIOs ***/
|
||||
/* Enable GPIO clock */
|
||||
DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_CLK_ENABLE();
|
||||
|
||||
/* Configure I2C Tx as alternate function */
|
||||
gpio_init_structure.Pin = DISCOVERY_AUDIO_I2Cx_SCL_PIN;
|
||||
gpio_init_structure.Mode = GPIO_MODE_AF_OD;
|
||||
gpio_init_structure.Pull = GPIO_NOPULL;
|
||||
gpio_init_structure.Speed = GPIO_SPEED_FAST;
|
||||
gpio_init_structure.Alternate = DISCOVERY_AUDIO_I2Cx_SCL_SDA_AF;
|
||||
HAL_GPIO_Init(DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_PORT, &gpio_init_structure);
|
||||
|
||||
/* Configure I2C Rx as alternate function */
|
||||
gpio_init_structure.Pin = DISCOVERY_AUDIO_I2Cx_SDA_PIN;
|
||||
HAL_GPIO_Init(DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_PORT, &gpio_init_structure);
|
||||
|
||||
/*** Configure the I2C peripheral ***/
|
||||
/* Enable I2C clock */
|
||||
DISCOVERY_AUDIO_I2Cx_CLK_ENABLE();
|
||||
|
||||
/* Force the I2C peripheral clock reset */
|
||||
DISCOVERY_AUDIO_I2Cx_FORCE_RESET();
|
||||
|
||||
/* Release the I2C peripheral clock reset */
|
||||
DISCOVERY_AUDIO_I2Cx_RELEASE_RESET();
|
||||
|
||||
/* Enable and set I2Cx Interrupt to a lower priority */
|
||||
HAL_NVIC_SetPriority(DISCOVERY_AUDIO_I2Cx_EV_IRQn, 0x0F, 0);
|
||||
HAL_NVIC_EnableIRQ(DISCOVERY_AUDIO_I2Cx_EV_IRQn);
|
||||
|
||||
/* Enable and set I2Cx Interrupt to a lower priority */
|
||||
HAL_NVIC_SetPriority(DISCOVERY_AUDIO_I2Cx_ER_IRQn, 0x0F, 0);
|
||||
HAL_NVIC_EnableIRQ(DISCOVERY_AUDIO_I2Cx_ER_IRQn);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* External, camera and Arduino connector I2C MSP init */
|
||||
|
||||
/*** Configure the GPIOs ***/
|
||||
/* Enable GPIO clock */
|
||||
DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_CLK_ENABLE();
|
||||
|
||||
/* Configure I2C Tx as alternate function */
|
||||
gpio_init_structure.Pin = DISCOVERY_EXT_I2Cx_SCL_PIN;
|
||||
gpio_init_structure.Mode = GPIO_MODE_AF_OD;
|
||||
gpio_init_structure.Pull = GPIO_NOPULL;
|
||||
gpio_init_structure.Speed = GPIO_SPEED_FAST;
|
||||
gpio_init_structure.Alternate = DISCOVERY_EXT_I2Cx_SCL_SDA_AF;
|
||||
HAL_GPIO_Init(DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_PORT, &gpio_init_structure);
|
||||
|
||||
/* Configure I2C Rx as alternate function */
|
||||
gpio_init_structure.Pin = DISCOVERY_EXT_I2Cx_SDA_PIN;
|
||||
HAL_GPIO_Init(DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_PORT, &gpio_init_structure);
|
||||
|
||||
/*** Configure the I2C peripheral ***/
|
||||
/* Enable I2C clock */
|
||||
DISCOVERY_EXT_I2Cx_CLK_ENABLE();
|
||||
|
||||
/* Force the I2C peripheral clock reset */
|
||||
DISCOVERY_EXT_I2Cx_FORCE_RESET();
|
||||
|
||||
/* Release the I2C peripheral clock reset */
|
||||
DISCOVERY_EXT_I2Cx_RELEASE_RESET();
|
||||
|
||||
/* Enable and set I2Cx Interrupt to a lower priority */
|
||||
HAL_NVIC_SetPriority(DISCOVERY_EXT_I2Cx_EV_IRQn, 0x0F, 0);
|
||||
HAL_NVIC_EnableIRQ(DISCOVERY_EXT_I2Cx_EV_IRQn);
|
||||
|
||||
/* Enable and set I2Cx Interrupt to a lower priority */
|
||||
HAL_NVIC_SetPriority(DISCOVERY_EXT_I2Cx_ER_IRQn, 0x0F, 0);
|
||||
HAL_NVIC_EnableIRQ(DISCOVERY_EXT_I2Cx_ER_IRQn);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Initializes I2C HAL.
|
||||
* @param i2c_handler : I2C handler
|
||||
* @retval None
|
||||
*/
|
||||
static void I2Cx_Init(I2C_HandleTypeDef *i2c_handler)
|
||||
{
|
||||
if(HAL_I2C_GetState(i2c_handler) == HAL_I2C_STATE_RESET)
|
||||
{
|
||||
if (i2c_handler == (I2C_HandleTypeDef*)(&hI2cAudioHandler))
|
||||
{
|
||||
/* Audio and LCD I2C configuration */
|
||||
i2c_handler->Instance = DISCOVERY_AUDIO_I2Cx;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* External, camera and Arduino connector I2C configuration */
|
||||
i2c_handler->Instance = DISCOVERY_EXT_I2Cx;
|
||||
}
|
||||
i2c_handler->Init.Timing = DISCOVERY_I2Cx_TIMING;
|
||||
i2c_handler->Init.OwnAddress1 = 0;
|
||||
i2c_handler->Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
|
||||
i2c_handler->Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
|
||||
i2c_handler->Init.OwnAddress2 = 0;
|
||||
i2c_handler->Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
|
||||
i2c_handler->Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
|
||||
|
||||
/* Init the I2C */
|
||||
I2Cx_MspInit(i2c_handler);
|
||||
HAL_I2C_Init(i2c_handler);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Reads multiple data.
|
||||
* @param i2c_handler : I2C handler
|
||||
* @param Addr: I2C address
|
||||
* @param Reg: Reg address
|
||||
* @param MemAddress: Memory address
|
||||
* @param Buffer: Pointer to data buffer
|
||||
* @param Length: Length of the data
|
||||
* @retval Number of read data
|
||||
*/
|
||||
static HAL_StatusTypeDef I2Cx_ReadMultiple(I2C_HandleTypeDef *i2c_handler,
|
||||
uint8_t Addr,
|
||||
uint16_t Reg,
|
||||
uint16_t MemAddress,
|
||||
uint8_t *Buffer,
|
||||
uint16_t Length)
|
||||
{
|
||||
HAL_StatusTypeDef status = HAL_OK;
|
||||
|
||||
status = HAL_I2C_Mem_Read(i2c_handler, Addr, (uint16_t)Reg, MemAddress, Buffer, Length, 1000);
|
||||
|
||||
/* Check the communication status */
|
||||
if(status != HAL_OK)
|
||||
{
|
||||
/* I2C error occurred */
|
||||
I2Cx_Error(i2c_handler, Addr);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Writes a value in a register of the device through BUS in using DMA mode.
|
||||
* @param i2c_handler : I2C handler
|
||||
* @param Addr: Device address on BUS Bus.
|
||||
* @param Reg: The target register address to write
|
||||
* @param MemAddress: Memory address
|
||||
* @param Buffer: The target register value to be written
|
||||
* @param Length: buffer size to be written
|
||||
* @retval HAL status
|
||||
*/
|
||||
static HAL_StatusTypeDef I2Cx_WriteMultiple(I2C_HandleTypeDef *i2c_handler,
|
||||
uint8_t Addr,
|
||||
uint16_t Reg,
|
||||
uint16_t MemAddress,
|
||||
uint8_t *Buffer,
|
||||
uint16_t Length)
|
||||
{
|
||||
HAL_StatusTypeDef status = HAL_OK;
|
||||
|
||||
status = HAL_I2C_Mem_Write(i2c_handler, Addr, (uint16_t)Reg, MemAddress, Buffer, Length, 1000);
|
||||
|
||||
/* Check the communication status */
|
||||
if(status != HAL_OK)
|
||||
{
|
||||
/* Re-Initiaize the I2C Bus */
|
||||
I2Cx_Error(i2c_handler, Addr);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Checks if target device is ready for communication.
|
||||
* @note This function is used with Memory devices
|
||||
* @param i2c_handler : I2C handler
|
||||
* @param DevAddress: Target device address
|
||||
* @param Trials: Number of trials
|
||||
* @retval HAL status
|
||||
*/
|
||||
static HAL_StatusTypeDef I2Cx_IsDeviceReady(I2C_HandleTypeDef *i2c_handler, uint16_t DevAddress, uint32_t Trials)
|
||||
{
|
||||
return (HAL_I2C_IsDeviceReady(i2c_handler, DevAddress, Trials, 1000));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Manages error callback by re-initializing I2C.
|
||||
* @param i2c_handler : I2C handler
|
||||
* @param Addr: I2C Address
|
||||
* @retval None
|
||||
*/
|
||||
static void I2Cx_Error(I2C_HandleTypeDef *i2c_handler, uint8_t Addr)
|
||||
{
|
||||
/* De-initialize the I2C communication bus */
|
||||
HAL_I2C_DeInit(i2c_handler);
|
||||
|
||||
/* Re-Initialize the I2C communication bus */
|
||||
I2Cx_Init(i2c_handler);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
LINK OPERATIONS
|
||||
*******************************************************************************/
|
||||
|
||||
/********************************* LINK AUDIO *********************************/
|
||||
|
||||
/**
|
||||
* @brief Initializes Audio low level.
|
||||
* @retval None
|
||||
*/
|
||||
void AUDIO_IO_Init(void)
|
||||
{
|
||||
I2Cx_Init(&hI2cAudioHandler);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Deinitializes Audio low level.
|
||||
* @retval None
|
||||
*/
|
||||
void AUDIO_IO_DeInit(void)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Writes a single data.
|
||||
* @param Addr: I2C address
|
||||
* @param Reg: Reg address
|
||||
* @param Value: Data to be written
|
||||
* @retval None
|
||||
*/
|
||||
void AUDIO_IO_Write(uint8_t Addr, uint16_t Reg, uint16_t Value)
|
||||
{
|
||||
uint16_t tmp = Value;
|
||||
|
||||
Value = ((uint16_t)(tmp >> 8) & 0x00FF);
|
||||
|
||||
Value |= ((uint16_t)(tmp << 8)& 0xFF00);
|
||||
|
||||
I2Cx_WriteMultiple(&hI2cAudioHandler, Addr, Reg, I2C_MEMADD_SIZE_16BIT,(uint8_t*)&Value, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Reads a single data.
|
||||
* @param Addr: I2C address
|
||||
* @param Reg: Reg address
|
||||
* @retval Data to be read
|
||||
*/
|
||||
uint16_t AUDIO_IO_Read(uint8_t Addr, uint16_t Reg)
|
||||
{
|
||||
uint16_t read_value = 0, tmp = 0;
|
||||
|
||||
I2Cx_ReadMultiple(&hI2cAudioHandler, Addr, Reg, I2C_MEMADD_SIZE_16BIT, (uint8_t*)&read_value, 2);
|
||||
|
||||
tmp = ((uint16_t)(read_value >> 8) & 0x00FF);
|
||||
|
||||
tmp |= ((uint16_t)(read_value << 8)& 0xFF00);
|
||||
|
||||
read_value = tmp;
|
||||
|
||||
return read_value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief AUDIO Codec delay
|
||||
* @param Delay: Delay in ms
|
||||
* @retval None
|
||||
*/
|
||||
void AUDIO_IO_Delay(uint32_t Delay)
|
||||
{
|
||||
HAL_Delay(Delay);
|
||||
}
|
||||
|
||||
/********************************* LINK CAMERA ********************************/
|
||||
|
||||
/**
|
||||
* @brief Initializes Camera low level.
|
||||
* @retval None
|
||||
*/
|
||||
void CAMERA_IO_Init(void)
|
||||
{
|
||||
I2Cx_Init(&hI2cExtHandler);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Camera writes single data.
|
||||
* @param Addr: I2C address
|
||||
* @param Reg: Register address
|
||||
* @param Value: Data to be written
|
||||
* @retval None
|
||||
*/
|
||||
void CAMERA_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
|
||||
{
|
||||
I2Cx_WriteMultiple(&hI2cExtHandler, Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT,(uint8_t*)&Value, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Camera reads single data.
|
||||
* @param Addr: I2C address
|
||||
* @param Reg: Register address
|
||||
* @retval Read data
|
||||
*/
|
||||
uint8_t CAMERA_IO_Read(uint8_t Addr, uint8_t Reg)
|
||||
{
|
||||
uint8_t read_value = 0;
|
||||
|
||||
I2Cx_ReadMultiple(&hI2cExtHandler, Addr, Reg, I2C_MEMADD_SIZE_8BIT, (uint8_t*)&read_value, 1);
|
||||
|
||||
return read_value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Camera delay
|
||||
* @param Delay: Delay in ms
|
||||
* @retval None
|
||||
*/
|
||||
void CAMERA_Delay(uint32_t Delay)
|
||||
{
|
||||
HAL_Delay(Delay);
|
||||
}
|
||||
|
||||
/******************************** LINK I2C EEPROM *****************************/
|
||||
|
||||
/**
|
||||
* @brief Initializes peripherals used by the I2C EEPROM driver.
|
||||
* @retval None
|
||||
*/
|
||||
void EEPROM_IO_Init(void)
|
||||
{
|
||||
I2Cx_Init(&hI2cExtHandler);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Write data to I2C EEPROM driver in using DMA channel.
|
||||
* @param DevAddress: Target device address
|
||||
* @param MemAddress: Internal memory address
|
||||
* @param pBuffer: Pointer to data buffer
|
||||
* @param BufferSize: Amount of data to be sent
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef EEPROM_IO_WriteData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize)
|
||||
{
|
||||
return (I2Cx_WriteMultiple(&hI2cExtHandler, DevAddress, MemAddress, I2C_MEMADD_SIZE_16BIT, pBuffer, BufferSize));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Read data from I2C EEPROM driver in using DMA channel.
|
||||
* @param DevAddress: Target device address
|
||||
* @param MemAddress: Internal memory address
|
||||
* @param pBuffer: Pointer to data buffer
|
||||
* @param BufferSize: Amount of data to be read
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef EEPROM_IO_ReadData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize)
|
||||
{
|
||||
return (I2Cx_ReadMultiple(&hI2cExtHandler, DevAddress, MemAddress, I2C_MEMADD_SIZE_16BIT, pBuffer, BufferSize));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Checks if target device is ready for communication.
|
||||
* @note This function is used with Memory devices
|
||||
* @param DevAddress: Target device address
|
||||
* @param Trials: Number of trials
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef EEPROM_IO_IsDeviceReady(uint16_t DevAddress, uint32_t Trials)
|
||||
{
|
||||
return (I2Cx_IsDeviceReady(&hI2cExtHandler, DevAddress, Trials));
|
||||
}
|
||||
|
||||
/********************************* LINK TOUCHSCREEN *********************************/
|
||||
|
||||
/**
|
||||
* @brief Initializes Touchscreen low level.
|
||||
* @retval None
|
||||
*/
|
||||
void TS_IO_Init(void)
|
||||
{
|
||||
I2Cx_Init(&hI2cAudioHandler);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Writes a single data.
|
||||
* @param Addr: I2C address
|
||||
* @param Reg: Reg address
|
||||
* @param Value: Data to be written
|
||||
* @retval None
|
||||
*/
|
||||
void TS_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
|
||||
{
|
||||
I2Cx_WriteMultiple(&hI2cAudioHandler, Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT,(uint8_t*)&Value, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Reads a single data.
|
||||
* @param Addr: I2C address
|
||||
* @param Reg: Reg address
|
||||
* @retval Data to be read
|
||||
*/
|
||||
uint8_t TS_IO_Read(uint8_t Addr, uint8_t Reg)
|
||||
{
|
||||
uint8_t read_value = 0;
|
||||
|
||||
I2Cx_ReadMultiple(&hI2cAudioHandler, Addr, Reg, I2C_MEMADD_SIZE_8BIT, (uint8_t*)&read_value, 1);
|
||||
|
||||
return read_value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TS delay
|
||||
* @param Delay: Delay in ms
|
||||
* @retval None
|
||||
*/
|
||||
void TS_IO_Delay(uint32_t Delay)
|
||||
{
|
||||
HAL_Delay(Delay);
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
321
project/Drivers/BSP/STM32746G-Discovery/stm32746g_discovery.h
Normal file
321
project/Drivers/BSP/STM32746G-Discovery/stm32746g_discovery.h
Normal file
@@ -0,0 +1,321 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32746g_discovery.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains definitions for STM32746G_DISCOVERY's LEDs,
|
||||
* push-buttons and COM ports hardware resources.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2016 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 __STM32746G_DISCOVERY_H
|
||||
#define __STM32746G_DISCOVERY_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32f7xx_hal.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32746G_DISCOVERY
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32746G_DISCOVERY_LOW_LEVEL
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_LOW_LEVEL_Exported_Types STM32746G_DISCOVERY_LOW_LEVEL Exported Types
|
||||
* @{
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
LED1 = 0,
|
||||
LED_GREEN = LED1,
|
||||
}Led_TypeDef;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
BUTTON_WAKEUP = 0,
|
||||
BUTTON_TAMPER = 1,
|
||||
BUTTON_KEY = 2
|
||||
}Button_TypeDef;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
BUTTON_MODE_GPIO = 0,
|
||||
BUTTON_MODE_EXTI = 1
|
||||
}ButtonMode_TypeDef;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
COM1 = 0,
|
||||
COM2 = 1
|
||||
}COM_TypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_LOW_LEVEL_Exported_Constants STM32746G_DISCOVERY_LOW_LEVEL Exported Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Define for STM32746G_DISCOVERY board
|
||||
*/
|
||||
#if !defined (USE_STM32746G_DISCO)
|
||||
#define USE_STM32746G_DISCO
|
||||
#endif
|
||||
|
||||
/** @addtogroup STM32746G_DISCOVERY_LOW_LEVEL_LED
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define LEDn ((uint8_t)1)
|
||||
|
||||
#define LED1_GPIO_PORT GPIOI
|
||||
#define LED1_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
|
||||
#define LED1_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
|
||||
#define LED1_PIN GPIO_PIN_1
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32746G_DISCOVERY_LOW_LEVEL_BUTTON
|
||||
* @{
|
||||
*/
|
||||
#define BUTTONn ((uint8_t)3)
|
||||
|
||||
/**
|
||||
* @brief Wakeup push-button
|
||||
*/
|
||||
#define WAKEUP_BUTTON_PIN GPIO_PIN_11
|
||||
#define WAKEUP_BUTTON_GPIO_PORT GPIOI
|
||||
#define WAKEUP_BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
|
||||
#define WAKEUP_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
|
||||
#define WAKEUP_BUTTON_EXTI_IRQn EXTI15_10_IRQn
|
||||
|
||||
/**
|
||||
* @brief Tamper push-button
|
||||
*/
|
||||
#define TAMPER_BUTTON_PIN GPIO_PIN_11
|
||||
#define TAMPER_BUTTON_GPIO_PORT GPIOI
|
||||
#define TAMPER_BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
|
||||
#define TAMPER_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
|
||||
#define TAMPER_BUTTON_EXTI_IRQn EXTI15_10_IRQn
|
||||
|
||||
/**
|
||||
* @brief Key push-button
|
||||
*/
|
||||
#define KEY_BUTTON_PIN GPIO_PIN_11
|
||||
#define KEY_BUTTON_GPIO_PORT GPIOI
|
||||
#define KEY_BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
|
||||
#define KEY_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
|
||||
#define KEY_BUTTON_EXTI_IRQn EXTI15_10_IRQn
|
||||
|
||||
#define BUTTONx_GPIO_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == 0) WAKEUP_BUTTON_GPIO_CLK_ENABLE(); else\
|
||||
if((__INDEX__) == 1) TAMPER_BUTTON_GPIO_CLK_ENABLE(); else\
|
||||
KEY_BUTTON_GPIO_CLK_ENABLE(); } while(0)
|
||||
|
||||
#define BUTTONx_GPIO_CLK_DISABLE(__INDEX__) (((__INDEX__) == 0) ? WAKEUP_BUTTON_GPIO_CLK_DISABLE() :\
|
||||
((__INDEX__) == 1) ? TAMPER_BUTTON_GPIO_CLK_DISABLE() : KEY_BUTTON_GPIO_CLK_DISABLE())
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32746G_DISCOVERY_LOW_LEVEL_SIGNAL
|
||||
* @{
|
||||
*/
|
||||
#define SIGNALn ((uint8_t)1)
|
||||
|
||||
/**
|
||||
* @brief SD-detect signal
|
||||
*/
|
||||
#define SD_DETECT_PIN GPIO_PIN_13
|
||||
#define SD_DETECT_GPIO_PORT GPIOC
|
||||
#define SD_DETECT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
|
||||
#define SD_DETECT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE()
|
||||
#define SD_DETECT_EXTI_IRQn EXTI15_10_IRQn
|
||||
|
||||
/**
|
||||
* @brief Touch screen interrupt signal
|
||||
*/
|
||||
#define TS_INT_PIN GPIO_PIN_13
|
||||
#define TS_INT_GPIO_PORT GPIOI
|
||||
#define TS_INT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
|
||||
#define TS_INT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
|
||||
#define TS_INT_EXTI_IRQn EXTI15_10_IRQn
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32746G_DISCOVERY_LOW_LEVEL_COM
|
||||
* @{
|
||||
*/
|
||||
#define COMn ((uint8_t)1)
|
||||
|
||||
/**
|
||||
* @brief Definition for COM port1, connected to USART1
|
||||
*/
|
||||
#define DISCOVERY_COM1 USART1
|
||||
#define DISCOVERY_COM1_CLK_ENABLE() __HAL_RCC_USART1_CLK_ENABLE()
|
||||
#define DISCOVERY_COM1_CLK_DISABLE() __HAL_RCC_USART1_CLK_DISABLE()
|
||||
|
||||
#define DISCOVERY_COM1_TX_PIN GPIO_PIN_9
|
||||
#define DISCOVERY_COM1_TX_GPIO_PORT GPIOA
|
||||
#define DISCOVERY_COM1_TX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
|
||||
#define DISCOVERY_COM1_TX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE()
|
||||
#define DISCOVERY_COM1_TX_AF GPIO_AF7_USART1
|
||||
|
||||
#define DISCOVERY_COM1_RX_PIN GPIO_PIN_7
|
||||
#define DISCOVERY_COM1_RX_GPIO_PORT GPIOB
|
||||
#define DISCOVERY_COM1_RX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
#define DISCOVERY_COM1_RX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
|
||||
#define DISCOVERY_COM1_RX_AF GPIO_AF7_USART1
|
||||
|
||||
#define DISCOVERY_COM1_IRQn USART1_IRQn
|
||||
|
||||
#define DISCOVERY_COMx_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == COM1) DISCOVERY_COM1_CLK_ENABLE(); } while(0)
|
||||
#define DISCOVERY_COMx_CLK_DISABLE(__INDEX__) (((__INDEX__) == 0) ? DISCOVERY_COM1_CLK_DISABLE() : 0)
|
||||
|
||||
#define DISCOVERY_COMx_TX_GPIO_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == COM1) DISCOVERY_COM1_TX_GPIO_CLK_ENABLE(); } while(0)
|
||||
#define DISCOVERY_COMx_TX_GPIO_CLK_DISABLE(__INDEX__) (((__INDEX__) == 0) ? DISCOVERY_COM1_TX_GPIO_CLK_DISABLE() : 0)
|
||||
|
||||
#define DISCOVERY_COMx_RX_GPIO_CLK_ENABLE(__INDEX__) do { if((__INDEX__) == COM1) DISCOVERY_COM1_RX_GPIO_CLK_ENABLE(); } while(0)
|
||||
#define DISCOVERY_COMx_RX_GPIO_CLK_DISABLE(__INDEX__) (((__INDEX__) == 0) ? DISCOVERY_COM1_RX_GPIO_CLK_DISABLE() : 0)
|
||||
|
||||
/* Exported constant IO ------------------------------------------------------*/
|
||||
|
||||
#define LCD_I2C_ADDRESS ((uint16_t)0x70)
|
||||
#define CAMERA_I2C_ADDRESS ((uint16_t)0x60)
|
||||
#define AUDIO_I2C_ADDRESS ((uint16_t)0x34)
|
||||
#define EEPROM_I2C_ADDRESS_A01 ((uint16_t)0xA0)
|
||||
#define EEPROM_I2C_ADDRESS_A02 ((uint16_t)0xA6)
|
||||
#define TS_I2C_ADDRESS ((uint16_t)0x70)
|
||||
|
||||
/* I2C clock speed configuration (in Hz)
|
||||
WARNING:
|
||||
Make sure that this define is not already declared in other files (ie.
|
||||
stm32746g_discovery.h file). It can be used in parallel by other modules. */
|
||||
#ifndef I2C_SPEED
|
||||
#define I2C_SPEED ((uint32_t)100000)
|
||||
#endif /* I2C_SPEED */
|
||||
|
||||
/* User can use this section to tailor I2Cx/I2Cx instance used and associated
|
||||
resources */
|
||||
/* Definition for AUDIO and LCD I2Cx resources */
|
||||
#define DISCOVERY_AUDIO_I2Cx I2C3
|
||||
#define DISCOVERY_AUDIO_I2Cx_CLK_ENABLE() __HAL_RCC_I2C3_CLK_ENABLE()
|
||||
#define DISCOVERY_AUDIO_DMAx_CLK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE()
|
||||
#define DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOH_CLK_ENABLE()
|
||||
|
||||
#define DISCOVERY_AUDIO_I2Cx_FORCE_RESET() __HAL_RCC_I2C3_FORCE_RESET()
|
||||
#define DISCOVERY_AUDIO_I2Cx_RELEASE_RESET() __HAL_RCC_I2C3_RELEASE_RESET()
|
||||
|
||||
/* Definition for I2Cx Pins */
|
||||
#define DISCOVERY_AUDIO_I2Cx_SCL_PIN GPIO_PIN_7
|
||||
#define DISCOVERY_AUDIO_I2Cx_SCL_SDA_GPIO_PORT GPIOH
|
||||
#define DISCOVERY_AUDIO_I2Cx_SCL_SDA_AF GPIO_AF4_I2C3
|
||||
#define DISCOVERY_AUDIO_I2Cx_SDA_PIN GPIO_PIN_8
|
||||
|
||||
/* I2C interrupt requests */
|
||||
#define DISCOVERY_AUDIO_I2Cx_EV_IRQn I2C3_EV_IRQn
|
||||
#define DISCOVERY_AUDIO_I2Cx_ER_IRQn I2C3_ER_IRQn
|
||||
|
||||
/* Definition for external, camera and Arduino connector I2Cx resources */
|
||||
#define DISCOVERY_EXT_I2Cx I2C1
|
||||
#define DISCOVERY_EXT_I2Cx_CLK_ENABLE() __HAL_RCC_I2C1_CLK_ENABLE()
|
||||
#define DISCOVERY_EXT_DMAx_CLK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE()
|
||||
#define DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
|
||||
#define DISCOVERY_EXT_I2Cx_FORCE_RESET() __HAL_RCC_I2C1_FORCE_RESET()
|
||||
#define DISCOVERY_EXT_I2Cx_RELEASE_RESET() __HAL_RCC_I2C1_RELEASE_RESET()
|
||||
|
||||
/* Definition for I2Cx Pins */
|
||||
#define DISCOVERY_EXT_I2Cx_SCL_PIN GPIO_PIN_8
|
||||
#define DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_PORT GPIOB
|
||||
#define DISCOVERY_EXT_I2Cx_SCL_SDA_AF GPIO_AF4_I2C1
|
||||
#define DISCOVERY_EXT_I2Cx_SDA_PIN GPIO_PIN_9
|
||||
|
||||
/* I2C interrupt requests */
|
||||
#define DISCOVERY_EXT_I2Cx_EV_IRQn I2C1_EV_IRQn
|
||||
#define DISCOVERY_EXT_I2Cx_ER_IRQn I2C1_ER_IRQn
|
||||
|
||||
/* I2C TIMING Register define when I2C clock source is SYSCLK */
|
||||
/* I2C TIMING is calculated from APB1 source clock = 50 MHz */
|
||||
/* Due to the big MOFSET capacity for adapting the camera level the rising time is very large (>1us) */
|
||||
/* 0x40912732 takes in account the big rising and aims a clock of 100khz */
|
||||
#ifndef DISCOVERY_I2Cx_TIMING
|
||||
#define DISCOVERY_I2Cx_TIMING ((uint32_t)0x40912732)
|
||||
#endif /* DISCOVERY_I2Cx_TIMING */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_LOW_LEVEL_Exported_Macros STM32746G_DISCOVERY_LOW_LEVEL Exported Macros
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32746G_DISCOVERY_LOW_LEVEL_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
uint32_t BSP_GetVersion(void);
|
||||
void BSP_LED_Init(Led_TypeDef Led);
|
||||
void BSP_LED_DeInit(Led_TypeDef Led);
|
||||
void BSP_LED_On(Led_TypeDef Led);
|
||||
void BSP_LED_Off(Led_TypeDef Led);
|
||||
void BSP_LED_Toggle(Led_TypeDef Led);
|
||||
void BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef ButtonMode);
|
||||
void BSP_PB_DeInit(Button_TypeDef Button);
|
||||
uint32_t BSP_PB_GetState(Button_TypeDef Button);
|
||||
void BSP_COM_Init(COM_TypeDef COM, UART_HandleTypeDef *husart);
|
||||
void BSP_COM_DeInit(COM_TypeDef COM, UART_HandleTypeDef *huart);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __STM32746G_DISCOVERY_H */
|
||||
|
||||
1647
project/Drivers/BSP/STM32746G-Discovery/stm32746g_discovery_lcd.c
Normal file
1647
project/Drivers/BSP/STM32746G-Discovery/stm32746g_discovery_lcd.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,249 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32746g_discovery_lcd.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains the common defines and functions prototypes for
|
||||
* the stm32746g_discovery_lcd.c driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2016 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 __STM32746G_DISCOVERY_LCD_H
|
||||
#define __STM32746G_DISCOVERY_LCD_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
/* Include LCD component Driver */
|
||||
/* LCD RK043FN48H-CT672B 4,3" 480x272 pixels */
|
||||
#include "../Components/rk043fn48h/rk043fn48h.h"
|
||||
|
||||
/* Include SDRAM Driver */
|
||||
#include "stm32746g_discovery_sdram.h"
|
||||
|
||||
#include "stm32746g_discovery.h"
|
||||
#include "../../../Utilities/Fonts/fonts.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32746G_DISCOVERY
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32746G_DISCOVERY_LCD
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_LCD_Exported_Types STM32746G_DISCOVERY_LCD Exported Types
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t TextColor;
|
||||
uint32_t BackColor;
|
||||
sFONT *pFont;
|
||||
}LCD_DrawPropTypeDef;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int16_t X;
|
||||
int16_t Y;
|
||||
}Point, * pPoint;
|
||||
|
||||
/**
|
||||
* @brief Line mode structures definition
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
CENTER_MODE = 0x01, /* Center mode */
|
||||
RIGHT_MODE = 0x02, /* Right mode */
|
||||
LEFT_MODE = 0x03 /* Left mode */
|
||||
}Text_AlignModeTypdef;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_LCD_Exported_Constants STM32746G_DISCOVERY_LCD Exported Constants
|
||||
* @{
|
||||
*/
|
||||
#define MAX_LAYER_NUMBER ((uint32_t)2)
|
||||
|
||||
#define LCD_LayerCfgTypeDef LTDC_LayerCfgTypeDef
|
||||
|
||||
#define LTDC_ACTIVE_LAYER ((uint32_t)1) /* Layer 1 */
|
||||
/**
|
||||
* @brief LCD status structure definition
|
||||
*/
|
||||
#define LCD_OK ((uint8_t)0x00)
|
||||
#define LCD_ERROR ((uint8_t)0x01)
|
||||
#define LCD_TIMEOUT ((uint8_t)0x02)
|
||||
|
||||
/**
|
||||
* @brief LCD FB_StartAddress
|
||||
*/
|
||||
#define LCD_FB_START_ADDRESS ((uint32_t)0xC0000000)
|
||||
|
||||
/**
|
||||
* @brief LCD color
|
||||
*/
|
||||
#define LCD_COLOR_BLUE ((uint32_t)0xFF0000FF)
|
||||
#define LCD_COLOR_GREEN ((uint32_t)0xFF00FF00)
|
||||
#define LCD_COLOR_RED ((uint32_t)0xFFFF0000)
|
||||
#define LCD_COLOR_CYAN ((uint32_t)0xFF00FFFF)
|
||||
#define LCD_COLOR_MAGENTA ((uint32_t)0xFFFF00FF)
|
||||
#define LCD_COLOR_YELLOW ((uint32_t)0xFFFFFF00)
|
||||
#define LCD_COLOR_LIGHTBLUE ((uint32_t)0xFF8080FF)
|
||||
#define LCD_COLOR_LIGHTGREEN ((uint32_t)0xFF80FF80)
|
||||
#define LCD_COLOR_LIGHTRED ((uint32_t)0xFFFF8080)
|
||||
#define LCD_COLOR_LIGHTCYAN ((uint32_t)0xFF80FFFF)
|
||||
#define LCD_COLOR_LIGHTMAGENTA ((uint32_t)0xFFFF80FF)
|
||||
#define LCD_COLOR_LIGHTYELLOW ((uint32_t)0xFFFFFF80)
|
||||
#define LCD_COLOR_DARKBLUE ((uint32_t)0xFF000080)
|
||||
#define LCD_COLOR_DARKGREEN ((uint32_t)0xFF008000)
|
||||
#define LCD_COLOR_DARKRED ((uint32_t)0xFF800000)
|
||||
#define LCD_COLOR_DARKCYAN ((uint32_t)0xFF008080)
|
||||
#define LCD_COLOR_DARKMAGENTA ((uint32_t)0xFF800080)
|
||||
#define LCD_COLOR_DARKYELLOW ((uint32_t)0xFF808000)
|
||||
#define LCD_COLOR_WHITE ((uint32_t)0xFFFFFFFF)
|
||||
#define LCD_COLOR_LIGHTGRAY ((uint32_t)0xFFD3D3D3)
|
||||
#define LCD_COLOR_GRAY ((uint32_t)0xFF808080)
|
||||
#define LCD_COLOR_DARKGRAY ((uint32_t)0xFF404040)
|
||||
#define LCD_COLOR_BLACK ((uint32_t)0xFF000000)
|
||||
#define LCD_COLOR_BROWN ((uint32_t)0xFFA52A2A)
|
||||
#define LCD_COLOR_ORANGE ((uint32_t)0xFFFFA500)
|
||||
#define LCD_COLOR_TRANSPARENT ((uint32_t)0xFF000000)
|
||||
|
||||
/**
|
||||
* @brief LCD default font
|
||||
*/
|
||||
#define LCD_DEFAULT_FONT Font24
|
||||
|
||||
/**
|
||||
* @brief LCD Reload Types
|
||||
*/
|
||||
#define LCD_RELOAD_IMMEDIATE ((uint32_t)LTDC_SRCR_IMR)
|
||||
#define LCD_RELOAD_VERTICAL_BLANKING ((uint32_t)LTDC_SRCR_VBR)
|
||||
|
||||
|
||||
/**
|
||||
* @brief LCD special pins
|
||||
*/
|
||||
/* Display enable pin */
|
||||
#define LCD_DISP_PIN GPIO_PIN_12
|
||||
#define LCD_DISP_GPIO_PORT GPIOI
|
||||
#define LCD_DISP_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE()
|
||||
#define LCD_DISP_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE()
|
||||
|
||||
/* Backlight control pin */
|
||||
#define LCD_BL_CTRL_PIN GPIO_PIN_3
|
||||
#define LCD_BL_CTRL_GPIO_PORT GPIOK
|
||||
#define LCD_BL_CTRL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOK_CLK_ENABLE()
|
||||
#define LCD_BL_CTRL_GPIO_CLK_DISABLE() __HAL_RCC_GPIOK_CLK_DISABLE()
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32746G_DISCOVERY_LCD_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
uint8_t BSP_LCD_Init(void);
|
||||
uint8_t BSP_LCD_DeInit(void);
|
||||
uint32_t BSP_LCD_GetXSize(void);
|
||||
uint32_t BSP_LCD_GetYSize(void);
|
||||
void BSP_LCD_SetXSize(uint32_t imageWidthPixels);
|
||||
void BSP_LCD_SetYSize(uint32_t imageHeightPixels);
|
||||
|
||||
/* Functions using the LTDC controller */
|
||||
void BSP_LCD_LayerDefaultInit(uint16_t LayerIndex, uint32_t FrameBuffer);
|
||||
void BSP_LCD_LayerRgb565Init(uint16_t LayerIndex, uint32_t FB_Address);
|
||||
void BSP_LCD_SetTransparency(uint32_t LayerIndex, uint8_t Transparency);
|
||||
void BSP_LCD_SetTransparency_NoReload(uint32_t LayerIndex, uint8_t Transparency);
|
||||
void BSP_LCD_SetLayerAddress(uint32_t LayerIndex, uint32_t Address);
|
||||
void BSP_LCD_SetLayerAddress_NoReload(uint32_t LayerIndex, uint32_t Address);
|
||||
void BSP_LCD_SetColorKeying(uint32_t LayerIndex, uint32_t RGBValue);
|
||||
void BSP_LCD_SetColorKeying_NoReload(uint32_t LayerIndex, uint32_t RGBValue);
|
||||
void BSP_LCD_ResetColorKeying(uint32_t LayerIndex);
|
||||
void BSP_LCD_ResetColorKeying_NoReload(uint32_t LayerIndex);
|
||||
void BSP_LCD_SetLayerWindow(uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
|
||||
void BSP_LCD_SetLayerWindow_NoReload(uint16_t LayerIndex, uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
|
||||
void BSP_LCD_SelectLayer(uint32_t LayerIndex);
|
||||
void BSP_LCD_SetLayerVisible(uint32_t LayerIndex, FunctionalState State);
|
||||
void BSP_LCD_SetLayerVisible_NoReload(uint32_t LayerIndex, FunctionalState State);
|
||||
void BSP_LCD_Reload(uint32_t ReloadType);
|
||||
|
||||
void BSP_LCD_SetTextColor(uint32_t Color);
|
||||
uint32_t BSP_LCD_GetTextColor(void);
|
||||
void BSP_LCD_SetBackColor(uint32_t Color);
|
||||
uint32_t BSP_LCD_GetBackColor(void);
|
||||
void BSP_LCD_SetFont(sFONT *fonts);
|
||||
sFONT *BSP_LCD_GetFont(void);
|
||||
|
||||
uint32_t BSP_LCD_ReadPixel(uint16_t Xpos, uint16_t Ypos);
|
||||
void BSP_LCD_DrawPixel(uint16_t Xpos, uint16_t Ypos, uint32_t pixel);
|
||||
void BSP_LCD_Clear(uint32_t Color);
|
||||
void BSP_LCD_ClearStringLine(uint32_t Line);
|
||||
void BSP_LCD_DisplayStringAtLine(uint16_t Line, uint8_t *ptr);
|
||||
void BSP_LCD_DisplayStringAt(uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Text_AlignModeTypdef Mode);
|
||||
void BSP_LCD_DisplayChar(uint16_t Xpos, uint16_t Ypos, uint8_t Ascii);
|
||||
|
||||
void BSP_LCD_DrawHLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length);
|
||||
void BSP_LCD_DrawVLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length);
|
||||
void BSP_LCD_DrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
|
||||
void BSP_LCD_DrawRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
|
||||
void BSP_LCD_DrawCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius);
|
||||
void BSP_LCD_DrawPolygon(pPoint Points, uint16_t PointCount);
|
||||
void BSP_LCD_DrawEllipse(int Xpos, int Ypos, int XRadius, int YRadius);
|
||||
void BSP_LCD_DrawBitmap(uint32_t Xpos, uint32_t Ypos, uint8_t *pbmp);
|
||||
|
||||
void BSP_LCD_FillRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
|
||||
void BSP_LCD_FillCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius);
|
||||
void BSP_LCD_FillPolygon(pPoint Points, uint16_t PointCount);
|
||||
void BSP_LCD_FillEllipse(int Xpos, int Ypos, int XRadius, int YRadius);
|
||||
|
||||
void BSP_LCD_DisplayOff(void);
|
||||
void BSP_LCD_DisplayOn(void);
|
||||
|
||||
/* These functions can be modified in case the current settings
|
||||
need to be changed for specific application needs */
|
||||
void BSP_LCD_MspInit(LTDC_HandleTypeDef *hltdc, void *Params);
|
||||
void BSP_LCD_MspDeInit(LTDC_HandleTypeDef *hltdc, void *Params);
|
||||
void BSP_LCD_ClockConfig(LTDC_HandleTypeDef *hltdc, void *Params);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __STM32746G_DISCOVERY_LCD_H */
|
||||
|
||||
@@ -0,0 +1,782 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32746g_discovery_qspi.c
|
||||
* @author MCD Application Team
|
||||
* @brief This file includes a standard driver for the N25Q128A QSPI
|
||||
* memory mounted on STM32746G-Discovery board.
|
||||
*
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2016 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.
|
||||
*
|
||||
******************************************************************************
|
||||
@verbatim
|
||||
==============================================================================
|
||||
##### How to use this driver #####
|
||||
==============================================================================
|
||||
[..]
|
||||
(#) This driver is used to drive the N25Q128A QSPI external
|
||||
memory mounted on STM32746G-Discovery board.
|
||||
|
||||
(#) This driver need a specific component driver (N25Q128A) to be included with.
|
||||
|
||||
(#) Initialization steps:
|
||||
(++) Initialize the QPSI external memory using the BSP_QSPI_Init() function. This
|
||||
function includes the MSP layer hardware resources initialization and the
|
||||
QSPI interface with the external memory.
|
||||
|
||||
(#) QSPI memory operations
|
||||
(++) QSPI memory can be accessed with read/write operations once it is
|
||||
initialized.
|
||||
Read/write operation can be performed with AHB access using the functions
|
||||
BSP_QSPI_Read()/BSP_QSPI_Write().
|
||||
(++) The function BSP_QSPI_GetInfo() returns the configuration of the QSPI memory.
|
||||
(see the QSPI memory data sheet)
|
||||
(++) Perform erase block operation using the function BSP_QSPI_Erase_Block() and by
|
||||
specifying the block address. You can perform an erase operation of the whole
|
||||
chip by calling the function BSP_QSPI_Erase_Chip().
|
||||
(++) The function BSP_QSPI_GetStatus() returns the current status of the QSPI memory.
|
||||
(see the QSPI memory data sheet)
|
||||
@endverbatim
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Dependencies
|
||||
- stm32f7xx_hal_qspi.c
|
||||
- stm32f7xx_hal_gpio.c
|
||||
- stm32f7xx_hal_cortex.c
|
||||
- stm32f7xx_hal_rcc_ex.h
|
||||
- n25q128a.h
|
||||
EndDependencies */
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32746g_discovery_qspi.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32746G_DISCOVERY
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_QSPI STM32746G-Discovery QSPI
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_QSPI_Private_Variables STM32746G_DISCOVERY QSPI Private Variables
|
||||
* @{
|
||||
*/
|
||||
QSPI_HandleTypeDef QSPIHandle;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* Private functions ---------------------------------------------------------*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_QSPI_Private_Functions STM32746G_DISCOVERY QSPI Private Functions
|
||||
* @{
|
||||
*/
|
||||
static uint8_t QSPI_ResetMemory (QSPI_HandleTypeDef *hqspi);
|
||||
static uint8_t QSPI_DummyCyclesCfg (QSPI_HandleTypeDef *hqspi);
|
||||
static uint8_t QSPI_WriteEnable (QSPI_HandleTypeDef *hqspi);
|
||||
static uint8_t QSPI_AutoPollingMemReady (QSPI_HandleTypeDef *hqspi, uint32_t Timeout);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_QSPI_Exported_Functions STM32746G_DISCOVERY QSPI Exported Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Initializes the QSPI interface.
|
||||
* @retval QSPI memory status
|
||||
*/
|
||||
uint8_t BSP_QSPI_Init(void)
|
||||
{
|
||||
QSPIHandle.Instance = QUADSPI;
|
||||
|
||||
/* Call the DeInit function to reset the driver */
|
||||
if (HAL_QSPI_DeInit(&QSPIHandle) != HAL_OK)
|
||||
{
|
||||
return QSPI_ERROR;
|
||||
}
|
||||
|
||||
/* System level initialization */
|
||||
BSP_QSPI_MspInit(&QSPIHandle, NULL);
|
||||
|
||||
/* QSPI initialization */
|
||||
QSPIHandle.Init.ClockPrescaler = 1; /* QSPI freq = 216 MHz/(1+1) = 108 Mhz */
|
||||
QSPIHandle.Init.FifoThreshold = 4;
|
||||
QSPIHandle.Init.SampleShifting = QSPI_SAMPLE_SHIFTING_HALFCYCLE;
|
||||
QSPIHandle.Init.FlashSize = POSITION_VAL(N25Q128A_FLASH_SIZE) - 1;
|
||||
QSPIHandle.Init.ChipSelectHighTime = QSPI_CS_HIGH_TIME_6_CYCLE; /* Min 50ns for nonRead */
|
||||
QSPIHandle.Init.ClockMode = QSPI_CLOCK_MODE_0;
|
||||
QSPIHandle.Init.FlashID = QSPI_FLASH_ID_1;
|
||||
QSPIHandle.Init.DualFlash = QSPI_DUALFLASH_DISABLE;
|
||||
|
||||
if (HAL_QSPI_Init(&QSPIHandle) != HAL_OK)
|
||||
{
|
||||
return QSPI_ERROR;
|
||||
}
|
||||
|
||||
/* QSPI memory reset */
|
||||
if (QSPI_ResetMemory(&QSPIHandle) != QSPI_OK)
|
||||
{
|
||||
return QSPI_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
/* Configuration of the dummy cycles on QSPI memory side */
|
||||
if (QSPI_DummyCyclesCfg(&QSPIHandle) != QSPI_OK)
|
||||
{
|
||||
return QSPI_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
return QSPI_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief De-Initializes the QSPI interface.
|
||||
* @retval QSPI memory status
|
||||
*/
|
||||
uint8_t BSP_QSPI_DeInit(void)
|
||||
{
|
||||
QSPIHandle.Instance = QUADSPI;
|
||||
|
||||
/* Call the DeInit function to reset the driver */
|
||||
if (HAL_QSPI_DeInit(&QSPIHandle) != HAL_OK)
|
||||
{
|
||||
return QSPI_ERROR;
|
||||
}
|
||||
|
||||
/* System level De-initialization */
|
||||
BSP_QSPI_MspDeInit(&QSPIHandle, NULL);
|
||||
|
||||
return QSPI_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Reads an amount of data from the QSPI memory.
|
||||
* @param pData: Pointer to data to be read
|
||||
* @param ReadAddr: Read start address
|
||||
* @param Size: Size of data to read
|
||||
* @retval QSPI memory status
|
||||
*/
|
||||
uint8_t BSP_QSPI_Read(uint8_t* pData, uint32_t ReadAddr, uint32_t Size)
|
||||
{
|
||||
QSPI_CommandTypeDef s_command;
|
||||
|
||||
/* Initialize the read command */
|
||||
s_command.InstructionMode = QSPI_INSTRUCTION_1_LINE;
|
||||
s_command.Instruction = QUAD_INOUT_FAST_READ_CMD;
|
||||
s_command.AddressMode = QSPI_ADDRESS_4_LINES;
|
||||
s_command.AddressSize = QSPI_ADDRESS_24_BITS;
|
||||
s_command.Address = ReadAddr;
|
||||
s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
|
||||
s_command.DataMode = QSPI_DATA_4_LINES;
|
||||
s_command.DummyCycles = N25Q128A_DUMMY_CYCLES_READ_QUAD;
|
||||
s_command.NbData = Size;
|
||||
s_command.DdrMode = QSPI_DDR_MODE_DISABLE;
|
||||
s_command.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
|
||||
s_command.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
|
||||
|
||||
/* Configure the command */
|
||||
if (HAL_QSPI_Command(&QSPIHandle, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
|
||||
{
|
||||
return QSPI_ERROR;
|
||||
}
|
||||
|
||||
/* Set S# timing for Read command */
|
||||
MODIFY_REG(QSPIHandle.Instance->DCR, QUADSPI_DCR_CSHT, QSPI_CS_HIGH_TIME_3_CYCLE);
|
||||
|
||||
/* Reception of the data */
|
||||
if (HAL_QSPI_Receive(&QSPIHandle, pData, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
|
||||
{
|
||||
return QSPI_ERROR;
|
||||
}
|
||||
|
||||
/* Restore S# timing for nonRead commands */
|
||||
MODIFY_REG(QSPIHandle.Instance->DCR, QUADSPI_DCR_CSHT, QSPI_CS_HIGH_TIME_6_CYCLE);
|
||||
|
||||
return QSPI_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Writes an amount of data to the QSPI memory.
|
||||
* @param pData: Pointer to data to be written
|
||||
* @param WriteAddr: Write start address
|
||||
* @param Size: Size of data to write
|
||||
* @retval QSPI memory status
|
||||
*/
|
||||
uint8_t BSP_QSPI_Write(uint8_t* pData, uint32_t WriteAddr, uint32_t Size)
|
||||
{
|
||||
QSPI_CommandTypeDef s_command;
|
||||
uint32_t end_addr, current_size, current_addr;
|
||||
|
||||
/* Calculation of the size between the write address and the end of the page */
|
||||
current_size = N25Q128A_PAGE_SIZE - (WriteAddr % N25Q128A_PAGE_SIZE);
|
||||
|
||||
/* Check if the size of the data is less than the remaining place in the page */
|
||||
if (current_size > Size)
|
||||
{
|
||||
current_size = Size;
|
||||
}
|
||||
|
||||
/* Initialize the adress variables */
|
||||
current_addr = WriteAddr;
|
||||
end_addr = WriteAddr + Size;
|
||||
|
||||
/* Initialize the program command */
|
||||
s_command.InstructionMode = QSPI_INSTRUCTION_1_LINE;
|
||||
s_command.Instruction = EXT_QUAD_IN_FAST_PROG_CMD;
|
||||
s_command.AddressMode = QSPI_ADDRESS_4_LINES;
|
||||
s_command.AddressSize = QSPI_ADDRESS_24_BITS;
|
||||
s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
|
||||
s_command.DataMode = QSPI_DATA_4_LINES;
|
||||
s_command.DummyCycles = 0;
|
||||
s_command.DdrMode = QSPI_DDR_MODE_DISABLE;
|
||||
s_command.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
|
||||
s_command.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
|
||||
|
||||
/* Perform the write page by page */
|
||||
do
|
||||
{
|
||||
s_command.Address = current_addr;
|
||||
s_command.NbData = current_size;
|
||||
|
||||
/* Enable write operations */
|
||||
if (QSPI_WriteEnable(&QSPIHandle) != QSPI_OK)
|
||||
{
|
||||
return QSPI_ERROR;
|
||||
}
|
||||
|
||||
/* Configure the command */
|
||||
if (HAL_QSPI_Command(&QSPIHandle, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
|
||||
{
|
||||
return QSPI_ERROR;
|
||||
}
|
||||
|
||||
/* Transmission of the data */
|
||||
if (HAL_QSPI_Transmit(&QSPIHandle, pData, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
|
||||
{
|
||||
return QSPI_ERROR;
|
||||
}
|
||||
|
||||
/* Configure automatic polling mode to wait for end of program */
|
||||
if (QSPI_AutoPollingMemReady(&QSPIHandle, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != QSPI_OK)
|
||||
{
|
||||
return QSPI_ERROR;
|
||||
}
|
||||
|
||||
/* Update the address and size variables for next page programming */
|
||||
current_addr += current_size;
|
||||
pData += current_size;
|
||||
current_size = ((current_addr + N25Q128A_PAGE_SIZE) > end_addr) ? (end_addr - current_addr) : N25Q128A_PAGE_SIZE;
|
||||
} while (current_addr < end_addr);
|
||||
|
||||
return QSPI_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Erases the specified block of the QSPI memory.
|
||||
* @param BlockAddress: Block address to erase
|
||||
* @retval QSPI memory status
|
||||
*/
|
||||
uint8_t BSP_QSPI_Erase_Block(uint32_t BlockAddress)
|
||||
{
|
||||
QSPI_CommandTypeDef s_command;
|
||||
|
||||
/* Initialize the erase command */
|
||||
s_command.InstructionMode = QSPI_INSTRUCTION_1_LINE;
|
||||
s_command.Instruction = SUBSECTOR_ERASE_CMD;
|
||||
s_command.AddressMode = QSPI_ADDRESS_1_LINE;
|
||||
s_command.AddressSize = QSPI_ADDRESS_24_BITS;
|
||||
s_command.Address = BlockAddress;
|
||||
s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
|
||||
s_command.DataMode = QSPI_DATA_NONE;
|
||||
s_command.DummyCycles = 0;
|
||||
s_command.DdrMode = QSPI_DDR_MODE_DISABLE;
|
||||
s_command.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
|
||||
s_command.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
|
||||
|
||||
/* Enable write operations */
|
||||
if (QSPI_WriteEnable(&QSPIHandle) != QSPI_OK)
|
||||
{
|
||||
return QSPI_ERROR;
|
||||
}
|
||||
|
||||
/* Send the command */
|
||||
if (HAL_QSPI_Command(&QSPIHandle, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
|
||||
{
|
||||
return QSPI_ERROR;
|
||||
}
|
||||
|
||||
/* Configure automatic polling mode to wait for end of erase */
|
||||
if (QSPI_AutoPollingMemReady(&QSPIHandle, N25Q128A_SUBSECTOR_ERASE_MAX_TIME) != QSPI_OK)
|
||||
{
|
||||
return QSPI_ERROR;
|
||||
}
|
||||
|
||||
return QSPI_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Erases the entire QSPI memory.
|
||||
* @retval QSPI memory status
|
||||
*/
|
||||
uint8_t BSP_QSPI_Erase_Chip(void)
|
||||
{
|
||||
QSPI_CommandTypeDef s_command;
|
||||
|
||||
/* Initialize the erase command */
|
||||
s_command.InstructionMode = QSPI_INSTRUCTION_1_LINE;
|
||||
s_command.Instruction = BULK_ERASE_CMD;
|
||||
s_command.AddressMode = QSPI_ADDRESS_NONE;
|
||||
s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
|
||||
s_command.DataMode = QSPI_DATA_NONE;
|
||||
s_command.DummyCycles = 0;
|
||||
s_command.DdrMode = QSPI_DDR_MODE_DISABLE;
|
||||
s_command.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
|
||||
s_command.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
|
||||
|
||||
/* Enable write operations */
|
||||
if (QSPI_WriteEnable(&QSPIHandle) != QSPI_OK)
|
||||
{
|
||||
return QSPI_ERROR;
|
||||
}
|
||||
|
||||
/* Send the command */
|
||||
if (HAL_QSPI_Command(&QSPIHandle, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
|
||||
{
|
||||
return QSPI_ERROR;
|
||||
}
|
||||
|
||||
/* Configure automatic polling mode to wait for end of erase */
|
||||
if (QSPI_AutoPollingMemReady(&QSPIHandle, N25Q128A_BULK_ERASE_MAX_TIME) != QSPI_OK)
|
||||
{
|
||||
return QSPI_ERROR;
|
||||
}
|
||||
|
||||
return QSPI_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Reads current status of the QSPI memory.
|
||||
* @retval QSPI memory status
|
||||
*/
|
||||
uint8_t BSP_QSPI_GetStatus(void)
|
||||
{
|
||||
QSPI_CommandTypeDef s_command;
|
||||
uint8_t reg;
|
||||
|
||||
/* Initialize the read flag status register command */
|
||||
s_command.InstructionMode = QSPI_INSTRUCTION_1_LINE;
|
||||
s_command.Instruction = READ_FLAG_STATUS_REG_CMD;
|
||||
s_command.AddressMode = QSPI_ADDRESS_NONE;
|
||||
s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
|
||||
s_command.DataMode = QSPI_DATA_1_LINE;
|
||||
s_command.DummyCycles = 0;
|
||||
s_command.NbData = 1;
|
||||
s_command.DdrMode = QSPI_DDR_MODE_DISABLE;
|
||||
s_command.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
|
||||
s_command.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
|
||||
|
||||
/* Configure the command */
|
||||
if (HAL_QSPI_Command(&QSPIHandle, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
|
||||
{
|
||||
return QSPI_ERROR;
|
||||
}
|
||||
|
||||
/* Reception of the data */
|
||||
if (HAL_QSPI_Receive(&QSPIHandle, ®, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
|
||||
{
|
||||
return QSPI_ERROR;
|
||||
}
|
||||
|
||||
/* Check the value of the register */
|
||||
if ((reg & (N25Q128A_FSR_PRERR | N25Q128A_FSR_VPPERR | N25Q128A_FSR_PGERR | N25Q128A_FSR_ERERR)) != 0)
|
||||
{
|
||||
return QSPI_ERROR;
|
||||
}
|
||||
else if ((reg & (N25Q128A_FSR_PGSUS | N25Q128A_FSR_ERSUS)) != 0)
|
||||
{
|
||||
return QSPI_SUSPENDED;
|
||||
}
|
||||
else if ((reg & N25Q128A_FSR_READY) != 0)
|
||||
{
|
||||
return QSPI_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
return QSPI_BUSY;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return the configuration of the QSPI memory.
|
||||
* @param pInfo: pointer on the configuration structure
|
||||
* @retval QSPI memory status
|
||||
*/
|
||||
uint8_t BSP_QSPI_GetInfo(QSPI_Info* pInfo)
|
||||
{
|
||||
/* Configure the structure with the memory configuration */
|
||||
pInfo->FlashSize = N25Q128A_FLASH_SIZE;
|
||||
pInfo->EraseSectorSize = N25Q128A_SUBSECTOR_SIZE;
|
||||
pInfo->EraseSectorsNumber = (N25Q128A_FLASH_SIZE/N25Q128A_SUBSECTOR_SIZE);
|
||||
pInfo->ProgPageSize = N25Q128A_PAGE_SIZE;
|
||||
pInfo->ProgPagesNumber = (N25Q128A_FLASH_SIZE/N25Q128A_PAGE_SIZE);
|
||||
|
||||
return QSPI_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configure the QSPI in memory-mapped mode
|
||||
* @retval QSPI memory status
|
||||
*/
|
||||
uint8_t BSP_QSPI_EnableMemoryMappedMode(void)
|
||||
{
|
||||
QSPI_CommandTypeDef s_command;
|
||||
QSPI_MemoryMappedTypeDef s_mem_mapped_cfg;
|
||||
|
||||
/* Configure the command for the read instruction */
|
||||
s_command.InstructionMode = QSPI_INSTRUCTION_1_LINE;
|
||||
s_command.Instruction = QUAD_INOUT_FAST_READ_CMD;
|
||||
s_command.AddressMode = QSPI_ADDRESS_4_LINES;
|
||||
s_command.AddressSize = QSPI_ADDRESS_24_BITS;
|
||||
s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
|
||||
s_command.DataMode = QSPI_DATA_4_LINES;
|
||||
s_command.DummyCycles = N25Q128A_DUMMY_CYCLES_READ_QUAD;
|
||||
s_command.DdrMode = QSPI_DDR_MODE_DISABLE;
|
||||
s_command.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
|
||||
s_command.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
|
||||
|
||||
/* Configure the memory mapped mode */
|
||||
s_mem_mapped_cfg.TimeOutActivation = QSPI_TIMEOUT_COUNTER_DISABLE;
|
||||
s_mem_mapped_cfg.TimeOutPeriod = 0;
|
||||
|
||||
if (HAL_QSPI_MemoryMapped(&QSPIHandle, &s_command, &s_mem_mapped_cfg) != HAL_OK)
|
||||
{
|
||||
return QSPI_ERROR;
|
||||
}
|
||||
|
||||
return QSPI_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32746G_DISCOVERY_QSPI_Private_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief QSPI MSP Initialization
|
||||
* This function configures the hardware resources used in this example:
|
||||
* - Peripheral's clock enable
|
||||
* - Peripheral's GPIO Configuration
|
||||
* - NVIC configuration for QSPI interrupt
|
||||
* @retval None
|
||||
*/
|
||||
__weak void BSP_QSPI_MspInit(QSPI_HandleTypeDef *hqspi, void *Params)
|
||||
{
|
||||
GPIO_InitTypeDef gpio_init_structure;
|
||||
|
||||
/*##-1- Enable peripherals and GPIO Clocks #################################*/
|
||||
/* Enable the QuadSPI memory interface clock */
|
||||
QSPI_CLK_ENABLE();
|
||||
/* Reset the QuadSPI memory interface */
|
||||
QSPI_FORCE_RESET();
|
||||
QSPI_RELEASE_RESET();
|
||||
/* Enable GPIO clocks */
|
||||
QSPI_CS_GPIO_CLK_ENABLE();
|
||||
QSPI_CLK_GPIO_CLK_ENABLE();
|
||||
QSPI_D0_GPIO_CLK_ENABLE();
|
||||
QSPI_D1_GPIO_CLK_ENABLE();
|
||||
QSPI_D2_GPIO_CLK_ENABLE();
|
||||
QSPI_D3_GPIO_CLK_ENABLE();
|
||||
|
||||
/*##-2- Configure peripheral GPIO ##########################################*/
|
||||
/* QSPI CS GPIO pin configuration */
|
||||
gpio_init_structure.Pin = QSPI_CS_PIN;
|
||||
gpio_init_structure.Mode = GPIO_MODE_AF_PP;
|
||||
gpio_init_structure.Pull = GPIO_PULLUP;
|
||||
gpio_init_structure.Speed = GPIO_SPEED_HIGH;
|
||||
gpio_init_structure.Alternate = GPIO_AF10_QUADSPI;
|
||||
HAL_GPIO_Init(QSPI_CS_GPIO_PORT, &gpio_init_structure);
|
||||
|
||||
/* QSPI CLK GPIO pin configuration */
|
||||
gpio_init_structure.Pin = QSPI_CLK_PIN;
|
||||
gpio_init_structure.Pull = GPIO_NOPULL;
|
||||
gpio_init_structure.Alternate = GPIO_AF9_QUADSPI;
|
||||
HAL_GPIO_Init(QSPI_CLK_GPIO_PORT, &gpio_init_structure);
|
||||
|
||||
/* QSPI D0 GPIO pin configuration */
|
||||
gpio_init_structure.Pin = QSPI_D0_PIN;
|
||||
gpio_init_structure.Alternate = GPIO_AF9_QUADSPI;
|
||||
HAL_GPIO_Init(QSPI_D0_GPIO_PORT, &gpio_init_structure);
|
||||
|
||||
/* QSPI D1 GPIO pin configuration */
|
||||
gpio_init_structure.Pin = QSPI_D1_PIN;
|
||||
gpio_init_structure.Alternate = GPIO_AF9_QUADSPI;
|
||||
HAL_GPIO_Init(QSPI_D1_GPIO_PORT, &gpio_init_structure);
|
||||
|
||||
/* QSPI D2 GPIO pin configuration */
|
||||
gpio_init_structure.Pin = QSPI_D2_PIN;
|
||||
gpio_init_structure.Alternate = GPIO_AF9_QUADSPI;
|
||||
HAL_GPIO_Init(QSPI_D2_GPIO_PORT, &gpio_init_structure);
|
||||
|
||||
/* QSPI D3 GPIO pin configuration */
|
||||
gpio_init_structure.Pin = QSPI_D3_PIN;
|
||||
gpio_init_structure.Alternate = GPIO_AF9_QUADSPI;
|
||||
HAL_GPIO_Init(QSPI_D3_GPIO_PORT, &gpio_init_structure);
|
||||
|
||||
/*##-3- Configure the NVIC for QSPI #########################################*/
|
||||
/* NVIC configuration for QSPI interrupt */
|
||||
HAL_NVIC_SetPriority(QUADSPI_IRQn, 0x0F, 0);
|
||||
HAL_NVIC_EnableIRQ(QUADSPI_IRQn);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QSPI MSP De-Initialization
|
||||
* This function frees the hardware resources used in this example:
|
||||
* - Disable the Peripheral's clock
|
||||
* - Revert GPIO and NVIC configuration to their default state
|
||||
* @retval None
|
||||
*/
|
||||
__weak void BSP_QSPI_MspDeInit(QSPI_HandleTypeDef *hqspi, void *Params)
|
||||
{
|
||||
/*##-1- Disable the NVIC for QSPI ###########################################*/
|
||||
HAL_NVIC_DisableIRQ(QUADSPI_IRQn);
|
||||
|
||||
/*##-2- Disable peripherals and GPIO Clocks ################################*/
|
||||
/* De-Configure QSPI pins */
|
||||
HAL_GPIO_DeInit(QSPI_CS_GPIO_PORT, QSPI_CS_PIN);
|
||||
HAL_GPIO_DeInit(QSPI_CLK_GPIO_PORT, QSPI_CLK_PIN);
|
||||
HAL_GPIO_DeInit(QSPI_D0_GPIO_PORT, QSPI_D0_PIN);
|
||||
HAL_GPIO_DeInit(QSPI_D1_GPIO_PORT, QSPI_D1_PIN);
|
||||
HAL_GPIO_DeInit(QSPI_D2_GPIO_PORT, QSPI_D2_PIN);
|
||||
HAL_GPIO_DeInit(QSPI_D3_GPIO_PORT, QSPI_D3_PIN);
|
||||
|
||||
/*##-3- Reset peripherals ##################################################*/
|
||||
/* Reset the QuadSPI memory interface */
|
||||
QSPI_FORCE_RESET();
|
||||
QSPI_RELEASE_RESET();
|
||||
|
||||
/* Disable the QuadSPI memory interface clock */
|
||||
QSPI_CLK_DISABLE();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function reset the QSPI memory.
|
||||
* @param hqspi: QSPI handle
|
||||
* @retval None
|
||||
*/
|
||||
static uint8_t QSPI_ResetMemory(QSPI_HandleTypeDef *hqspi)
|
||||
{
|
||||
QSPI_CommandTypeDef s_command;
|
||||
|
||||
/* Initialize the reset enable command */
|
||||
s_command.InstructionMode = QSPI_INSTRUCTION_1_LINE;
|
||||
s_command.Instruction = RESET_ENABLE_CMD;
|
||||
s_command.AddressMode = QSPI_ADDRESS_NONE;
|
||||
s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
|
||||
s_command.DataMode = QSPI_DATA_NONE;
|
||||
s_command.DummyCycles = 0;
|
||||
s_command.DdrMode = QSPI_DDR_MODE_DISABLE;
|
||||
s_command.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
|
||||
s_command.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
|
||||
|
||||
/* Send the command */
|
||||
if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
|
||||
{
|
||||
return QSPI_ERROR;
|
||||
}
|
||||
|
||||
/* Send the reset memory command */
|
||||
s_command.Instruction = RESET_MEMORY_CMD;
|
||||
if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
|
||||
{
|
||||
return QSPI_ERROR;
|
||||
}
|
||||
|
||||
/* Configure automatic polling mode to wait the memory is ready */
|
||||
if (QSPI_AutoPollingMemReady(hqspi, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != QSPI_OK)
|
||||
{
|
||||
return QSPI_ERROR;
|
||||
}
|
||||
|
||||
return QSPI_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function configure the dummy cycles on memory side.
|
||||
* @param hqspi: QSPI handle
|
||||
* @retval None
|
||||
*/
|
||||
static uint8_t QSPI_DummyCyclesCfg(QSPI_HandleTypeDef *hqspi)
|
||||
{
|
||||
QSPI_CommandTypeDef s_command;
|
||||
uint8_t reg;
|
||||
|
||||
/* Initialize the read volatile configuration register command */
|
||||
s_command.InstructionMode = QSPI_INSTRUCTION_1_LINE;
|
||||
s_command.Instruction = READ_VOL_CFG_REG_CMD;
|
||||
s_command.AddressMode = QSPI_ADDRESS_NONE;
|
||||
s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
|
||||
s_command.DataMode = QSPI_DATA_1_LINE;
|
||||
s_command.DummyCycles = 0;
|
||||
s_command.NbData = 1;
|
||||
s_command.DdrMode = QSPI_DDR_MODE_DISABLE;
|
||||
s_command.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
|
||||
s_command.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
|
||||
|
||||
/* Configure the command */
|
||||
if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
|
||||
{
|
||||
return QSPI_ERROR;
|
||||
}
|
||||
|
||||
/* Reception of the data */
|
||||
if (HAL_QSPI_Receive(hqspi, ®, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
|
||||
{
|
||||
return QSPI_ERROR;
|
||||
}
|
||||
|
||||
/* Enable write operations */
|
||||
if (QSPI_WriteEnable(hqspi) != QSPI_OK)
|
||||
{
|
||||
return QSPI_ERROR;
|
||||
}
|
||||
|
||||
/* Update volatile configuration register (with new dummy cycles) */
|
||||
s_command.Instruction = WRITE_VOL_CFG_REG_CMD;
|
||||
MODIFY_REG(reg, N25Q128A_VCR_NB_DUMMY, (N25Q128A_DUMMY_CYCLES_READ_QUAD << POSITION_VAL(N25Q128A_VCR_NB_DUMMY)));
|
||||
|
||||
/* Configure the write volatile configuration register command */
|
||||
if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
|
||||
{
|
||||
return QSPI_ERROR;
|
||||
}
|
||||
|
||||
/* Transmission of the data */
|
||||
if (HAL_QSPI_Transmit(hqspi, ®, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
|
||||
{
|
||||
return QSPI_ERROR;
|
||||
}
|
||||
|
||||
return QSPI_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function send a Write Enable and wait it is effective.
|
||||
* @param hqspi: QSPI handle
|
||||
* @retval None
|
||||
*/
|
||||
static uint8_t QSPI_WriteEnable(QSPI_HandleTypeDef *hqspi)
|
||||
{
|
||||
QSPI_CommandTypeDef s_command;
|
||||
QSPI_AutoPollingTypeDef s_config;
|
||||
|
||||
/* Enable write operations */
|
||||
s_command.InstructionMode = QSPI_INSTRUCTION_1_LINE;
|
||||
s_command.Instruction = WRITE_ENABLE_CMD;
|
||||
s_command.AddressMode = QSPI_ADDRESS_NONE;
|
||||
s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
|
||||
s_command.DataMode = QSPI_DATA_NONE;
|
||||
s_command.DummyCycles = 0;
|
||||
s_command.DdrMode = QSPI_DDR_MODE_DISABLE;
|
||||
s_command.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
|
||||
s_command.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
|
||||
|
||||
if (HAL_QSPI_Command(hqspi, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
|
||||
{
|
||||
return QSPI_ERROR;
|
||||
}
|
||||
|
||||
/* Configure automatic polling mode to wait for write enabling */
|
||||
s_config.Match = N25Q128A_SR_WREN;
|
||||
s_config.Mask = N25Q128A_SR_WREN;
|
||||
s_config.MatchMode = QSPI_MATCH_MODE_AND;
|
||||
s_config.StatusBytesSize = 1;
|
||||
s_config.Interval = 0x10;
|
||||
s_config.AutomaticStop = QSPI_AUTOMATIC_STOP_ENABLE;
|
||||
|
||||
s_command.Instruction = READ_STATUS_REG_CMD;
|
||||
s_command.DataMode = QSPI_DATA_1_LINE;
|
||||
|
||||
if (HAL_QSPI_AutoPolling(hqspi, &s_command, &s_config, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
|
||||
{
|
||||
return QSPI_ERROR;
|
||||
}
|
||||
|
||||
return QSPI_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function read the SR of the memory and wait the EOP.
|
||||
* @param hqspi: QSPI handle
|
||||
* @param Timeout
|
||||
* @retval None
|
||||
*/
|
||||
static uint8_t QSPI_AutoPollingMemReady(QSPI_HandleTypeDef *hqspi, uint32_t Timeout)
|
||||
{
|
||||
QSPI_CommandTypeDef s_command;
|
||||
QSPI_AutoPollingTypeDef s_config;
|
||||
|
||||
/* Configure automatic polling mode to wait for memory ready */
|
||||
s_command.InstructionMode = QSPI_INSTRUCTION_1_LINE;
|
||||
s_command.Instruction = READ_STATUS_REG_CMD;
|
||||
s_command.AddressMode = QSPI_ADDRESS_NONE;
|
||||
s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
|
||||
s_command.DataMode = QSPI_DATA_1_LINE;
|
||||
s_command.DummyCycles = 0;
|
||||
s_command.DdrMode = QSPI_DDR_MODE_DISABLE;
|
||||
s_command.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
|
||||
s_command.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
|
||||
|
||||
s_config.Match = 0;
|
||||
s_config.Mask = N25Q128A_SR_WIP;
|
||||
s_config.MatchMode = QSPI_MATCH_MODE_AND;
|
||||
s_config.StatusBytesSize = 1;
|
||||
s_config.Interval = 0x10;
|
||||
s_config.AutomaticStop = QSPI_AUTOMATIC_STOP_ENABLE;
|
||||
|
||||
if (HAL_QSPI_AutoPolling(hqspi, &s_command, &s_config, Timeout) != HAL_OK)
|
||||
{
|
||||
return QSPI_ERROR;
|
||||
}
|
||||
|
||||
return QSPI_OK;
|
||||
}
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
@@ -0,0 +1,152 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32746g_discovery_qspi.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains the common defines and functions prototypes for
|
||||
* the stm32746g_discovery_qspi.c driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2016 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.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32746G_DISCOVERY
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __STM32746G_DISCOVERY_QSPI_H
|
||||
#define __STM32746G_DISCOVERY_QSPI_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32f7xx_hal.h"
|
||||
#include "../Components/n25q128a/n25q128a.h"
|
||||
|
||||
/** @addtogroup STM32746G_DISCOVERY_QSPI
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
/** @defgroup STM32746G_DISCOVERY_QSPI_Exported_Constants STM32746G_DISCOVERY_QSPI Exported Constants
|
||||
* @{
|
||||
*/
|
||||
/* QSPI Error codes */
|
||||
#define QSPI_OK ((uint8_t)0x00)
|
||||
#define QSPI_ERROR ((uint8_t)0x01)
|
||||
#define QSPI_BUSY ((uint8_t)0x02)
|
||||
#define QSPI_NOT_SUPPORTED ((uint8_t)0x04)
|
||||
#define QSPI_SUSPENDED ((uint8_t)0x08)
|
||||
|
||||
|
||||
/* Definition for QSPI clock resources */
|
||||
#define QSPI_CLK_ENABLE() __HAL_RCC_QSPI_CLK_ENABLE()
|
||||
#define QSPI_CLK_DISABLE() __HAL_RCC_QSPI_CLK_DISABLE()
|
||||
#define QSPI_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
#define QSPI_CLK_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
|
||||
#define QSPI_D0_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
|
||||
#define QSPI_D1_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
|
||||
#define QSPI_D2_GPIO_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
|
||||
#define QSPI_D3_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE()
|
||||
|
||||
#define QSPI_FORCE_RESET() __HAL_RCC_QSPI_FORCE_RESET()
|
||||
#define QSPI_RELEASE_RESET() __HAL_RCC_QSPI_RELEASE_RESET()
|
||||
|
||||
/* Definition for QSPI Pins */
|
||||
#define QSPI_CS_PIN GPIO_PIN_6
|
||||
#define QSPI_CS_GPIO_PORT GPIOB
|
||||
#define QSPI_CLK_PIN GPIO_PIN_2
|
||||
#define QSPI_CLK_GPIO_PORT GPIOB
|
||||
#define QSPI_D0_PIN GPIO_PIN_11
|
||||
#define QSPI_D0_GPIO_PORT GPIOD
|
||||
#define QSPI_D1_PIN GPIO_PIN_12
|
||||
#define QSPI_D1_GPIO_PORT GPIOD
|
||||
#define QSPI_D2_PIN GPIO_PIN_2
|
||||
#define QSPI_D2_GPIO_PORT GPIOE
|
||||
#define QSPI_D3_PIN GPIO_PIN_13
|
||||
#define QSPI_D3_GPIO_PORT GPIOD
|
||||
|
||||
/* N25Q128A13EF840E Micron memory */
|
||||
/* Size of the flash */
|
||||
#define QSPI_FLASH_SIZE 23 /* Address bus width to access whole memory space */
|
||||
#define QSPI_PAGE_SIZE 256
|
||||
|
||||
/* This alias is added as the name of Memory mapped fucntion changed */
|
||||
#define BSP_QSPI_MemoryMappedMode BSP_QSPI_EnableMemoryMappedMode
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/** @defgroup STM32746G_DISCOVERY_QSPI_Exported_Types STM32746G_DISCOVERY_QSPI Exported Types
|
||||
* @{
|
||||
*/
|
||||
/* QSPI Info */
|
||||
typedef struct {
|
||||
uint32_t FlashSize; /*!< Size of the flash */
|
||||
uint32_t EraseSectorSize; /*!< Size of sectors for the erase operation */
|
||||
uint32_t EraseSectorsNumber; /*!< Number of sectors for the erase operation */
|
||||
uint32_t ProgPageSize; /*!< Size of pages for the program operation */
|
||||
uint32_t ProgPagesNumber; /*!< Number of pages for the program operation */
|
||||
} QSPI_Info;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/** @addtogroup STM32746G_DISCOVERY_QSPI_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
uint8_t BSP_QSPI_Init (void);
|
||||
uint8_t BSP_QSPI_DeInit (void);
|
||||
uint8_t BSP_QSPI_Read (uint8_t* pData, uint32_t ReadAddr, uint32_t Size);
|
||||
uint8_t BSP_QSPI_Write (uint8_t* pData, uint32_t WriteAddr, uint32_t Size);
|
||||
uint8_t BSP_QSPI_Erase_Block(uint32_t BlockAddress);
|
||||
uint8_t BSP_QSPI_Erase_Chip (void);
|
||||
uint8_t BSP_QSPI_GetStatus (void);
|
||||
uint8_t BSP_QSPI_GetInfo (QSPI_Info* pInfo);
|
||||
uint8_t BSP_QSPI_EnableMemoryMappedMode(void);
|
||||
|
||||
/* These functions can be modified in case the current settings
|
||||
need to be changed for specific application needs */
|
||||
void BSP_QSPI_MspInit(QSPI_HandleTypeDef *hqspi, void *Params);
|
||||
void BSP_QSPI_MspDeInit(QSPI_HandleTypeDef *hqspi, void *Params);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __STM32746G_DISCOVERY_QSPI_H */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,481 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32746g_discovery_sdram.c
|
||||
* @author MCD Application Team
|
||||
* @brief This file includes the SDRAM driver for the MT48LC4M32B2B5-7 memory
|
||||
* device mounted on STM32746G-Discovery board.
|
||||
*
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2016 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.
|
||||
*
|
||||
******************************************************************************
|
||||
@verbatim
|
||||
1. How To use this driver:
|
||||
--------------------------
|
||||
- This driver is used to drive the MT48LC4M32B2B5-7 SDRAM external memory mounted
|
||||
on STM32746G-Discovery board.
|
||||
- This driver does not need a specific component driver for the SDRAM device
|
||||
to be included with.
|
||||
|
||||
2. Driver description:
|
||||
---------------------
|
||||
+ Initialization steps:
|
||||
o Initialize the SDRAM external memory using the BSP_SDRAM_Init() function. This
|
||||
function includes the MSP layer hardware resources initialization and the
|
||||
FMC controller configuration to interface with the external SDRAM memory.
|
||||
o It contains the SDRAM initialization sequence to program the SDRAM external
|
||||
device using the function BSP_SDRAM_Initialization_sequence(). Note that this
|
||||
sequence is standard for all SDRAM devices, but can include some differences
|
||||
from a device to another. If it is the case, the right sequence should be
|
||||
implemented separately.
|
||||
|
||||
+ SDRAM read/write operations
|
||||
o SDRAM external memory can be accessed with read/write operations once it is
|
||||
initialized.
|
||||
Read/write operation can be performed with AHB access using the functions
|
||||
BSP_SDRAM_ReadData()/BSP_SDRAM_WriteData(), or by DMA transfer using the functions
|
||||
BSP_SDRAM_ReadData_DMA()/BSP_SDRAM_WriteData_DMA().
|
||||
o The AHB access is performed with 32-bit width transaction, the DMA transfer
|
||||
configuration is fixed at single (no burst) word transfer (see the
|
||||
SDRAM_MspInit() static function).
|
||||
o User can implement his own functions for read/write access with his desired
|
||||
configurations.
|
||||
o If interrupt mode is used for DMA transfer, the function BSP_SDRAM_DMA_IRQHandler()
|
||||
is called in IRQ handler file, to serve the generated interrupt once the DMA
|
||||
transfer is complete.
|
||||
o You can send a command to the SDRAM device in runtime using the function
|
||||
BSP_SDRAM_Sendcmd(), and giving the desired command as parameter chosen between
|
||||
the predefined commands of the "FMC_SDRAM_CommandTypeDef" structure.
|
||||
|
||||
@endverbatim
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Dependencies
|
||||
- stm32f7xx_hal_sdram.c
|
||||
- stm32f7xx_ll_fmc.c
|
||||
- stm32f7xx_hal_dma.c
|
||||
- stm32f7xx_hal_gpio.c
|
||||
- stm32f7xx_hal_cortex.c
|
||||
- stm32f7xx_hal_rcc_ex.h
|
||||
EndDependencies */
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32746g_discovery_sdram.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32746G_DISCOVERY
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_SDRAM STM32746G_DISCOVERY_SDRAM
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_SDRAM_Private_Types_Definitions STM32746G_DISCOVERY_SDRAM Private Types Definitions
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_SDRAM_Private_Defines STM32746G_DISCOVERY_SDRAM Private Defines
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_SDRAM_Private_Macros STM32746G_DISCOVERY_SDRAM Private Macros
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_SDRAM_Private_Variables STM32746G_DISCOVERY_SDRAM Private Variables
|
||||
* @{
|
||||
*/
|
||||
SDRAM_HandleTypeDef sdramHandle;
|
||||
static FMC_SDRAM_TimingTypeDef Timing;
|
||||
static FMC_SDRAM_CommandTypeDef Command;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_SDRAM_Private_Function_Prototypes STM32746G_DISCOVERY_SDRAM Private Function Prototypes
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_SDRAM_Exported_Functions STM32746G_DISCOVERY_SDRAM Exported Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Initializes the SDRAM device.
|
||||
* @retval SDRAM status
|
||||
*/
|
||||
uint8_t BSP_SDRAM_Init(void)
|
||||
{
|
||||
static uint8_t sdramstatus = SDRAM_ERROR;
|
||||
/* SDRAM device configuration */
|
||||
sdramHandle.Instance = FMC_SDRAM_DEVICE;
|
||||
|
||||
/* Timing configuration for 100Mhz as SD clock frequency (System clock is up to 200Mhz) */
|
||||
Timing.LoadToActiveDelay = 2;
|
||||
Timing.ExitSelfRefreshDelay = 7;
|
||||
Timing.SelfRefreshTime = 4;
|
||||
Timing.RowCycleDelay = 7;
|
||||
Timing.WriteRecoveryTime = 2;
|
||||
Timing.RPDelay = 2;
|
||||
Timing.RCDDelay = 2;
|
||||
|
||||
sdramHandle.Init.SDBank = FMC_SDRAM_BANK1;
|
||||
sdramHandle.Init.ColumnBitsNumber = FMC_SDRAM_COLUMN_BITS_NUM_8;
|
||||
sdramHandle.Init.RowBitsNumber = FMC_SDRAM_ROW_BITS_NUM_12;
|
||||
sdramHandle.Init.MemoryDataWidth = SDRAM_MEMORY_WIDTH;
|
||||
sdramHandle.Init.InternalBankNumber = FMC_SDRAM_INTERN_BANKS_NUM_4;
|
||||
sdramHandle.Init.CASLatency = FMC_SDRAM_CAS_LATENCY_2;
|
||||
sdramHandle.Init.WriteProtection = FMC_SDRAM_WRITE_PROTECTION_DISABLE;
|
||||
sdramHandle.Init.SDClockPeriod = SDCLOCK_PERIOD;
|
||||
sdramHandle.Init.ReadBurst = FMC_SDRAM_RBURST_ENABLE;
|
||||
sdramHandle.Init.ReadPipeDelay = FMC_SDRAM_RPIPE_DELAY_0;
|
||||
|
||||
/* SDRAM controller initialization */
|
||||
|
||||
BSP_SDRAM_MspInit(&sdramHandle, NULL); /* __weak function can be rewritten by the application */
|
||||
|
||||
if(HAL_SDRAM_Init(&sdramHandle, &Timing) != HAL_OK)
|
||||
{
|
||||
sdramstatus = SDRAM_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
sdramstatus = SDRAM_OK;
|
||||
}
|
||||
|
||||
/* SDRAM initialization sequence */
|
||||
BSP_SDRAM_Initialization_sequence(REFRESH_COUNT);
|
||||
|
||||
return sdramstatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DeInitializes the SDRAM device.
|
||||
* @retval SDRAM status
|
||||
*/
|
||||
uint8_t BSP_SDRAM_DeInit(void)
|
||||
{
|
||||
static uint8_t sdramstatus = SDRAM_ERROR;
|
||||
/* SDRAM device de-initialization */
|
||||
sdramHandle.Instance = FMC_SDRAM_DEVICE;
|
||||
|
||||
if(HAL_SDRAM_DeInit(&sdramHandle) != HAL_OK)
|
||||
{
|
||||
sdramstatus = SDRAM_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
sdramstatus = SDRAM_OK;
|
||||
}
|
||||
|
||||
/* SDRAM controller de-initialization */
|
||||
BSP_SDRAM_MspDeInit(&sdramHandle, NULL);
|
||||
|
||||
return sdramstatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Programs the SDRAM device.
|
||||
* @param RefreshCount: SDRAM refresh counter value
|
||||
* @retval None
|
||||
*/
|
||||
void BSP_SDRAM_Initialization_sequence(uint32_t RefreshCount)
|
||||
{
|
||||
__IO uint32_t tmpmrd = 0;
|
||||
|
||||
/* Step 1: Configure a clock configuration enable command */
|
||||
Command.CommandMode = FMC_SDRAM_CMD_CLK_ENABLE;
|
||||
Command.CommandTarget = FMC_SDRAM_CMD_TARGET_BANK1;
|
||||
Command.AutoRefreshNumber = 1;
|
||||
Command.ModeRegisterDefinition = 0;
|
||||
|
||||
/* Send the command */
|
||||
HAL_SDRAM_SendCommand(&sdramHandle, &Command, SDRAM_TIMEOUT);
|
||||
|
||||
/* Step 2: Insert 100 us minimum delay */
|
||||
/* Inserted delay is equal to 1 ms due to systick time base unit (ms) */
|
||||
HAL_Delay(1);
|
||||
|
||||
/* Step 3: Configure a PALL (precharge all) command */
|
||||
Command.CommandMode = FMC_SDRAM_CMD_PALL;
|
||||
Command.CommandTarget = FMC_SDRAM_CMD_TARGET_BANK1;
|
||||
Command.AutoRefreshNumber = 1;
|
||||
Command.ModeRegisterDefinition = 0;
|
||||
|
||||
/* Send the command */
|
||||
HAL_SDRAM_SendCommand(&sdramHandle, &Command, SDRAM_TIMEOUT);
|
||||
|
||||
/* Step 4: Configure an Auto Refresh command */
|
||||
Command.CommandMode = FMC_SDRAM_CMD_AUTOREFRESH_MODE;
|
||||
Command.CommandTarget = FMC_SDRAM_CMD_TARGET_BANK1;
|
||||
Command.AutoRefreshNumber = 8;
|
||||
Command.ModeRegisterDefinition = 0;
|
||||
|
||||
/* Send the command */
|
||||
HAL_SDRAM_SendCommand(&sdramHandle, &Command, SDRAM_TIMEOUT);
|
||||
|
||||
/* Step 5: Program the external memory mode register */
|
||||
tmpmrd = (uint32_t)SDRAM_MODEREG_BURST_LENGTH_1 |\
|
||||
SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL |\
|
||||
SDRAM_MODEREG_CAS_LATENCY_2 |\
|
||||
SDRAM_MODEREG_OPERATING_MODE_STANDARD |\
|
||||
SDRAM_MODEREG_WRITEBURST_MODE_SINGLE;
|
||||
|
||||
Command.CommandMode = FMC_SDRAM_CMD_LOAD_MODE;
|
||||
Command.CommandTarget = FMC_SDRAM_CMD_TARGET_BANK1;
|
||||
Command.AutoRefreshNumber = 1;
|
||||
Command.ModeRegisterDefinition = tmpmrd;
|
||||
|
||||
/* Send the command */
|
||||
HAL_SDRAM_SendCommand(&sdramHandle, &Command, SDRAM_TIMEOUT);
|
||||
|
||||
/* Step 6: Set the refresh rate counter */
|
||||
/* Set the device refresh rate */
|
||||
HAL_SDRAM_ProgramRefreshRate(&sdramHandle, RefreshCount);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Reads an amount of data from the SDRAM memory in polling mode.
|
||||
* @param uwStartAddress: Read start address
|
||||
* @param pData: Pointer to data to be read
|
||||
* @param uwDataSize: Size of read data from the memory
|
||||
* @retval SDRAM status
|
||||
*/
|
||||
uint8_t BSP_SDRAM_ReadData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
|
||||
{
|
||||
if(HAL_SDRAM_Read_32b(&sdramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK)
|
||||
{
|
||||
return SDRAM_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
return SDRAM_OK;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Reads an amount of data from the SDRAM memory in DMA mode.
|
||||
* @param uwStartAddress: Read start address
|
||||
* @param pData: Pointer to data to be read
|
||||
* @param uwDataSize: Size of read data from the memory
|
||||
* @retval SDRAM status
|
||||
*/
|
||||
uint8_t BSP_SDRAM_ReadData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
|
||||
{
|
||||
if(HAL_SDRAM_Read_DMA(&sdramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK)
|
||||
{
|
||||
return SDRAM_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
return SDRAM_OK;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Writes an amount of data to the SDRAM memory in polling mode.
|
||||
* @param uwStartAddress: Write start address
|
||||
* @param pData: Pointer to data to be written
|
||||
* @param uwDataSize: Size of written data from the memory
|
||||
* @retval SDRAM status
|
||||
*/
|
||||
uint8_t BSP_SDRAM_WriteData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
|
||||
{
|
||||
if(HAL_SDRAM_Write_32b(&sdramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK)
|
||||
{
|
||||
return SDRAM_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
return SDRAM_OK;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Writes an amount of data to the SDRAM memory in DMA mode.
|
||||
* @param uwStartAddress: Write start address
|
||||
* @param pData: Pointer to data to be written
|
||||
* @param uwDataSize: Size of written data from the memory
|
||||
* @retval SDRAM status
|
||||
*/
|
||||
uint8_t BSP_SDRAM_WriteData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize)
|
||||
{
|
||||
if(HAL_SDRAM_Write_DMA(&sdramHandle, (uint32_t *)uwStartAddress, pData, uwDataSize) != HAL_OK)
|
||||
{
|
||||
return SDRAM_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
return SDRAM_OK;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Sends command to the SDRAM bank.
|
||||
* @param SdramCmd: Pointer to SDRAM command structure
|
||||
* @retval SDRAM status
|
||||
*/
|
||||
uint8_t BSP_SDRAM_Sendcmd(FMC_SDRAM_CommandTypeDef *SdramCmd)
|
||||
{
|
||||
if(HAL_SDRAM_SendCommand(&sdramHandle, SdramCmd, SDRAM_TIMEOUT) != HAL_OK)
|
||||
{
|
||||
return SDRAM_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
return SDRAM_OK;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Initializes SDRAM MSP.
|
||||
* @param hsdram: SDRAM handle
|
||||
* @param Params
|
||||
* @retval None
|
||||
*/
|
||||
__weak void BSP_SDRAM_MspInit(SDRAM_HandleTypeDef *hsdram, void *Params)
|
||||
{
|
||||
static DMA_HandleTypeDef dma_handle;
|
||||
GPIO_InitTypeDef gpio_init_structure;
|
||||
|
||||
/* Enable FMC clock */
|
||||
__HAL_RCC_FMC_CLK_ENABLE();
|
||||
|
||||
/* Enable chosen DMAx clock */
|
||||
__DMAx_CLK_ENABLE();
|
||||
|
||||
/* Enable GPIOs clock */
|
||||
__HAL_RCC_GPIOC_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOD_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOE_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOF_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOG_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOH_CLK_ENABLE();
|
||||
|
||||
/* Common GPIO configuration */
|
||||
gpio_init_structure.Mode = GPIO_MODE_AF_PP;
|
||||
gpio_init_structure.Pull = GPIO_PULLUP;
|
||||
gpio_init_structure.Speed = GPIO_SPEED_FAST;
|
||||
gpio_init_structure.Alternate = GPIO_AF12_FMC;
|
||||
|
||||
/* GPIOC configuration */
|
||||
gpio_init_structure.Pin = GPIO_PIN_3;
|
||||
HAL_GPIO_Init(GPIOC, &gpio_init_structure);
|
||||
|
||||
/* GPIOD configuration */
|
||||
gpio_init_structure.Pin = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_8 | GPIO_PIN_9 |
|
||||
GPIO_PIN_10 | GPIO_PIN_14 | GPIO_PIN_15;
|
||||
HAL_GPIO_Init(GPIOD, &gpio_init_structure);
|
||||
|
||||
/* GPIOE configuration */
|
||||
gpio_init_structure.Pin = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_7| GPIO_PIN_8 | GPIO_PIN_9 |\
|
||||
GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14 |\
|
||||
GPIO_PIN_15;
|
||||
HAL_GPIO_Init(GPIOE, &gpio_init_structure);
|
||||
|
||||
/* GPIOF configuration */
|
||||
gpio_init_structure.Pin = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2| GPIO_PIN_3 | GPIO_PIN_4 |\
|
||||
GPIO_PIN_5 | GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14 |\
|
||||
GPIO_PIN_15;
|
||||
HAL_GPIO_Init(GPIOF, &gpio_init_structure);
|
||||
|
||||
/* GPIOG configuration */
|
||||
gpio_init_structure.Pin = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_4| GPIO_PIN_5 | GPIO_PIN_8 |\
|
||||
GPIO_PIN_15;
|
||||
HAL_GPIO_Init(GPIOG, &gpio_init_structure);
|
||||
|
||||
/* GPIOH configuration */
|
||||
gpio_init_structure.Pin = GPIO_PIN_3 | GPIO_PIN_5;
|
||||
HAL_GPIO_Init(GPIOH, &gpio_init_structure);
|
||||
|
||||
/* Configure common DMA parameters */
|
||||
dma_handle.Init.Channel = SDRAM_DMAx_CHANNEL;
|
||||
dma_handle.Init.Direction = DMA_MEMORY_TO_MEMORY;
|
||||
dma_handle.Init.PeriphInc = DMA_PINC_ENABLE;
|
||||
dma_handle.Init.MemInc = DMA_MINC_ENABLE;
|
||||
dma_handle.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
|
||||
dma_handle.Init.MemDataAlignment = DMA_MDATAALIGN_WORD;
|
||||
dma_handle.Init.Mode = DMA_NORMAL;
|
||||
dma_handle.Init.Priority = DMA_PRIORITY_HIGH;
|
||||
dma_handle.Init.FIFOMode = DMA_FIFOMODE_DISABLE;
|
||||
dma_handle.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL;
|
||||
dma_handle.Init.MemBurst = DMA_MBURST_SINGLE;
|
||||
dma_handle.Init.PeriphBurst = DMA_PBURST_SINGLE;
|
||||
|
||||
dma_handle.Instance = SDRAM_DMAx_STREAM;
|
||||
|
||||
/* Associate the DMA handle */
|
||||
__HAL_LINKDMA(hsdram, hdma, dma_handle);
|
||||
|
||||
/* Deinitialize the stream for new transfer */
|
||||
HAL_DMA_DeInit(&dma_handle);
|
||||
|
||||
/* Configure the DMA stream */
|
||||
HAL_DMA_Init(&dma_handle);
|
||||
|
||||
/* NVIC configuration for DMA transfer complete interrupt */
|
||||
HAL_NVIC_SetPriority(SDRAM_DMAx_IRQn, 0x0F, 0);
|
||||
HAL_NVIC_EnableIRQ(SDRAM_DMAx_IRQn);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DeInitializes SDRAM MSP.
|
||||
* @param hsdram: SDRAM handle
|
||||
* @param Params
|
||||
* @retval None
|
||||
*/
|
||||
__weak void BSP_SDRAM_MspDeInit(SDRAM_HandleTypeDef *hsdram, void *Params)
|
||||
{
|
||||
static DMA_HandleTypeDef dma_handle;
|
||||
|
||||
/* Disable NVIC configuration for DMA interrupt */
|
||||
HAL_NVIC_DisableIRQ(SDRAM_DMAx_IRQn);
|
||||
|
||||
/* Deinitialize the stream for new transfer */
|
||||
dma_handle.Instance = SDRAM_DMAx_STREAM;
|
||||
HAL_DMA_DeInit(&dma_handle);
|
||||
|
||||
/* GPIO pins clock, FMC clock and DMA clock can be shut down in the applications
|
||||
by surcharging this __weak function */
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,144 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32746g_discovery_sdram.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains the common defines and functions prototypes for
|
||||
* the stm32746g_discovery_sdram.c driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2016 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 __STM32746G_DISCOVERY_SDRAM_H
|
||||
#define __STM32746G_DISCOVERY_SDRAM_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32f7xx_hal.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32746G_DISCOVERY
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32746G_DISCOVERY_SDRAM
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_SDRAM_Exported_Types STM32746G_DISCOVERY_SDRAM Exported Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief SDRAM status structure definition
|
||||
*/
|
||||
#define SDRAM_OK ((uint8_t)0x00)
|
||||
#define SDRAM_ERROR ((uint8_t)0x01)
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_SDRAM_Exported_Constants STM32746G_DISCOVERY_SDRAM Exported Constants
|
||||
* @{
|
||||
*/
|
||||
#define SDRAM_DEVICE_ADDR ((uint32_t)0xC0000000)
|
||||
#define SDRAM_DEVICE_SIZE ((uint32_t)0x800000) /* SDRAM device size in MBytes */
|
||||
|
||||
/* #define SDRAM_MEMORY_WIDTH FMC_SDRAM_MEM_BUS_WIDTH_8 */
|
||||
#define SDRAM_MEMORY_WIDTH FMC_SDRAM_MEM_BUS_WIDTH_16
|
||||
|
||||
#define SDCLOCK_PERIOD FMC_SDRAM_CLOCK_PERIOD_2
|
||||
/* #define SDCLOCK_PERIOD FMC_SDRAM_CLOCK_PERIOD_3 */
|
||||
|
||||
#define REFRESH_COUNT ((uint32_t)0x0603) /* SDRAM refresh counter (100Mhz SD clock) */
|
||||
|
||||
#define SDRAM_TIMEOUT ((uint32_t)0xFFFF)
|
||||
|
||||
/* DMA definitions for SDRAM DMA transfer */
|
||||
#define __DMAx_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE
|
||||
#define __DMAx_CLK_DISABLE __HAL_RCC_DMA2_CLK_DISABLE
|
||||
#define SDRAM_DMAx_CHANNEL DMA_CHANNEL_0
|
||||
#define SDRAM_DMAx_STREAM DMA2_Stream0
|
||||
#define SDRAM_DMAx_IRQn DMA2_Stream0_IRQn
|
||||
#define BSP_SDRAM_DMA_IRQHandler DMA2_Stream0_IRQHandler
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief FMC SDRAM Mode definition register defines
|
||||
*/
|
||||
#define SDRAM_MODEREG_BURST_LENGTH_1 ((uint16_t)0x0000)
|
||||
#define SDRAM_MODEREG_BURST_LENGTH_2 ((uint16_t)0x0001)
|
||||
#define SDRAM_MODEREG_BURST_LENGTH_4 ((uint16_t)0x0002)
|
||||
#define SDRAM_MODEREG_BURST_LENGTH_8 ((uint16_t)0x0004)
|
||||
#define SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL ((uint16_t)0x0000)
|
||||
#define SDRAM_MODEREG_BURST_TYPE_INTERLEAVED ((uint16_t)0x0008)
|
||||
#define SDRAM_MODEREG_CAS_LATENCY_2 ((uint16_t)0x0020)
|
||||
#define SDRAM_MODEREG_CAS_LATENCY_3 ((uint16_t)0x0030)
|
||||
#define SDRAM_MODEREG_OPERATING_MODE_STANDARD ((uint16_t)0x0000)
|
||||
#define SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED ((uint16_t)0x0000)
|
||||
#define SDRAM_MODEREG_WRITEBURST_MODE_SINGLE ((uint16_t)0x0200)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_SDRAM_Exported_Macro STM32746G_DISCOVERY_SDRAM Exported Macro
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32746G_DISCOVERY_SDRAM_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
uint8_t BSP_SDRAM_Init(void);
|
||||
uint8_t BSP_SDRAM_DeInit(void);
|
||||
void BSP_SDRAM_Initialization_sequence(uint32_t RefreshCount);
|
||||
uint8_t BSP_SDRAM_ReadData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize);
|
||||
uint8_t BSP_SDRAM_ReadData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize);
|
||||
uint8_t BSP_SDRAM_WriteData(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize);
|
||||
uint8_t BSP_SDRAM_WriteData_DMA(uint32_t uwStartAddress, uint32_t *pData, uint32_t uwDataSize);
|
||||
uint8_t BSP_SDRAM_Sendcmd(FMC_SDRAM_CommandTypeDef *SdramCmd);
|
||||
|
||||
/* These functions can be modified in case the current settings (e.g. DMA stream)
|
||||
need to be changed for specific application needs */
|
||||
void BSP_SDRAM_MspInit(SDRAM_HandleTypeDef *hsdram, void *Params);
|
||||
void BSP_SDRAM_MspDeInit(SDRAM_HandleTypeDef *hsdram, void *Params);
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __STM32746G_DISCOVERY_SDRAM_H */
|
||||
|
||||
434
project/Drivers/BSP/STM32746G-Discovery/stm32746g_discovery_ts.c
Normal file
434
project/Drivers/BSP/STM32746G-Discovery/stm32746g_discovery_ts.c
Normal file
@@ -0,0 +1,434 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32746g_discovery_ts.c
|
||||
* @author MCD Application Team
|
||||
* @brief This file provides a set of functions needed to manage the Touch
|
||||
* Screen on STM32746G-Discovery board.
|
||||
*
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2016 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.
|
||||
*
|
||||
******************************************************************************
|
||||
@verbatim
|
||||
1. How To use this driver:
|
||||
--------------------------
|
||||
- This driver is used to drive the touch screen module of the STM32746G-Discovery
|
||||
board on the RK043FN48H-CT672B 480x272 LCD screen with capacitive touch screen.
|
||||
- The FT5336 component driver must be included in project files according to
|
||||
the touch screen driver present on this board.
|
||||
|
||||
2. Driver description:
|
||||
---------------------
|
||||
+ Initialization steps:
|
||||
o Initialize the TS module using the BSP_TS_Init() function. This
|
||||
function includes the MSP layer hardware resources initialization and the
|
||||
communication layer configuration to start the TS use. The LCD size properties
|
||||
(x and y) are passed as parameters.
|
||||
o If TS interrupt mode is desired, you must configure the TS interrupt mode
|
||||
by calling the function BSP_TS_ITConfig(). The TS interrupt mode is generated
|
||||
as an external interrupt whenever a touch is detected.
|
||||
The interrupt mode internally uses the IO functionalities driver driven by
|
||||
the IO expander, to configure the IT line.
|
||||
|
||||
+ Touch screen use
|
||||
o The touch screen state is captured whenever the function BSP_TS_GetState() is
|
||||
used. This function returns information about the last LCD touch occurred
|
||||
in the TS_StateTypeDef structure.
|
||||
o If TS interrupt mode is used, the function BSP_TS_ITGetStatus() is needed to get
|
||||
the interrupt status. To clear the IT pending bits, you should call the
|
||||
function BSP_TS_ITClear().
|
||||
o The IT is handled using the corresponding external interrupt IRQ handler,
|
||||
the user IT callback treatment is implemented on the same external interrupt
|
||||
callback.
|
||||
@endverbatim
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Dependencies
|
||||
- stm32746g_discovery_lcd.c
|
||||
- ft5336.c
|
||||
EndDependencies */
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32746g_discovery_ts.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32746G_DISCOVERY
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_TS STM32746G_DISCOVERY_TS
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_TS_Private_Types_Definitions STM32746G_DISCOVERY_TS Types Definitions
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_TS_Private_Defines STM32746G_DISCOVERY_TS Types Defines
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_TS_Private_Macros STM32746G_DISCOVERY_TS Private Macros
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_TS_Imported_Variables STM32746G_DISCOVERY_TS Imported Variables
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_TS_Private_Variables STM32746G_DISCOVERY_TS Private Variables
|
||||
* @{
|
||||
*/
|
||||
static TS_DrvTypeDef *tsDriver;
|
||||
static uint16_t tsXBoundary, tsYBoundary;
|
||||
static uint8_t tsOrientation;
|
||||
static uint8_t I2cAddress;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_TS_Private_Function_Prototypes STM32746G_DISCOVERY_TS Private Function Prototypes
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_TS_Exported_Functions STM32746G_DISCOVERY_TS Exported Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Initializes and configures the touch screen functionalities and
|
||||
* configures all necessary hardware resources (GPIOs, I2C, clocks..).
|
||||
* @param ts_SizeX: Maximum X size of the TS area on LCD
|
||||
* @param ts_SizeY: Maximum Y size of the TS area on LCD
|
||||
* @retval TS_OK if all initializations are OK. Other value if error.
|
||||
*/
|
||||
uint8_t BSP_TS_Init(uint16_t ts_SizeX, uint16_t ts_SizeY)
|
||||
{
|
||||
uint8_t status = TS_OK;
|
||||
tsXBoundary = ts_SizeX;
|
||||
tsYBoundary = ts_SizeY;
|
||||
|
||||
/* Read ID and verify if the touch screen driver is ready */
|
||||
ft5336_ts_drv.Init(TS_I2C_ADDRESS);
|
||||
if(ft5336_ts_drv.ReadID(TS_I2C_ADDRESS) == FT5336_ID_VALUE)
|
||||
{
|
||||
/* Initialize the TS driver structure */
|
||||
tsDriver = &ft5336_ts_drv;
|
||||
I2cAddress = TS_I2C_ADDRESS;
|
||||
tsOrientation = TS_SWAP_XY;
|
||||
|
||||
/* Initialize the TS driver */
|
||||
tsDriver->Start(I2cAddress);
|
||||
}
|
||||
else
|
||||
{
|
||||
status = TS_DEVICE_NOT_FOUND;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DeInitializes the TouchScreen.
|
||||
* @retval TS state
|
||||
*/
|
||||
uint8_t BSP_TS_DeInit(void)
|
||||
{
|
||||
/* Actually ts_driver does not provide a DeInit function */
|
||||
return TS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configures and enables the touch screen interrupts.
|
||||
* @retval TS_OK if all initializations are OK. Other value if error.
|
||||
*/
|
||||
uint8_t BSP_TS_ITConfig(void)
|
||||
{
|
||||
GPIO_InitTypeDef gpio_init_structure;
|
||||
|
||||
/* Configure Interrupt mode for SD detection pin */
|
||||
gpio_init_structure.Pin = TS_INT_PIN;
|
||||
gpio_init_structure.Pull = GPIO_NOPULL;
|
||||
gpio_init_structure.Speed = GPIO_SPEED_FAST;
|
||||
gpio_init_structure.Mode = GPIO_MODE_IT_RISING;
|
||||
HAL_GPIO_Init(TS_INT_GPIO_PORT, &gpio_init_structure);
|
||||
|
||||
/* Enable and set Touch screen EXTI Interrupt to the lowest priority */
|
||||
HAL_NVIC_SetPriority((IRQn_Type)(TS_INT_EXTI_IRQn), 0x0F, 0x00);
|
||||
HAL_NVIC_EnableIRQ((IRQn_Type)(TS_INT_EXTI_IRQn));
|
||||
|
||||
/* Enable the TS ITs */
|
||||
tsDriver->EnableIT(I2cAddress);
|
||||
|
||||
return TS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Gets the touch screen interrupt status.
|
||||
* @retval TS_OK if all initializations are OK. Other value if error.
|
||||
*/
|
||||
uint8_t BSP_TS_ITGetStatus(void)
|
||||
{
|
||||
/* Return the TS IT status */
|
||||
return (tsDriver->GetITStatus(I2cAddress));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns status and positions of the touch screen.
|
||||
* @param TS_State: Pointer to touch screen current state structure
|
||||
* @retval TS_OK if all initializations are OK. Other value if error.
|
||||
*/
|
||||
uint8_t BSP_TS_GetState(TS_StateTypeDef *TS_State)
|
||||
{
|
||||
static uint32_t _x[TS_MAX_NB_TOUCH] = {0, 0};
|
||||
static uint32_t _y[TS_MAX_NB_TOUCH] = {0, 0};
|
||||
uint8_t ts_status = TS_OK;
|
||||
uint16_t x[TS_MAX_NB_TOUCH];
|
||||
uint16_t y[TS_MAX_NB_TOUCH];
|
||||
uint16_t brute_x[TS_MAX_NB_TOUCH];
|
||||
uint16_t brute_y[TS_MAX_NB_TOUCH];
|
||||
uint16_t x_diff;
|
||||
uint16_t y_diff;
|
||||
uint32_t index;
|
||||
#if (TS_MULTI_TOUCH_SUPPORTED == 1)
|
||||
uint32_t weight = 0;
|
||||
uint32_t area = 0;
|
||||
uint32_t event = 0;
|
||||
#endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
|
||||
|
||||
/* Check and update the number of touches active detected */
|
||||
TS_State->touchDetected = tsDriver->DetectTouch(I2cAddress);
|
||||
|
||||
if(TS_State->touchDetected)
|
||||
{
|
||||
for(index=0; index < TS_State->touchDetected; index++)
|
||||
{
|
||||
/* Get each touch coordinates */
|
||||
tsDriver->GetXY(I2cAddress, &(brute_x[index]), &(brute_y[index]));
|
||||
|
||||
if(tsOrientation == TS_SWAP_NONE)
|
||||
{
|
||||
x[index] = brute_x[index];
|
||||
y[index] = brute_y[index];
|
||||
}
|
||||
|
||||
if(tsOrientation & TS_SWAP_X)
|
||||
{
|
||||
x[index] = 4096 - brute_x[index];
|
||||
}
|
||||
|
||||
if(tsOrientation & TS_SWAP_Y)
|
||||
{
|
||||
y[index] = 4096 - brute_y[index];
|
||||
}
|
||||
|
||||
if(tsOrientation & TS_SWAP_XY)
|
||||
{
|
||||
y[index] = brute_x[index];
|
||||
x[index] = brute_y[index];
|
||||
}
|
||||
|
||||
x_diff = x[index] > _x[index]? (x[index] - _x[index]): (_x[index] - x[index]);
|
||||
y_diff = y[index] > _y[index]? (y[index] - _y[index]): (_y[index] - y[index]);
|
||||
|
||||
if ((x_diff + y_diff) > 5)
|
||||
{
|
||||
_x[index] = x[index];
|
||||
_y[index] = y[index];
|
||||
}
|
||||
|
||||
if(I2cAddress == FT5336_I2C_SLAVE_ADDRESS)
|
||||
{
|
||||
TS_State->touchX[index] = x[index];
|
||||
TS_State->touchY[index] = y[index];
|
||||
}
|
||||
else
|
||||
{
|
||||
/* 2^12 = 4096 : indexes are expressed on a dynamic of 4096 */
|
||||
TS_State->touchX[index] = (tsXBoundary * _x[index]) >> 12;
|
||||
TS_State->touchY[index] = (tsYBoundary * _y[index]) >> 12;
|
||||
}
|
||||
|
||||
#if (TS_MULTI_TOUCH_SUPPORTED == 1)
|
||||
|
||||
/* Get touch info related to the current touch */
|
||||
ft5336_TS_GetTouchInfo(I2cAddress, index, &weight, &area, &event);
|
||||
|
||||
/* Update TS_State structure */
|
||||
TS_State->touchWeight[index] = weight;
|
||||
TS_State->touchArea[index] = area;
|
||||
|
||||
/* Remap touch event */
|
||||
switch(event)
|
||||
{
|
||||
case FT5336_TOUCH_EVT_FLAG_PRESS_DOWN :
|
||||
TS_State->touchEventId[index] = TOUCH_EVENT_PRESS_DOWN;
|
||||
break;
|
||||
case FT5336_TOUCH_EVT_FLAG_LIFT_UP :
|
||||
TS_State->touchEventId[index] = TOUCH_EVENT_LIFT_UP;
|
||||
break;
|
||||
case FT5336_TOUCH_EVT_FLAG_CONTACT :
|
||||
TS_State->touchEventId[index] = TOUCH_EVENT_CONTACT;
|
||||
break;
|
||||
case FT5336_TOUCH_EVT_FLAG_NO_EVENT :
|
||||
TS_State->touchEventId[index] = TOUCH_EVENT_NO_EVT;
|
||||
break;
|
||||
default :
|
||||
ts_status = TS_ERROR;
|
||||
break;
|
||||
} /* of switch(event) */
|
||||
|
||||
#endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
|
||||
|
||||
} /* of for(index=0; index < TS_State->touchDetected; index++) */
|
||||
|
||||
#if (TS_MULTI_TOUCH_SUPPORTED == 1)
|
||||
/* Get gesture Id */
|
||||
ts_status = BSP_TS_Get_GestureId(TS_State);
|
||||
#endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
|
||||
|
||||
} /* end of if(TS_State->touchDetected != 0) */
|
||||
|
||||
return (ts_status);
|
||||
}
|
||||
|
||||
#if (TS_MULTI_TOUCH_SUPPORTED == 1)
|
||||
/**
|
||||
* @brief Update gesture Id following a touch detected.
|
||||
* @param TS_State: Pointer to touch screen current state structure
|
||||
* @retval TS_OK if all initializations are OK. Other value if error.
|
||||
*/
|
||||
uint8_t BSP_TS_Get_GestureId(TS_StateTypeDef *TS_State)
|
||||
{
|
||||
uint32_t gestureId = 0;
|
||||
uint8_t ts_status = TS_OK;
|
||||
|
||||
/* Get gesture Id */
|
||||
ft5336_TS_GetGestureID(I2cAddress, &gestureId);
|
||||
|
||||
/* Remap gesture Id to a TS_GestureIdTypeDef value */
|
||||
switch(gestureId)
|
||||
{
|
||||
case FT5336_GEST_ID_NO_GESTURE :
|
||||
TS_State->gestureId = GEST_ID_NO_GESTURE;
|
||||
break;
|
||||
case FT5336_GEST_ID_MOVE_UP :
|
||||
TS_State->gestureId = GEST_ID_MOVE_UP;
|
||||
break;
|
||||
case FT5336_GEST_ID_MOVE_RIGHT :
|
||||
TS_State->gestureId = GEST_ID_MOVE_RIGHT;
|
||||
break;
|
||||
case FT5336_GEST_ID_MOVE_DOWN :
|
||||
TS_State->gestureId = GEST_ID_MOVE_DOWN;
|
||||
break;
|
||||
case FT5336_GEST_ID_MOVE_LEFT :
|
||||
TS_State->gestureId = GEST_ID_MOVE_LEFT;
|
||||
break;
|
||||
case FT5336_GEST_ID_ZOOM_IN :
|
||||
TS_State->gestureId = GEST_ID_ZOOM_IN;
|
||||
break;
|
||||
case FT5336_GEST_ID_ZOOM_OUT :
|
||||
TS_State->gestureId = GEST_ID_ZOOM_OUT;
|
||||
break;
|
||||
default :
|
||||
ts_status = TS_ERROR;
|
||||
break;
|
||||
} /* of switch(gestureId) */
|
||||
|
||||
return(ts_status);
|
||||
}
|
||||
#endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
|
||||
|
||||
/**
|
||||
* @brief Clears all touch screen interrupts.
|
||||
*/
|
||||
void BSP_TS_ITClear(void)
|
||||
{
|
||||
/* Clear TS IT pending bits */
|
||||
tsDriver->ClearIT(I2cAddress);
|
||||
}
|
||||
|
||||
|
||||
/** @defgroup STM32756G_DISCOVERY_TS_Private_Functions TS Private Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @brief Function used to reset all touch data before a new acquisition
|
||||
* of touch information.
|
||||
* @param TS_State: Pointer to touch screen current state structure
|
||||
* @retval TS_OK if OK, TE_ERROR if problem found.
|
||||
*/
|
||||
uint8_t BSP_TS_ResetTouchData(TS_StateTypeDef *TS_State)
|
||||
{
|
||||
uint8_t ts_status = TS_ERROR;
|
||||
uint32_t index;
|
||||
|
||||
if (TS_State != (TS_StateTypeDef *)NULL)
|
||||
{
|
||||
TS_State->gestureId = GEST_ID_NO_GESTURE;
|
||||
TS_State->touchDetected = 0;
|
||||
|
||||
for(index = 0; index < TS_MAX_NB_TOUCH; index++)
|
||||
{
|
||||
TS_State->touchX[index] = 0;
|
||||
TS_State->touchY[index] = 0;
|
||||
TS_State->touchArea[index] = 0;
|
||||
TS_State->touchEventId[index] = TOUCH_EVENT_NO_EVT;
|
||||
TS_State->touchWeight[index] = 0;
|
||||
}
|
||||
|
||||
ts_status = TS_OK;
|
||||
|
||||
} /* of if (TS_State != (TS_StateTypeDef *)NULL) */
|
||||
|
||||
return (ts_status);
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
194
project/Drivers/BSP/STM32746G-Discovery/stm32746g_discovery_ts.h
Normal file
194
project/Drivers/BSP/STM32746G-Discovery/stm32746g_discovery_ts.h
Normal file
@@ -0,0 +1,194 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32746g_discovery_ts.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains the common defines and functions prototypes for
|
||||
* the stm32746g_discovery_ts.c driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2016 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 __STM32746G_DISCOVERY_TS_H
|
||||
#define __STM32746G_DISCOVERY_TS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32746g_discovery.h"
|
||||
/* Include touch screen FT5336 component Driver */
|
||||
#include "../Components/ft5336/ft5336.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32746G_DISCOVERY
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32746G_DISCOVERY_TS
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_TS_Exported_Constants STM32746G_DISCOVERY_TS Exported Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @brief With FT5336 : maximum 5 touches detected simultaneously
|
||||
*/
|
||||
#define TS_MAX_NB_TOUCH ((uint32_t) FT5336_MAX_DETECTABLE_TOUCH)
|
||||
|
||||
#define TS_NO_IRQ_PENDING ((uint8_t) 0)
|
||||
#define TS_IRQ_PENDING ((uint8_t) 1)
|
||||
|
||||
#define TS_SWAP_NONE ((uint8_t) 0x01)
|
||||
#define TS_SWAP_X ((uint8_t) 0x02)
|
||||
#define TS_SWAP_Y ((uint8_t) 0x04)
|
||||
#define TS_SWAP_XY ((uint8_t) 0x08)
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_TS_Exported_Types STM32746G_DISCOVERY_TS Exported Types
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @brief TS_StateTypeDef
|
||||
* Define TS State structure
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint8_t touchDetected; /*!< Total number of active touches detected at last scan */
|
||||
uint16_t touchX[TS_MAX_NB_TOUCH]; /*!< Touch X[0], X[1] coordinates on 12 bits */
|
||||
uint16_t touchY[TS_MAX_NB_TOUCH]; /*!< Touch Y[0], Y[1] coordinates on 12 bits */
|
||||
|
||||
#if (TS_MULTI_TOUCH_SUPPORTED == 1)
|
||||
uint8_t touchWeight[TS_MAX_NB_TOUCH]; /*!< Touch_Weight[0], Touch_Weight[1] : weight property of touches */
|
||||
uint8_t touchEventId[TS_MAX_NB_TOUCH]; /*!< Touch_EventId[0], Touch_EventId[1] : take value of type @ref TS_TouchEventTypeDef */
|
||||
uint8_t touchArea[TS_MAX_NB_TOUCH]; /*!< Touch_Area[0], Touch_Area[1] : touch area of each touch */
|
||||
uint32_t gestureId; /*!< type of gesture detected : take value of type @ref TS_GestureIdTypeDef */
|
||||
#endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
|
||||
|
||||
} TS_StateTypeDef;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_TS_Exported_Constants STM32746G_DISCOVERY_TS Exported Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
typedef enum
|
||||
{
|
||||
TS_OK = 0x00, /*!< Touch Ok */
|
||||
TS_ERROR = 0x01, /*!< Touch Error */
|
||||
TS_TIMEOUT = 0x02, /*!< Touch Timeout */
|
||||
TS_DEVICE_NOT_FOUND = 0x03 /*!< Touchscreen device not found */
|
||||
}TS_StatusTypeDef;
|
||||
|
||||
/**
|
||||
* @brief TS_GestureIdTypeDef
|
||||
* Define Possible managed gesture identification values returned by touch screen
|
||||
* driver.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GEST_ID_NO_GESTURE = 0x00, /*!< Gesture not defined / recognized */
|
||||
GEST_ID_MOVE_UP = 0x01, /*!< Gesture Move Up */
|
||||
GEST_ID_MOVE_RIGHT = 0x02, /*!< Gesture Move Right */
|
||||
GEST_ID_MOVE_DOWN = 0x03, /*!< Gesture Move Down */
|
||||
GEST_ID_MOVE_LEFT = 0x04, /*!< Gesture Move Left */
|
||||
GEST_ID_ZOOM_IN = 0x05, /*!< Gesture Zoom In */
|
||||
GEST_ID_ZOOM_OUT = 0x06, /*!< Gesture Zoom Out */
|
||||
GEST_ID_NB_MAX = 0x07 /*!< max number of gesture id */
|
||||
|
||||
} TS_GestureIdTypeDef;
|
||||
|
||||
/**
|
||||
* @brief TS_TouchEventTypeDef
|
||||
* Define Possible touch events kind as returned values
|
||||
* by touch screen IC Driver.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
TOUCH_EVENT_NO_EVT = 0x00, /*!< Touch Event : undetermined */
|
||||
TOUCH_EVENT_PRESS_DOWN = 0x01, /*!< Touch Event Press Down */
|
||||
TOUCH_EVENT_LIFT_UP = 0x02, /*!< Touch Event Lift Up */
|
||||
TOUCH_EVENT_CONTACT = 0x03, /*!< Touch Event Contact */
|
||||
TOUCH_EVENT_NB_MAX = 0x04 /*!< max number of touch events kind */
|
||||
|
||||
} TS_TouchEventTypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM32746G_DISCOVERY_TS_Imported_Variables STM32746G_DISCOVERY_TS Imported Variables
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @brief Table for touchscreen event information display on LCD :
|
||||
* table indexed on enum @ref TS_TouchEventTypeDef information
|
||||
*/
|
||||
extern char * ts_event_string_tab[TOUCH_EVENT_NB_MAX];
|
||||
|
||||
/**
|
||||
* @brief Table for touchscreen gesture Id information display on LCD : table indexed
|
||||
* on enum @ref TS_GestureIdTypeDef information
|
||||
*/
|
||||
extern char * ts_gesture_id_string_tab[GEST_ID_NB_MAX];
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32746G_DISCOVERY_TS_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
uint8_t BSP_TS_Init(uint16_t ts_SizeX, uint16_t ts_SizeY);
|
||||
uint8_t BSP_TS_DeInit(void);
|
||||
uint8_t BSP_TS_GetState(TS_StateTypeDef *TS_State);
|
||||
|
||||
#if (TS_MULTI_TOUCH_SUPPORTED == 1)
|
||||
uint8_t BSP_TS_Get_GestureId(TS_StateTypeDef *TS_State);
|
||||
#endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */
|
||||
|
||||
uint8_t BSP_TS_ITConfig(void);
|
||||
uint8_t BSP_TS_ITGetStatus(void);
|
||||
void BSP_TS_ITClear(void);
|
||||
uint8_t BSP_TS_ResetTouchData(TS_StateTypeDef *TS_State);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __STM32746G_DISCOVERY_TS_H */
|
||||
|
||||
750
project/Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_qspi.h
Normal file
750
project/Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal_qspi.h
Normal file
@@ -0,0 +1,750 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32f7xx_hal_qspi.h
|
||||
* @author MCD Application Team
|
||||
* @brief Header file of QSPI HAL module.
|
||||
******************************************************************************
|
||||
* @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 STM32F7xx_HAL_QSPI_H
|
||||
#define STM32F7xx_HAL_QSPI_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32f7xx_hal_def.h"
|
||||
|
||||
#if defined(QUADSPI)
|
||||
|
||||
/** @addtogroup STM32F7xx_HAL_Driver
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup QSPI
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/** @defgroup QSPI_Exported_Types QSPI Exported Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief QSPI Init structure definition
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t ClockPrescaler; /* Specifies the prescaler factor for generating clock based on the AHB clock.
|
||||
This parameter can be a number between 0 and 255 */
|
||||
uint32_t FifoThreshold; /* Specifies the threshold number of bytes in the FIFO (used only in indirect mode)
|
||||
This parameter can be a value between 1 and 32 */
|
||||
uint32_t SampleShifting; /* Specifies the Sample Shift. The data is sampled 1/2 clock cycle delay later to
|
||||
take in account external signal delays. (It should be QSPI_SAMPLE_SHIFTING_NONE in DDR mode)
|
||||
This parameter can be a value of @ref QSPI_SampleShifting */
|
||||
uint32_t FlashSize; /* Specifies the Flash Size. FlashSize+1 is effectively the number of address bits
|
||||
required to address the flash memory. The flash capacity can be up to 4GB
|
||||
(addressed using 32 bits) in indirect mode, but the addressable space in
|
||||
memory-mapped mode is limited to 256MB
|
||||
This parameter can be a number between 0 and 31 */
|
||||
uint32_t ChipSelectHighTime; /* Specifies the Chip Select High Time. ChipSelectHighTime+1 defines the minimum number
|
||||
of clock cycles which the chip select must remain high between commands.
|
||||
This parameter can be a value of @ref QSPI_ChipSelectHighTime */
|
||||
uint32_t ClockMode; /* Specifies the Clock Mode. It indicates the level that clock takes between commands.
|
||||
This parameter can be a value of @ref QSPI_ClockMode */
|
||||
uint32_t FlashID; /* Specifies the Flash which will be used,
|
||||
This parameter can be a value of @ref QSPI_Flash_Select */
|
||||
uint32_t DualFlash; /* Specifies the Dual Flash Mode State
|
||||
This parameter can be a value of @ref QSPI_DualFlash_Mode */
|
||||
}QSPI_InitTypeDef;
|
||||
|
||||
/**
|
||||
* @brief HAL QSPI State structures definition
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
HAL_QSPI_STATE_RESET = 0x00U, /*!< Peripheral not initialized */
|
||||
HAL_QSPI_STATE_READY = 0x01U, /*!< Peripheral initialized and ready for use */
|
||||
HAL_QSPI_STATE_BUSY = 0x02U, /*!< Peripheral in indirect mode and busy */
|
||||
HAL_QSPI_STATE_BUSY_INDIRECT_TX = 0x12U, /*!< Peripheral in indirect mode with transmission ongoing */
|
||||
HAL_QSPI_STATE_BUSY_INDIRECT_RX = 0x22U, /*!< Peripheral in indirect mode with reception ongoing */
|
||||
HAL_QSPI_STATE_BUSY_AUTO_POLLING = 0x42U, /*!< Peripheral in auto polling mode ongoing */
|
||||
HAL_QSPI_STATE_BUSY_MEM_MAPPED = 0x82U, /*!< Peripheral in memory mapped mode ongoing */
|
||||
HAL_QSPI_STATE_ABORT = 0x08U, /*!< Peripheral with abort request ongoing */
|
||||
HAL_QSPI_STATE_ERROR = 0x04U /*!< Peripheral in error */
|
||||
}HAL_QSPI_StateTypeDef;
|
||||
|
||||
/**
|
||||
* @brief QSPI Handle Structure definition
|
||||
*/
|
||||
#if (USE_HAL_QSPI_REGISTER_CALLBACKS == 1)
|
||||
typedef struct __QSPI_HandleTypeDef
|
||||
#else
|
||||
typedef struct
|
||||
#endif
|
||||
{
|
||||
QUADSPI_TypeDef *Instance; /* QSPI registers base address */
|
||||
QSPI_InitTypeDef Init; /* QSPI communication parameters */
|
||||
uint8_t *pTxBuffPtr; /* Pointer to QSPI Tx transfer Buffer */
|
||||
__IO uint32_t TxXferSize; /* QSPI Tx Transfer size */
|
||||
__IO uint32_t TxXferCount; /* QSPI Tx Transfer Counter */
|
||||
uint8_t *pRxBuffPtr; /* Pointer to QSPI Rx transfer Buffer */
|
||||
__IO uint32_t RxXferSize; /* QSPI Rx Transfer size */
|
||||
__IO uint32_t RxXferCount; /* QSPI Rx Transfer Counter */
|
||||
DMA_HandleTypeDef *hdma; /* QSPI Rx/Tx DMA Handle parameters */
|
||||
__IO HAL_LockTypeDef Lock; /* Locking object */
|
||||
__IO HAL_QSPI_StateTypeDef State; /* QSPI communication state */
|
||||
__IO uint32_t ErrorCode; /* QSPI Error code */
|
||||
uint32_t Timeout; /* Timeout for the QSPI memory access */
|
||||
#if (USE_HAL_QSPI_REGISTER_CALLBACKS == 1)
|
||||
void (* ErrorCallback) (struct __QSPI_HandleTypeDef *hqspi);
|
||||
void (* AbortCpltCallback) (struct __QSPI_HandleTypeDef *hqspi);
|
||||
void (* FifoThresholdCallback)(struct __QSPI_HandleTypeDef *hqspi);
|
||||
void (* CmdCpltCallback) (struct __QSPI_HandleTypeDef *hqspi);
|
||||
void (* RxCpltCallback) (struct __QSPI_HandleTypeDef *hqspi);
|
||||
void (* TxCpltCallback) (struct __QSPI_HandleTypeDef *hqspi);
|
||||
void (* RxHalfCpltCallback) (struct __QSPI_HandleTypeDef *hqspi);
|
||||
void (* TxHalfCpltCallback) (struct __QSPI_HandleTypeDef *hqspi);
|
||||
void (* StatusMatchCallback) (struct __QSPI_HandleTypeDef *hqspi);
|
||||
void (* TimeOutCallback) (struct __QSPI_HandleTypeDef *hqspi);
|
||||
|
||||
void (* MspInitCallback) (struct __QSPI_HandleTypeDef *hqspi);
|
||||
void (* MspDeInitCallback) (struct __QSPI_HandleTypeDef *hqspi);
|
||||
#endif
|
||||
}QSPI_HandleTypeDef;
|
||||
|
||||
/**
|
||||
* @brief QSPI Command structure definition
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t Instruction; /* Specifies the Instruction to be sent
|
||||
This parameter can be a value (8-bit) between 0x00 and 0xFF */
|
||||
uint32_t Address; /* Specifies the Address to be sent (Size from 1 to 4 bytes according AddressSize)
|
||||
This parameter can be a value (32-bits) between 0x0 and 0xFFFFFFFF */
|
||||
uint32_t AlternateBytes; /* Specifies the Alternate Bytes to be sent (Size from 1 to 4 bytes according AlternateBytesSize)
|
||||
This parameter can be a value (32-bits) between 0x0 and 0xFFFFFFFF */
|
||||
uint32_t AddressSize; /* Specifies the Address Size
|
||||
This parameter can be a value of @ref QSPI_AddressSize */
|
||||
uint32_t AlternateBytesSize; /* Specifies the Alternate Bytes Size
|
||||
This parameter can be a value of @ref QSPI_AlternateBytesSize */
|
||||
uint32_t DummyCycles; /* Specifies the Number of Dummy Cycles.
|
||||
This parameter can be a number between 0 and 31 */
|
||||
uint32_t InstructionMode; /* Specifies the Instruction Mode
|
||||
This parameter can be a value of @ref QSPI_InstructionMode */
|
||||
uint32_t AddressMode; /* Specifies the Address Mode
|
||||
This parameter can be a value of @ref QSPI_AddressMode */
|
||||
uint32_t AlternateByteMode; /* Specifies the Alternate Bytes Mode
|
||||
This parameter can be a value of @ref QSPI_AlternateBytesMode */
|
||||
uint32_t DataMode; /* Specifies the Data Mode (used for dummy cycles and data phases)
|
||||
This parameter can be a value of @ref QSPI_DataMode */
|
||||
uint32_t NbData; /* Specifies the number of data to transfer. (This is the number of bytes)
|
||||
This parameter can be any value between 0 and 0xFFFFFFFF (0 means undefined length
|
||||
until end of memory)*/
|
||||
uint32_t DdrMode; /* Specifies the double data rate mode for address, alternate byte and data phase
|
||||
This parameter can be a value of @ref QSPI_DdrMode */
|
||||
uint32_t DdrHoldHalfCycle; /* Specifies if the DDR hold is enabled. When enabled it delays the data
|
||||
output by one half of system clock in DDR mode.
|
||||
This parameter can be a value of @ref QSPI_DdrHoldHalfCycle */
|
||||
uint32_t SIOOMode; /* Specifies the send instruction only once mode
|
||||
This parameter can be a value of @ref QSPI_SIOOMode */
|
||||
}QSPI_CommandTypeDef;
|
||||
|
||||
/**
|
||||
* @brief QSPI Auto Polling mode configuration structure definition
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t Match; /* Specifies the value to be compared with the masked status register to get a match.
|
||||
This parameter can be any value between 0 and 0xFFFFFFFF */
|
||||
uint32_t Mask; /* Specifies the mask to be applied to the status bytes received.
|
||||
This parameter can be any value between 0 and 0xFFFFFFFF */
|
||||
uint32_t Interval; /* Specifies the number of clock cycles between two read during automatic polling phases.
|
||||
This parameter can be any value between 0 and 0xFFFF */
|
||||
uint32_t StatusBytesSize; /* Specifies the size of the status bytes received.
|
||||
This parameter can be any value between 1 and 4 */
|
||||
uint32_t MatchMode; /* Specifies the method used for determining a match.
|
||||
This parameter can be a value of @ref QSPI_MatchMode */
|
||||
uint32_t AutomaticStop; /* Specifies if automatic polling is stopped after a match.
|
||||
This parameter can be a value of @ref QSPI_AutomaticStop */
|
||||
}QSPI_AutoPollingTypeDef;
|
||||
|
||||
/**
|
||||
* @brief QSPI Memory Mapped mode configuration structure definition
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t TimeOutPeriod; /* Specifies the number of clock to wait when the FIFO is full before to release the chip select.
|
||||
This parameter can be any value between 0 and 0xFFFF */
|
||||
uint32_t TimeOutActivation; /* Specifies if the timeout counter is enabled to release the chip select.
|
||||
This parameter can be a value of @ref QSPI_TimeOutActivation */
|
||||
}QSPI_MemoryMappedTypeDef;
|
||||
|
||||
#if (USE_HAL_QSPI_REGISTER_CALLBACKS == 1)
|
||||
/**
|
||||
* @brief HAL QSPI Callback ID enumeration definition
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
HAL_QSPI_ERROR_CB_ID = 0x00U, /*!< QSPI Error Callback ID */
|
||||
HAL_QSPI_ABORT_CB_ID = 0x01U, /*!< QSPI Abort Callback ID */
|
||||
HAL_QSPI_FIFO_THRESHOLD_CB_ID = 0x02U, /*!< QSPI FIFO Threshold Callback ID */
|
||||
HAL_QSPI_CMD_CPLT_CB_ID = 0x03U, /*!< QSPI Command Complete Callback ID */
|
||||
HAL_QSPI_RX_CPLT_CB_ID = 0x04U, /*!< QSPI Rx Complete Callback ID */
|
||||
HAL_QSPI_TX_CPLT_CB_ID = 0x05U, /*!< QSPI Tx Complete Callback ID */
|
||||
HAL_QSPI_RX_HALF_CPLT_CB_ID = 0x06U, /*!< QSPI Rx Half Complete Callback ID */
|
||||
HAL_QSPI_TX_HALF_CPLT_CB_ID = 0x07U, /*!< QSPI Tx Half Complete Callback ID */
|
||||
HAL_QSPI_STATUS_MATCH_CB_ID = 0x08U, /*!< QSPI Status Match Callback ID */
|
||||
HAL_QSPI_TIMEOUT_CB_ID = 0x09U, /*!< QSPI Timeout Callback ID */
|
||||
|
||||
HAL_QSPI_MSP_INIT_CB_ID = 0x0AU, /*!< QSPI MspInit Callback ID */
|
||||
HAL_QSPI_MSP_DEINIT_CB_ID = 0x0B0 /*!< QSPI MspDeInit Callback ID */
|
||||
}HAL_QSPI_CallbackIDTypeDef;
|
||||
|
||||
/**
|
||||
* @brief HAL QSPI Callback pointer definition
|
||||
*/
|
||||
typedef void (*pQSPI_CallbackTypeDef)(QSPI_HandleTypeDef *hqspi);
|
||||
#endif
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
/** @defgroup QSPI_Exported_Constants QSPI Exported Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup QSPI_ErrorCode QSPI Error Code
|
||||
* @{
|
||||
*/
|
||||
#define HAL_QSPI_ERROR_NONE 0x00000000U /*!< No error */
|
||||
#define HAL_QSPI_ERROR_TIMEOUT 0x00000001U /*!< Timeout error */
|
||||
#define HAL_QSPI_ERROR_TRANSFER 0x00000002U /*!< Transfer error */
|
||||
#define HAL_QSPI_ERROR_DMA 0x00000004U /*!< DMA transfer error */
|
||||
#define HAL_QSPI_ERROR_INVALID_PARAM 0x00000008U /*!< Invalid parameters error */
|
||||
#if (USE_HAL_QSPI_REGISTER_CALLBACKS == 1)
|
||||
#define HAL_QSPI_ERROR_INVALID_CALLBACK 0x00000010U /*!< Invalid callback error */
|
||||
#endif
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup QSPI_SampleShifting QSPI Sample Shifting
|
||||
* @{
|
||||
*/
|
||||
#define QSPI_SAMPLE_SHIFTING_NONE 0x00000000U /*!<No clock cycle shift to sample data*/
|
||||
#define QSPI_SAMPLE_SHIFTING_HALFCYCLE ((uint32_t)QUADSPI_CR_SSHIFT) /*!<1/2 clock cycle shift to sample data*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup QSPI_ChipSelectHighTime QSPI ChipSelect High Time
|
||||
* @{
|
||||
*/
|
||||
#define QSPI_CS_HIGH_TIME_1_CYCLE 0x00000000U /*!<nCS stay high for at least 1 clock cycle between commands*/
|
||||
#define QSPI_CS_HIGH_TIME_2_CYCLE ((uint32_t)QUADSPI_DCR_CSHT_0) /*!<nCS stay high for at least 2 clock cycles between commands*/
|
||||
#define QSPI_CS_HIGH_TIME_3_CYCLE ((uint32_t)QUADSPI_DCR_CSHT_1) /*!<nCS stay high for at least 3 clock cycles between commands*/
|
||||
#define QSPI_CS_HIGH_TIME_4_CYCLE ((uint32_t)QUADSPI_DCR_CSHT_0 | QUADSPI_DCR_CSHT_1) /*!<nCS stay high for at least 4 clock cycles between commands*/
|
||||
#define QSPI_CS_HIGH_TIME_5_CYCLE ((uint32_t)QUADSPI_DCR_CSHT_2) /*!<nCS stay high for at least 5 clock cycles between commands*/
|
||||
#define QSPI_CS_HIGH_TIME_6_CYCLE ((uint32_t)QUADSPI_DCR_CSHT_2 | QUADSPI_DCR_CSHT_0) /*!<nCS stay high for at least 6 clock cycles between commands*/
|
||||
#define QSPI_CS_HIGH_TIME_7_CYCLE ((uint32_t)QUADSPI_DCR_CSHT_2 | QUADSPI_DCR_CSHT_1) /*!<nCS stay high for at least 7 clock cycles between commands*/
|
||||
#define QSPI_CS_HIGH_TIME_8_CYCLE ((uint32_t)QUADSPI_DCR_CSHT) /*!<nCS stay high for at least 8 clock cycles between commands*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup QSPI_ClockMode QSPI Clock Mode
|
||||
* @{
|
||||
*/
|
||||
#define QSPI_CLOCK_MODE_0 0x00000000U /*!<Clk stays low while nCS is released*/
|
||||
#define QSPI_CLOCK_MODE_3 ((uint32_t)QUADSPI_DCR_CKMODE) /*!<Clk goes high while nCS is released*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup QSPI_Flash_Select QSPI Flash Select
|
||||
* @{
|
||||
*/
|
||||
#define QSPI_FLASH_ID_1 0x00000000U /*!<FLASH 1 selected*/
|
||||
#define QSPI_FLASH_ID_2 ((uint32_t)QUADSPI_CR_FSEL) /*!<FLASH 2 selected*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup QSPI_DualFlash_Mode QSPI Dual Flash Mode
|
||||
* @{
|
||||
*/
|
||||
#define QSPI_DUALFLASH_ENABLE ((uint32_t)QUADSPI_CR_DFM) /*!<Dual-flash mode enabled*/
|
||||
#define QSPI_DUALFLASH_DISABLE 0x00000000U /*!<Dual-flash mode disabled*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup QSPI_AddressSize QSPI Address Size
|
||||
* @{
|
||||
*/
|
||||
#define QSPI_ADDRESS_8_BITS 0x00000000U /*!<8-bit address*/
|
||||
#define QSPI_ADDRESS_16_BITS ((uint32_t)QUADSPI_CCR_ADSIZE_0) /*!<16-bit address*/
|
||||
#define QSPI_ADDRESS_24_BITS ((uint32_t)QUADSPI_CCR_ADSIZE_1) /*!<24-bit address*/
|
||||
#define QSPI_ADDRESS_32_BITS ((uint32_t)QUADSPI_CCR_ADSIZE) /*!<32-bit address*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup QSPI_AlternateBytesSize QSPI Alternate Bytes Size
|
||||
* @{
|
||||
*/
|
||||
#define QSPI_ALTERNATE_BYTES_8_BITS 0x00000000U /*!<8-bit alternate bytes*/
|
||||
#define QSPI_ALTERNATE_BYTES_16_BITS ((uint32_t)QUADSPI_CCR_ABSIZE_0) /*!<16-bit alternate bytes*/
|
||||
#define QSPI_ALTERNATE_BYTES_24_BITS ((uint32_t)QUADSPI_CCR_ABSIZE_1) /*!<24-bit alternate bytes*/
|
||||
#define QSPI_ALTERNATE_BYTES_32_BITS ((uint32_t)QUADSPI_CCR_ABSIZE) /*!<32-bit alternate bytes*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup QSPI_InstructionMode QSPI Instruction Mode
|
||||
* @{
|
||||
*/
|
||||
#define QSPI_INSTRUCTION_NONE 0x00000000U /*!<No instruction*/
|
||||
#define QSPI_INSTRUCTION_1_LINE ((uint32_t)QUADSPI_CCR_IMODE_0) /*!<Instruction on a single line*/
|
||||
#define QSPI_INSTRUCTION_2_LINES ((uint32_t)QUADSPI_CCR_IMODE_1) /*!<Instruction on two lines*/
|
||||
#define QSPI_INSTRUCTION_4_LINES ((uint32_t)QUADSPI_CCR_IMODE) /*!<Instruction on four lines*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup QSPI_AddressMode QSPI Address Mode
|
||||
* @{
|
||||
*/
|
||||
#define QSPI_ADDRESS_NONE 0x00000000U /*!<No address*/
|
||||
#define QSPI_ADDRESS_1_LINE ((uint32_t)QUADSPI_CCR_ADMODE_0) /*!<Address on a single line*/
|
||||
#define QSPI_ADDRESS_2_LINES ((uint32_t)QUADSPI_CCR_ADMODE_1) /*!<Address on two lines*/
|
||||
#define QSPI_ADDRESS_4_LINES ((uint32_t)QUADSPI_CCR_ADMODE) /*!<Address on four lines*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup QSPI_AlternateBytesMode QSPI Alternate Bytes Mode
|
||||
* @{
|
||||
*/
|
||||
#define QSPI_ALTERNATE_BYTES_NONE 0x00000000U /*!<No alternate bytes*/
|
||||
#define QSPI_ALTERNATE_BYTES_1_LINE ((uint32_t)QUADSPI_CCR_ABMODE_0) /*!<Alternate bytes on a single line*/
|
||||
#define QSPI_ALTERNATE_BYTES_2_LINES ((uint32_t)QUADSPI_CCR_ABMODE_1) /*!<Alternate bytes on two lines*/
|
||||
#define QSPI_ALTERNATE_BYTES_4_LINES ((uint32_t)QUADSPI_CCR_ABMODE) /*!<Alternate bytes on four lines*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup QSPI_DataMode QSPI Data Mode
|
||||
* @{
|
||||
*/
|
||||
#define QSPI_DATA_NONE 0x00000000U /*!<No data*/
|
||||
#define QSPI_DATA_1_LINE ((uint32_t)QUADSPI_CCR_DMODE_0) /*!<Data on a single line*/
|
||||
#define QSPI_DATA_2_LINES ((uint32_t)QUADSPI_CCR_DMODE_1) /*!<Data on two lines*/
|
||||
#define QSPI_DATA_4_LINES ((uint32_t)QUADSPI_CCR_DMODE) /*!<Data on four lines*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup QSPI_DdrMode QSPI DDR Mode
|
||||
* @{
|
||||
*/
|
||||
#define QSPI_DDR_MODE_DISABLE 0x00000000U /*!<Double data rate mode disabled*/
|
||||
#define QSPI_DDR_MODE_ENABLE ((uint32_t)QUADSPI_CCR_DDRM) /*!<Double data rate mode enabled*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup QSPI_DdrHoldHalfCycle QSPI DDR Data Output Delay
|
||||
* @{
|
||||
*/
|
||||
#define QSPI_DDR_HHC_ANALOG_DELAY 0x00000000U /*!<Delay the data output using analog delay in DDR mode*/
|
||||
#define QSPI_DDR_HHC_HALF_CLK_DELAY ((uint32_t)QUADSPI_CCR_DHHC) /*!<Delay the data output by one half of system clock in DDR mode*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup QSPI_SIOOMode QSPI Send Instruction Mode
|
||||
* @{
|
||||
*/
|
||||
#define QSPI_SIOO_INST_EVERY_CMD 0x00000000U /*!<Send instruction on every transaction*/
|
||||
#define QSPI_SIOO_INST_ONLY_FIRST_CMD ((uint32_t)QUADSPI_CCR_SIOO) /*!<Send instruction only for the first command*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup QSPI_MatchMode QSPI Match Mode
|
||||
* @{
|
||||
*/
|
||||
#define QSPI_MATCH_MODE_AND 0x00000000U /*!<AND match mode between unmasked bits*/
|
||||
#define QSPI_MATCH_MODE_OR ((uint32_t)QUADSPI_CR_PMM) /*!<OR match mode between unmasked bits*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup QSPI_AutomaticStop QSPI Automatic Stop
|
||||
* @{
|
||||
*/
|
||||
#define QSPI_AUTOMATIC_STOP_DISABLE 0x00000000U /*!<AutoPolling stops only with abort or QSPI disabling*/
|
||||
#define QSPI_AUTOMATIC_STOP_ENABLE ((uint32_t)QUADSPI_CR_APMS) /*!<AutoPolling stops as soon as there is a match*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup QSPI_TimeOutActivation QSPI Timeout Activation
|
||||
* @{
|
||||
*/
|
||||
#define QSPI_TIMEOUT_COUNTER_DISABLE 0x00000000U /*!<Timeout counter disabled, nCS remains active*/
|
||||
#define QSPI_TIMEOUT_COUNTER_ENABLE ((uint32_t)QUADSPI_CR_TCEN) /*!<Timeout counter enabled, nCS released when timeout expires*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup QSPI_Flags QSPI Flags
|
||||
* @{
|
||||
*/
|
||||
#define QSPI_FLAG_BUSY QUADSPI_SR_BUSY /*!<Busy flag: operation is ongoing*/
|
||||
#define QSPI_FLAG_TO QUADSPI_SR_TOF /*!<Timeout flag: timeout occurs in memory-mapped mode*/
|
||||
#define QSPI_FLAG_SM QUADSPI_SR_SMF /*!<Status match flag: received data matches in autopolling mode*/
|
||||
#define QSPI_FLAG_FT QUADSPI_SR_FTF /*!<Fifo threshold flag: Fifo threshold reached or data left after read from memory is complete*/
|
||||
#define QSPI_FLAG_TC QUADSPI_SR_TCF /*!<Transfer complete flag: programmed number of data have been transferred or the transfer has been aborted*/
|
||||
#define QSPI_FLAG_TE QUADSPI_SR_TEF /*!<Transfer error flag: invalid address is being accessed*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup QSPI_Interrupts QSPI Interrupts
|
||||
* @{
|
||||
*/
|
||||
#define QSPI_IT_TO QUADSPI_CR_TOIE /*!<Interrupt on the timeout flag*/
|
||||
#define QSPI_IT_SM QUADSPI_CR_SMIE /*!<Interrupt on the status match flag*/
|
||||
#define QSPI_IT_FT QUADSPI_CR_FTIE /*!<Interrupt on the fifo threshold flag*/
|
||||
#define QSPI_IT_TC QUADSPI_CR_TCIE /*!<Interrupt on the transfer complete flag*/
|
||||
#define QSPI_IT_TE QUADSPI_CR_TEIE /*!<Interrupt on the transfer error flag*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup QSPI_Timeout_definition QSPI Timeout definition
|
||||
* @brief QSPI Timeout definition
|
||||
* @{
|
||||
*/
|
||||
#define HAL_QSPI_TIMEOUT_DEFAULT_VALUE 5000U /* 5 s */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported macros -----------------------------------------------------------*/
|
||||
/** @defgroup QSPI_Exported_Macros QSPI Exported Macros
|
||||
* @{
|
||||
*/
|
||||
/** @brief Reset QSPI handle state.
|
||||
* @param __HANDLE__ QSPI handle.
|
||||
* @retval None
|
||||
*/
|
||||
#if (USE_HAL_QSPI_REGISTER_CALLBACKS == 1)
|
||||
#define __HAL_QSPI_RESET_HANDLE_STATE(__HANDLE__) do { \
|
||||
(__HANDLE__)->State = HAL_QSPI_STATE_RESET; \
|
||||
(__HANDLE__)->MspInitCallback = NULL; \
|
||||
(__HANDLE__)->MspDeInitCallback = NULL; \
|
||||
} while(0)
|
||||
#else
|
||||
#define __HAL_QSPI_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_QSPI_STATE_RESET)
|
||||
#endif
|
||||
|
||||
/** @brief Enable the QSPI peripheral.
|
||||
* @param __HANDLE__ specifies the QSPI Handle.
|
||||
* @retval None
|
||||
*/
|
||||
#define __HAL_QSPI_ENABLE(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CR, QUADSPI_CR_EN)
|
||||
|
||||
/** @brief Disable the QSPI peripheral.
|
||||
* @param __HANDLE__ specifies the QSPI Handle.
|
||||
* @retval None
|
||||
*/
|
||||
#define __HAL_QSPI_DISABLE(__HANDLE__) CLEAR_BIT((__HANDLE__)->Instance->CR, QUADSPI_CR_EN)
|
||||
|
||||
/** @brief Enable the specified QSPI interrupt.
|
||||
* @param __HANDLE__ specifies the QSPI Handle.
|
||||
* @param __INTERRUPT__ specifies the QSPI interrupt source to enable.
|
||||
* This parameter can be one of the following values:
|
||||
* @arg QSPI_IT_TO: QSPI Timeout interrupt
|
||||
* @arg QSPI_IT_SM: QSPI Status match interrupt
|
||||
* @arg QSPI_IT_FT: QSPI FIFO threshold interrupt
|
||||
* @arg QSPI_IT_TC: QSPI Transfer complete interrupt
|
||||
* @arg QSPI_IT_TE: QSPI Transfer error interrupt
|
||||
* @retval None
|
||||
*/
|
||||
#define __HAL_QSPI_ENABLE_IT(__HANDLE__, __INTERRUPT__) SET_BIT((__HANDLE__)->Instance->CR, (__INTERRUPT__))
|
||||
|
||||
|
||||
/** @brief Disable the specified QSPI interrupt.
|
||||
* @param __HANDLE__ specifies the QSPI Handle.
|
||||
* @param __INTERRUPT__ specifies the QSPI interrupt source to disable.
|
||||
* This parameter can be one of the following values:
|
||||
* @arg QSPI_IT_TO: QSPI Timeout interrupt
|
||||
* @arg QSPI_IT_SM: QSPI Status match interrupt
|
||||
* @arg QSPI_IT_FT: QSPI FIFO threshold interrupt
|
||||
* @arg QSPI_IT_TC: QSPI Transfer complete interrupt
|
||||
* @arg QSPI_IT_TE: QSPI Transfer error interrupt
|
||||
* @retval None
|
||||
*/
|
||||
#define __HAL_QSPI_DISABLE_IT(__HANDLE__, __INTERRUPT__) CLEAR_BIT((__HANDLE__)->Instance->CR, (__INTERRUPT__))
|
||||
|
||||
/** @brief Check whether the specified QSPI interrupt source is enabled or not.
|
||||
* @param __HANDLE__ specifies the QSPI Handle.
|
||||
* @param __INTERRUPT__ specifies the QSPI interrupt source to check.
|
||||
* This parameter can be one of the following values:
|
||||
* @arg QSPI_IT_TO: QSPI Timeout interrupt
|
||||
* @arg QSPI_IT_SM: QSPI Status match interrupt
|
||||
* @arg QSPI_IT_FT: QSPI FIFO threshold interrupt
|
||||
* @arg QSPI_IT_TC: QSPI Transfer complete interrupt
|
||||
* @arg QSPI_IT_TE: QSPI Transfer error interrupt
|
||||
* @retval The new state of __INTERRUPT__ (TRUE or FALSE).
|
||||
*/
|
||||
#define __HAL_QSPI_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (READ_BIT((__HANDLE__)->Instance->CR, (__INTERRUPT__)) == (__INTERRUPT__))
|
||||
|
||||
/**
|
||||
* @brief Check whether the selected QSPI flag is set or not.
|
||||
* @param __HANDLE__ specifies the QSPI Handle.
|
||||
* @param __FLAG__ specifies the QSPI flag to check.
|
||||
* This parameter can be one of the following values:
|
||||
* @arg QSPI_FLAG_BUSY: QSPI Busy flag
|
||||
* @arg QSPI_FLAG_TO: QSPI Timeout flag
|
||||
* @arg QSPI_FLAG_SM: QSPI Status match flag
|
||||
* @arg QSPI_FLAG_FT: QSPI FIFO threshold flag
|
||||
* @arg QSPI_FLAG_TC: QSPI Transfer complete flag
|
||||
* @arg QSPI_FLAG_TE: QSPI Transfer error flag
|
||||
* @retval None
|
||||
*/
|
||||
#define __HAL_QSPI_GET_FLAG(__HANDLE__, __FLAG__) ((READ_BIT((__HANDLE__)->Instance->SR, (__FLAG__)) != 0U) ? SET : RESET)
|
||||
|
||||
/** @brief Clears the specified QSPI's flag status.
|
||||
* @param __HANDLE__ specifies the QSPI Handle.
|
||||
* @param __FLAG__ specifies the QSPI clear register flag that needs to be set
|
||||
* This parameter can be one of the following values:
|
||||
* @arg QSPI_FLAG_TO: QSPI Timeout flag
|
||||
* @arg QSPI_FLAG_SM: QSPI Status match flag
|
||||
* @arg QSPI_FLAG_TC: QSPI Transfer complete flag
|
||||
* @arg QSPI_FLAG_TE: QSPI Transfer error flag
|
||||
* @retval None
|
||||
*/
|
||||
#define __HAL_QSPI_CLEAR_FLAG(__HANDLE__, __FLAG__) WRITE_REG((__HANDLE__)->Instance->FCR, (__FLAG__))
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/** @addtogroup QSPI_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup QSPI_Exported_Functions_Group1
|
||||
* @{
|
||||
*/
|
||||
/* Initialization/de-initialization functions ********************************/
|
||||
HAL_StatusTypeDef HAL_QSPI_Init (QSPI_HandleTypeDef *hqspi);
|
||||
HAL_StatusTypeDef HAL_QSPI_DeInit (QSPI_HandleTypeDef *hqspi);
|
||||
void HAL_QSPI_MspInit (QSPI_HandleTypeDef *hqspi);
|
||||
void HAL_QSPI_MspDeInit(QSPI_HandleTypeDef *hqspi);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup QSPI_Exported_Functions_Group2
|
||||
* @{
|
||||
*/
|
||||
/* IO operation functions *****************************************************/
|
||||
/* QSPI IRQ handler method */
|
||||
void HAL_QSPI_IRQHandler(QSPI_HandleTypeDef *hqspi);
|
||||
|
||||
/* QSPI indirect mode */
|
||||
HAL_StatusTypeDef HAL_QSPI_Command (QSPI_HandleTypeDef *hqspi, QSPI_CommandTypeDef *cmd, uint32_t Timeout);
|
||||
HAL_StatusTypeDef HAL_QSPI_Transmit (QSPI_HandleTypeDef *hqspi, uint8_t *pData, uint32_t Timeout);
|
||||
HAL_StatusTypeDef HAL_QSPI_Receive (QSPI_HandleTypeDef *hqspi, uint8_t *pData, uint32_t Timeout);
|
||||
HAL_StatusTypeDef HAL_QSPI_Command_IT (QSPI_HandleTypeDef *hqspi, QSPI_CommandTypeDef *cmd);
|
||||
HAL_StatusTypeDef HAL_QSPI_Transmit_IT (QSPI_HandleTypeDef *hqspi, uint8_t *pData);
|
||||
HAL_StatusTypeDef HAL_QSPI_Receive_IT (QSPI_HandleTypeDef *hqspi, uint8_t *pData);
|
||||
HAL_StatusTypeDef HAL_QSPI_Transmit_DMA (QSPI_HandleTypeDef *hqspi, uint8_t *pData);
|
||||
HAL_StatusTypeDef HAL_QSPI_Receive_DMA (QSPI_HandleTypeDef *hqspi, uint8_t *pData);
|
||||
|
||||
/* QSPI status flag polling mode */
|
||||
HAL_StatusTypeDef HAL_QSPI_AutoPolling (QSPI_HandleTypeDef *hqspi, QSPI_CommandTypeDef *cmd, QSPI_AutoPollingTypeDef *cfg, uint32_t Timeout);
|
||||
HAL_StatusTypeDef HAL_QSPI_AutoPolling_IT(QSPI_HandleTypeDef *hqspi, QSPI_CommandTypeDef *cmd, QSPI_AutoPollingTypeDef *cfg);
|
||||
|
||||
/* QSPI memory-mapped mode */
|
||||
HAL_StatusTypeDef HAL_QSPI_MemoryMapped(QSPI_HandleTypeDef *hqspi, QSPI_CommandTypeDef *cmd, QSPI_MemoryMappedTypeDef *cfg);
|
||||
|
||||
/* Callback functions in non-blocking modes ***********************************/
|
||||
void HAL_QSPI_ErrorCallback (QSPI_HandleTypeDef *hqspi);
|
||||
void HAL_QSPI_AbortCpltCallback (QSPI_HandleTypeDef *hqspi);
|
||||
void HAL_QSPI_FifoThresholdCallback(QSPI_HandleTypeDef *hqspi);
|
||||
|
||||
/* QSPI indirect mode */
|
||||
void HAL_QSPI_CmdCpltCallback (QSPI_HandleTypeDef *hqspi);
|
||||
void HAL_QSPI_RxCpltCallback (QSPI_HandleTypeDef *hqspi);
|
||||
void HAL_QSPI_TxCpltCallback (QSPI_HandleTypeDef *hqspi);
|
||||
void HAL_QSPI_RxHalfCpltCallback (QSPI_HandleTypeDef *hqspi);
|
||||
void HAL_QSPI_TxHalfCpltCallback (QSPI_HandleTypeDef *hqspi);
|
||||
|
||||
/* QSPI status flag polling mode */
|
||||
void HAL_QSPI_StatusMatchCallback (QSPI_HandleTypeDef *hqspi);
|
||||
|
||||
/* QSPI memory-mapped mode */
|
||||
void HAL_QSPI_TimeOutCallback (QSPI_HandleTypeDef *hqspi);
|
||||
|
||||
#if (USE_HAL_QSPI_REGISTER_CALLBACKS == 1)
|
||||
/* QSPI callback registering/unregistering */
|
||||
HAL_StatusTypeDef HAL_QSPI_RegisterCallback (QSPI_HandleTypeDef *hqspi, HAL_QSPI_CallbackIDTypeDef CallbackId, pQSPI_CallbackTypeDef pCallback);
|
||||
HAL_StatusTypeDef HAL_QSPI_UnRegisterCallback (QSPI_HandleTypeDef *hqspi, HAL_QSPI_CallbackIDTypeDef CallbackId);
|
||||
#endif
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup QSPI_Exported_Functions_Group3
|
||||
* @{
|
||||
*/
|
||||
/* Peripheral Control and State functions ************************************/
|
||||
HAL_QSPI_StateTypeDef HAL_QSPI_GetState (QSPI_HandleTypeDef *hqspi);
|
||||
uint32_t HAL_QSPI_GetError (QSPI_HandleTypeDef *hqspi);
|
||||
HAL_StatusTypeDef HAL_QSPI_Abort (QSPI_HandleTypeDef *hqspi);
|
||||
HAL_StatusTypeDef HAL_QSPI_Abort_IT (QSPI_HandleTypeDef *hqspi);
|
||||
void HAL_QSPI_SetTimeout (QSPI_HandleTypeDef *hqspi, uint32_t Timeout);
|
||||
HAL_StatusTypeDef HAL_QSPI_SetFifoThreshold(QSPI_HandleTypeDef *hqspi, uint32_t Threshold);
|
||||
uint32_t HAL_QSPI_GetFifoThreshold(QSPI_HandleTypeDef *hqspi);
|
||||
HAL_StatusTypeDef HAL_QSPI_SetFlashID (QSPI_HandleTypeDef *hqspi, uint32_t FlashID);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/* End of exported functions -------------------------------------------------*/
|
||||
|
||||
/* Private macros ------------------------------------------------------------*/
|
||||
/** @defgroup QSPI_Private_Macros QSPI Private Macros
|
||||
* @{
|
||||
*/
|
||||
#define IS_QSPI_CLOCK_PRESCALER(PRESCALER) ((PRESCALER) <= 0xFFU)
|
||||
|
||||
#define IS_QSPI_FIFO_THRESHOLD(THR) (((THR) > 0U) && ((THR) <= 32U))
|
||||
|
||||
#define IS_QSPI_SSHIFT(SSHIFT) (((SSHIFT) == QSPI_SAMPLE_SHIFTING_NONE) || \
|
||||
((SSHIFT) == QSPI_SAMPLE_SHIFTING_HALFCYCLE))
|
||||
|
||||
#define IS_QSPI_FLASH_SIZE(FSIZE) (((FSIZE) <= 31U))
|
||||
|
||||
#define IS_QSPI_CS_HIGH_TIME(CSHTIME) (((CSHTIME) == QSPI_CS_HIGH_TIME_1_CYCLE) || \
|
||||
((CSHTIME) == QSPI_CS_HIGH_TIME_2_CYCLE) || \
|
||||
((CSHTIME) == QSPI_CS_HIGH_TIME_3_CYCLE) || \
|
||||
((CSHTIME) == QSPI_CS_HIGH_TIME_4_CYCLE) || \
|
||||
((CSHTIME) == QSPI_CS_HIGH_TIME_5_CYCLE) || \
|
||||
((CSHTIME) == QSPI_CS_HIGH_TIME_6_CYCLE) || \
|
||||
((CSHTIME) == QSPI_CS_HIGH_TIME_7_CYCLE) || \
|
||||
((CSHTIME) == QSPI_CS_HIGH_TIME_8_CYCLE))
|
||||
|
||||
#define IS_QSPI_CLOCK_MODE(CLKMODE) (((CLKMODE) == QSPI_CLOCK_MODE_0) || \
|
||||
((CLKMODE) == QSPI_CLOCK_MODE_3))
|
||||
|
||||
#define IS_QSPI_FLASH_ID(FLASH_ID) (((FLASH_ID) == QSPI_FLASH_ID_1) || \
|
||||
((FLASH_ID) == QSPI_FLASH_ID_2))
|
||||
|
||||
#define IS_QSPI_DUAL_FLASH_MODE(MODE) (((MODE) == QSPI_DUALFLASH_ENABLE) || \
|
||||
((MODE) == QSPI_DUALFLASH_DISABLE))
|
||||
|
||||
#define IS_QSPI_INSTRUCTION(INSTRUCTION) ((INSTRUCTION) <= 0xFFU)
|
||||
|
||||
#define IS_QSPI_ADDRESS_SIZE(ADDR_SIZE) (((ADDR_SIZE) == QSPI_ADDRESS_8_BITS) || \
|
||||
((ADDR_SIZE) == QSPI_ADDRESS_16_BITS) || \
|
||||
((ADDR_SIZE) == QSPI_ADDRESS_24_BITS) || \
|
||||
((ADDR_SIZE) == QSPI_ADDRESS_32_BITS))
|
||||
|
||||
#define IS_QSPI_ALTERNATE_BYTES_SIZE(SIZE) (((SIZE) == QSPI_ALTERNATE_BYTES_8_BITS) || \
|
||||
((SIZE) == QSPI_ALTERNATE_BYTES_16_BITS) || \
|
||||
((SIZE) == QSPI_ALTERNATE_BYTES_24_BITS) || \
|
||||
((SIZE) == QSPI_ALTERNATE_BYTES_32_BITS))
|
||||
|
||||
#define IS_QSPI_DUMMY_CYCLES(DCY) ((DCY) <= 31U)
|
||||
|
||||
#define IS_QSPI_INSTRUCTION_MODE(MODE) (((MODE) == QSPI_INSTRUCTION_NONE) || \
|
||||
((MODE) == QSPI_INSTRUCTION_1_LINE) || \
|
||||
((MODE) == QSPI_INSTRUCTION_2_LINES) || \
|
||||
((MODE) == QSPI_INSTRUCTION_4_LINES))
|
||||
|
||||
#define IS_QSPI_ADDRESS_MODE(MODE) (((MODE) == QSPI_ADDRESS_NONE) || \
|
||||
((MODE) == QSPI_ADDRESS_1_LINE) || \
|
||||
((MODE) == QSPI_ADDRESS_2_LINES) || \
|
||||
((MODE) == QSPI_ADDRESS_4_LINES))
|
||||
|
||||
#define IS_QSPI_ALTERNATE_BYTES_MODE(MODE) (((MODE) == QSPI_ALTERNATE_BYTES_NONE) || \
|
||||
((MODE) == QSPI_ALTERNATE_BYTES_1_LINE) || \
|
||||
((MODE) == QSPI_ALTERNATE_BYTES_2_LINES) || \
|
||||
((MODE) == QSPI_ALTERNATE_BYTES_4_LINES))
|
||||
|
||||
#define IS_QSPI_DATA_MODE(MODE) (((MODE) == QSPI_DATA_NONE) || \
|
||||
((MODE) == QSPI_DATA_1_LINE) || \
|
||||
((MODE) == QSPI_DATA_2_LINES) || \
|
||||
((MODE) == QSPI_DATA_4_LINES))
|
||||
|
||||
#define IS_QSPI_DDR_MODE(DDR_MODE) (((DDR_MODE) == QSPI_DDR_MODE_DISABLE) || \
|
||||
((DDR_MODE) == QSPI_DDR_MODE_ENABLE))
|
||||
|
||||
#define IS_QSPI_DDR_HHC(DDR_HHC) (((DDR_HHC) == QSPI_DDR_HHC_ANALOG_DELAY) || \
|
||||
((DDR_HHC) == QSPI_DDR_HHC_HALF_CLK_DELAY))
|
||||
|
||||
#define IS_QSPI_SIOO_MODE(SIOO_MODE) (((SIOO_MODE) == QSPI_SIOO_INST_EVERY_CMD) || \
|
||||
((SIOO_MODE) == QSPI_SIOO_INST_ONLY_FIRST_CMD))
|
||||
|
||||
#define IS_QSPI_INTERVAL(INTERVAL) ((INTERVAL) <= QUADSPI_PIR_INTERVAL)
|
||||
|
||||
#define IS_QSPI_STATUS_BYTES_SIZE(SIZE) (((SIZE) >= 1U) && ((SIZE) <= 4U))
|
||||
|
||||
#define IS_QSPI_MATCH_MODE(MODE) (((MODE) == QSPI_MATCH_MODE_AND) || \
|
||||
((MODE) == QSPI_MATCH_MODE_OR))
|
||||
|
||||
#define IS_QSPI_AUTOMATIC_STOP(APMS) (((APMS) == QSPI_AUTOMATIC_STOP_DISABLE) || \
|
||||
((APMS) == QSPI_AUTOMATIC_STOP_ENABLE))
|
||||
|
||||
#define IS_QSPI_TIMEOUT_ACTIVATION(TCEN) (((TCEN) == QSPI_TIMEOUT_COUNTER_DISABLE) || \
|
||||
((TCEN) == QSPI_TIMEOUT_COUNTER_ENABLE))
|
||||
|
||||
#define IS_QSPI_TIMEOUT_PERIOD(PERIOD) ((PERIOD) <= 0xFFFFU)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/* End of private macros -----------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* defined(QUADSPI) */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* STM32F7xx_HAL_QSPI_H */
|
||||
2840
project/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_qspi.c
Normal file
2840
project/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_qspi.c
Normal file
File diff suppressed because it is too large
Load Diff
163
project/Utilities/Fonts/Release_Notes.html
Normal file
163
project/Utilities/Fonts/Release_Notes.html
Normal file
@@ -0,0 +1,163 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
|
||||
|
||||
<link rel="File-List" href="Library_files/filelist.xml">
|
||||
|
||||
|
||||
<link rel="Edit-Time-Data" href="Library_files/editdata.mso"><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><title>Release Notes for STM32Cube Fonts Utilities Driver</title><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>STMicroelectronics</o:Author> <o:LastAuthor>STMicroelectronics</o:LastAuthor> <o:Revision>37</o:Revision> <o:TotalTime>136</o:TotalTime> <o:Created>2009-02-27T19:26:00Z</o:Created> <o:LastSaved>2009-03-01T17:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>522</o:Words> <o:Characters>2977</o:Characters> <o:Company>STMicroelectronics</o:Company> <o:Lines>24</o:Lines> <o:Paragraphs>6</o:Paragraphs> <o:CharactersWithSpaces>3493</o:CharactersWithSpaces> <o:Version>11.6568</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>110</w:Zoom> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
<!--
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
h2
|
||||
{mso-style-next:Normal;
|
||||
margin-top:12.0pt;
|
||||
margin-right:0in;
|
||||
margin-bottom:3.0pt;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
page-break-after:avoid;
|
||||
mso-outline-level:2;
|
||||
font-size:14.0pt;
|
||||
font-family:Arial;
|
||||
font-weight:bold;
|
||||
font-style:italic;}
|
||||
a:link, span.MsoHyperlink
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
a:visited, span.MsoHyperlinkFollowed
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
p
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="5122"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]-->
|
||||
<meta content="MCD Application Team" name="author"></head><body link="blue" vlink="blue">
|
||||
<div class="Section1">
|
||||
<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
|
||||
</o:p></span></p>
|
||||
<div align="center">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Arial; color: blue;"><a href="../../Release_Notes.html">Back to Release page</a><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="">
|
||||
<td style="padding: 1.5pt;">
|
||||
<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release
|
||||
Notes for STM32Cube Fonts Utilities Driver</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
|
||||
2014 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="../../_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p> </o:p></span></p>
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" width="900">
|
||||
<tbody>
|
||||
<tr style="">
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<span style="font-family: "Times New Roman";"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2><br>
|
||||
<h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0 / 18-February-2014 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;"><o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;">
|
||||
<li><span style="font-size: 10pt; font-family: Verdana;">First official release</span><span style="font-size: 10pt; font-family: Verdana;"><br>
|
||||
</span></li>
|
||||
</ul><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><a name="License"></a><span style="font-size: 12pt; color: white;">License<o:p></o:p></span><br></h2>
|
||||
<div style="text-align: justify;"><font size="-1"><span style="font-family: "Verdana","sans-serif";">
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:</span><br>
|
||||
</font>
|
||||
<ol><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions
|
||||
in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in </span><span style="font-family: "Verdana","sans-serif";">the documentation and/or other materials provided with the distribution.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived </span><br>
|
||||
</font>
|
||||
</li></ol>
|
||||
<font size="-1"><span style="font-family: "Verdana","sans-serif";"> from this software without specific prior written permission.</span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";"></span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED</span><span style="font-family: "Verdana","sans-serif";"> WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A </span><span style="font-family: "Verdana","sans-serif";">PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY </span><span style="font-family: "Verdana","sans-serif";">DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, </span><span style="font-family: "Verdana","sans-serif";">PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER</span><span style="font-family: "Verdana","sans-serif";"> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR </span><span style="font-family: "Verdana","sans-serif";">OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></font>
|
||||
|
||||
</div>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;"><o:p></o:p></span></p>
|
||||
<b><span style="font-size: 10pt; font-family: Verdana; color: black;"></span></b>
|
||||
|
||||
<div class="MsoNormal" style="text-align: center;" align="center"><span style="color: black;">
|
||||
<hr align="center" size="2" width="100%"></span></div>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt; text-align: center;" align="center"><span style="font-size: 10pt; font-family: Verdana; color: black;">For
|
||||
complete documentation on </span><span style="font-size: 10pt; font-family: Verdana;">STM32<span style="color: black;"> Microcontrollers
|
||||
visit </span><u><span style="color: blue;"><a href="http://www.st.com/internet/mcu/class/1734.jsp" target="_blank">www.st.com/STM32</a></span></u></span><span style="font-size: 10pt; font-family: Verdana;"><a target="_blank" href="http://www.st.com/internet/mcu/family/141.jsp"><u><span style="color: blue;"></span></u></a></span><span style="font-size: 10pt; font-family: Verdana;"><u><span style="color: blue;"></span></u></span><span style="color: black;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="MsoNormal"><o:p> </o:p></p>
|
||||
</div>
|
||||
|
||||
</body></html>
|
||||
1464
project/Utilities/Fonts/font12.c
Normal file
1464
project/Utilities/Fonts/font12.c
Normal file
File diff suppressed because it is too large
Load Diff
1844
project/Utilities/Fonts/font16.c
Normal file
1844
project/Utilities/Fonts/font16.c
Normal file
File diff suppressed because it is too large
Load Diff
2223
project/Utilities/Fonts/font20.c
Normal file
2223
project/Utilities/Fonts/font20.c
Normal file
File diff suppressed because it is too large
Load Diff
2600
project/Utilities/Fonts/font24.c
Normal file
2600
project/Utilities/Fonts/font24.c
Normal file
File diff suppressed because it is too large
Load Diff
1084
project/Utilities/Fonts/font8.c
Normal file
1084
project/Utilities/Fonts/font8.c
Normal file
File diff suppressed because it is too large
Load Diff
134
project/Utilities/Fonts/fonts.h
Normal file
134
project/Utilities/Fonts/fonts.h
Normal file
@@ -0,0 +1,134 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file fonts.h
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.0
|
||||
* @date 18-February-2014
|
||||
* @brief Header for fonts.c file
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __FONTS_H
|
||||
#define __FONTS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup Utilities
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32_EVAL
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Common
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup FONTS
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup FONTS_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
typedef struct _tFont
|
||||
{
|
||||
const uint8_t *table;
|
||||
uint16_t Width;
|
||||
uint16_t Height;
|
||||
|
||||
} sFONT;
|
||||
|
||||
extern sFONT Font24;
|
||||
extern sFONT Font20;
|
||||
extern sFONT Font16;
|
||||
extern sFONT Font12;
|
||||
extern sFONT Font8;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup FONTS_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
#define LINE(x) ((x) * (((sFONT *)BSP_LCD_GetFont())->Height))
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup FONTS_Exported_Macros
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup FONTS_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __FONTS_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -57,106 +57,113 @@ Mcu.CPN=STM32F746NGH6
|
||||
Mcu.Family=STM32F7
|
||||
Mcu.IP0=CORTEX_M7
|
||||
Mcu.IP1=DMA2D
|
||||
Mcu.IP10=USART1
|
||||
Mcu.IP2=ETH
|
||||
Mcu.IP3=FMC
|
||||
Mcu.IP4=LTDC
|
||||
Mcu.IP5=LWIP
|
||||
Mcu.IP6=NVIC
|
||||
Mcu.IP7=RCC
|
||||
Mcu.IP8=SYS
|
||||
Mcu.IP9=USART1
|
||||
Mcu.IPNb=10
|
||||
Mcu.IP7=QUADSPI
|
||||
Mcu.IP8=RCC
|
||||
Mcu.IP9=SYS
|
||||
Mcu.IPNb=11
|
||||
Mcu.Name=STM32F746NGHx
|
||||
Mcu.Package=TFBGA216
|
||||
Mcu.Pin0=PE4
|
||||
Mcu.Pin1=PG14
|
||||
Mcu.Pin10=PK7
|
||||
Mcu.Pin11=PK6
|
||||
Mcu.Pin12=PK5
|
||||
Mcu.Pin13=PG12
|
||||
Mcu.Pin14=PJ14
|
||||
Mcu.Pin15=PD1
|
||||
Mcu.Pin16=PF0
|
||||
Mcu.Pin17=PI10
|
||||
Mcu.Pin18=PK4
|
||||
Mcu.Pin19=PK3
|
||||
Mcu.Pin2=PE1
|
||||
Mcu.Pin20=PJ15
|
||||
Mcu.Pin21=PI1
|
||||
Mcu.Pin22=PC14/OSC32_IN
|
||||
Mcu.Pin23=PF1
|
||||
Mcu.Pin24=PI12
|
||||
Mcu.Pin25=PI9
|
||||
Mcu.Pin26=PA9
|
||||
Mcu.Pin27=PC15/OSC32_OUT
|
||||
Mcu.Pin28=PI11
|
||||
Mcu.Pin29=PK1
|
||||
Mcu.Pin3=PE0
|
||||
Mcu.Pin30=PK2
|
||||
Mcu.Pin31=PH0/OSC_IN
|
||||
Mcu.Pin32=PF2
|
||||
Mcu.Pin33=PI15
|
||||
Mcu.Pin34=PJ11
|
||||
Mcu.Pin35=PK0
|
||||
Mcu.Pin36=PH1/OSC_OUT
|
||||
Mcu.Pin37=PF3
|
||||
Mcu.Pin38=PI14
|
||||
Mcu.Pin39=PJ8
|
||||
Mcu.Pin4=PG13
|
||||
Mcu.Pin40=PJ10
|
||||
Mcu.Pin41=PG8
|
||||
Mcu.Pin42=PF4
|
||||
Mcu.Pin43=PH5
|
||||
Mcu.Pin44=PH3
|
||||
Mcu.Pin45=PJ7
|
||||
Mcu.Pin46=PJ9
|
||||
Mcu.Pin47=PF5
|
||||
Mcu.Pin48=PH2
|
||||
Mcu.Pin49=PJ6
|
||||
Mcu.Pin5=PB7
|
||||
Mcu.Pin50=PD15
|
||||
Mcu.Pin51=PD10
|
||||
Mcu.Pin52=PD14
|
||||
Mcu.Pin53=PD9
|
||||
Mcu.Pin54=PD8
|
||||
Mcu.Pin55=PC1
|
||||
Mcu.Pin56=PF12
|
||||
Mcu.Pin57=PG1
|
||||
Mcu.Pin58=PF15
|
||||
Mcu.Pin59=PJ4
|
||||
Mcu.Pin6=PG15
|
||||
Mcu.Pin60=PJ5
|
||||
Mcu.Pin61=PA1
|
||||
Mcu.Pin62=PC4
|
||||
Mcu.Pin63=PF13
|
||||
Mcu.Pin64=PG0
|
||||
Mcu.Pin65=PJ3
|
||||
Mcu.Pin66=PE8
|
||||
Mcu.Pin67=PG5
|
||||
Mcu.Pin68=PG4
|
||||
Mcu.Pin69=PA2
|
||||
Mcu.Pin7=PG11
|
||||
Mcu.Pin70=PC5
|
||||
Mcu.Pin71=PF14
|
||||
Mcu.Pin72=PJ2
|
||||
Mcu.Pin73=PF11
|
||||
Mcu.Pin74=PE9
|
||||
Mcu.Pin75=PE11
|
||||
Mcu.Pin76=PE14
|
||||
Mcu.Pin77=PA7
|
||||
Mcu.Pin78=PJ0
|
||||
Mcu.Pin79=PJ1
|
||||
Mcu.Pin8=PJ13
|
||||
Mcu.Pin80=PE7
|
||||
Mcu.Pin81=PE10
|
||||
Mcu.Pin82=PE12
|
||||
Mcu.Pin83=PE15
|
||||
Mcu.Pin84=PE13
|
||||
Mcu.Pin85=VP_DMA2D_VS_DMA2D
|
||||
Mcu.Pin86=VP_LWIP_VS_Enabled
|
||||
Mcu.Pin87=VP_SYS_VS_Systick
|
||||
Mcu.Pin9=PD0
|
||||
Mcu.PinsNb=88
|
||||
Mcu.Pin1=PE2
|
||||
Mcu.Pin10=PJ13
|
||||
Mcu.Pin11=PD0
|
||||
Mcu.Pin12=PK7
|
||||
Mcu.Pin13=PK6
|
||||
Mcu.Pin14=PK5
|
||||
Mcu.Pin15=PG12
|
||||
Mcu.Pin16=PJ14
|
||||
Mcu.Pin17=PD1
|
||||
Mcu.Pin18=PF0
|
||||
Mcu.Pin19=PI10
|
||||
Mcu.Pin2=PG14
|
||||
Mcu.Pin20=PK4
|
||||
Mcu.Pin21=PK3
|
||||
Mcu.Pin22=PJ15
|
||||
Mcu.Pin23=PI1
|
||||
Mcu.Pin24=PC14/OSC32_IN
|
||||
Mcu.Pin25=PF1
|
||||
Mcu.Pin26=PI12
|
||||
Mcu.Pin27=PI9
|
||||
Mcu.Pin28=PA9
|
||||
Mcu.Pin29=PC15/OSC32_OUT
|
||||
Mcu.Pin3=PE1
|
||||
Mcu.Pin30=PI11
|
||||
Mcu.Pin31=PK1
|
||||
Mcu.Pin32=PK2
|
||||
Mcu.Pin33=PH0/OSC_IN
|
||||
Mcu.Pin34=PF2
|
||||
Mcu.Pin35=PI15
|
||||
Mcu.Pin36=PJ11
|
||||
Mcu.Pin37=PK0
|
||||
Mcu.Pin38=PH1/OSC_OUT
|
||||
Mcu.Pin39=PF3
|
||||
Mcu.Pin4=PE0
|
||||
Mcu.Pin40=PI14
|
||||
Mcu.Pin41=PJ8
|
||||
Mcu.Pin42=PJ10
|
||||
Mcu.Pin43=PG8
|
||||
Mcu.Pin44=PF4
|
||||
Mcu.Pin45=PH5
|
||||
Mcu.Pin46=PH3
|
||||
Mcu.Pin47=PJ7
|
||||
Mcu.Pin48=PJ9
|
||||
Mcu.Pin49=PF5
|
||||
Mcu.Pin5=PG13
|
||||
Mcu.Pin50=PH2
|
||||
Mcu.Pin51=PJ6
|
||||
Mcu.Pin52=PD15
|
||||
Mcu.Pin53=PD10
|
||||
Mcu.Pin54=PD14
|
||||
Mcu.Pin55=PD9
|
||||
Mcu.Pin56=PD8
|
||||
Mcu.Pin57=PC1
|
||||
Mcu.Pin58=PB2
|
||||
Mcu.Pin59=PF12
|
||||
Mcu.Pin6=PB7
|
||||
Mcu.Pin60=PG1
|
||||
Mcu.Pin61=PF15
|
||||
Mcu.Pin62=PJ4
|
||||
Mcu.Pin63=PD12
|
||||
Mcu.Pin64=PD13
|
||||
Mcu.Pin65=PJ5
|
||||
Mcu.Pin66=PA1
|
||||
Mcu.Pin67=PC4
|
||||
Mcu.Pin68=PF13
|
||||
Mcu.Pin69=PG0
|
||||
Mcu.Pin7=PB6
|
||||
Mcu.Pin70=PJ3
|
||||
Mcu.Pin71=PE8
|
||||
Mcu.Pin72=PD11
|
||||
Mcu.Pin73=PG5
|
||||
Mcu.Pin74=PG4
|
||||
Mcu.Pin75=PA2
|
||||
Mcu.Pin76=PC5
|
||||
Mcu.Pin77=PF14
|
||||
Mcu.Pin78=PJ2
|
||||
Mcu.Pin79=PF11
|
||||
Mcu.Pin8=PG15
|
||||
Mcu.Pin80=PE9
|
||||
Mcu.Pin81=PE11
|
||||
Mcu.Pin82=PE14
|
||||
Mcu.Pin83=PA7
|
||||
Mcu.Pin84=PJ0
|
||||
Mcu.Pin85=PJ1
|
||||
Mcu.Pin86=PE7
|
||||
Mcu.Pin87=PE10
|
||||
Mcu.Pin88=PE12
|
||||
Mcu.Pin89=PE15
|
||||
Mcu.Pin9=PG11
|
||||
Mcu.Pin90=PE13
|
||||
Mcu.Pin91=VP_DMA2D_VS_DMA2D
|
||||
Mcu.Pin92=VP_LWIP_VS_Enabled
|
||||
Mcu.Pin93=VP_SYS_VS_Systick
|
||||
Mcu.PinsNb=94
|
||||
Mcu.ThirdPartyNb=0
|
||||
Mcu.UserConstants=
|
||||
Mcu.UserName=STM32F746NGHx
|
||||
@@ -182,6 +189,10 @@ PA7.Signal=ETH_CRS_DV
|
||||
PA9.Locked=true
|
||||
PA9.Mode=Asynchronous
|
||||
PA9.Signal=USART1_TX
|
||||
PB2.Mode=Single Bank 1
|
||||
PB2.Signal=QUADSPI_CLK
|
||||
PB6.Mode=Single Bank 1
|
||||
PB6.Signal=QUADSPI_BK1_NCS
|
||||
PB7.Mode=Asynchronous
|
||||
PB7.Signal=USART1_RX
|
||||
PC1.Mode=RMII
|
||||
@@ -197,6 +208,15 @@ PC5.Signal=ETH_RXD1
|
||||
PD0.Signal=FMC_D2_DA2
|
||||
PD1.Signal=FMC_D3_DA3
|
||||
PD10.Signal=FMC_D15_DA15
|
||||
PD11.Locked=true
|
||||
PD11.Mode=Single Bank 1
|
||||
PD11.Signal=QUADSPI_BK1_IO0
|
||||
PD12.Locked=true
|
||||
PD12.Mode=Single Bank 1
|
||||
PD12.Signal=QUADSPI_BK1_IO1
|
||||
PD13.Locked=true
|
||||
PD13.Mode=Single Bank 1
|
||||
PD13.Signal=QUADSPI_BK1_IO3
|
||||
PD14.Signal=FMC_D0_DA0
|
||||
PD15.Signal=FMC_D1_DA1
|
||||
PD8.Signal=FMC_D13_DA13
|
||||
@@ -209,6 +229,8 @@ PE12.Signal=FMC_D9_DA9
|
||||
PE13.Signal=FMC_D10_DA10
|
||||
PE14.Signal=FMC_D11_DA11
|
||||
PE15.Signal=FMC_D12_DA12
|
||||
PE2.Mode=Single Bank 1
|
||||
PE2.Signal=QUADSPI_BK1_IO2
|
||||
PE4.Mode=RGB888
|
||||
PE4.Signal=LTDC_B0
|
||||
PE7.Signal=FMC_D4_DA4
|
||||
@@ -369,6 +391,12 @@ ProjectManager.TargetToolchain=STM32CubeIDE
|
||||
ProjectManager.ToolChainLocation=
|
||||
ProjectManager.UnderRoot=true
|
||||
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-true,3-MX_LTDC_Init-LTDC-false-HAL-true,4-MX_USART1_UART_Init-USART1-false-HAL-true,5-MX_DMA2D_Init-DMA2D-false-HAL-true,6-MX_FMC_Init-FMC-false-HAL-true,7-MX_LWIP_Init-LWIP-false-HAL-false,0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true
|
||||
QUADSPI.ChipSelectHighTime=QSPI_CS_HIGH_TIME_6_CYCLE
|
||||
QUADSPI.ClockPrescaler=1
|
||||
QUADSPI.FifoThreshold=4
|
||||
QUADSPI.FlashSize=16
|
||||
QUADSPI.IPParameters=ClockPrescaler,FifoThreshold,SampleShifting,FlashSize,ChipSelectHighTime
|
||||
QUADSPI.SampleShifting=QSPI_SAMPLE_SHIFTING_HALFCYCLE
|
||||
RCC.AHBFreq_Value=200000000
|
||||
RCC.APB1CLKDivider=RCC_HCLK_DIV4
|
||||
RCC.APB1Freq_Value=50000000
|
||||
@@ -514,4 +542,3 @@ VP_SYS_VS_Systick.Mode=SysTick
|
||||
VP_SYS_VS_Systick.Signal=SYS_VS_Systick
|
||||
board=STM32F746G-DISCO
|
||||
boardIOC=true
|
||||
isbadioc=false
|
||||
|
||||
Reference in New Issue
Block a user