Skip to content

Commit 2b551f1

Browse files
committed
Initial import of ST fw 1.3.1
0 parents  commit 2b551f1

File tree

6,933 files changed

+2356210
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

6,933 files changed

+2356210
-0
lines changed
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2+
<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>
3+
4+
5+
6+
7+
8+
9+
10+
11+
12+
13+
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
14+
15+
16+
<link rel="File-List" href="Library_files/filelist.xml">
17+
18+
19+
<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 B-L072Z-LRWAN1 Discovery 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]-->
20+
21+
22+
23+
24+
25+
26+
27+
<style>
28+
<!--
29+
/* Style Definitions */
30+
p.MsoNormal, li.MsoNormal, div.MsoNormal
31+
{mso-style-parent:"";
32+
margin:0in;
33+
margin-bottom:.0001pt;
34+
mso-pagination:widow-orphan;
35+
font-size:12.0pt;
36+
font-family:"Times New Roman";
37+
mso-fareast-font-family:"Times New Roman";}
38+
h2
39+
{mso-style-next:Normal;
40+
margin-top:12.0pt;
41+
margin-right:0in;
42+
margin-bottom:3.0pt;
43+
margin-left:0in;
44+
mso-pagination:widow-orphan;
45+
page-break-after:avoid;
46+
mso-outline-level:2;
47+
font-size:14.0pt;
48+
font-family:Arial;
49+
font-weight:bold;
50+
font-style:italic;}
51+
a:link, span.MsoHyperlink
52+
{color:blue;
53+
text-decoration:underline;
54+
text-underline:single;}
55+
a:visited, span.MsoHyperlinkFollowed
56+
{color:blue;
57+
text-decoration:underline;
58+
text-underline:single;}
59+
p
60+
{mso-margin-top-alt:auto;
61+
margin-right:0in;
62+
mso-margin-bottom-alt:auto;
63+
margin-left:0in;
64+
mso-pagination:widow-orphan;
65+
font-size:12.0pt;
66+
font-family:"Times New Roman";
67+
mso-fareast-font-family:"Times New Roman";}
68+
@page Section1
69+
{size:8.5in 11.0in;
70+
margin:1.0in 1.25in 1.0in 1.25in;
71+
mso-header-margin:.5in;
72+
mso-footer-margin:.5in;
73+
mso-paper-source:0;}
74+
div.Section1
75+
{page:Section1;}
76+
-->
77+
</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]-->
78+
<meta content="MCD Application Team" name="author"></head>
79+
<body link="blue" vlink="blue">
80+
<div class="Section1">
81+
<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
82+
</o:p></span></p>
83+
<div align="center">
84+
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
85+
<tbody>
86+
<tr>
87+
<td style="padding: 0cm;" valign="top">
88+
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
89+
<tbody>
90+
<tr>
91+
<td style="vertical-align: top;">
92+
<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>
93+
</td>
94+
</tr>
95+
<tr style="">
96+
<td style="padding: 1.5pt;">
97+
<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release
98+
Notes for B-L072Z-LRWAN1 Discovery Board Drivers</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
99+
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
100+
2016 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
101+
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="../../../_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
102+
</td>
103+
</tr>
104+
</tbody>
105+
</table>
106+
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p>&nbsp;</o:p></span></p>
107+
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" width="900">
108+
<tbody>
109+
<tr style="">
110+
111+
112+
113+
<span style="font-family: &quot;Times New Roman&quot;;"></span>
114+
<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;">
115+
<span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0 / 15-November-2016</span>
116+
</h3>
117+
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;">
118+
<b style="">
119+
<u>
120+
<span style="font-size: 10pt; font-family: Verdana; color: black;">Main Changes<o:p></o:p>
121+
</span>
122+
</u>
123+
</b>
124+
</p>
125+
126+
<ul style="margin-top: 0cm;" type="square">
127+
<li class="MsoNormal">
128+
<span style="font-size: 10pt; font-family: Verdana;">First Release
129+
<span style="font-weight: bold; font-style: italic;">
130+
</span>
131+
</span>
132+
</li>
133+
</ul>
134+
<span style="font-size: 10pt; font-family: Verdana;"> </span>
135+
<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;">
136+
<a name="License"></a>
137+
<span style="font-size: 12pt; color: white;">License<o:p></o:p>
138+
</span>
139+
</h2>
140+
<p>This software component is licensed by ST under BSD 3-Clause
141+
license,&nbsp;the "License"; You may not use this component except
142+
in compliance with the License. You may obtain a copy of the License at:</p>
143+
<p style="text-align: center;"><a href="https://opensource.org/licenses/BSD-3-Clause" target="_blank">https://opensource.org/licenses/BSD-3-Clause</a></p>
144+
145+
<span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; color: black;"></span> <b><span style="font-size: 10pt; font-family: Verdana; color: black;"></span></b>
146+
147+
<div class="MsoNormal" style="text-align: center;" align="center"><span style="color: black;">
148+
<hr align="center" size="2" width="100%"></span></div>
149+
<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
150+
complete documentation on </span><span style="font-size: 10pt; font-family: Verdana;">STM32<span style="color: black;">&nbsp;Microcontrollers
151+
visit </span><u><span style="color: blue;"><a href="http://www.st.com/internet/mcu/class/1734.jsp" target="_blank">www.st.com/STM32</a></span></u></span><span style="font-size: 10pt; font-family: Verdana;"><a target="_blank" href="http://www.st.com/internet/mcu/family/141.jsp"><u><span style="color: blue;"></span></u></a></span><span style="font-size: 10pt; font-family: Verdana;"><u><span style="color: blue;"></span></u></span><span style="color: black;"><o:p></o:p></span></p>
152+
</td>
153+
</tr>
154+
</tbody>
155+
</table>
156+
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
157+
</td>
158+
</tr>
159+
</tbody>
160+
</table>
161+
</div>
162+
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
163+
</div>
164+
165+
</body></html>
Lines changed: 228 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,228 @@
1+
/**
2+
******************************************************************************
3+
* @file b-l072z-lrwan1.c
4+
* @author MCD Application Team
5+
* @brief This file contains definitions for:
6+
* - LEDs and push-button available on B-L072Z-LRWAN1 Discovery Kit
7+
* from STMicroelectronics
8+
******************************************************************************
9+
* @attention
10+
*
11+
* <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
12+
* All rights reserved.</center></h2>
13+
*
14+
* This software component is licensed by ST under BSD 3-Clause license,
15+
* the "License"; You may not use this file except in compliance with the
16+
* License. You may obtain a copy of the License at:
17+
* opensource.org/licenses/BSD-3-Clause
18+
*
19+
******************************************************************************
20+
*/
21+
22+
23+
/* Includes ------------------------------------------------------------------*/
24+
#include "b-l072z-lrwan1.h"
25+
#include <stdlib.h>
26+
27+
/** @addtogroup BSP
28+
* @{
29+
*/
30+
31+
/** @addtogroup B-L072Z-LRWAN1
32+
* @{
33+
*/
34+
35+
/** @addtogroup B-L072Z-LRWAN1_LOW_LEVEL
36+
* @brief This file provides set of firmware functions to manage Leds and push-button
37+
* available on B-L072Z-LRWAN1 Discovery Kit from STMicroelectronics.
38+
* @{
39+
*/
40+
41+
/** @defgroup B-L072Z-LRWAN1_LOW_LEVEL_Private_TypesDefinitions
42+
* @{
43+
*/
44+
/**
45+
* @}
46+
*/
47+
48+
49+
/** @defgroup B-L072Z-LRWAN1_LOW_LEVEL_Private_Defines
50+
* @{
51+
*/
52+
53+
/**
54+
* @brief 32L082MLM DISCO BSP Driver version number V1.0.0
55+
*/
56+
#define __B_L072Z_LRWAN1_BSP_VERSION_MAIN (0x01) /*!< [31:24] main version */
57+
#define __B_L072Z_LRWAN1_BSP_VERSION_SUB1 (0x00) /*!< [23:16] sub1 version */
58+
#define __B_L072Z_LRWAN1_BSP_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */
59+
#define __B_L072Z_LRWAN1_BSP_VERSION_RC (0x00) /*!< [7:0] release candidate */
60+
#define __B_L072Z_LRWAN1_BSP_VERSION ((__B_L072Z_LRWAN1_BSP_VERSION_MAIN << 24)\
61+
|(__B_L072Z_LRWAN1_BSP_VERSION_SUB1 << 16)\
62+
|(__B_L072Z_LRWAN1_BSP_VERSION_SUB2 << 8 )\
63+
|(__B_L072Z_LRWAN1_BSP_VERSION_RC))
64+
65+
66+
67+
/** @defgroup B-L072Z-LRWAN1_LOW_LEVEL_Private_Variables
68+
* @{
69+
*/
70+
GPIO_TypeDef* LED_PORT[LEDn] = {LED1_GPIO_PORT, LED2_GPIO_PORT, LED3_GPIO_PORT, LED4_GPIO_PORT};
71+
const uint16_t LED_PIN[LEDn] = {LED1_PIN, LED2_PIN,LED3_PIN, LED4_PIN};
72+
73+
GPIO_TypeDef* BUTTON_PORT[BUTTONn] = {KEY_BUTTON_GPIO_PORT };
74+
const uint16_t BUTTON_PIN[BUTTONn] = {KEY_BUTTON_PIN };
75+
const uint8_t BUTTON_IRQn[BUTTONn] = {KEY_BUTTON_EXTI_IRQn };
76+
77+
/**
78+
* @}
79+
*/
80+
81+
82+
/** @defgroup B-L072Z-LRWAN1_LOW_LEVEL_Private_Functions
83+
* @{
84+
*/
85+
/**
86+
* @}
87+
*/
88+
/**
89+
* @brief This method returns the B-L072Z-LRWAN1 BSP Driver revision
90+
* @param None
91+
* @retval version : 0xXYZR (8bits for each decimal, R for RC)
92+
*/
93+
uint32_t BSP_GetVersion(void)
94+
{
95+
return __B_L072Z_LRWAN1_BSP_VERSION;
96+
}
97+
98+
/**
99+
* @brief Configures LED GPIO.
100+
* @param Led: Specifies the Led to be configured.
101+
* This parameter can be one of following parameters:
102+
* @arg LED2
103+
* @retval None
104+
*/
105+
void BSP_LED_Init(Led_TypeDef Led)
106+
{
107+
GPIO_InitTypeDef GPIO_InitStruct;
108+
109+
/* Enable the GPIO_LED Clock */
110+
LEDx_GPIO_CLK_ENABLE( Led );
111+
112+
/* Configure the GPIO_LED pin */
113+
GPIO_InitStruct.Pin = LED_PIN[Led];
114+
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
115+
GPIO_InitStruct.Pull = GPIO_NOPULL;
116+
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
117+
118+
HAL_GPIO_Init(LED_PORT[Led], &GPIO_InitStruct);
119+
}
120+
121+
/**
122+
* @brief Turns selected LED On.
123+
* @param Led: Specifies the Led to be set on.
124+
* This parameter can be one of following parameters:
125+
* @arg LED2
126+
* @retval None
127+
*/
128+
void BSP_LED_On(Led_TypeDef Led)
129+
{
130+
HAL_GPIO_WritePin(LED_PORT[Led], LED_PIN[Led], GPIO_PIN_SET);
131+
}
132+
133+
/**
134+
* @brief Turns selected LED Off.
135+
* @param Led: Specifies the Led to be set off.
136+
* This parameter can be one of following parameters:
137+
* @arg LED2
138+
* @retval None
139+
*/
140+
void BSP_LED_Off(Led_TypeDef Led)
141+
{
142+
HAL_GPIO_WritePin(LED_PORT[Led], LED_PIN[Led], GPIO_PIN_RESET);
143+
}
144+
145+
/**
146+
* @brief Toggles the selected LED.
147+
* @param Led: Specifies the Led to be toggled.
148+
* This parameter can be one of following parameters:
149+
* @arg LED2
150+
* @retval None
151+
*/
152+
void BSP_LED_Toggle(Led_TypeDef Led)
153+
{
154+
HAL_GPIO_TogglePin(LED_PORT[Led], LED_PIN[Led]);
155+
}
156+
157+
/**
158+
* @brief Configures Button GPIO and EXTI Line.
159+
* @param Button: Specifies the Button to be configured.
160+
* This parameter should be: BUTTON_KEY
161+
* @param ButtonMode: Specifies Button mode.
162+
* This parameter can be one of following parameters:
163+
* @arg BUTTON_MODE_GPIO: Button will be used as simple IO
164+
* @arg BUTTON_MODE_EXTI: Button will be connected to EXTI line with interrupt
165+
* generation capability
166+
* @retval None
167+
*/
168+
void BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef ButtonMode)
169+
{
170+
GPIO_InitTypeDef GPIO_InitStruct;
171+
172+
/* Enable the BUTTON Clock */
173+
BUTTONx_GPIO_CLK_ENABLE(Button);
174+
__HAL_RCC_SYSCFG_CLK_ENABLE();
175+
176+
if(ButtonMode == BUTTON_MODE_GPIO)
177+
{
178+
/* Configure Button pin as input */
179+
GPIO_InitStruct.Pin = BUTTON_PIN[Button];
180+
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
181+
GPIO_InitStruct.Pull = GPIO_PULLDOWN;
182+
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
183+
HAL_GPIO_Init(BUTTON_PORT[Button], &GPIO_InitStruct);
184+
}
185+
186+
if(ButtonMode == BUTTON_MODE_EXTI)
187+
{
188+
/* Configure Button pin as input with External interrupt */
189+
GPIO_InitStruct.Pin = BUTTON_PIN[Button];
190+
GPIO_InitStruct.Pull = GPIO_NOPULL;
191+
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
192+
HAL_GPIO_Init(BUTTON_PORT[Button], &GPIO_InitStruct);
193+
194+
/* Enable and set Button EXTI Interrupt to the lowest priority */
195+
NVIC_SetPriority((IRQn_Type)(BUTTON_IRQn[Button]), 0x03);
196+
HAL_NVIC_EnableIRQ((IRQn_Type)(BUTTON_IRQn[Button]));
197+
}
198+
}
199+
200+
/**
201+
* @brief Returns the selected Button state.
202+
* @param Button: Specifies the Button to be checked.
203+
* This parameter should be: BUTTON_KEY
204+
* @retval The Button GPIO pin value.
205+
*/
206+
uint32_t BSP_PB_GetState(Button_TypeDef Button)
207+
{
208+
return HAL_GPIO_ReadPin(BUTTON_PORT[Button], BUTTON_PIN[Button]);
209+
}
210+
211+
212+
/**
213+
* @}
214+
*/
215+
216+
/**
217+
* @}
218+
*/
219+
220+
/**
221+
* @}
222+
*/
223+
224+
/**
225+
* @}
226+
*/
227+
228+
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

0 commit comments

Comments
 (0)