Skip to content
This repository was archived by the owner on Mar 31, 2023. It is now read-only.

Commit e28dc60

Browse files
ridhaosWi6labsVVESTM
authored andcommitted
Add STM8L15x/16x/05x/AL3Lx/AL31x Standard peripheral library
STM8L15x/16x/05x/AL3Lx/AL31x Standard peripheral library version 1.6.1 from http://www.st.com/ => STSW-STM8016.
1 parent d628d87 commit e28dc60

Some content is hidden

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

59 files changed

+40185
-0
lines changed

system/Drivers/STM8L15x_StdPeriph_Driver/Release_Notes.html

Lines changed: 184 additions & 0 deletions
Large diffs are not rendered by default.

system/Drivers/STM8L15x_StdPeriph_Driver/inc/stm8l15x.h

Lines changed: 3027 additions & 0 deletions
Large diffs are not rendered by default.

system/Drivers/STM8L15x_StdPeriph_Driver/inc/stm8l15x_adc.h

Lines changed: 386 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
/**
2+
********************************************************************************
3+
* @file stm8l15x_aes.h
4+
* @author MCD Application Team
5+
* @version V1.6.1
6+
* @date 30-September-2014
7+
* @brief This file contains all the functions prototypes for the AES firmware
8+
* library.
9+
******************************************************************************
10+
* @attention
11+
*
12+
* <h2><center>&copy; COPYRIGHT 2014 STMicroelectronics</center></h2>
13+
*
14+
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
15+
* You may not use this file except in compliance with the License.
16+
* You may obtain a copy of the License at:
17+
*
18+
* http://www.st.com/software_license_agreement_liberty_v2
19+
*
20+
* Unless required by applicable law or agreed to in writing, software
21+
* distributed under the License is distributed on an "AS IS" BASIS,
22+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23+
* See the License for the specific language governing permissions and
24+
* limitations under the License.
25+
*
26+
******************************************************************************
27+
*/
28+
29+
/* Define to prevent recursive inclusion -------------------------------------*/
30+
#ifndef __STM8L15x_AES_H
31+
#define __STM8L15x_AES_H
32+
33+
/* Includes ------------------------------------------------------------------*/
34+
#include "stm8l15x.h"
35+
36+
/** @addtogroup STM8L15x_StdPeriph_Driver
37+
* @{
38+
*/
39+
40+
/** @addtogroup AES
41+
* @{
42+
*/
43+
44+
/* Exported types ------------------------------------------------------------*/
45+
46+
/** @defgroup AES_Exported_Types
47+
* @{
48+
*/
49+
50+
/** @defgroup AES_Operation_Mode
51+
* @{
52+
*/
53+
typedef enum
54+
{
55+
AES_Operation_Encryp = (uint8_t)0x00, /*!< AES in Encryption mode */
56+
AES_Operation_KeyDeriv = (uint8_t)0x02, /*!< AES in Key Derivation mode */
57+
AES_Operation_Decryp = (uint8_t)0x04, /*!< AES in Decryption mode */
58+
AES_Operation_KeyDerivAndDecryp = (uint8_t)0x06 /*!< AES in Key Derivation and Decryption mode */
59+
} AES_Operation_TypeDef;
60+
61+
#define IS_AES_MODE(Operation) (((Operation) == AES_Operation_Encryp) || \
62+
((Operation) == AES_Operation_KeyDeriv) || \
63+
((Operation) == AES_Operation_Decryp) || \
64+
((Operation) == AES_Operation_KeyDerivAndDecryp))
65+
/**
66+
* @}
67+
*/
68+
69+
/** @defgroup AES_Flags
70+
* @{
71+
*/
72+
typedef enum
73+
{
74+
AES_FLAG_CCF = (uint8_t)0x01, /*!< Computation Complete Flag */
75+
AES_FLAG_RDERR = (uint8_t)0x02, /*!< Read Error Flag */
76+
AES_FLAG_WRERR = (uint8_t)0x04 /*!< Write Error Flag */
77+
}AES_FLAG_TypeDef;
78+
79+
#define IS_AES_FLAG(Flag) (((Flag) == AES_FLAG_CCF) || \
80+
((Flag) == AES_FLAG_RDERR) || \
81+
((Flag) == AES_FLAG_WRERR))
82+
83+
/**
84+
* @}
85+
*/
86+
87+
/** @defgroup AES_Interrupts
88+
* @{
89+
*/
90+
typedef enum
91+
{
92+
AES_IT_CCIE = (uint16_t)0x20, /*!< Computation Complete interrupt enable */
93+
AES_IT_ERRIE = (uint16_t)0x40 /*!< Error interrupt enable */
94+
}AES_IT_TypeDef;
95+
96+
#define IS_AES_IT(IT) (((IT) == AES_IT_CCIE) || \
97+
((IT) == AES_IT_ERRIE))
98+
99+
/**
100+
* @}
101+
*/
102+
103+
/** @defgroup AES_DMA_Transfer_Direction
104+
* @{
105+
*/
106+
typedef enum
107+
{
108+
AES_DMATransfer_InOut = (uint8_t) 0x80 /*!< DMA requests enabled for input transfer phase
109+
as well as for the output transfer phase */
110+
}
111+
AES_DMATransfer_TypeDef;
112+
113+
#define IS_AES_DMATRANSFER(Transfer) ((Transfer) == AES_DMATransfer_InOut)
114+
/**
115+
* @}
116+
*/
117+
118+
/**
119+
* @}
120+
*/
121+
122+
/* Exported constants --------------------------------------------------------*/
123+
/* Exported macros -----------------------------------------------------------*/
124+
/* Exported functions ------------------------------------------------------- */
125+
/* Function used to set the AES configuration to the default reset state *****/
126+
void AES_DeInit(void);
127+
128+
/* AES Configuration **********************************************************/
129+
void AES_OperationModeConfig(AES_Operation_TypeDef AES_Operation);
130+
void AES_Cmd(FunctionalState NewState);
131+
132+
/* AES Read and Write operations **********************************************/
133+
void AES_WriteSubData(uint8_t Data);
134+
void AES_WriteSubKey(uint8_t Key);
135+
uint8_t AES_ReadSubData(void);
136+
uint8_t AES_ReadSubKey(void);
137+
138+
/* DMA transfers management function ******************************************/
139+
void AES_DMAConfig(AES_DMATransfer_TypeDef AES_DMATransfer, FunctionalState NewState);
140+
141+
/* Interrupts and flags management functions **********************************/
142+
void AES_ITConfig(AES_IT_TypeDef AES_IT, FunctionalState NewState);
143+
FlagStatus AES_GetFlagStatus(AES_FLAG_TypeDef AES_FLAG);
144+
void AES_ClearFlag(AES_FLAG_TypeDef AES_FLAG);
145+
ITStatus AES_GetITStatus(AES_IT_TypeDef AES_IT);
146+
void AES_ClearITPendingBit(AES_IT_TypeDef AES_IT);
147+
148+
#endif /* __STM8L15x_AES_H */
149+
150+
/**
151+
* @}
152+
*/
153+
154+
/**
155+
* @}
156+
*/
157+
158+
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
/**
2+
******************************************************************************
3+
* @file stm8l15x_beep.h
4+
* @author MCD Application Team
5+
* @version V1.6.1
6+
* @date 30-September-2014
7+
* @brief This file contains all the functions prototypes for the BEEP firmware
8+
* library.
9+
******************************************************************************
10+
* @attention
11+
*
12+
* <h2><center>&copy; COPYRIGHT 2014 STMicroelectronics</center></h2>
13+
*
14+
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
15+
* You may not use this file except in compliance with the License.
16+
* You may obtain a copy of the License at:
17+
*
18+
* http://www.st.com/software_license_agreement_liberty_v2
19+
*
20+
* Unless required by applicable law or agreed to in writing, software
21+
* distributed under the License is distributed on an "AS IS" BASIS,
22+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23+
* See the License for the specific language governing permissions and
24+
* limitations under the License.
25+
*
26+
******************************************************************************
27+
*/
28+
29+
/* Define to prevent recursive inclusion -------------------------------------*/
30+
#ifndef __STM8L15x_BEEP_H
31+
#define __STM8L15x_BEEP_H
32+
33+
/* Includes ------------------------------------------------------------------*/
34+
#include "stm8l15x.h"
35+
36+
/** @addtogroup STM8L15x_StdPeriph_Driver
37+
* @{
38+
*/
39+
40+
/** @addtogroup BEEP
41+
* @{
42+
*/
43+
44+
/* Exported types ------------------------------------------------------------*/
45+
/** @defgroup BEEP_Exported_Types
46+
* @{
47+
*/
48+
49+
/** @defgroup BEEP_Frequency
50+
* @{
51+
*/
52+
typedef enum {
53+
BEEP_Frequency_1KHz = (uint8_t)0x00, /*!< Beep signal output frequency 1 KHz */
54+
BEEP_Frequency_2KHz = (uint8_t)0x40, /*!< Beep signal output frequency 2 KHz */
55+
BEEP_Frequency_4KHz = (uint8_t)0x80 /*!< Beep signal output frequency 4 KHz */
56+
} BEEP_Frequency_TypeDef;
57+
58+
#define IS_BEEP_FREQUENCY(FREQ) (((FREQ) == BEEP_Frequency_1KHz) || \
59+
((FREQ) == BEEP_Frequency_2KHz) || \
60+
((FREQ) == BEEP_Frequency_4KHz))
61+
62+
/**
63+
* @}
64+
*/
65+
66+
/**
67+
* @}
68+
*/
69+
70+
/* Exported constants --------------------------------------------------------*/
71+
/** @defgroup BEEP_Exported_Constants
72+
* @{
73+
*/
74+
75+
#define BEEP_CALIBRATION_DEFAULT ((uint8_t)0x01) /*!< Default value when calibration is not done */
76+
#define LSI_FREQUENCY_MIN ((uint32_t)25000) /*!< LSI minimum value in Hertz */
77+
#define LSI_FREQUENCY_MAX ((uint32_t)75000) /*!< LSI maximum value in Hertz */
78+
79+
/**
80+
* @}
81+
*/
82+
83+
/* Exported macros -----------------------------------------------------------*/
84+
/** @defgroup BEEP_Exported_Macros
85+
* @{
86+
*/
87+
#define IS_LSI_FREQUENCY(FREQ) (((FREQ) >= LSI_FREQUENCY_MIN) && ((FREQ) <= LSI_FREQUENCY_MAX))
88+
89+
/**
90+
* @}
91+
*/
92+
93+
/* Exported functions ------------------------------------------------------- */
94+
95+
/* Function used to set the BEEP configuration to the default reset state *****/
96+
void BEEP_DeInit(void);
97+
98+
/* Initialization and Configuration functions *********************************/
99+
void BEEP_Init(BEEP_Frequency_TypeDef BEEP_Frequency);
100+
void BEEP_Cmd(FunctionalState NewState);
101+
102+
/* Low Speed Internal Clock(LSI) Calibration functions ***********************/
103+
void BEEP_LSClockToTIMConnectCmd(FunctionalState NewState);
104+
void BEEP_LSICalibrationConfig(uint32_t LSIFreqHz);
105+
106+
107+
#endif /* __STM8L15x_BEEP_H */
108+
109+
/**
110+
* @}
111+
*/
112+
113+
/**
114+
* @}
115+
*/
116+
117+
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

0 commit comments

Comments
 (0)