*
This commit is contained in:
+263
@@ -0,0 +1,263 @@
|
||||
<!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 Evaluation Board 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 STM32 Evaluation Board 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
|
||||
2012 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/logo.bmp" 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">
|
||||
<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;">Contents<o:p></o:p></span></h2>
|
||||
<ol style="margin-top: 0cm;" start="1" type="1">
|
||||
<li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-size: 10pt; font-family: Verdana;"><a href="#History">STM32 Evaluation Board Common Drivers
|
||||
update History</a><o:p></o:p></span></li>
|
||||
<li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-size: 10pt; font-family: Verdana;"><a href="#License">License</a><o:p></o:p></span></li>
|
||||
</ol>
|
||||
<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;">STM32 Evaluation Board Common Drivers 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: 167px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V5.0.2 / 05-March-2012<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="margin-top: 0cm;" type="square"><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-size: 10pt; font-family: Verdana;">All source files: license disclaimer text update and add link to the License file on ST Internet.</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: 176px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V5.0.1 / 28-December-2011<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="margin-top: 0cm;" type="square"><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><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: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V5.0.0 / 30-September-2011<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="margin-top: 0cm;" type="square"><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">Update STM32 Evaluation Board Drivers architecture and folder organization, <span style="font-weight: bold; font-style: italic;">full API compatibility maintained vs. V4.6.2</span></span></li><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">All the HW drivers required for each board are provided within this board folder</span><span style="font-size: 10pt; font-family: Verdana;">. The concerned drivers are:</span></li><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic;">stm32_eval_i2c_ee.c\.h:</span> I2C M24CXX EEPROM memory driver</span></li><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic;">stm32_eval_i2c_tsensor.c\.h:</span> </span><span style="font-size: 10pt; font-family: Verdana;">I2C </span><span style="font-size: 10pt; font-family: Verdana;">LM75 temperature sensor driver</span></li><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic;">stm32_eval_spi_flash.c\.h:</span> SPI M25Pxxx FLASH memory driver</span></li><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic;">stm32_eval_sdio_sd.c\.h:</span> SDIO SD Card memory driver</span></li><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic;">stm32_eval_spi_sd.c\.h:</span> </span><span style="font-size: 10pt; font-family: Verdana;">SPI SD Card memory driver </span></li><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">These drivers were moved from </span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic;">\Common</span> to </span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic;">\STM32XXX_EVAL</span> folder(s)</span></li></ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic;">\Common </span></span><span style="font-size: 10pt; font-family: Verdana;">folder contains only drivers for the fonts and log module used by the LCD driver</span></li><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic;">stm32_eval.c\.h</span> files removed, <span style="font-style: italic; text-decoration: underline;">as consequence you need to perform the following update on your project configuration (based on EVAL drivers V4.6.2):</span></span></li><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">In the project files, add your EVAL board driver source file </span><span style="font-size: 10pt; font-family: Verdana;">(ex. <span style="font-style: italic;">"stm3210c_eval.c"</span>) instead of <span style="font-style: italic;">"stm32_eval.c"</span></span></li><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">Include your EVAL board driver header file (ex. <span style="font-style: italic;">#include "stm3210c_eval.h"</span>) instead of <span style="font-style: italic;">#include "stm32_eval.h"</span></span></li><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">If
|
||||
you are using the EVAL board's LCD, you need to add the include of
|
||||
the LCD header file (ex: #include "stm3210c_eval_lcd.h")</span></li><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">If
|
||||
you are using the LCD log module, after copying it to the application
|
||||
folder you have to edit it and update the name of the LCD header file. For more details, refer to the <span style="font-style: italic;">lcd_log_conf_template.h</span> driver description.<br></span></li></ul></ul></ul></ul><span style="font-size: 10pt; font-family: Verdana;"></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: 175px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V4.6.2 / 22-July-2011<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="margin-top: 0cm;" type="square"><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">STM3210C_EVAL</span></li><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">stm3210c_eval_lcd.c: update to support new LCD AM240320D5TOQW01H (controller ILI9325)</span></li></ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">STM322xG-EVAL</span></li><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">stm322xg_eval.h: fix value of the SDIO clock divider (<span style="font-style: italic;">SDIO_TRANSFER_CLK_DIV</span> constant) to 2 instead of 0</span></li></ul><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">stm322xg_eval_lcd.c: increase FSMC<span style="font-style: italic;"> AddressSetupTime</span> value from 1 to 3 to be compliant with some LCD access timing</span></li></ul><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">stm322xg_eval_audio_codec.c: update <span style="font-style: italic;">Codec_CtrlInterface_Init(</span>) and <span style="font-style: italic;">Codec_GPIO_Init(</span>) functions to not reconfigure the I2C peripheral if it's already </span><span style="font-size: 10pt; font-family: Verdana;">enabled and </span><span style="font-size: 10pt; font-family: Verdana;">configured (to
|
||||
avoid configuring the I2C twice when using both Audio codec and IO
|
||||
Expander drivers in the same application).</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: 167px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V4.6.1 / 18-April-2011<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="margin-top: 0cm;" type="square"><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">Update </span><span style="font-size: 10pt; font-family: Verdana;">some</span><span style="font-size: 10pt; font-family: Verdana;"> <span style="font-weight: bold; font-style: italic;">STM322xG_EVAL</span> drivers (no change on the API) to fix warnings wit<span style="font-weight: bold; font-style: italic;"></span>h TASKING C compiler.</span></li><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">Change the Release Notes name to <span style="font-weight: bold; font-style: italic;">STM32 Evaluation Board Drivers </span><br></span></li><li style="font-style: italic;" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">stm322xg_eval.c</span></li><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">SD_LowLevel_Init(): change SDIO pins speed configuration to "GPIO_Speed_25MHz"</span></li></ul></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: 167px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V4.6.0 / 11-March-2011<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="margin-top: 0cm;" type="square"><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">Official version supporting <span style="font-weight: bold; font-style: italic;">STM322xG_EVAL</span> evaluation board RevB (for <span style="font-weight: bold; font-style: italic;">STM32F2xx</span> devices).</span></li><li style="font-style: italic;" class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">Common</span></li><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">Add
|
||||
new LCD log utility drivers: The LCD Log module allows to automatically
|
||||
set a header and footer on any application using the LCD display and
|
||||
allows to dump user, debug and error messages by using the following
|
||||
macros: LCD_ErrLog(), LCD_UsrLog() and LCD_DbgLog().</span></li></ul></ul><div style="margin-left: 40px;"><span style="font-size: 10pt; font-family: Verdana;"><span style="text-decoration: underline; font-style: italic;">Note</span><span style="font-style: italic;">:</span> the <span style="font-style: italic;">STM322xG_EVAL</span> board RevA was wrongly named <span style="font-style: italic;">STM3220F_EVAL</span></span><br></div><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: 167px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V4.5.0 / 07-March-2011<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="margin-top: 0cm;" type="square"><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">stm32_eval_sdio_sd.c\.h: driver improvement</span></li><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">SD Clock increased to 24MHz to improve the data transfer performance.</span></li><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">Add
|
||||
new functions to check the SDIO peripheral and SD Card status at any
|
||||
time: SD_WaitReadOperation(), SD_WaitWriteOperation(). The
|
||||
software sequence is little bit changed but without any impact on
|
||||
driver API. For more details, refer to the stm32_eval_sdio_sd.c
|
||||
driver description.</span></li><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">Add
|
||||
new structure containing the SD Status register parameters. This
|
||||
structure is called by the
|
||||
|
||||
SD_SendSDStatus() function.</span></li><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">Transfers mode updated</span></li><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">Read/Write Block using Polling and DMA modes</span></li><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">Read/Write Multi Blocks using DMA mode only</span></li><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">Interrupt mode removed</span></li></ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">Data transfer functions are managing only fixed Block size (512-byte) </span></li></ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">STM32100B-EVAL</span></li><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">stm32100b_eval_cec.c: fix some strict ANSI-C errors</span><span style="font-size: 10pt; font-family: Verdana;"></span></li></ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">STM32100E-EVAL</span></li><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">stm32100e_eval_cec.c: fix some strict ANSI-C errors<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: 167px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V4.4.0 / 31-December-2010<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="margin-top: 0cm;" type="square"><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">Add new directory for STM32L152-EVAL board containing the following files:</span></li><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">stm32l152_eval.h/.c, </span><span style="font-size: 10pt; font-family: Verdana;">stm32l152</span><span style="font-size: 10pt; font-family: Verdana;">_eval_lcd.h/.c, stm32l152_eval_glass_lcd.h</span><span style="font-size: 10pt; font-family: Verdana;">/.c, </span><span style="font-size: 10pt; font-family: Verdana;">stm32l152_eval_i2c_ee</span><span style="font-size: 10pt; font-family: Verdana;">.h/.c</span></li></ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">Add support for the STM32100E-EVAL Rev B: SPI FLASH CS pin "sFLASH_CS_PIN" changed from PB.02 to PE.06.</span></li><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">stm32100e_eval_lcd.h/.c: Add support for "LCD_ILI9325" LCD controller.</span></li><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">stm32100e_eval_fsmc_onenand.h/.c driver updated to correct asynchronous and synchronous read operations procedures.<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: 558.05pt;"><span style="font-size: 10pt; font-family: Arial; color: white;">4.3.0
|
||||
- 10/15/2010</span></h3>
|
||||
<ol style="margin-top: 0in;" start="1" type="1"><li class="MsoNormal" style=""><b><i><span style="font-size: 10pt; font-family: Verdana;">General</span></i></b><i><span style="font-size: 10pt; font-family: Verdana;"> </span></i><i><span style="font-size: 10pt;"><o:p></o:p></span></i></li></ol>
|
||||
|
||||
<ul style="margin-top: 0in;" type="disc"><li class="MsoNormal" style=""><span style="font-size: 10pt; font-family: Verdana;">I2C EEPROM, </span><span style="font-size: 10pt; font-family: Verdana;">Temperature Sensor and </span><span style="font-size: 10pt; font-family: Verdana;">IOE Expander</span><span style="font-size: 10pt; font-family: Verdana;"> drivers updated to </span><span style="font-size: 10pt; font-family: Verdana;">use the DMA for read/write transfer and add more robustness</span></li><li class="MsoNormal" style=""><span style="font-size: 10pt; font-family: Verdana;">SD Card (SDIO) driver updated to </span><span style="font-size: 10pt; font-family: Verdana;">add more robustness</span></li><li class="MsoNormal" style=""><span style="font-size: 10pt; font-family: Verdana;">SPI Flash and </span><span style="font-size: 10pt; font-family: Verdana;">SD Card (SPI) drivers: SPI MISO pin configuration changed to Input Floating </span></li></ul>
|
||||
|
||||
|
||||
|
||||
<ol style="margin-top: 0in;" start="2" type="1"><li class="MsoNormal" style=""><b><i><span style="font-size: 10pt; font-family: Verdana;">Utilities</span></i></b><b><i><span style="font-size: 10pt;"><o:p></o:p></span></i></b></li></ol>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="margin-top: 0in;" type="circle"><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">Add new directory for STM32100E-EVAL board containing the following files:</span></li><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">stm32100e_eval.h/.c,
|
||||
stm32100e_eval_lcd.h/.c, stm32100e_eval_cec.h/.c,
|
||||
stm32100e_eval_fsmc_onenand.h/.c, stm32100e_eval_fsmc_sram.h/.c,
|
||||
stm32100e_eval_ioe.h/.c</span><br>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic;"></span></span></li></ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">Common</span></li><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">stm32_eval_sdio_sd.c:
|
||||
Update the DMA End of Transfer Check loop inside the SD_ReadBlock(),
|
||||
SD_WriteBlock(), SD_ReadMultiBlocks() and SD_Write MultiBlocks().</span></li></ul><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic;">stm32_eval_i2c_ee.c/.h</span> <br>
|
||||
</span></li></ul><ul><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">Enhanced sEE_WaitEepromStandbyState() function for more robustness.</span></li><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">Enhanced Read and Write operations to manage I2C limitations.</span></li><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">Add Timeout management with user callback implementation which allows recovering from I2C bus errors.</span></li><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">Add
|
||||
critical sections user callbacks allowing to disable then enable
|
||||
interrupts when I2C operation require to be not interrupted.</span></li></ul></ul><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic;">stm32_eval_i2c_tsensor.c/.h</span> <br>
|
||||
</span></li></ul><ul><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">Enhanced I2C communication functions by using DMA for registers Read and Write operations.</span></li><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">Add Timeout management with user callback implementation which allows recovering from I2C bus errors.</span></li></ul></ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">STM32100B_EVAL</span></li><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">stm32100b_eval.h: Add LM75 DMA defines.</span></li></ul><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">stm32100b_eval_lcd.c: </span><span style="font-size: 10pt; font-family: Verdana;">Change "SPI_FLASH" by "sFLASH" in LCD_DrawBMP() function.</span></li></ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">STM3210B_EVAL</span></li><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">stm3210b_eval.h: Add LM75 DMA defines.</span></li></ul><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">stm3210b_eval_lcd.c: </span><span style="font-size: 10pt; font-family: Verdana;">Change "SPI_FLASH" by "sFLASH" in LCD_DrawBMP() function.</span></li></ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">STM3210C_EVAL</span></li><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">stm3210c_eval.h: Add EEPROM driver Timeout define.</span></li></ul><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">stm3210c_eval_lcd.c: </span><span style="font-size: 10pt; font-family: Verdana;">Change "SPI_FLASH" by "sFLASH" in LCD_DrawBMP() function.</span></li></ul><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">stm3210c_eval_i2c_ioe.c</span></li><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">Enhanced I2C communication functions by using DMA for registers Read and Write operations.</span></li></ul><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">Add Timeout management with user callback implementation which allows recovering from I2C bus errors.</span></li><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">change IOE_I2C_SPEED from "400000" to "300000".</span></li></ul></ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;">STM3210E_EVAL</span></li><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">stm3210e_eval.c: change "void SD_WaitForDMAEndOfTransfer(void)" to "uint32_t SD_DMAEndOfTransferStatus(void)".</span></li></ul><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">stm3210e_eval.h: Add LM75 DMA defines.</span></li></ul><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">stm3210e_eval_fsmc_nand.h: remove "NAND_CMD_AREA_TRUE1" define.</span></li></ul><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">stm3210e_eval_fsmc_nand.c: Update FSMC timing in NAND_Init() function to be aligned with AN2784 application note.</span></li></ul><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">stm3210e_eval_fsmc_nor.c</span></li><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">NOR</span><span style="font-size: 10pt; font-family: Verdana;">_Init() function: add FSMC_AsynchronousWait field to FSMC_NORSRAMInitStructure </span></li></ul></ul><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">stm3210e_eval_fsmc_sram.c<br>
|
||||
</span></li></ul><ul><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">Update FSMC timing in SRAM_Init() function to be aligned with AN2784 application note.</span><br>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span></li></ul><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">SRAM_Init() function: add FSMC_AsynchronousWait field to FSMC_NORSRAMInitStructure </span></li></ul></ul><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">stm3210e_eval_lcd.c</span></li><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">LCD_FSMCConfig() function: add FSMC_AsynchronousWait field to FSMC_NORSRAMInitStructure </span></li></ul></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: 558.05pt;"><span style="font-size: 10pt; font-family: Arial; color: white;">4.2.0
|
||||
- 04/16/2010</span></h3>
|
||||
<ol style="margin-top: 0in;" start="1" type="1"><li class="MsoNormal" style=""><b><i><span style="font-size: 10pt; font-family: Verdana;">General</span></i></b><i><span style="font-size: 10pt; font-family: Verdana;"> </span></i><i><span style="font-size: 10pt;"><o:p></o:p></span></i></li></ol>
|
||||
|
||||
<ul style="margin-top: 0in;" type="disc"><li class="MsoNormal" style=""><span style="font-size: 10pt; font-family: Verdana;">I2C EEPROM driver
|
||||
update to </span><span style="font-size: 10pt; font-family: Verdana;">use the DMA to
|
||||
perform data transfer to/from EEPROM memory.</span><span style="font-size: 10pt; font-family: Verdana;"> </span><span style="font-size: 10pt;"><o:p></o:p></span></li></ul>
|
||||
|
||||
<ol style="margin-top: 0in;" start="2" type="1"><li class="MsoNormal" style=""><b><i><span style="font-size: 10pt; font-family: Verdana;">Utilities</span></i></b><b><i><span style="font-size: 10pt;"><o:p></o:p></span></i></b></li></ol>
|
||||
<ul style="margin-top: 0in;" type="disc"><li class="MsoNormal" style=""><i><u><span style="font-size: 10pt; font-family: Verdana;">STM32_EVAL</span></u></i><u><span style="font-size: 10pt;"><o:p></o:p></span></u></li></ul>
|
||||
<ul style="margin-top: 0in;" type="disc"><ul style="margin-top: 0in;" type="circle"><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic;">stm32_eval_i2c_ee.c</span>:
|
||||
updated to use the DMA to perform data transfer to/from
|
||||
EEPROM memory. For more details, refer to the description provided
|
||||
within this file.</span></li><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic;">stm3210c_eval.c</span>: add low level
|
||||
functions to configure the DMA (needed for I2C EEPROM driver)<br>
|
||||
</span></li><li class="MsoNormal" style=""><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic;">stm3210c_eval_ioe.c</span>: add a delay
|
||||
in IOE_TS_GetState() function to wait till the end of ADC
|
||||
conversion</span></li><li class="MsoNormal" style=""><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic;">stm3210e_eval_fsmc_nor.c</span>: add </span><span style="font-size: 10pt; font-family: Verdana;">PD6 pin </span><span style="font-size: 10pt; font-family: Verdana;">configuration in
|
||||
NOR_Init() function</span></li><li class="MsoNormal" style=""><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic;">stm3210b_eval_lcd.c</span>: remove the
|
||||
second ";" from "static void PutPixel(int16_t x, int16_t y);;" </span><span style="font-size: 10pt; font-family: Verdana;"></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: 558.05pt;"><span style="font-size: 10pt; font-family: Arial; color: white;">4.1.0
|
||||
- 03/01/2010</span></h3>
|
||||
<ol style="margin-top: 0in;" start="1" type="1"><li class="MsoNormal" style=""><b><i><span style="font-size: 10pt; font-family: Verdana;">General</span></i></b><i><span style="font-size: 10pt; font-family: Verdana;"> </span></i><i><span style="font-size: 10pt;"><o:p></o:p></span></i></li></ol>
|
||||
<ul style="margin-top: 0in;" type="disc"><li class="MsoNormal" style=""><span style="font-size: 10pt; font-family: Verdana;">Add support
|
||||
for <b>STM32 Low-density Value line (STM32F100x4/6) and
|
||||
Medium-density Value line (STM32F100x8/B) devices</b>.</span></li><li class="MsoNormal" style=""><span style="font-size: 10pt; font-family: Verdana;">Add support for the
|
||||
STMicroelectronics STM32100B-EVAL evaluation board. </span><span style="font-size: 10pt;"><o:p></o:p></span></li></ul>
|
||||
<ol style="margin-top: 0in;" start="2" type="1"><li class="MsoNormal" style=""><b><i><span style="font-size: 10pt; font-family: Verdana;">Utilities</span></i></b><b><i><span style="font-size: 10pt;"><o:p></o:p></span></i></b></li></ol>
|
||||
<ul style="margin-top: 0in;" type="disc"><li class="MsoNormal" style=""><i><u><span style="font-size: 10pt; font-family: Verdana;">STM32_EVAL</span></u></i><u><span style="font-size: 10pt;"><o:p></o:p></span></u></li></ul>
|
||||
<ul style="margin-top: 0in;" type="circle"><li class="MsoNormal" style=""><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;">Add new directory
|
||||
"Common" containing a common drivers for all STM32 evaluation boards:
|
||||
fonts.h/.c, stm32_eval_i2c_ee.h/.c, </span><span style="font-size: 10pt; font-family: Verdana;">stm32_eval_spi_flash.h/.c,
|
||||
</span><span style="font-size: 10pt; font-family: Verdana;">stm32_eval_i2c_tsensor.h/.c,
|
||||
</span><span style="font-size: 10pt; font-family: Verdana;">stm32_eval_spi_sd.h/.c
|
||||
and </span><span style="font-size: 10pt; font-family: Verdana;">stm32_eval_sdio_sd.h/.c</span></li><li class="MsoNormal" style=""><span style="font-size: 10pt; font-family: Verdana;">Add new driver for the
|
||||
STM32100B-EVAL managing Leds, push button and COM ports.</span></li><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">New HDMI CEC High level
|
||||
driver.</span><br>
|
||||
</li><li class="MsoNormal" style=""><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic;"></span>For all LCD drivers new fonts has
|
||||
been added.</span></li><li class="MsoNormal" style=""><span style="font-size: 10pt; font-family: Verdana;">New FSMC memories
|
||||
drivers for STM3210E-EVAL board: stm3210e_eval_fsmc_sram.h/.c, </span><span style="font-size: 10pt; font-family: Verdana;">stm3210e_eval_fsmc_nor.h/.c
|
||||
and </span><span style="font-size: 10pt; font-family: Verdana;">stm3210e_eval_fsmc_nand.h/.c.</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></h2>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;">Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); You may not use this </span><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;">package</span><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;"> except in compliance with the License. You may obtain a copy of the License at:<br><br></span></p><div style="text-align: center;"><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;"> <a target="_blank" href="http://www.st.com/software_license_agreement_liberty_v2">http://www.st.com/software_license_agreement_liberty_v2</a></span><br><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;"></span></div><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;"><br>Unless
|
||||
required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS, <br>WITHOUT
|
||||
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
|
||||
the License for the specific language governing permissions and
|
||||
limitations under the License.</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><a target="_blank" href="http://www.st.com/internet/mcu/family/141.jsp"><u><span style="color: blue;">www.st.com</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>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,124 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file fonts.h
|
||||
* @author MCD Application Team
|
||||
* @version V5.0.2
|
||||
* @date 05-March-2012
|
||||
* @brief Header for fonts.c file
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT 2012 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at:
|
||||
*
|
||||
* http://www.st.com/software_license_agreement_liberty_v2
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* 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 uint16_t *table;
|
||||
uint16_t Width;
|
||||
uint16_t Height;
|
||||
|
||||
} sFONT;
|
||||
|
||||
extern sFONT Font16x24;
|
||||
extern sFONT Font12x12;
|
||||
extern sFONT Font8x12;
|
||||
extern sFONT Font8x8;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup FONTS_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
#define LINE(x) ((x) * (((sFONT *)LCD_GetFont())->Height))
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup FONTS_Exported_Macros
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup FONTS_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __FONTS_H */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,528 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file lcd_log.c
|
||||
* @author MCD Application Team
|
||||
* @version V5.0.2
|
||||
* @date 05-March-2012
|
||||
* @brief This file provides all the LCD Log firmware functions.
|
||||
*
|
||||
* The LCD Log module allows to automatically set a header and footer
|
||||
* on any application using the LCD display and allows to dump user,
|
||||
* debug and error messages by using the following macros: LCD_ErrLog(),
|
||||
* LCD_UsrLog() and LCD_DbgLog().
|
||||
*
|
||||
* It supports also the scroll feature by embedding an internal software
|
||||
* cache for display. This feature allows to dump message sequentially
|
||||
* on the display even if the number of displayed lines is bigger than
|
||||
* the total number of line allowed by the display.
|
||||
*
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT 2012 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at:
|
||||
*
|
||||
* http://www.st.com/software_license_agreement_liberty_v2
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "lcd_log.h"
|
||||
|
||||
/** @addtogroup Utilities
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32_EVAL
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Common
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup LCD_LOG
|
||||
* @brief LCD Log LCD_Application module
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup LCD_LOG_Private_Types
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
/** @defgroup LCD_LOG_Private_Defines
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
/** @defgroup LCD_LOG_Private_Macros
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
/** @defgroup LCD_LOG_Private_Variables
|
||||
* @{
|
||||
*/
|
||||
|
||||
LCD_LOG_line LCD_CacheBuffer [LCD_CACHE_DEPTH];
|
||||
uint16_t LCD_LineColor;
|
||||
uint16_t LCD_CacheBuffer_xptr;
|
||||
uint16_t LCD_CacheBuffer_yptr_top;
|
||||
uint16_t LCD_CacheBuffer_yptr_bottom;
|
||||
|
||||
uint16_t LCD_CacheBuffer_yptr_top_bak;
|
||||
uint16_t LCD_CacheBuffer_yptr_bottom_bak;
|
||||
|
||||
FunctionalState LCD_CacheBuffer_yptr_invert;
|
||||
FunctionalState LCD_ScrollActive;
|
||||
FunctionalState LCD_Lock;
|
||||
FunctionalState LCD_Scrolled;
|
||||
uint16_t LCD_ScrollBackStep;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
/** @defgroup LCD_LOG_Private_FunctionPrototypes
|
||||
* @{
|
||||
*/
|
||||
static void LCD_LOG_UpdateDisplay (void);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
/** @defgroup LCD_LOG_Private_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @brief Init the LCD Log module
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
|
||||
void LCD_LOG_Init ( void)
|
||||
{
|
||||
/* Deinit LCD cache */
|
||||
LCD_LOG_DeInit();
|
||||
/* Clear the LCD */
|
||||
LCD_Clear(Black);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DeInitializes the LCD Log module.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void LCD_LOG_DeInit(void)
|
||||
{
|
||||
LCD_LineColor = LCD_LOG_DEFAULT_COLOR;
|
||||
LCD_CacheBuffer_xptr = 0;
|
||||
LCD_CacheBuffer_yptr_top = 0;
|
||||
LCD_CacheBuffer_yptr_bottom = 0;
|
||||
|
||||
LCD_CacheBuffer_yptr_top_bak = 0;
|
||||
LCD_CacheBuffer_yptr_bottom_bak = 0;
|
||||
|
||||
LCD_CacheBuffer_yptr_invert= ENABLE;
|
||||
LCD_ScrollActive = DISABLE;
|
||||
LCD_Lock = DISABLE;
|
||||
LCD_Scrolled = DISABLE;
|
||||
LCD_ScrollBackStep = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Display the application header (title) on the LCD screen
|
||||
* @param Title : pointer to the string to be displayed
|
||||
* @retval None
|
||||
*/
|
||||
void LCD_LOG_SetHeader (uint8_t *Title)
|
||||
{
|
||||
sFONT *cFont;
|
||||
uint32_t size = 0 , idx;
|
||||
uint8_t *ptr = Title;
|
||||
uint8_t tmp[27];
|
||||
|
||||
/* center the header */
|
||||
while (*ptr++) size ++ ;
|
||||
|
||||
/* truncate extra text */
|
||||
if(size > 26)
|
||||
{
|
||||
size = 26;
|
||||
}
|
||||
|
||||
for (idx = 0 ; idx < 27 ; idx ++)
|
||||
{
|
||||
tmp[idx] = ' ';
|
||||
}
|
||||
|
||||
for (idx = 0 ; idx < size ; idx ++)
|
||||
{
|
||||
tmp[idx + (27 - size)/2] = Title[idx];
|
||||
}
|
||||
|
||||
/* Clear the LCD */
|
||||
LCD_Clear(Black);
|
||||
|
||||
/* Set the LCD Font */
|
||||
LCD_SetFont (&Font12x12);
|
||||
|
||||
cFont = LCD_GetFont();
|
||||
/* Set the LCD Text Color */
|
||||
LCD_SetTextColor(White);
|
||||
LCD_SetBackColor(Blue);
|
||||
LCD_ClearLine(0);
|
||||
LCD_DisplayStringLine(cFont->Height, tmp);
|
||||
LCD_ClearLine(2 * cFont->Height);
|
||||
|
||||
LCD_SetBackColor(Black);
|
||||
LCD_SetFont (&Font8x12);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Display the application footer (status) on the LCD screen
|
||||
* @param Status : pointer to the string to be displayed
|
||||
* @retval None
|
||||
*/
|
||||
void LCD_LOG_SetFooter(uint8_t *Status)
|
||||
{
|
||||
sFONT *cFont;
|
||||
uint8_t tmp[40], i;
|
||||
LCD_SetBackColor(Blue);
|
||||
cFont = LCD_GetFont();
|
||||
|
||||
for (i= 0; i< (320/cFont->Width)-1 ; i++)
|
||||
{
|
||||
tmp[i] = ' ';
|
||||
}
|
||||
|
||||
tmp[(320/cFont->Width)-1] = 0;
|
||||
LCD_DisplayStringLine(LCD_PIXEL_HEIGHT - cFont->Height, tmp);
|
||||
LCD_DisplayStringLine(LCD_PIXEL_HEIGHT - cFont->Height, Status);
|
||||
LCD_SetBackColor(Black);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clear the Text Zone
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void LCD_LOG_ClearTextZone(void)
|
||||
{
|
||||
uint8_t i=0;
|
||||
sFONT *cFont = LCD_GetFont();
|
||||
|
||||
for (i= 0 ; i < YWINDOW_SIZE; i++)
|
||||
{
|
||||
LCD_ClearLine((i + YWINDOW_MIN) * cFont->Height);
|
||||
}
|
||||
|
||||
LCD_LOG_DeInit();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Redirect the printf to the lcd
|
||||
* @param c: character to be displayed
|
||||
* @param f: output file pointer
|
||||
* @retval None
|
||||
*/
|
||||
PUTCHAR_PROTOTYPE
|
||||
{
|
||||
|
||||
sFONT *cFont = LCD_GetFont();
|
||||
uint32_t idx;
|
||||
|
||||
if(LCD_Lock == DISABLE)
|
||||
{
|
||||
if((LCD_ScrollActive == ENABLE)||(LCD_ScrollActive == ENABLE))
|
||||
{
|
||||
LCD_CacheBuffer_yptr_bottom = LCD_CacheBuffer_yptr_bottom_bak;
|
||||
LCD_CacheBuffer_yptr_top = LCD_CacheBuffer_yptr_top_bak;
|
||||
LCD_ScrollActive = DISABLE;
|
||||
LCD_Scrolled = DISABLE;
|
||||
LCD_ScrollBackStep = 0;
|
||||
|
||||
}
|
||||
|
||||
if(( LCD_CacheBuffer_xptr < LCD_PIXEL_WIDTH /cFont->Width ) && ( ch != '\n'))
|
||||
{
|
||||
LCD_CacheBuffer[LCD_CacheBuffer_yptr_bottom].line[LCD_CacheBuffer_xptr++] = (uint16_t)ch;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(LCD_CacheBuffer_yptr_top >= LCD_CacheBuffer_yptr_bottom)
|
||||
{
|
||||
|
||||
if(LCD_CacheBuffer_yptr_invert == DISABLE)
|
||||
{
|
||||
LCD_CacheBuffer_yptr_top++;
|
||||
|
||||
if(LCD_CacheBuffer_yptr_top == LCD_CACHE_DEPTH)
|
||||
{
|
||||
LCD_CacheBuffer_yptr_top = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LCD_CacheBuffer_yptr_invert= DISABLE;
|
||||
}
|
||||
}
|
||||
|
||||
for(idx = LCD_CacheBuffer_xptr ; idx < LCD_PIXEL_WIDTH /cFont->Width; idx++)
|
||||
{
|
||||
LCD_CacheBuffer[LCD_CacheBuffer_yptr_bottom].line[LCD_CacheBuffer_xptr++] = ' ';
|
||||
}
|
||||
LCD_CacheBuffer[LCD_CacheBuffer_yptr_bottom].color = LCD_LineColor;
|
||||
|
||||
LCD_CacheBuffer_xptr = 0;
|
||||
|
||||
LCD_LOG_UpdateDisplay ();
|
||||
|
||||
LCD_CacheBuffer_yptr_bottom ++;
|
||||
|
||||
if (LCD_CacheBuffer_yptr_bottom == LCD_CACHE_DEPTH)
|
||||
{
|
||||
LCD_CacheBuffer_yptr_bottom = 0;
|
||||
LCD_CacheBuffer_yptr_top = 1;
|
||||
LCD_CacheBuffer_yptr_invert = ENABLE;
|
||||
}
|
||||
|
||||
if( ch != '\n')
|
||||
{
|
||||
LCD_CacheBuffer[LCD_CacheBuffer_yptr_bottom].line[LCD_CacheBuffer_xptr++] = (uint16_t)ch;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return ch;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Update the text area display
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void LCD_LOG_UpdateDisplay (void)
|
||||
{
|
||||
uint8_t cnt = 0 ;
|
||||
uint16_t length = 0 ;
|
||||
uint16_t ptr = 0, index = 0;
|
||||
|
||||
sFONT *cFont = LCD_GetFont();
|
||||
|
||||
if((LCD_CacheBuffer_yptr_bottom < (YWINDOW_SIZE -1)) &&
|
||||
(LCD_CacheBuffer_yptr_bottom >= LCD_CacheBuffer_yptr_top))
|
||||
{
|
||||
LCD_SetTextColor(LCD_CacheBuffer[cnt + LCD_CacheBuffer_yptr_bottom].color);
|
||||
LCD_DisplayStringLine ((YWINDOW_MIN + LCD_CacheBuffer_yptr_bottom) * cFont->Height,
|
||||
(uint8_t *)(LCD_CacheBuffer[cnt + LCD_CacheBuffer_yptr_bottom].line));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if(LCD_CacheBuffer_yptr_bottom < LCD_CacheBuffer_yptr_top)
|
||||
{
|
||||
/* Virtual length for rolling */
|
||||
length = LCD_CACHE_DEPTH + LCD_CacheBuffer_yptr_bottom ;
|
||||
}
|
||||
else
|
||||
{
|
||||
length = LCD_CacheBuffer_yptr_bottom;
|
||||
}
|
||||
|
||||
ptr = length - YWINDOW_SIZE + 1;
|
||||
|
||||
for (cnt = 0 ; cnt < YWINDOW_SIZE ; cnt ++)
|
||||
{
|
||||
|
||||
index = (cnt + ptr )% LCD_CACHE_DEPTH ;
|
||||
|
||||
LCD_SetTextColor(LCD_CacheBuffer[index].color);
|
||||
LCD_DisplayStringLine ((cnt + YWINDOW_MIN) * cFont->Height,
|
||||
(uint8_t *)(LCD_CacheBuffer[index].line));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#ifdef LCD_SCROLL_ENABLED
|
||||
/**
|
||||
* @brief Display previous text frame
|
||||
* @param None
|
||||
* @retval Status
|
||||
*/
|
||||
ErrorStatus LCD_LOG_ScrollBack (void)
|
||||
{
|
||||
|
||||
if(LCD_ScrollActive == DISABLE)
|
||||
{
|
||||
|
||||
LCD_CacheBuffer_yptr_bottom_bak = LCD_CacheBuffer_yptr_bottom;
|
||||
LCD_CacheBuffer_yptr_top_bak = LCD_CacheBuffer_yptr_top;
|
||||
|
||||
|
||||
if(LCD_CacheBuffer_yptr_bottom > LCD_CacheBuffer_yptr_top)
|
||||
{
|
||||
|
||||
if ((LCD_CacheBuffer_yptr_bottom - LCD_CacheBuffer_yptr_top) <= YWINDOW_SIZE)
|
||||
{
|
||||
LCD_Lock = DISABLE;
|
||||
return ERROR;
|
||||
}
|
||||
}
|
||||
LCD_ScrollActive = ENABLE;
|
||||
|
||||
if((LCD_CacheBuffer_yptr_bottom > LCD_CacheBuffer_yptr_top)&&
|
||||
(LCD_Scrolled == DISABLE ))
|
||||
{
|
||||
LCD_CacheBuffer_yptr_bottom--;
|
||||
LCD_Scrolled = ENABLE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(LCD_ScrollActive == ENABLE)
|
||||
{
|
||||
LCD_Lock = ENABLE;
|
||||
|
||||
if(LCD_CacheBuffer_yptr_bottom > LCD_CacheBuffer_yptr_top)
|
||||
{
|
||||
|
||||
if((LCD_CacheBuffer_yptr_bottom - LCD_CacheBuffer_yptr_top) < YWINDOW_SIZE )
|
||||
{
|
||||
LCD_Lock = DISABLE;
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
LCD_CacheBuffer_yptr_bottom --;
|
||||
}
|
||||
else if(LCD_CacheBuffer_yptr_bottom <= LCD_CacheBuffer_yptr_top)
|
||||
{
|
||||
|
||||
if((LCD_CACHE_DEPTH - LCD_CacheBuffer_yptr_top + LCD_CacheBuffer_yptr_bottom) < YWINDOW_SIZE)
|
||||
{
|
||||
LCD_Lock = DISABLE;
|
||||
return ERROR;
|
||||
}
|
||||
LCD_CacheBuffer_yptr_bottom --;
|
||||
|
||||
if(LCD_CacheBuffer_yptr_bottom == 0xFFFF)
|
||||
{
|
||||
LCD_CacheBuffer_yptr_bottom = LCD_CACHE_DEPTH - 2;
|
||||
}
|
||||
}
|
||||
LCD_ScrollBackStep++;
|
||||
LCD_LOG_UpdateDisplay();
|
||||
LCD_Lock = DISABLE;
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Display next text frame
|
||||
* @param None
|
||||
* @retval Status
|
||||
*/
|
||||
ErrorStatus LCD_LOG_ScrollForward (void)
|
||||
{
|
||||
|
||||
if(LCD_ScrollBackStep != 0)
|
||||
{
|
||||
if(LCD_ScrollActive == DISABLE)
|
||||
{
|
||||
|
||||
LCD_CacheBuffer_yptr_bottom_bak = LCD_CacheBuffer_yptr_bottom;
|
||||
LCD_CacheBuffer_yptr_top_bak = LCD_CacheBuffer_yptr_top;
|
||||
|
||||
if(LCD_CacheBuffer_yptr_bottom > LCD_CacheBuffer_yptr_top)
|
||||
{
|
||||
|
||||
if ((LCD_CacheBuffer_yptr_bottom - LCD_CacheBuffer_yptr_top) <= YWINDOW_SIZE)
|
||||
{
|
||||
LCD_Lock = DISABLE;
|
||||
return ERROR;
|
||||
}
|
||||
}
|
||||
LCD_ScrollActive = ENABLE;
|
||||
|
||||
if((LCD_CacheBuffer_yptr_bottom > LCD_CacheBuffer_yptr_top)&&
|
||||
(LCD_Scrolled == DISABLE ))
|
||||
{
|
||||
LCD_CacheBuffer_yptr_bottom--;
|
||||
LCD_Scrolled = ENABLE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(LCD_ScrollActive == ENABLE)
|
||||
{
|
||||
LCD_Lock = ENABLE;
|
||||
LCD_ScrollBackStep--;
|
||||
|
||||
if(++LCD_CacheBuffer_yptr_bottom == LCD_CACHE_DEPTH)
|
||||
{
|
||||
LCD_CacheBuffer_yptr_bottom = 0;
|
||||
}
|
||||
|
||||
LCD_LOG_UpdateDisplay();
|
||||
LCD_Lock = DISABLE;
|
||||
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
else // LCD_ScrollBackStep == 0
|
||||
{
|
||||
LCD_Lock = DISABLE;
|
||||
return ERROR;
|
||||
}
|
||||
}
|
||||
#endif /* LCD_SCROLL_ENABLED */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,160 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file lcd_log.h
|
||||
* @author MCD Application Team
|
||||
* @version V5.0.2
|
||||
* @date 05-March-2012
|
||||
* @brief header for the lcd_log.c file
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT 2012 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at:
|
||||
*
|
||||
* http://www.st.com/software_license_agreement_liberty_v2
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __LCD_LOG_H__
|
||||
#define __LCD_LOG_H__
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
|
||||
#include "lcd_log_conf.h"
|
||||
|
||||
/** @addtogroup Utilities
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32_EVAL
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Common
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup LCD_LOG
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup LCD_LOG
|
||||
* @brief
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/** @defgroup LCD_LOG_Exported_Defines
|
||||
* @{
|
||||
*/
|
||||
#ifdef __GNUC__
|
||||
/* With GCC/RAISONANCE, small printf (option LD Linker->Libraries->Small printf
|
||||
set to 'Yes') calls __io_putchar() */
|
||||
#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
|
||||
#else
|
||||
#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
/** These value can be changed by user */
|
||||
|
||||
#ifdef LCD_SCROLL_ENABLED
|
||||
#define LCD_CACHE_DEPTH (YWINDOW_SIZE + CACHE_SIZE)
|
||||
#else
|
||||
#define LCD_CACHE_DEPTH YWINDOW_SIZE
|
||||
#endif
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LCD_LOG_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
typedef struct _LCD_LOG_line
|
||||
{
|
||||
uint8_t line[XWINDOW_MAX];
|
||||
uint16_t color;
|
||||
|
||||
}LCD_LOG_line;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LCD_LOG_Exported_Macros
|
||||
* @{
|
||||
*/
|
||||
#define LCD_ErrLog(...) LCD_LineColor = Red;\
|
||||
printf("ERROR: ") ;\
|
||||
printf(__VA_ARGS__);\
|
||||
LCD_LineColor = LCD_LOG_DEFAULT_COLOR
|
||||
|
||||
#define LCD_UsrLog(...) LCD_LineColor = LCD_LOG_DEFAULT_COLOR;\
|
||||
printf(__VA_ARGS__);\
|
||||
|
||||
|
||||
#define LCD_DbgLog(...) LCD_LineColor = Cyan;\
|
||||
printf(__VA_ARGS__);\
|
||||
LCD_LineColor = LCD_LOG_DEFAULT_COLOR
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LCD_LOG_Exported_Variables
|
||||
* @{
|
||||
*/
|
||||
extern uint16_t LCD_LineColor;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LCD_LOG_Exported_FunctionsPrototype
|
||||
* @{
|
||||
*/
|
||||
void LCD_LOG_Init(void);
|
||||
void LCD_LOG_DeInit(void);
|
||||
void LCD_LOG_SetHeader(uint8_t *Title);
|
||||
void LCD_LOG_SetFooter(uint8_t *Status);
|
||||
void LCD_LOG_ClearTextZone(void);
|
||||
#ifdef LCD_SCROLL_ENABLED
|
||||
ErrorStatus LCD_LOG_ScrollBack(void);
|
||||
ErrorStatus LCD_LOG_ScrollForward(void);
|
||||
#endif
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
#endif /* __LCD_LOG_H__ */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file lcd_log_conf_template.h
|
||||
* @author MCD Application Team
|
||||
* @version V5.0.2
|
||||
* @date 05-March-2012
|
||||
* @brief lcd_log configuration template file.
|
||||
* This file should be copied to the application folder and modified
|
||||
* as follows:
|
||||
* - Rename it to 'lcd_log_conf.h'.
|
||||
* - Update the name of the LCD header file depending on the EVAL board
|
||||
* you are using (see line32 below).
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT 2012 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at:
|
||||
*
|
||||
* http://www.st.com/software_license_agreement_liberty_v2
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __LCD_LOG_CONF_H__
|
||||
#define __LCD_LOG_CONF_H__
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32xxx_eval_lcd.h" /* replace 'stm32xxx' with your EVAL board name, ex: stm3210c_eval_lcd.h */
|
||||
#include <stdio.h>
|
||||
|
||||
/** @addtogroup LCD_LOG
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup LCD_LOG
|
||||
* @brief This file is the
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/** @defgroup LCD_LOG_CONF_Exported_Defines
|
||||
* @{
|
||||
*/
|
||||
/* Comment the line below to disable the scroll back and forward features */
|
||||
#define LCD_SCROLL_ENABLED
|
||||
|
||||
/* Define the LCD default text color */
|
||||
#define LCD_LOG_DEFAULT_COLOR LCD_COLOR_WHITE
|
||||
|
||||
/* Define the display window settings */
|
||||
#define YWINDOW_MIN 3
|
||||
#define YWINDOW_SIZE 12
|
||||
#define XWINDOW_MAX 50
|
||||
|
||||
/* Define the cache depth */
|
||||
#define CACHE_SIZE 50
|
||||
|
||||
/** @defgroup LCD_LOG_CONF_Exported_TypesDefinitions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
/** @defgroup LCD_LOG_Exported_Macros
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LCD_LOG_CONF_Exported_Variables
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LCD_LOG_CONF_Exported_FunctionsPrototype
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
#endif /* __LCD_LOG_H__ */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
+208
@@ -0,0 +1,208 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32_eval_legacy.h
|
||||
* @author MCD Application Team
|
||||
* @version V5.0.2
|
||||
* @date 05-March-2012
|
||||
* @brief This file contains defines legacy for STM32 EVAL drivers.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT 2012 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at:
|
||||
*
|
||||
* http://www.st.com/software_license_agreement_liberty_v2
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __STM32_EVAL_LEGACY_H
|
||||
#define __STM32_EVAL_LEGACY_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
/* STM322xG_EVAL Defines Legacy */
|
||||
#ifdef USE_STM3220F_EVAL
|
||||
#define USE_STM322xG_EVAL
|
||||
#endif
|
||||
#define STM3220F_LCD_Init STM322xG_LCD_Init
|
||||
|
||||
/* Button Defines Legacy */
|
||||
#define Button_WAKEUP BUTTON_WAKEUP
|
||||
#define Button_TAMPER BUTTON_TAMPER
|
||||
#define Button_KEY BUTTON_KEY
|
||||
#define Button_RIGHT BUTTON_RIGHT
|
||||
#define Button_LEFT BUTTON_LEFT
|
||||
#define Button_UP BUTTON_UP
|
||||
#define Button_DOWN BUTTON_DOWN
|
||||
#define Button_SEL BUTTON_SEL
|
||||
#define Mode_GPIO BUTTON_MODE_GPIO
|
||||
#define Mode_EXTI BUTTON_MODE_EXTI
|
||||
#define Button_Mode_TypeDef ButtonMode_TypeDef
|
||||
#define JOY_CENTER JOY_SEL
|
||||
#define JOY_State_TypeDef JOYState_TypeDef
|
||||
|
||||
/* LCD Defines Legacy */
|
||||
#define LCD_RSNWR_GPIO_CLK LCD_NWR_GPIO_CLK
|
||||
#define LCD_SPI_GPIO_PORT LCD_SPI_SCK_GPIO_PORT
|
||||
#define LCD_SPI_GPIO_CLK LCD_SPI_SCK_GPIO_CLK
|
||||
#define R0 LCD_REG_0
|
||||
#define R1 LCD_REG_1
|
||||
#define R2 LCD_REG_2
|
||||
#define R3 LCD_REG_3
|
||||
#define R4 LCD_REG_4
|
||||
#define R5 LCD_REG_5
|
||||
#define R6 LCD_REG_6
|
||||
#define R7 LCD_REG_7
|
||||
#define R8 LCD_REG_8
|
||||
#define R9 LCD_REG_9
|
||||
#define R10 LCD_REG_10
|
||||
#define R12 LCD_REG_12
|
||||
#define R13 LCD_REG_13
|
||||
#define R14 LCD_REG_14
|
||||
#define R15 LCD_REG_15
|
||||
#define R16 LCD_REG_16
|
||||
#define R17 LCD_REG_17
|
||||
#define R18 LCD_REG_18
|
||||
#define R19 LCD_REG_19
|
||||
#define R20 LCD_REG_20
|
||||
#define R21 LCD_REG_21
|
||||
#define R22 LCD_REG_22
|
||||
#define R23 LCD_REG_23
|
||||
#define R24 LCD_REG_24
|
||||
#define R25 LCD_REG_25
|
||||
#define R26 LCD_REG_26
|
||||
#define R27 LCD_REG_27
|
||||
#define R28 LCD_REG_28
|
||||
#define R29 LCD_REG_29
|
||||
#define R30 LCD_REG_30
|
||||
#define R31 LCD_REG_31
|
||||
#define R32 LCD_REG_32
|
||||
#define R33 LCD_REG_33
|
||||
#define R34 LCD_REG_34
|
||||
#define R36 LCD_REG_36
|
||||
#define R37 LCD_REG_37
|
||||
#define R40 LCD_REG_40
|
||||
#define R41 LCD_REG_41
|
||||
#define R43 LCD_REG_43
|
||||
#define R45 LCD_REG_45
|
||||
#define R48 LCD_REG_48
|
||||
#define R49 LCD_REG_49
|
||||
#define R50 LCD_REG_50
|
||||
#define R51 LCD_REG_51
|
||||
#define R52 LCD_REG_52
|
||||
#define R53 LCD_REG_53
|
||||
#define R54 LCD_REG_54
|
||||
#define R55 LCD_REG_55
|
||||
#define R56 LCD_REG_56
|
||||
#define R57 LCD_REG_57
|
||||
#define R59 LCD_REG_59
|
||||
#define R60 LCD_REG_60
|
||||
#define R61 LCD_REG_61
|
||||
#define R62 LCD_REG_62
|
||||
#define R63 LCD_REG_63
|
||||
#define R64 LCD_REG_64
|
||||
#define R65 LCD_REG_65
|
||||
#define R66 LCD_REG_66
|
||||
#define R67 LCD_REG_67
|
||||
#define R68 LCD_REG_68
|
||||
#define R69 LCD_REG_69
|
||||
#define R70 LCD_REG_70
|
||||
#define R71 LCD_REG_71
|
||||
#define R72 LCD_REG_72
|
||||
#define R73 LCD_REG_73
|
||||
#define R74 LCD_REG_74
|
||||
#define R75 LCD_REG_75
|
||||
#define R76 LCD_REG_76
|
||||
#define R77 LCD_REG_77
|
||||
#define R78 LCD_REG_78
|
||||
#define R79 LCD_REG_79
|
||||
#define R80 LCD_REG_80
|
||||
#define R81 LCD_REG_81
|
||||
#define R82 LCD_REG_82
|
||||
#define R83 LCD_REG_83
|
||||
#define R96 LCD_REG_96
|
||||
#define R97 LCD_REG_97
|
||||
#define R106 LCD_REG_106
|
||||
#define R118 LCD_REG_118
|
||||
#define R128 LCD_REG_128
|
||||
#define R129 LCD_REG_129
|
||||
#define R130 LCD_REG_130
|
||||
#define R131 LCD_REG_131
|
||||
#define R132 LCD_REG_132
|
||||
#define R133 LCD_REG_133
|
||||
#define R134 LCD_REG_134
|
||||
#define R135 LCD_REG_135
|
||||
#define R136 LCD_REG_136
|
||||
#define R137 LCD_REG_137
|
||||
#define R139 LCD_REG_139
|
||||
#define R140 LCD_REG_140
|
||||
#define R141 LCD_REG_141
|
||||
#define R143 LCD_REG_143
|
||||
#define R144 LCD_REG_144
|
||||
#define R145 LCD_REG_145
|
||||
#define R146 LCD_REG_146
|
||||
#define R147 LCD_REG_147
|
||||
#define R148 LCD_REG_148
|
||||
#define R149 LCD_REG_149
|
||||
#define R150 LCD_REG_150
|
||||
#define R151 LCD_REG_151
|
||||
#define R152 LCD_REG_152
|
||||
#define R153 LCD_REG_153
|
||||
#define R154 LCD_REG_154
|
||||
#define R157 LCD_REG_157
|
||||
#define R192 LCD_REG_192
|
||||
#define R193 LCD_REG_193
|
||||
#define R227 LCD_REG_227
|
||||
#define R229 LCD_REG_229
|
||||
#define R231 LCD_REG_231
|
||||
#define R239 LCD_REG_239
|
||||
#define White LCD_COLOR_WHITE
|
||||
#define Black LCD_COLOR_BLACK
|
||||
#define Grey LCD_COLOR_GREY
|
||||
#define Blue LCD_COLOR_BLUE
|
||||
#define Blue2 LCD_COLOR_BLUE2
|
||||
#define Red LCD_COLOR_RED
|
||||
#define Magenta LCD_COLOR_MAGENTA
|
||||
#define Green LCD_COLOR_GREEN
|
||||
#define Cyan LCD_COLOR_CYAN
|
||||
#define Yellow LCD_COLOR_YELLOW
|
||||
#define Line0 LCD_LINE_0
|
||||
#define Line1 LCD_LINE_1
|
||||
#define Line2 LCD_LINE_2
|
||||
#define Line3 LCD_LINE_3
|
||||
#define Line4 LCD_LINE_4
|
||||
#define Line5 LCD_LINE_5
|
||||
#define Line6 LCD_LINE_6
|
||||
#define Line7 LCD_LINE_7
|
||||
#define Line8 LCD_LINE_8
|
||||
#define Line9 LCD_LINE_9
|
||||
#define Horizontal LCD_DIR_HORIZONTAL
|
||||
#define Vertical LCD_DIR_VERTICAL
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __STM32_EVAL_LEGACY_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
+160
@@ -0,0 +1,160 @@
|
||||
<!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 STM3240_41_G_EVAL Evaluation Board 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 STM3240_41_G_EVAL Evaluation Board 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
|
||||
2012 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/logo.bmp" 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">
|
||||
<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;">Contents<o:p></o:p></span></h2>
|
||||
<ol style="margin-top: 0cm;" start="1" type="1">
|
||||
<li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-size: 10pt; font-family: Verdana;"><a href="#History">STM3240_41_G_EVAL Evaluation Board Drivers
|
||||
update History</a><o:p></o:p></span></li>
|
||||
<li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-size: 10pt; font-family: Verdana;"><a href="#License">License</a><o:p></o:p></span></li>
|
||||
</ol>
|
||||
<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;">STM3240_41_G_EVAL Evaluation Board Drivers 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: 167px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.2 / 05-March-2012<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="margin-top: 0cm;" type="square"><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-size: 10pt; font-family: Verdana;">All source files: license disclaimer text update and add link to the License file on ST Internet.</span></li><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-size: 10pt; font-family: Verdana;">stm324xg_eval_lcd.c</span></li><ul><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-size: 10pt; font-family: Verdana;">Enhance Gamma Curve settings for ILI9320 controller </span></li></ul><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-size: 10pt; font-family: Verdana;">stm324xg_eval.c and stm324xg_eval_ioe.c</span></li><ul><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-size: 10pt; font-family: Verdana;">Swap
|
||||
the order of I2C IOs and alternate function (AF)
|
||||
configuration: AF configuration should be done before to configure the
|
||||
IOs.</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: 176px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.1 / 28-December-2011<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="margin-top: 0cm;" type="square"><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-size: 10pt; font-family: Verdana;">All source files: update disclaimer to add reference to the new license agreement</span></li><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-size: 10pt; font-family: Verdana;">stm324xg_eval_lcd.c</span></li><ul><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;">Remove “static” from <span style="font-style: italic;">TextColor</span> and <span style="font-style: italic;">BackColor</span> variables declaration (need to be changed from other application modules) </span></li></ul><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-size: 10pt; font-family: Verdana;">stm324xg_eval_ioe.h</span></li><ul><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-size: 10pt; font-family: Verdana;">Add
|
||||
conditional compilation on the default DMA stream(s) used for I2C1 Tx
|
||||
and Rx transfers, to allow user to change them from application level.</span></li></ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">stm322xg_eval_sdio_sd.h</span></li><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic;">SD_CardInfo</span> structure, define <span style="font-style: italic;">CardCapacity</span> variable as 64-bit long (instead of 32-bit) to support SDHC memory cards with capacity greater than 4 GB.</span></li></ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">stm324xg_eval_fsmc_sram.c</span></li><ul><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">Add IOs config of missing FSMC address lines (FSMC_A21, FSMC_A22 and FSMC_A23). </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: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0 / 30-September-2011</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="margin-top: 0cm;" type="square"><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">First official release </span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-weight: bold; font-style: italic;"></span></span><span style="font-size: 10pt; font-family: Verdana;">for <span style="font-weight: bold; font-style: italic;">STM3240_41_G_EVAL</span> board RevB drivers</span></li><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;">stm322xg_eval_lcd.c: increase FSMC<span style="font-style: italic;"> AddressSetupTime</span> value from 4 to 5 to be compliant with some LCD access timing</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: 200px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0RC1 / 26-September-2011</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="margin-top: 0cm;" type="square"><li class="MsoNormal"><span style="font-size: 10pt; font-family: Verdana;">Official version (V1.0.0) Release Candidate1<span style="font-weight: bold; font-style: italic;"> </span></span><span style="font-size: 10pt; font-family: Verdana;">for <span style="font-weight: bold; font-style: italic;">STM3240_41_G_EVAL</span> board RevB drivers</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></h2>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;">Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); You may not use this </span><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;">package</span><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;"> except in compliance with the License. You may obtain a copy of the License at:<br><br></span></p><div style="text-align: center;"><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;"> <a target="_blank" href="http://www.st.com/software_license_agreement_liberty_v2">http://www.st.com/software_license_agreement_liberty_v2</a></span><br><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;"></span></div><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;"><br>Unless
|
||||
required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS, <br>WITHOUT
|
||||
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
|
||||
the License for the specific language governing permissions and
|
||||
limitations under the License.</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><a target="_blank" href="http://www.st.com/internet/mcu/family/141.jsp"><u><span style="color: blue;">www.st.com</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>
|
||||
+552
@@ -0,0 +1,552 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm324xg_eval.c
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.2
|
||||
* @date 05-March-2012
|
||||
* @brief This file provides
|
||||
* - set of firmware functions to manage Leds, push-button and COM ports
|
||||
* - low level initialization functions for SD card (on SDIO) and
|
||||
* serial EEPROM (sEE)
|
||||
* available on STM324xG-EVAL evaluation board(MB786) RevB from
|
||||
* STMicroelectronics.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT 2012 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at:
|
||||
*
|
||||
* http://www.st.com/software_license_agreement_liberty_v2
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm324xg_eval.h"
|
||||
#include "stm32f4xx_sdio.h"
|
||||
#include "stm32f4xx_dma.h"
|
||||
#include "stm32f4xx_i2c.h"
|
||||
|
||||
/** @addtogroup Utilities
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32_EVAL
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM324xG_EVAL
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup STM324xG_EVAL_LOW_LEVEL
|
||||
* @brief This file provides firmware functions to manage Leds, push-buttons,
|
||||
* COM ports, SD card on SDIO and serial EEPROM (sEE) available on
|
||||
* STM324xG-EVAL evaluation board from STMicroelectronics.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup STM324xG_EVAL_LOW_LEVEL_Private_TypesDefinitions
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
/** @defgroup STM324xG_EVAL_LOW_LEVEL_Private_Defines
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
/** @defgroup STM324xG_EVAL_LOW_LEVEL_Private_Macros
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
/** @defgroup STM324xG_EVAL_LOW_LEVEL_Private_Variables
|
||||
* @{
|
||||
*/
|
||||
GPIO_TypeDef* GPIO_PORT[LEDn] = {LED1_GPIO_PORT, LED2_GPIO_PORT, LED3_GPIO_PORT,
|
||||
LED4_GPIO_PORT};
|
||||
const uint16_t GPIO_PIN[LEDn] = {LED1_PIN, LED2_PIN, LED3_PIN,
|
||||
LED4_PIN};
|
||||
const uint32_t GPIO_CLK[LEDn] = {LED1_GPIO_CLK, LED2_GPIO_CLK, LED3_GPIO_CLK,
|
||||
LED4_GPIO_CLK};
|
||||
|
||||
GPIO_TypeDef* BUTTON_PORT[BUTTONn] = {WAKEUP_BUTTON_GPIO_PORT, 0,
|
||||
KEY_BUTTON_GPIO_PORT};
|
||||
|
||||
const uint16_t BUTTON_PIN[BUTTONn] = {WAKEUP_BUTTON_PIN, 0,
|
||||
KEY_BUTTON_PIN};
|
||||
|
||||
const uint32_t BUTTON_CLK[BUTTONn] = {WAKEUP_BUTTON_GPIO_CLK, 0,
|
||||
KEY_BUTTON_GPIO_CLK};
|
||||
|
||||
const uint16_t BUTTON_EXTI_LINE[BUTTONn] = {WAKEUP_BUTTON_EXTI_LINE,
|
||||
0,
|
||||
KEY_BUTTON_EXTI_LINE};
|
||||
|
||||
const uint16_t BUTTON_PORT_SOURCE[BUTTONn] = {WAKEUP_BUTTON_EXTI_PORT_SOURCE,
|
||||
0,
|
||||
KEY_BUTTON_EXTI_PORT_SOURCE};
|
||||
|
||||
const uint16_t BUTTON_PIN_SOURCE[BUTTONn] = {WAKEUP_BUTTON_EXTI_PIN_SOURCE,
|
||||
0,
|
||||
KEY_BUTTON_EXTI_PIN_SOURCE};
|
||||
const uint16_t BUTTON_IRQn[BUTTONn] = {WAKEUP_BUTTON_EXTI_IRQn, 0,
|
||||
KEY_BUTTON_EXTI_IRQn};
|
||||
|
||||
USART_TypeDef* COM_USART[COMn] = {EVAL_COM1};
|
||||
|
||||
GPIO_TypeDef* COM_TX_PORT[COMn] = {EVAL_COM1_TX_GPIO_PORT};
|
||||
|
||||
GPIO_TypeDef* COM_RX_PORT[COMn] = {EVAL_COM1_RX_GPIO_PORT};
|
||||
|
||||
const uint32_t COM_USART_CLK[COMn] = {EVAL_COM1_CLK};
|
||||
|
||||
const uint32_t COM_TX_PORT_CLK[COMn] = {EVAL_COM1_TX_GPIO_CLK};
|
||||
|
||||
const uint32_t COM_RX_PORT_CLK[COMn] = {EVAL_COM1_RX_GPIO_CLK};
|
||||
|
||||
const uint16_t COM_TX_PIN[COMn] = {EVAL_COM1_TX_PIN};
|
||||
|
||||
const uint16_t COM_RX_PIN[COMn] = {EVAL_COM1_RX_PIN};
|
||||
|
||||
const uint16_t COM_TX_PIN_SOURCE[COMn] = {EVAL_COM1_TX_SOURCE};
|
||||
|
||||
const uint16_t COM_RX_PIN_SOURCE[COMn] = {EVAL_COM1_RX_SOURCE};
|
||||
|
||||
const uint16_t COM_TX_AF[COMn] = {EVAL_COM1_TX_AF};
|
||||
|
||||
const uint16_t COM_RX_AF[COMn] = {EVAL_COM1_RX_AF};
|
||||
|
||||
DMA_InitTypeDef sEEDMA_InitStructure;
|
||||
NVIC_InitTypeDef NVIC_InitStructure;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
/** @defgroup STM324xG_EVAL_LOW_LEVEL_Private_FunctionPrototypes
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM324xG_EVAL_LOW_LEVEL_Private_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Configures LED GPIO.
|
||||
* @param Led: Specifies the Led to be configured.
|
||||
* This parameter can be one of following parameters:
|
||||
* @arg LED1
|
||||
* @arg LED2
|
||||
* @arg LED3
|
||||
* @arg LED4
|
||||
* @retval None
|
||||
*/
|
||||
void STM_EVAL_LEDInit(Led_TypeDef Led)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
|
||||
/* Enable the GPIO_LED Clock */
|
||||
RCC_AHB1PeriphClockCmd(GPIO_CLK[Led], ENABLE);
|
||||
|
||||
|
||||
/* Configure the GPIO_LED pin */
|
||||
GPIO_InitStructure.GPIO_Pin = GPIO_PIN[Led];
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_Init(GPIO_PORT[Led], &GPIO_InitStructure);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Turns selected LED On.
|
||||
* @param Led: Specifies the Led to be set on.
|
||||
* This parameter can be one of following parameters:
|
||||
* @arg LED1
|
||||
* @arg LED2
|
||||
* @arg LED3
|
||||
* @arg LED4
|
||||
* @retval None
|
||||
*/
|
||||
void STM_EVAL_LEDOn(Led_TypeDef Led)
|
||||
{
|
||||
GPIO_PORT[Led]->BSRRL = GPIO_PIN[Led];
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Turns selected LED Off.
|
||||
* @param Led: Specifies the Led to be set off.
|
||||
* This parameter can be one of following parameters:
|
||||
* @arg LED1
|
||||
* @arg LED2
|
||||
* @arg LED3
|
||||
* @arg LED4
|
||||
* @retval None
|
||||
*/
|
||||
void STM_EVAL_LEDOff(Led_TypeDef Led)
|
||||
{
|
||||
GPIO_PORT[Led]->BSRRH = GPIO_PIN[Led];
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Toggles the selected LED.
|
||||
* @param Led: Specifies the Led to be toggled.
|
||||
* This parameter can be one of following parameters:
|
||||
* @arg LED1
|
||||
* @arg LED2
|
||||
* @arg LED3
|
||||
* @arg LED4
|
||||
* @retval None
|
||||
*/
|
||||
void STM_EVAL_LEDToggle(Led_TypeDef Led)
|
||||
{
|
||||
GPIO_PORT[Led]->ODR ^= GPIO_PIN[Led];
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configures Button GPIO and EXTI Line.
|
||||
* @param Button: Specifies the Button to be configured.
|
||||
* This parameter can be one of following parameters:
|
||||
* @arg BUTTON_WAKEUP: Wakeup Push Button
|
||||
* @arg BUTTON_TAMPER: Tamper Push Button
|
||||
* @arg BUTTON_KEY: Key Push Button
|
||||
* @arg BUTTON_RIGHT: Joystick Right Push Button
|
||||
* @arg BUTTON_LEFT: Joystick Left Push Button
|
||||
* @arg BUTTON_UP: Joystick Up Push Button
|
||||
* @arg BUTTON_DOWN: Joystick Down Push Button
|
||||
* @arg BUTTON_SEL: Joystick Sel Push Button
|
||||
* @param Button_Mode: Specifies Button mode.
|
||||
* This parameter can be one of following parameters:
|
||||
* @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
|
||||
* @retval None
|
||||
*/
|
||||
void STM_EVAL_PBInit(Button_TypeDef Button, ButtonMode_TypeDef Button_Mode)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
EXTI_InitTypeDef EXTI_InitStructure;
|
||||
NVIC_InitTypeDef NVIC_InitStructure;
|
||||
|
||||
|
||||
/* Enable the BUTTON Clock */
|
||||
RCC_AHB1PeriphClockCmd(BUTTON_CLK[Button], ENABLE);
|
||||
RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);
|
||||
|
||||
/* Configure Button pin as input */
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
|
||||
GPIO_InitStructure.GPIO_Pin = BUTTON_PIN[Button];
|
||||
GPIO_Init(BUTTON_PORT[Button], &GPIO_InitStructure);
|
||||
|
||||
|
||||
if (Button_Mode == BUTTON_MODE_EXTI)
|
||||
{
|
||||
/* Connect Button EXTI Line to Button GPIO Pin */
|
||||
SYSCFG_EXTILineConfig(BUTTON_PORT_SOURCE[Button], BUTTON_PIN_SOURCE[Button]);
|
||||
|
||||
/* Configure Button EXTI line */
|
||||
EXTI_InitStructure.EXTI_Line = BUTTON_EXTI_LINE[Button];
|
||||
EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
|
||||
|
||||
if(Button != BUTTON_WAKEUP)
|
||||
{
|
||||
EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling;
|
||||
}
|
||||
else
|
||||
{
|
||||
EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising;
|
||||
}
|
||||
EXTI_InitStructure.EXTI_LineCmd = ENABLE;
|
||||
EXTI_Init(&EXTI_InitStructure);
|
||||
|
||||
/* Enable and set Button EXTI Interrupt to the lowest priority */
|
||||
NVIC_InitStructure.NVIC_IRQChannel = BUTTON_IRQn[Button];
|
||||
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x0F;
|
||||
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x0F;
|
||||
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
|
||||
|
||||
NVIC_Init(&NVIC_InitStructure);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns the selected Button state.
|
||||
* @param Button: Specifies the Button to be checked.
|
||||
* This parameter can be one of following parameters:
|
||||
* @arg BUTTON_WAKEUP: Wakeup Push Button
|
||||
* @arg BUTTON_TAMPER: Tamper Push Button
|
||||
* @arg BUTTON_KEY: Key Push Button
|
||||
* @arg BUTTON_RIGHT: Joystick Right Push Button
|
||||
* @arg BUTTON_LEFT: Joystick Left Push Button
|
||||
* @arg BUTTON_UP: Joystick Up Push Button
|
||||
* @arg BUTTON_DOWN: Joystick Down Push Button
|
||||
* @arg BUTTON_SEL: Joystick Sel Push Button
|
||||
* @retval The Button GPIO pin value.
|
||||
*/
|
||||
uint32_t STM_EVAL_PBGetState(Button_TypeDef Button)
|
||||
{
|
||||
return GPIO_ReadInputDataBit(BUTTON_PORT[Button], BUTTON_PIN[Button]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Configures COM port.
|
||||
* @param COM: Specifies the COM port to be configured.
|
||||
* This parameter can be one of following parameters:
|
||||
* @arg COM1
|
||||
* @arg COM2
|
||||
* @param USART_InitStruct: pointer to a USART_InitTypeDef structure that
|
||||
* contains the configuration information for the specified USART peripheral.
|
||||
* @retval None
|
||||
*/
|
||||
void STM_EVAL_COMInit(COM_TypeDef COM, USART_InitTypeDef* USART_InitStruct)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
|
||||
/* Enable GPIO clock */
|
||||
RCC_AHB1PeriphClockCmd(COM_TX_PORT_CLK[COM] | COM_RX_PORT_CLK[COM], ENABLE);
|
||||
|
||||
if (COM == COM1)
|
||||
{
|
||||
/* Enable UART clock */
|
||||
RCC_APB1PeriphClockCmd(COM_USART_CLK[COM], ENABLE);
|
||||
}
|
||||
|
||||
/* Connect PXx to USARTx_Tx*/
|
||||
GPIO_PinAFConfig(COM_TX_PORT[COM], COM_TX_PIN_SOURCE[COM], COM_TX_AF[COM]);
|
||||
|
||||
/* Connect PXx to USARTx_Rx*/
|
||||
GPIO_PinAFConfig(COM_RX_PORT[COM], COM_RX_PIN_SOURCE[COM], COM_RX_AF[COM]);
|
||||
|
||||
/* Configure USART Tx as alternate function */
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
|
||||
|
||||
GPIO_InitStructure.GPIO_Pin = COM_TX_PIN[COM];
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_Init(COM_TX_PORT[COM], &GPIO_InitStructure);
|
||||
|
||||
/* Configure USART Rx as alternate function */
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
|
||||
GPIO_InitStructure.GPIO_Pin = COM_RX_PIN[COM];
|
||||
GPIO_Init(COM_RX_PORT[COM], &GPIO_InitStructure);
|
||||
|
||||
/* USART configuration */
|
||||
USART_Init(COM_USART[COM], USART_InitStruct);
|
||||
|
||||
/* Enable USART */
|
||||
USART_Cmd(COM_USART[COM], ENABLE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DeInitializes the SDIO interface.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void SD_LowLevel_DeInit(void)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
|
||||
/*!< Disable SDIO Clock */
|
||||
SDIO_ClockCmd(DISABLE);
|
||||
|
||||
/*!< Set Power State to OFF */
|
||||
SDIO_SetPowerState(SDIO_PowerState_OFF);
|
||||
|
||||
/*!< DeInitializes the SDIO peripheral */
|
||||
SDIO_DeInit();
|
||||
|
||||
/* Disable the SDIO APB2 Clock */
|
||||
RCC_APB2PeriphClockCmd(RCC_APB2Periph_SDIO, DISABLE);
|
||||
|
||||
GPIO_PinAFConfig(GPIOC, GPIO_PinSource8, GPIO_AF_MCO);
|
||||
GPIO_PinAFConfig(GPIOC, GPIO_PinSource9, GPIO_AF_MCO);
|
||||
GPIO_PinAFConfig(GPIOC, GPIO_PinSource10, GPIO_AF_MCO);
|
||||
GPIO_PinAFConfig(GPIOC, GPIO_PinSource11, GPIO_AF_MCO);
|
||||
GPIO_PinAFConfig(GPIOC, GPIO_PinSource12, GPIO_AF_MCO);
|
||||
GPIO_PinAFConfig(GPIOD, GPIO_PinSource2, GPIO_AF_MCO);
|
||||
|
||||
/* Configure PC.08, PC.09, PC.10, PC.11 pins: D0, D1, D2, D3 pins */
|
||||
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10 | GPIO_Pin_11;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
||||
GPIO_Init(GPIOC, &GPIO_InitStructure);
|
||||
|
||||
/* Configure PD.02 CMD line */
|
||||
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2;
|
||||
GPIO_Init(GPIOD, &GPIO_InitStructure);
|
||||
|
||||
/* Configure PC.12 pin: CLK pin */
|
||||
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12;
|
||||
GPIO_Init(GPIOC, &GPIO_InitStructure);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Initializes the SD Card and put it into StandBy State (Ready for
|
||||
* data transfer).
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void SD_LowLevel_Init(void)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
|
||||
/* GPIOC and GPIOD Periph clock enable */
|
||||
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC | RCC_AHB1Periph_GPIOD | SD_DETECT_GPIO_CLK, ENABLE);
|
||||
|
||||
GPIO_PinAFConfig(GPIOC, GPIO_PinSource8, GPIO_AF_SDIO);
|
||||
GPIO_PinAFConfig(GPIOC, GPIO_PinSource9, GPIO_AF_SDIO);
|
||||
GPIO_PinAFConfig(GPIOC, GPIO_PinSource10, GPIO_AF_SDIO);
|
||||
GPIO_PinAFConfig(GPIOC, GPIO_PinSource11, GPIO_AF_SDIO);
|
||||
GPIO_PinAFConfig(GPIOC, GPIO_PinSource12, GPIO_AF_SDIO);
|
||||
GPIO_PinAFConfig(GPIOD, GPIO_PinSource2, GPIO_AF_SDIO);
|
||||
|
||||
/* Configure PC.08, PC.09, PC.10, PC.11 pins: D0, D1, D2, D3 pins */
|
||||
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10 | GPIO_Pin_11;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_25MHz;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
|
||||
GPIO_Init(GPIOC, &GPIO_InitStructure);
|
||||
|
||||
/* Configure PD.02 CMD line */
|
||||
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2;
|
||||
GPIO_Init(GPIOD, &GPIO_InitStructure);
|
||||
|
||||
/* Configure PC.12 pin: CLK pin */
|
||||
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
||||
GPIO_Init(GPIOC, &GPIO_InitStructure);
|
||||
|
||||
/*!< Configure SD_SPI_DETECT_PIN pin: SD Card detect pin */
|
||||
GPIO_InitStructure.GPIO_Pin = SD_DETECT_PIN;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
|
||||
GPIO_Init(SD_DETECT_GPIO_PORT, &GPIO_InitStructure);
|
||||
|
||||
/* Enable the SDIO APB2 Clock */
|
||||
RCC_APB2PeriphClockCmd(RCC_APB2Periph_SDIO, ENABLE);
|
||||
|
||||
/* Enable the DMA2 Clock */
|
||||
RCC_AHB1PeriphClockCmd(SD_SDIO_DMA_CLK, ENABLE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configures the DMA2 Channel4 for SDIO Tx request.
|
||||
* @param BufferSRC: pointer to the source buffer
|
||||
* @param BufferSize: buffer size
|
||||
* @retval None
|
||||
*/
|
||||
void SD_LowLevel_DMA_TxConfig(uint32_t *BufferSRC, uint32_t BufferSize)
|
||||
{
|
||||
DMA_InitTypeDef SDDMA_InitStructure;
|
||||
|
||||
DMA_ClearFlag(SD_SDIO_DMA_STREAM, SD_SDIO_DMA_FLAG_FEIF | SD_SDIO_DMA_FLAG_DMEIF | SD_SDIO_DMA_FLAG_TEIF | SD_SDIO_DMA_FLAG_HTIF | SD_SDIO_DMA_FLAG_TCIF);
|
||||
|
||||
/* DMA2 Stream3 or Stream6 disable */
|
||||
DMA_Cmd(SD_SDIO_DMA_STREAM, DISABLE);
|
||||
|
||||
/* DMA2 Stream3 or Stream6 Config */
|
||||
DMA_DeInit(SD_SDIO_DMA_STREAM);
|
||||
|
||||
SDDMA_InitStructure.DMA_Channel = SD_SDIO_DMA_CHANNEL;
|
||||
SDDMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)SDIO_FIFO_ADDRESS;
|
||||
SDDMA_InitStructure.DMA_Memory0BaseAddr = (uint32_t)BufferSRC;
|
||||
SDDMA_InitStructure.DMA_DIR = DMA_DIR_MemoryToPeripheral;
|
||||
SDDMA_InitStructure.DMA_BufferSize = 0;
|
||||
SDDMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;
|
||||
SDDMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;
|
||||
SDDMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Word;
|
||||
SDDMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_Word;
|
||||
SDDMA_InitStructure.DMA_Mode = DMA_Mode_Normal;
|
||||
SDDMA_InitStructure.DMA_Priority = DMA_Priority_VeryHigh;
|
||||
SDDMA_InitStructure.DMA_FIFOMode = DMA_FIFOMode_Enable;
|
||||
SDDMA_InitStructure.DMA_FIFOThreshold = DMA_FIFOThreshold_Full;
|
||||
SDDMA_InitStructure.DMA_MemoryBurst = DMA_MemoryBurst_INC4;
|
||||
SDDMA_InitStructure.DMA_PeripheralBurst = DMA_PeripheralBurst_INC4;
|
||||
DMA_Init(SD_SDIO_DMA_STREAM, &SDDMA_InitStructure);
|
||||
DMA_ITConfig(SD_SDIO_DMA_STREAM, DMA_IT_TC, ENABLE);
|
||||
DMA_FlowControllerConfig(SD_SDIO_DMA_STREAM, DMA_FlowCtrl_Peripheral);
|
||||
|
||||
/* DMA2 Stream3 or Stream6 enable */
|
||||
DMA_Cmd(SD_SDIO_DMA_STREAM, ENABLE);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configures the DMA2 Channel4 for SDIO Rx request.
|
||||
* @param BufferDST: pointer to the destination buffer
|
||||
* @param BufferSize: buffer size
|
||||
* @retval None
|
||||
*/
|
||||
void SD_LowLevel_DMA_RxConfig(uint32_t *BufferDST, uint32_t BufferSize)
|
||||
{
|
||||
DMA_InitTypeDef SDDMA_InitStructure;
|
||||
|
||||
DMA_ClearFlag(SD_SDIO_DMA_STREAM, SD_SDIO_DMA_FLAG_FEIF | SD_SDIO_DMA_FLAG_DMEIF | SD_SDIO_DMA_FLAG_TEIF | SD_SDIO_DMA_FLAG_HTIF | SD_SDIO_DMA_FLAG_TCIF);
|
||||
|
||||
/* DMA2 Stream3 or Stream6 disable */
|
||||
DMA_Cmd(SD_SDIO_DMA_STREAM, DISABLE);
|
||||
|
||||
/* DMA2 Stream3 or Stream6 Config */
|
||||
DMA_DeInit(SD_SDIO_DMA_STREAM);
|
||||
|
||||
SDDMA_InitStructure.DMA_Channel = SD_SDIO_DMA_CHANNEL;
|
||||
SDDMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)SDIO_FIFO_ADDRESS;
|
||||
SDDMA_InitStructure.DMA_Memory0BaseAddr = (uint32_t)BufferDST;
|
||||
SDDMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralToMemory;
|
||||
SDDMA_InitStructure.DMA_BufferSize = 0;
|
||||
SDDMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;
|
||||
SDDMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;
|
||||
SDDMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Word;
|
||||
SDDMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_Word;
|
||||
SDDMA_InitStructure.DMA_Mode = DMA_Mode_Normal;
|
||||
SDDMA_InitStructure.DMA_Priority = DMA_Priority_VeryHigh;
|
||||
SDDMA_InitStructure.DMA_FIFOMode = DMA_FIFOMode_Enable;
|
||||
SDDMA_InitStructure.DMA_FIFOThreshold = DMA_FIFOThreshold_Full;
|
||||
SDDMA_InitStructure.DMA_MemoryBurst = DMA_MemoryBurst_INC4;
|
||||
SDDMA_InitStructure.DMA_PeripheralBurst = DMA_PeripheralBurst_INC4;
|
||||
DMA_Init(SD_SDIO_DMA_STREAM, &SDDMA_InitStructure);
|
||||
DMA_ITConfig(SD_SDIO_DMA_STREAM, DMA_IT_TC, ENABLE);
|
||||
DMA_FlowControllerConfig(SD_SDIO_DMA_STREAM, DMA_FlowCtrl_Peripheral);
|
||||
|
||||
/* DMA2 Stream3 or Stream6 enable */
|
||||
DMA_Cmd(SD_SDIO_DMA_STREAM, ENABLE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
+299
@@ -0,0 +1,299 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm324xg_eval.h
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.2
|
||||
* @date 05-March-2012
|
||||
* @brief This file contains definitions for STM324xG_EVAL's Leds, push-buttons
|
||||
* and COM ports hardware resources.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT 2012 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at:
|
||||
*
|
||||
* http://www.st.com/software_license_agreement_liberty_v2
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __STM324xG_EVAL_H
|
||||
#define __STM324xG_EVAL_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32f4xx.h"
|
||||
#include "stm32_eval_legacy.h"
|
||||
|
||||
/** @addtogroup Utilities
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32_EVAL
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM324xG_EVAL
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM324xG_EVAL_LOW_LEVEL
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup STM324xG_EVAL_LOW_LEVEL_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
LED1 = 0,
|
||||
LED2 = 1,
|
||||
LED3 = 2,
|
||||
LED4 = 3
|
||||
} Led_TypeDef;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
BUTTON_WAKEUP = 0,
|
||||
BUTTON_TAMPER = 1,
|
||||
BUTTON_KEY = 2,
|
||||
BUTTON_RIGHT = 3,
|
||||
BUTTON_LEFT = 4,
|
||||
BUTTON_UP = 5,
|
||||
BUTTON_DOWN = 6,
|
||||
BUTTON_SEL = 7
|
||||
} Button_TypeDef;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
BUTTON_MODE_GPIO = 0,
|
||||
BUTTON_MODE_EXTI = 1
|
||||
} ButtonMode_TypeDef;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
JOY_NONE = 0,
|
||||
JOY_SEL = 1,
|
||||
JOY_DOWN = 2,
|
||||
JOY_LEFT = 3,
|
||||
JOY_RIGHT = 4,
|
||||
JOY_UP = 5
|
||||
} JOYState_TypeDef
|
||||
;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
COM1 = 0,
|
||||
COM2 = 1
|
||||
} COM_TypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM324xG_EVAL_LOW_LEVEL_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Define for STM324xG_EVAL board
|
||||
*/
|
||||
#if !defined (USE_STM324xG_EVAL)
|
||||
#define USE_STM324xG_EVAL
|
||||
#endif
|
||||
|
||||
/** @addtogroup STM324xG_EVAL_LOW_LEVEL_LED
|
||||
* @{
|
||||
*/
|
||||
#define LEDn 4
|
||||
|
||||
#define LED1_PIN GPIO_Pin_2
|
||||
#define LED1_GPIO_PORT GPIOH
|
||||
#define LED1_GPIO_CLK RCC_AHB1Periph_GPIOH
|
||||
|
||||
#define LED2_PIN GPIO_Pin_3
|
||||
#define LED2_GPIO_PORT GPIOH
|
||||
#define LED2_GPIO_CLK RCC_AHB1Periph_GPIOH
|
||||
|
||||
#define LED3_PIN GPIO_Pin_8
|
||||
#define LED3_GPIO_PORT GPIOI
|
||||
#define LED3_GPIO_CLK RCC_AHB1Periph_GPIOI
|
||||
|
||||
#define LED4_PIN GPIO_Pin_10
|
||||
#define LED4_GPIO_PORT GPIOI
|
||||
#define LED4_GPIO_CLK RCC_AHB1Periph_GPIOI
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup STM324xG_EVAL_LOW_LEVEL_BUTTON
|
||||
* @{
|
||||
*/
|
||||
#define BUTTONn 3 /*!< Joystick pins are connected to
|
||||
an IO Expander (accessible through
|
||||
I2C1 interface) */
|
||||
|
||||
/**
|
||||
* @brief Wakeup push-button
|
||||
*/
|
||||
#define WAKEUP_BUTTON_PIN GPIO_Pin_0
|
||||
#define WAKEUP_BUTTON_GPIO_PORT GPIOA
|
||||
#define WAKEUP_BUTTON_GPIO_CLK RCC_AHB1Periph_GPIOA
|
||||
#define WAKEUP_BUTTON_EXTI_LINE EXTI_Line0
|
||||
#define WAKEUP_BUTTON_EXTI_PORT_SOURCE EXTI_PortSourceGPIOA
|
||||
#define WAKEUP_BUTTON_EXTI_PIN_SOURCE EXTI_PinSource0
|
||||
#define WAKEUP_BUTTON_EXTI_IRQn EXTI0_IRQn
|
||||
|
||||
/**
|
||||
* @brief Key push-button
|
||||
*/
|
||||
#define KEY_BUTTON_PIN GPIO_Pin_6
|
||||
#define KEY_BUTTON_GPIO_PORT GPIOE
|
||||
#define KEY_BUTTON_GPIO_CLK RCC_AHB1Periph_GPIOE
|
||||
#define KEY_BUTTON_EXTI_LINE EXTI_Line6
|
||||
#define KEY_BUTTON_EXTI_PORT_SOURCE EXTI_PortSourceGPIOE
|
||||
#define KEY_BUTTON_EXTI_PIN_SOURCE EXTI_PinSource6
|
||||
#define KEY_BUTTON_EXTI_IRQn EXTI15_10_IRQn
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup STM324xG_EVAL_LOW_LEVEL_COM
|
||||
* @{
|
||||
*/
|
||||
#define COMn 1
|
||||
|
||||
/**
|
||||
* @brief Definition for COM port1, connected to USART3
|
||||
*/
|
||||
#define EVAL_COM1 USART3
|
||||
#define EVAL_COM1_CLK RCC_APB1Periph_USART3
|
||||
#define EVAL_COM1_TX_PIN GPIO_Pin_10
|
||||
#define EVAL_COM1_TX_GPIO_PORT GPIOC
|
||||
#define EVAL_COM1_TX_GPIO_CLK RCC_AHB1Periph_GPIOC
|
||||
#define EVAL_COM1_TX_SOURCE GPIO_PinSource10
|
||||
#define EVAL_COM1_TX_AF GPIO_AF_USART3
|
||||
#define EVAL_COM1_RX_PIN GPIO_Pin_11
|
||||
#define EVAL_COM1_RX_GPIO_PORT GPIOC
|
||||
#define EVAL_COM1_RX_GPIO_CLK RCC_AHB1Periph_GPIOC
|
||||
#define EVAL_COM1_RX_SOURCE GPIO_PinSource11
|
||||
#define EVAL_COM1_RX_AF GPIO_AF_USART3
|
||||
#define EVAL_COM1_IRQn USART3_IRQn
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup STM324xG_EVAL_LOW_LEVEL_SD_FLASH
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @brief SD FLASH SDIO Interface
|
||||
*/
|
||||
#define SD_DETECT_PIN GPIO_Pin_6 /* PG.8 */
|
||||
#define SD_DETECT_GPIO_PORT GPIOG /* GPIOG */
|
||||
#define SD_DETECT_GPIO_CLK RCC_AHB1Periph_GPIOG
|
||||
|
||||
#define SDIO_FIFO_ADDRESS ((uint32_t)0x40012C80)
|
||||
/**
|
||||
* @brief SDIO Intialization Frequency (400KHz max)
|
||||
*/
|
||||
#define SDIO_INIT_CLK_DIV ((uint8_t)0x76)
|
||||
/**
|
||||
* @brief SDIO Data Transfer Frequency (25MHz max)
|
||||
*/
|
||||
#define SDIO_TRANSFER_CLK_DIV ((uint8_t)0x0)
|
||||
|
||||
#define SD_SDIO_DMA DMA2
|
||||
#define SD_SDIO_DMA_CLK RCC_AHB1Periph_DMA2
|
||||
|
||||
#define SD_SDIO_DMA_STREAM3 3
|
||||
//#define SD_SDIO_DMA_STREAM6 6
|
||||
|
||||
#ifdef SD_SDIO_DMA_STREAM3
|
||||
#define SD_SDIO_DMA_STREAM DMA2_Stream3
|
||||
#define SD_SDIO_DMA_CHANNEL DMA_Channel_4
|
||||
#define SD_SDIO_DMA_FLAG_FEIF DMA_FLAG_FEIF3
|
||||
#define SD_SDIO_DMA_FLAG_DMEIF DMA_FLAG_DMEIF3
|
||||
#define SD_SDIO_DMA_FLAG_TEIF DMA_FLAG_TEIF3
|
||||
#define SD_SDIO_DMA_FLAG_HTIF DMA_FLAG_HTIF3
|
||||
#define SD_SDIO_DMA_FLAG_TCIF DMA_FLAG_TCIF3
|
||||
#define SD_SDIO_DMA_IRQn DMA2_Stream3_IRQn
|
||||
#define SD_SDIO_DMA_IRQHANDLER DMA2_Stream3_IRQHandler
|
||||
#elif defined SD_SDIO_DMA_STREAM6
|
||||
#define SD_SDIO_DMA_STREAM DMA2_Stream6
|
||||
#define SD_SDIO_DMA_CHANNEL DMA_Channel_4
|
||||
#define SD_SDIO_DMA_FLAG_FEIF DMA_FLAG_FEIF6
|
||||
#define SD_SDIO_DMA_FLAG_DMEIF DMA_FLAG_DMEIF6
|
||||
#define SD_SDIO_DMA_FLAG_TEIF DMA_FLAG_TEIF6
|
||||
#define SD_SDIO_DMA_FLAG_HTIF DMA_FLAG_HTIF6
|
||||
#define SD_SDIO_DMA_FLAG_TCIF DMA_FLAG_TCIF6
|
||||
#define SD_SDIO_DMA_IRQn DMA2_Stream6_IRQn
|
||||
#define SD_SDIO_DMA_IRQHANDLER DMA2_Stream6_IRQHandler
|
||||
#endif /* SD_SDIO_DMA_STREAM3 */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM324xG_EVAL_LOW_LEVEL_Exported_Macros
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
/** @defgroup STM324xG_EVAL_LOW_LEVEL_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
void STM_EVAL_LEDInit(Led_TypeDef Led);
|
||||
void STM_EVAL_LEDOn(Led_TypeDef Led);
|
||||
void STM_EVAL_LEDOff(Led_TypeDef Led);
|
||||
void STM_EVAL_LEDToggle(Led_TypeDef Led);
|
||||
void STM_EVAL_PBInit(Button_TypeDef Button, ButtonMode_TypeDef Button_Mode);
|
||||
uint32_t STM_EVAL_PBGetState(Button_TypeDef Button);
|
||||
void STM_EVAL_COMInit(COM_TypeDef COM, USART_InitTypeDef* USART_InitStruct);
|
||||
void SD_LowLevel_DeInit(void);
|
||||
void SD_LowLevel_Init(void);
|
||||
void SD_LowLevel_DMA_TxConfig(uint32_t *BufferSRC, uint32_t BufferSize);
|
||||
void SD_LowLevel_DMA_RxConfig(uint32_t *BufferDST, uint32_t BufferSize);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __STM324xG_EVAL_H */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
+142
@@ -0,0 +1,142 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm324xg_eval_ioe.c
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.2
|
||||
* @date 05-March-2012
|
||||
* @brief This file provides a set of functions needed to manage the STMPE811
|
||||
* IO Expander devices mounted on STM324xG-EVAL evaluation board.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT 2012 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at:
|
||||
*
|
||||
* http://www.st.com/software_license_agreement_liberty_v2
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm324xg_eval_Key.h"
|
||||
|
||||
void Key_Config(void)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
/*--------------------------------------------------------------------------------
|
||||
|
||||
Key GPIO Config
|
||||
|
||||
--------------------------------------------------------------------------------*/
|
||||
/* Periph clock enable */
|
||||
RCC_AHB1PeriphClockCmd(JOY_A_KEY_RCC_AHBPeriph | JOY_B_KEY_RCC_AHBPeriph |
|
||||
JOY_C_KEY_RCC_AHBPeriph | JOY_D_KEY_RCC_AHBPeriph| JOY_CTR_KEY_RCC_AHBPeriph, ENABLE);
|
||||
|
||||
/* Configure Input pushpull mode */
|
||||
|
||||
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_25MHz;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
|
||||
|
||||
GPIO_InitStructure.GPIO_Pin = JOY_A_KEY_Pin;
|
||||
GPIO_Init(JOY_A_KEY_Port, &GPIO_InitStructure);
|
||||
GPIO_InitStructure.GPIO_Pin = JOY_B_KEY_Pin;
|
||||
GPIO_Init(JOY_B_KEY_Port, &GPIO_InitStructure);
|
||||
GPIO_InitStructure.GPIO_Pin = JOY_C_KEY_Pin;
|
||||
GPIO_Init(JOY_C_KEY_Port, &GPIO_InitStructure);
|
||||
GPIO_InitStructure.GPIO_Pin = JOY_D_KEY_Pin;
|
||||
GPIO_Init(JOY_D_KEY_Port, &GPIO_InitStructure);
|
||||
GPIO_InitStructure.GPIO_Pin = JOY_CTR_KEY_Pin;
|
||||
GPIO_Init(JOY_CTR_KEY_Port, &GPIO_InitStructure);
|
||||
}
|
||||
|
||||
__IO JOYState_TypeDef keydone = JOY_NONE;
|
||||
|
||||
JOYState_TypeDef Key_ReadIOPin(void)
|
||||
{
|
||||
if(keydone == JOY_NONE)
|
||||
{
|
||||
if(!GPIO_ReadInputDataBit(JOY_A_KEY_Port,JOY_A_KEY_Pin))
|
||||
{
|
||||
keydone = JOY_LEFT;
|
||||
return JOY_NONE;
|
||||
}
|
||||
else if(!GPIO_ReadInputDataBit(JOY_B_KEY_Port,JOY_B_KEY_Pin))
|
||||
{
|
||||
keydone = JOY_UP;
|
||||
return JOY_NONE;
|
||||
}
|
||||
else if(!GPIO_ReadInputDataBit(JOY_C_KEY_Port,JOY_C_KEY_Pin))
|
||||
{
|
||||
keydone = JOY_DOWN;
|
||||
return JOY_NONE;
|
||||
}
|
||||
else if(!GPIO_ReadInputDataBit(JOY_D_KEY_Port,JOY_D_KEY_Pin))
|
||||
{
|
||||
keydone = JOY_RIGHT;
|
||||
return JOY_NONE;
|
||||
}
|
||||
else if(!GPIO_ReadInputDataBit(JOY_CTR_KEY_Port,JOY_CTR_KEY_Pin))
|
||||
{
|
||||
keydone = JOY_SEL;
|
||||
return JOY_NONE;
|
||||
}
|
||||
}
|
||||
else if(keydone != JOY_NONE)
|
||||
{
|
||||
if(GPIO_ReadInputDataBit(JOY_A_KEY_Port,JOY_A_KEY_Pin) && keydone == JOY_LEFT)
|
||||
{
|
||||
keydone = JOY_NONE;
|
||||
return JOY_LEFT;
|
||||
}
|
||||
else if(GPIO_ReadInputDataBit(JOY_B_KEY_Port,JOY_B_KEY_Pin) && keydone == JOY_UP)
|
||||
{
|
||||
keydone = JOY_NONE;
|
||||
return JOY_UP;
|
||||
}
|
||||
else if(GPIO_ReadInputDataBit(JOY_C_KEY_Port,JOY_C_KEY_Pin) && keydone == JOY_DOWN)
|
||||
{
|
||||
keydone = JOY_NONE;
|
||||
return JOY_DOWN;
|
||||
}
|
||||
else if(GPIO_ReadInputDataBit(JOY_D_KEY_Port,JOY_D_KEY_Pin) && keydone == JOY_RIGHT)
|
||||
{
|
||||
keydone = JOY_NONE;
|
||||
return JOY_RIGHT;
|
||||
}
|
||||
else if(GPIO_ReadInputDataBit(JOY_CTR_KEY_Port,JOY_CTR_KEY_Pin) && keydone == JOY_SEL)
|
||||
{
|
||||
keydone = JOY_NONE;
|
||||
return JOY_SEL;
|
||||
}
|
||||
}
|
||||
return JOY_NONE;
|
||||
}
|
||||
|
||||
JOYState_TypeDef Key_ReadIOPin_continuous(void)
|
||||
{
|
||||
if(!GPIO_ReadInputDataBit(JOY_A_KEY_Port,JOY_A_KEY_Pin))
|
||||
return JOY_LEFT;
|
||||
else if(!GPIO_ReadInputDataBit(JOY_B_KEY_Port,JOY_B_KEY_Pin))
|
||||
return JOY_UP;
|
||||
else if(!GPIO_ReadInputDataBit(JOY_C_KEY_Port,JOY_C_KEY_Pin))
|
||||
return JOY_DOWN;
|
||||
else if(!GPIO_ReadInputDataBit(JOY_D_KEY_Port,JOY_D_KEY_Pin))
|
||||
return JOY_RIGHT;
|
||||
else if(!GPIO_ReadInputDataBit(JOY_CTR_KEY_Port,JOY_CTR_KEY_Pin))
|
||||
return JOY_SEL;
|
||||
return JOY_NONE;
|
||||
}
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm324xg_eval_ioe.h
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.2
|
||||
* @date 05-March-2012
|
||||
* @brief This file contains all the functions prototypes for the
|
||||
* stm324xg_eval_ioe.c driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT 2012 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at:
|
||||
*
|
||||
* http://www.st.com/software_license_agreement_liberty_v2
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* File Info : ---------------------------------------------------------------
|
||||
SUPPORTED FEATURES:
|
||||
- IO Read/write : Set/Reset and Read (Polling/Interrupt)
|
||||
- Joystick: config and Read (Polling/Interrupt)
|
||||
- Touch Screen Features: Single point mode (Polling/Interrupt)
|
||||
- TempSensor Feature: accuracy not determined (Polling).
|
||||
|
||||
UNSUPPORTED FEATURES:
|
||||
- Row ADC Feature is not supported (not implemented on STM324xG_EVAL board)
|
||||
----------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __STM324xG_EVAL_IOE_H
|
||||
#define __STM324xG_EVAL_IOE_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm324xg_eval.h"
|
||||
|
||||
|
||||
/**
|
||||
* @brief Touch Screen Information structure
|
||||
*/
|
||||
|
||||
#define JOY_A_KEY_Port GPIOE
|
||||
#define JOY_A_KEY_Pin GPIO_Pin_2
|
||||
#define JOY_A_KEY_RCC_AHBPeriph RCC_AHB1Periph_GPIOE
|
||||
|
||||
#define JOY_B_KEY_Port GPIOE
|
||||
#define JOY_B_KEY_Pin GPIO_Pin_3
|
||||
#define JOY_B_KEY_RCC_AHBPeriph RCC_AHB1Periph_GPIOE
|
||||
|
||||
#define JOY_C_KEY_Port GPIOE
|
||||
#define JOY_C_KEY_Pin GPIO_Pin_4
|
||||
#define JOY_C_KEY_RCC_AHBPeriph RCC_AHB1Periph_GPIOE
|
||||
|
||||
#define JOY_D_KEY_Port GPIOE
|
||||
#define JOY_D_KEY_Pin GPIO_Pin_5
|
||||
#define JOY_D_KEY_RCC_AHBPeriph RCC_AHB1Periph_GPIOE
|
||||
|
||||
#define JOY_CTR_KEY_Port GPIOE
|
||||
#define JOY_CTR_KEY_Pin GPIO_Pin_6
|
||||
#define JOY_CTR_KEY_RCC_AHBPeriph RCC_AHB1Periph_GPIOE
|
||||
|
||||
|
||||
/**
|
||||
* @brief Configuration and initialization functions
|
||||
*/
|
||||
void Key_Config(void);
|
||||
JOYState_TypeDef Key_ReadIOPin(void);
|
||||
JOYState_TypeDef Key_ReadIOPin_continuous(void);
|
||||
|
||||
#endif
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
+1320
File diff suppressed because it is too large
Load Diff
+269
@@ -0,0 +1,269 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm324xg_eval_lcd.h
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.2
|
||||
* @date 05-March-2012
|
||||
* @brief This file contains all the functions prototypes for the stm324xg_eval_lcd.c
|
||||
* driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT 2012 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at:
|
||||
*
|
||||
* http://www.st.com/software_license_agreement_liberty_v2
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __STM324xG_EVAL_LCD_H
|
||||
#define __STM324xG_EVAL_LCD_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm324xg_eval.h"
|
||||
#include "../Common/fonts.h"
|
||||
|
||||
/** @addtogroup Utilities
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32_EVAL
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM324xG_EVAL
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM324xG_EVAL_LCD
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/** @defgroup STM324xG_EVAL_LCD_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
int16_t X;
|
||||
int16_t Y;
|
||||
} Point, * pPoint;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM324xG_EVAL_LCD_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Uncomment the line below if you want to use user defined Delay function
|
||||
* (for precise timing), otherwise default _delay_ function defined within
|
||||
* this driver is used (less precise timing).
|
||||
*/
|
||||
/* #define USE_Delay */
|
||||
|
||||
#ifdef USE_Delay
|
||||
#include "main.h"
|
||||
#define _delay_ Delay /* !< User can provide more timing precise _delay_ function
|
||||
(with 10ms time base), using SysTick for example */
|
||||
#else
|
||||
#define _delay_ delay /* !< Default _delay_ function with less precise timing */
|
||||
#endif
|
||||
|
||||
//#define DISP_HOR_RESOLUTION 320
|
||||
//#define DISP_VER_RESOLUTION 240
|
||||
|
||||
//#define DISP_ORIENTATION 0
|
||||
//#define DISP_ORIENTATION 90
|
||||
//#define DISP_ORIENTATION 180
|
||||
#define DISP_ORIENTATION 270
|
||||
|
||||
/* Private define ------------------------------------------------------------*/
|
||||
|
||||
#if ( DISP_ORIENTATION == 90 ) || ( DISP_ORIENTATION == 270 )
|
||||
|
||||
#define MAX_X 320
|
||||
#define MAX_Y 240
|
||||
|
||||
#elif ( DISP_ORIENTATION == 0 ) || ( DISP_ORIENTATION == 180 )
|
||||
|
||||
#define MAX_X 240
|
||||
#define MAX_Y 320
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief LCD color
|
||||
*/
|
||||
#define LCD_COLOR_WHITE 0xFFFF
|
||||
#define LCD_COLOR_BLACK 0x0000
|
||||
#define LCD_COLOR_GREY 0xF7DE
|
||||
#define LCD_COLOR_BLUE 0x001F
|
||||
#define LCD_COLOR_BLUE2 0x051F
|
||||
#define LCD_COLOR_RED 0xF800
|
||||
#define LCD_COLOR_MAGENTA 0xF81F
|
||||
#define LCD_COLOR_GREEN 0x07E0
|
||||
#define LCD_COLOR_CYAN 0x7FFF
|
||||
#define LCD_COLOR_YELLOW 0xFFE0
|
||||
|
||||
/**
|
||||
* @brief LCD Lines depending on the chosen fonts.
|
||||
*/
|
||||
#define LCD_LINE_0 LINE(0)
|
||||
#define LCD_LINE_1 LINE(1)
|
||||
#define LCD_LINE_2 LINE(2)
|
||||
#define LCD_LINE_3 LINE(3)
|
||||
#define LCD_LINE_4 LINE(4)
|
||||
#define LCD_LINE_5 LINE(5)
|
||||
#define LCD_LINE_6 LINE(6)
|
||||
#define LCD_LINE_7 LINE(7)
|
||||
#define LCD_LINE_8 LINE(8)
|
||||
#define LCD_LINE_9 LINE(9)
|
||||
#define LCD_LINE_10 LINE(10)
|
||||
#define LCD_LINE_11 LINE(11)
|
||||
#define LCD_LINE_12 LINE(12)
|
||||
#define LCD_LINE_13 LINE(13)
|
||||
#define LCD_LINE_14 LINE(14)
|
||||
#define LCD_LINE_15 LINE(15)
|
||||
#define LCD_LINE_16 LINE(16)
|
||||
#define LCD_LINE_17 LINE(17)
|
||||
#define LCD_LINE_18 LINE(18)
|
||||
#define LCD_LINE_19 LINE(19)
|
||||
#define LCD_LINE_20 LINE(20)
|
||||
#define LCD_LINE_21 LINE(21)
|
||||
#define LCD_LINE_22 LINE(22)
|
||||
#define LCD_LINE_23 LINE(23)
|
||||
#define LCD_LINE_24 LINE(24)
|
||||
#define LCD_LINE_25 LINE(25)
|
||||
#define LCD_LINE_26 LINE(26)
|
||||
#define LCD_LINE_27 LINE(27)
|
||||
#define LCD_LINE_28 LINE(28)
|
||||
#define LCD_LINE_29 LINE(29)
|
||||
|
||||
/**
|
||||
* @brief LCD default font
|
||||
*/
|
||||
#define LCD_DEFAULT_FONT Font16x24
|
||||
|
||||
/**
|
||||
* @brief LCD Direction
|
||||
*/
|
||||
#define LCD_DIR_HORIZONTAL 0x0000
|
||||
#define LCD_DIR_VERTICAL 0x0001
|
||||
|
||||
/**
|
||||
* @brief LCD Size (Width and Height)
|
||||
*/
|
||||
#define LCD_PIXEL_WIDTH 0x0140
|
||||
#define LCD_PIXEL_HEIGHT 0x00F0
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM324xG_EVAL_LCD_Exported_Macros
|
||||
* @{
|
||||
*/
|
||||
#define ASSEMBLE_RGB(R ,G, B) ((((R)& 0xF8) << 8) | (((G) & 0xFC) << 3) | (((B) & 0xF8) >> 3))
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM324xG_EVAL_LCD_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
/** @defgroup
|
||||
* @{
|
||||
*/
|
||||
void LCD_DeInit(void);
|
||||
void STM324xG_LCD_Init(void);
|
||||
void LCD_SetColors(__IO uint16_t _TextColor, __IO uint16_t _BackColor);
|
||||
void LCD_GetColors(__IO uint16_t *_TextColor, __IO uint16_t *_BackColor);
|
||||
void LCD_SetTextColor(__IO uint16_t Color);
|
||||
void LCD_SetBackColor(__IO uint16_t Color);
|
||||
void LCD_ClearLine(uint16_t Line);
|
||||
void LCD_Clear(uint16_t Color);
|
||||
void LCD_SetCursor(uint16_t Xpos, uint16_t Ypos);
|
||||
void LCD_DrawChar(uint16_t Xpos, uint16_t Ypos, const uint16_t *c);
|
||||
void LCD_DisplayChar(uint16_t Line, uint16_t Column, uint8_t Ascii);
|
||||
void LCD_SetFont(sFONT *fonts);
|
||||
sFONT *LCD_GetFont(void);
|
||||
void LCD_DisplayStringLine(uint16_t Line, uint8_t *ptr);
|
||||
void LCD_DrawLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length, uint8_t Direction);
|
||||
void LCD_DrawRect(uint16_t Xpos, uint16_t Ypos, uint8_t Height, uint16_t Width);
|
||||
void LCD_DrawCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius);
|
||||
void LCD_DrawMonoPict(const uint32_t *Pict);
|
||||
void LCD_WriteBMP(uint32_t BmpAddress);
|
||||
void LCD_DrawUniLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
|
||||
void LCD_DrawFullRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
|
||||
void LCD_DrawFullCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius);
|
||||
void LCD_PolyLine(pPoint Points, uint16_t PointCount);
|
||||
void LCD_PolyLineRelative(pPoint Points, uint16_t PointCount);
|
||||
void LCD_ClosedPolyLine(pPoint Points, uint16_t PointCount);
|
||||
void LCD_ClosedPolyLineRelative(pPoint Points, uint16_t PointCount);
|
||||
void LCD_FillPolyLine(pPoint Points, uint16_t PointCount);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup
|
||||
* @{
|
||||
*/
|
||||
void LCD_WriteReg(uint8_t LCD_Reg, uint16_t LCD_RegValue);
|
||||
uint16_t LCD_ReadReg(uint8_t LCD_Reg);
|
||||
void LCD_WriteRAM_Prepare(void);
|
||||
void LCD_WriteRAM(uint16_t RGB_Code);
|
||||
uint16_t LCD_ReadRAM(void);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup
|
||||
* @{
|
||||
*/
|
||||
void LCD_CtrlLinesConfig(void);
|
||||
void LCD_FSMCConfig(void);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __STM324xG_EVAL_LCD_H */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
+2818
File diff suppressed because it is too large
Load Diff
+406
@@ -0,0 +1,406 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm324xg_eval_sdio_sd.h
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.2
|
||||
* @date 05-March-2012
|
||||
* @brief This file contains all the functions prototypes for the SD Card
|
||||
* stm324xg_eval_sdio_sd driver firmware library.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT 2012 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at:
|
||||
*
|
||||
* http://www.st.com/software_license_agreement_liberty_v2
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __STM324xG_EVAL_SDIO_SD_H
|
||||
#define __STM324xG_EVAL_SDIO_SD_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm324xg_eval.h"
|
||||
|
||||
/** @addtogroup Utilities
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM32_EVAL
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM324xG_EVAL
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup STM324xG_EVAL_SDIO_SD
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup STM324xG_EVAL_SDIO_SD_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
/**
|
||||
* @brief SDIO specific error defines
|
||||
*/
|
||||
SD_CMD_CRC_FAIL = (1), /*!< Command response received (but CRC check failed) */
|
||||
SD_DATA_CRC_FAIL = (2), /*!< Data bock sent/received (CRC check Failed) */
|
||||
SD_CMD_RSP_TIMEOUT = (3), /*!< Command response timeout */
|
||||
SD_DATA_TIMEOUT = (4), /*!< Data time out */
|
||||
SD_TX_UNDERRUN = (5), /*!< Transmit FIFO under-run */
|
||||
SD_RX_OVERRUN = (6), /*!< Receive FIFO over-run */
|
||||
SD_START_BIT_ERR = (7), /*!< Start bit not detected on all data signals in widE bus mode */
|
||||
SD_CMD_OUT_OF_RANGE = (8), /*!< CMD's argument was out of range.*/
|
||||
SD_ADDR_MISALIGNED = (9), /*!< Misaligned address */
|
||||
SD_BLOCK_LEN_ERR = (10), /*!< Transferred block length is not allowed for the card or the number of transferred bytes does not match the block length */
|
||||
SD_ERASE_SEQ_ERR = (11), /*!< An error in the sequence of erase command occurs.*/
|
||||
SD_BAD_ERASE_PARAM = (12), /*!< An Invalid selection for erase groups */
|
||||
SD_WRITE_PROT_VIOLATION = (13), /*!< Attempt to program a write protect block */
|
||||
SD_LOCK_UNLOCK_FAILED = (14), /*!< Sequence or password error has been detected in unlock command or if there was an attempt to access a locked card */
|
||||
SD_COM_CRC_FAILED = (15), /*!< CRC check of the previous command failed */
|
||||
SD_ILLEGAL_CMD = (16), /*!< Command is not legal for the card state */
|
||||
SD_CARD_ECC_FAILED = (17), /*!< Card internal ECC was applied but failed to correct the data */
|
||||
SD_CC_ERROR = (18), /*!< Internal card controller error */
|
||||
SD_GENERAL_UNKNOWN_ERROR = (19), /*!< General or Unknown error */
|
||||
SD_STREAM_READ_UNDERRUN = (20), /*!< The card could not sustain data transfer in stream read operation. */
|
||||
SD_STREAM_WRITE_OVERRUN = (21), /*!< The card could not sustain data programming in stream mode */
|
||||
SD_CID_CSD_OVERWRITE = (22), /*!< CID/CSD overwrite error */
|
||||
SD_WP_ERASE_SKIP = (23), /*!< only partial address space was erased */
|
||||
SD_CARD_ECC_DISABLED = (24), /*!< Command has been executed without using internal ECC */
|
||||
SD_ERASE_RESET = (25), /*!< Erase sequence was cleared before executing because an out of erase sequence command was received */
|
||||
SD_AKE_SEQ_ERROR = (26), /*!< Error in sequence of authentication. */
|
||||
SD_INVALID_VOLTRANGE = (27),
|
||||
SD_ADDR_OUT_OF_RANGE = (28),
|
||||
SD_SWITCH_ERROR = (29),
|
||||
SD_SDIO_DISABLED = (30),
|
||||
SD_SDIO_FUNCTION_BUSY = (31),
|
||||
SD_SDIO_FUNCTION_FAILED = (32),
|
||||
SD_SDIO_UNKNOWN_FUNCTION = (33),
|
||||
|
||||
/**
|
||||
* @brief Standard error defines
|
||||
*/
|
||||
SD_INTERNAL_ERROR,
|
||||
SD_NOT_CONFIGURED,
|
||||
SD_REQUEST_PENDING,
|
||||
SD_REQUEST_NOT_APPLICABLE,
|
||||
SD_INVALID_PARAMETER,
|
||||
SD_UNSUPPORTED_FEATURE,
|
||||
SD_UNSUPPORTED_HW,
|
||||
SD_ERROR,
|
||||
SD_OK = 0
|
||||
} SD_Error;
|
||||
|
||||
/**
|
||||
* @brief SDIO Transfer state
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
SD_TRANSFER_OK = 0,
|
||||
SD_TRANSFER_BUSY = 1,
|
||||
SD_TRANSFER_ERROR
|
||||
} SDTransferState;
|
||||
|
||||
/**
|
||||
* @brief SD Card States
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
SD_CARD_READY = ((uint32_t)0x00000001),
|
||||
SD_CARD_IDENTIFICATION = ((uint32_t)0x00000002),
|
||||
SD_CARD_STANDBY = ((uint32_t)0x00000003),
|
||||
SD_CARD_TRANSFER = ((uint32_t)0x00000004),
|
||||
SD_CARD_SENDING = ((uint32_t)0x00000005),
|
||||
SD_CARD_RECEIVING = ((uint32_t)0x00000006),
|
||||
SD_CARD_PROGRAMMING = ((uint32_t)0x00000007),
|
||||
SD_CARD_DISCONNECTED = ((uint32_t)0x00000008),
|
||||
SD_CARD_ERROR = ((uint32_t)0x000000FF)
|
||||
}SDCardState;
|
||||
|
||||
|
||||
/**
|
||||
* @brief Card Specific Data: CSD Register
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
__IO uint8_t CSDStruct; /*!< CSD structure */
|
||||
__IO uint8_t SysSpecVersion; /*!< System specification version */
|
||||
__IO uint8_t Reserved1; /*!< Reserved */
|
||||
__IO uint8_t TAAC; /*!< Data read access-time 1 */
|
||||
__IO uint8_t NSAC; /*!< Data read access-time 2 in CLK cycles */
|
||||
__IO uint8_t MaxBusClkFrec; /*!< Max. bus clock frequency */
|
||||
__IO uint16_t CardComdClasses; /*!< Card command classes */
|
||||
__IO uint8_t RdBlockLen; /*!< Max. read data block length */
|
||||
__IO uint8_t PartBlockRead; /*!< Partial blocks for read allowed */
|
||||
__IO uint8_t WrBlockMisalign; /*!< Write block misalignment */
|
||||
__IO uint8_t RdBlockMisalign; /*!< Read block misalignment */
|
||||
__IO uint8_t DSRImpl; /*!< DSR implemented */
|
||||
__IO uint8_t Reserved2; /*!< Reserved */
|
||||
__IO uint32_t DeviceSize; /*!< Device Size */
|
||||
__IO uint8_t MaxRdCurrentVDDMin; /*!< Max. read current @ VDD min */
|
||||
__IO uint8_t MaxRdCurrentVDDMax; /*!< Max. read current @ VDD max */
|
||||
__IO uint8_t MaxWrCurrentVDDMin; /*!< Max. write current @ VDD min */
|
||||
__IO uint8_t MaxWrCurrentVDDMax; /*!< Max. write current @ VDD max */
|
||||
__IO uint8_t DeviceSizeMul; /*!< Device size multiplier */
|
||||
__IO uint8_t EraseGrSize; /*!< Erase group size */
|
||||
__IO uint8_t EraseGrMul; /*!< Erase group size multiplier */
|
||||
__IO uint8_t WrProtectGrSize; /*!< Write protect group size */
|
||||
__IO uint8_t WrProtectGrEnable; /*!< Write protect group enable */
|
||||
__IO uint8_t ManDeflECC; /*!< Manufacturer default ECC */
|
||||
__IO uint8_t WrSpeedFact; /*!< Write speed factor */
|
||||
__IO uint8_t MaxWrBlockLen; /*!< Max. write data block length */
|
||||
__IO uint8_t WriteBlockPaPartial; /*!< Partial blocks for write allowed */
|
||||
__IO uint8_t Reserved3; /*!< Reserded */
|
||||
__IO uint8_t ContentProtectAppli; /*!< Content protection application */
|
||||
__IO uint8_t FileFormatGrouop; /*!< File format group */
|
||||
__IO uint8_t CopyFlag; /*!< Copy flag (OTP) */
|
||||
__IO uint8_t PermWrProtect; /*!< Permanent write protection */
|
||||
__IO uint8_t TempWrProtect; /*!< Temporary write protection */
|
||||
__IO uint8_t FileFormat; /*!< File Format */
|
||||
__IO uint8_t ECC; /*!< ECC code */
|
||||
__IO uint8_t CSD_CRC; /*!< CSD CRC */
|
||||
__IO uint8_t Reserved4; /*!< always 1*/
|
||||
} SD_CSD;
|
||||
|
||||
/**
|
||||
* @brief Card Identification Data: CID Register
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
__IO uint8_t ManufacturerID; /*!< ManufacturerID */
|
||||
__IO uint16_t OEM_AppliID; /*!< OEM/Application ID */
|
||||
__IO uint32_t ProdName1; /*!< Product Name part1 */
|
||||
__IO uint8_t ProdName2; /*!< Product Name part2*/
|
||||
__IO uint8_t ProdRev; /*!< Product Revision */
|
||||
__IO uint32_t ProdSN; /*!< Product Serial Number */
|
||||
__IO uint8_t Reserved1; /*!< Reserved1 */
|
||||
__IO uint16_t ManufactDate; /*!< Manufacturing Date */
|
||||
__IO uint8_t CID_CRC; /*!< CID CRC */
|
||||
__IO uint8_t Reserved2; /*!< always 1 */
|
||||
} SD_CID;
|
||||
|
||||
/**
|
||||
* @brief SD Card Status
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
__IO uint8_t DAT_BUS_WIDTH;
|
||||
__IO uint8_t SECURED_MODE;
|
||||
__IO uint16_t SD_CARD_TYPE;
|
||||
__IO uint32_t SIZE_OF_PROTECTED_AREA;
|
||||
__IO uint8_t SPEED_CLASS;
|
||||
__IO uint8_t PERFORMANCE_MOVE;
|
||||
__IO uint8_t AU_SIZE;
|
||||
__IO uint16_t ERASE_SIZE;
|
||||
__IO uint8_t ERASE_TIMEOUT;
|
||||
__IO uint8_t ERASE_OFFSET;
|
||||
} SD_CardStatus;
|
||||
|
||||
|
||||
/**
|
||||
* @brief SD Card information
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
SD_CSD SD_csd;
|
||||
SD_CID SD_cid;
|
||||
uint64_t CardCapacity; /*!< Card Capacity */
|
||||
uint32_t CardBlockSize; /*!< Card Block Size */
|
||||
uint16_t RCA;
|
||||
uint8_t CardType;
|
||||
} SD_CardInfo;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM324xG_EVAL_SDIO_SD_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief SDIO Commands Index
|
||||
*/
|
||||
#define SD_CMD_GO_IDLE_STATE ((uint8_t)0)
|
||||
#define SD_CMD_SEND_OP_COND ((uint8_t)1)
|
||||
#define SD_CMD_ALL_SEND_CID ((uint8_t)2)
|
||||
#define SD_CMD_SET_REL_ADDR ((uint8_t)3) /*!< SDIO_SEND_REL_ADDR for SD Card */
|
||||
#define SD_CMD_SET_DSR ((uint8_t)4)
|
||||
#define SD_CMD_SDIO_SEN_OP_COND ((uint8_t)5)
|
||||
#define SD_CMD_HS_SWITCH ((uint8_t)6)
|
||||
#define SD_CMD_SEL_DESEL_CARD ((uint8_t)7)
|
||||
#define SD_CMD_HS_SEND_EXT_CSD ((uint8_t)8)
|
||||
#define SD_CMD_SEND_CSD ((uint8_t)9)
|
||||
#define SD_CMD_SEND_CID ((uint8_t)10)
|
||||
#define SD_CMD_READ_DAT_UNTIL_STOP ((uint8_t)11) /*!< SD Card doesn't support it */
|
||||
#define SD_CMD_STOP_TRANSMISSION ((uint8_t)12)
|
||||
#define SD_CMD_SEND_STATUS ((uint8_t)13)
|
||||
#define SD_CMD_HS_BUSTEST_READ ((uint8_t)14)
|
||||
#define SD_CMD_GO_INACTIVE_STATE ((uint8_t)15)
|
||||
#define SD_CMD_SET_BLOCKLEN ((uint8_t)16)
|
||||
#define SD_CMD_READ_SINGLE_BLOCK ((uint8_t)17)
|
||||
#define SD_CMD_READ_MULT_BLOCK ((uint8_t)18)
|
||||
#define SD_CMD_HS_BUSTEST_WRITE ((uint8_t)19)
|
||||
#define SD_CMD_WRITE_DAT_UNTIL_STOP ((uint8_t)20) /*!< SD Card doesn't support it */
|
||||
#define SD_CMD_SET_BLOCK_COUNT ((uint8_t)23) /*!< SD Card doesn't support it */
|
||||
#define SD_CMD_WRITE_SINGLE_BLOCK ((uint8_t)24)
|
||||
#define SD_CMD_WRITE_MULT_BLOCK ((uint8_t)25)
|
||||
#define SD_CMD_PROG_CID ((uint8_t)26) /*!< reserved for manufacturers */
|
||||
#define SD_CMD_PROG_CSD ((uint8_t)27)
|
||||
#define SD_CMD_SET_WRITE_PROT ((uint8_t)28)
|
||||
#define SD_CMD_CLR_WRITE_PROT ((uint8_t)29)
|
||||
#define SD_CMD_SEND_WRITE_PROT ((uint8_t)30)
|
||||
#define SD_CMD_SD_ERASE_GRP_START ((uint8_t)32) /*!< To set the address of the first write
|
||||
block to be erased. (For SD card only) */
|
||||
#define SD_CMD_SD_ERASE_GRP_END ((uint8_t)33) /*!< To set the address of the last write block of the
|
||||
continuous range to be erased. (For SD card only) */
|
||||
#define SD_CMD_ERASE_GRP_START ((uint8_t)35) /*!< To set the address of the first write block to be erased.
|
||||
(For MMC card only spec 3.31) */
|
||||
|
||||
#define SD_CMD_ERASE_GRP_END ((uint8_t)36) /*!< To set the address of the last write block of the
|
||||
continuous range to be erased. (For MMC card only spec 3.31) */
|
||||
|
||||
#define SD_CMD_ERASE ((uint8_t)38)
|
||||
#define SD_CMD_FAST_IO ((uint8_t)39) /*!< SD Card doesn't support it */
|
||||
#define SD_CMD_GO_IRQ_STATE ((uint8_t)40) /*!< SD Card doesn't support it */
|
||||
#define SD_CMD_LOCK_UNLOCK ((uint8_t)42)
|
||||
#define SD_CMD_APP_CMD ((uint8_t)55)
|
||||
#define SD_CMD_GEN_CMD ((uint8_t)56)
|
||||
#define SD_CMD_NO_CMD ((uint8_t)64)
|
||||
|
||||
/**
|
||||
* @brief Following commands are SD Card Specific commands.
|
||||
* SDIO_APP_CMD should be sent before sending these commands.
|
||||
*/
|
||||
#define SD_CMD_APP_SD_SET_BUSWIDTH ((uint8_t)6) /*!< For SD Card only */
|
||||
#define SD_CMD_SD_APP_STAUS ((uint8_t)13) /*!< For SD Card only */
|
||||
#define SD_CMD_SD_APP_SEND_NUM_WRITE_BLOCKS ((uint8_t)22) /*!< For SD Card only */
|
||||
#define SD_CMD_SD_APP_OP_COND ((uint8_t)41) /*!< For SD Card only */
|
||||
#define SD_CMD_SD_APP_SET_CLR_CARD_DETECT ((uint8_t)42) /*!< For SD Card only */
|
||||
#define SD_CMD_SD_APP_SEND_SCR ((uint8_t)51) /*!< For SD Card only */
|
||||
#define SD_CMD_SDIO_RW_DIRECT ((uint8_t)52) /*!< For SD I/O Card only */
|
||||
#define SD_CMD_SDIO_RW_EXTENDED ((uint8_t)53) /*!< For SD I/O Card only */
|
||||
|
||||
/**
|
||||
* @brief Following commands are SD Card Specific security commands.
|
||||
* SDIO_APP_CMD should be sent before sending these commands.
|
||||
*/
|
||||
#define SD_CMD_SD_APP_GET_MKB ((uint8_t)43) /*!< For SD Card only */
|
||||
#define SD_CMD_SD_APP_GET_MID ((uint8_t)44) /*!< For SD Card only */
|
||||
#define SD_CMD_SD_APP_SET_CER_RN1 ((uint8_t)45) /*!< For SD Card only */
|
||||
#define SD_CMD_SD_APP_GET_CER_RN2 ((uint8_t)46) /*!< For SD Card only */
|
||||
#define SD_CMD_SD_APP_SET_CER_RES2 ((uint8_t)47) /*!< For SD Card only */
|
||||
#define SD_CMD_SD_APP_GET_CER_RES1 ((uint8_t)48) /*!< For SD Card only */
|
||||
#define SD_CMD_SD_APP_SECURE_READ_MULTIPLE_BLOCK ((uint8_t)18) /*!< For SD Card only */
|
||||
#define SD_CMD_SD_APP_SECURE_WRITE_MULTIPLE_BLOCK ((uint8_t)25) /*!< For SD Card only */
|
||||
#define SD_CMD_SD_APP_SECURE_ERASE ((uint8_t)38) /*!< For SD Card only */
|
||||
#define SD_CMD_SD_APP_CHANGE_SECURE_AREA ((uint8_t)49) /*!< For SD Card only */
|
||||
#define SD_CMD_SD_APP_SECURE_WRITE_MKB ((uint8_t)48) /*!< For SD Card only */
|
||||
|
||||
/* Uncomment the following line to select the SDIO Data transfer mode */
|
||||
#if !defined (SD_DMA_MODE) && !defined (SD_POLLING_MODE)
|
||||
#define SD_DMA_MODE ((uint32_t)0x00000000)
|
||||
/*#define SD_POLLING_MODE ((uint32_t)0x00000002)*/
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief SD detection on its memory slot
|
||||
*/
|
||||
#define SD_PRESENT ((uint8_t)0x01)
|
||||
#define SD_NOT_PRESENT ((uint8_t)0x00)
|
||||
|
||||
/**
|
||||
* @brief Supported SD Memory Cards
|
||||
*/
|
||||
#define SDIO_STD_CAPACITY_SD_CARD_V1_1 ((uint32_t)0x00000000)
|
||||
#define SDIO_STD_CAPACITY_SD_CARD_V2_0 ((uint32_t)0x00000001)
|
||||
#define SDIO_HIGH_CAPACITY_SD_CARD ((uint32_t)0x00000002)
|
||||
#define SDIO_MULTIMEDIA_CARD ((uint32_t)0x00000003)
|
||||
#define SDIO_SECURE_DIGITAL_IO_CARD ((uint32_t)0x00000004)
|
||||
#define SDIO_HIGH_SPEED_MULTIMEDIA_CARD ((uint32_t)0x00000005)
|
||||
#define SDIO_SECURE_DIGITAL_IO_COMBO_CARD ((uint32_t)0x00000006)
|
||||
#define SDIO_HIGH_CAPACITY_MMC_CARD ((uint32_t)0x00000007)
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM324xG_EVAL_SDIO_SD_Exported_Macros
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup STM324xG_EVAL_SDIO_SD_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
void SD_DeInit(void);
|
||||
SD_Error SD_Init(void);
|
||||
SDTransferState SD_GetStatus(void);
|
||||
SDCardState SD_GetState(void);
|
||||
uint8_t SD_Detect(void);
|
||||
SD_Error SD_PowerON(void);
|
||||
SD_Error SD_PowerOFF(void);
|
||||
SD_Error SD_InitializeCards(void);
|
||||
SD_Error SD_GetCardInfo(SD_CardInfo *cardinfo);
|
||||
SD_Error SD_GetCardStatus(SD_CardStatus *cardstatus);
|
||||
SD_Error SD_EnableWideBusOperation(uint32_t WideMode);
|
||||
SD_Error SD_SelectDeselect(uint32_t addr);
|
||||
SD_Error SD_ReadBlock(uint8_t *readbuff, uint32_t ReadAddr, uint16_t BlockSize);
|
||||
SD_Error SD_ReadMultiBlocks(uint8_t *readbuff, uint32_t ReadAddr, uint16_t BlockSize, uint32_t NumberOfBlocks);
|
||||
SD_Error SD_WriteBlock(uint8_t *writebuff, uint32_t WriteAddr, uint16_t BlockSize);
|
||||
SD_Error SD_WriteMultiBlocks(uint8_t *writebuff, uint32_t WriteAddr, uint16_t BlockSize, uint32_t NumberOfBlocks);
|
||||
SDTransferState SD_GetTransferState(void);
|
||||
SD_Error SD_StopTransfer(void);
|
||||
SD_Error SD_Erase(uint32_t startaddr, uint32_t endaddr);
|
||||
SD_Error SD_SendStatus(uint32_t *pcardstatus);
|
||||
SD_Error SD_SendSDStatus(uint32_t *psdstatus);
|
||||
SD_Error SD_ProcessIRQSrc(void);
|
||||
void SD_ProcessDMAIRQ(void);
|
||||
SD_Error SD_WaitReadOperation(void);
|
||||
SD_Error SD_WaitWriteOperation(void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __STM324xG_EVAL_SDIO_SD_H */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
Reference in New Issue
Block a user