stm8s Lib
stm8s Lib
h Page:1/51
D:\Users\Jagan\Workspace\FanControl_Gitworkspace\Fan_project\lib\inc\ Last modification: 10/03/2024 21:31:40
1: /**
2: ******************************************************************************
3: * @file stm8s.h
4: * @author MCD Application Team
5: * @version V2.3.0
6: * @date 16-June-2017
7: * @brief This file contains all HW registers definitions and memory mapping.
8: ******************************************************************************
9: * @attention
10: *
11: * <h2><center>© COPYRIGHT 2014 STMicroelectronics</center></h2>
12: *
13: * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
14: * You may not use this file except in compliance with the License.
15: * You may obtain a copy of the License at:
16: *
17: * http://www.st.com/software_license_agreement_liberty_v2
18: *
19: * Unless required by applicable law or agreed to in writing, software
20: * distributed under the License is distributed on an "AS IS" BASIS,
21: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22: * See the License for the specific language governing permissions and
23: * limitations under the License.
24: *
25: ******************************************************************************
26: */
27:
28: /* Define to prevent recursive inclusion -------------------------------------*/
29: #ifndef __STM8S_H
30: #define __STM8S_H
31:
32: /** @addtogroup STM8S_StdPeriph_Driver
33: * @{
34: */
35:
36: /* Uncomment the line below according to the target STM8S or STM8A device used in
your
37: application. */
38:
39: /* #define STM8S208 */ /*!< STM8S High density devices with CAN */
40: /* #define STM8S207 */ /*!< STM8S High density devices without CAN */
41: /* #define STM8S007 */ /*!< STM8S Value Line High density devices */
42: /* #define STM8AF52Ax */ /*!< STM8A High density devices with CAN */
43: /* #define STM8AF62Ax */ /*!< STM8A High density devices without CAN */
44: /* #define STM8S105 */ /*!< STM8S Medium density devices */
45: /* #define STM8S005 */ /*!< STM8S Value Line Medium density devices */
46: /* #define STM8AF626x */ /*!< STM8A Medium density devices */
47: /* #define STM8AF622x */ /*!< STM8A Low density devices */
48: /* #define STM8S103 */ /*!< STM8S Low density devices */
49: #define STM8S003 // */ /*!< STM8S Value Line Low density devices */
50: /* #define STM8S903 */ /*!< STM8S Low density devices */
51: /* #define STM8S001 */ /*!< STM8S Value Line Low denisty devices */
52:
53: /* Tip: To avoid modifying this file each time you need to switch between these
54: devices, you can define the device in your toolchain compiler preprocessor.
55:
56: - High-Density STM8A devices are the STM8AF52xx STM8AF6269/8x/Ax,
57: STM8AF51xx, and STM8AF6169/7x/8x/9x/Ax microcontrollers where the Flash memory
58: density ranges between 32 to 128 Kbytes
59: - Medium-Density STM8A devices are the STM8AF622x/4x, STM8AF6266/68,
168:
169: #ifdef RAM_EXECUTION
170: #ifdef _COSMIC_
171: #define IN_RAM(a) a
172: #elif defined (_RAISONANCE_) /* __RCST7__ */
173: #define IN_RAM(a) a inram
174: #else /*_IAR_*/
175: #define IN_RAM(a) __ramfunc a
176: #endif /* _COSMIC_ */
177: #else
178: #define IN_RAM(a) a
179: #endif /* RAM_EXECUTION */
180:
181: /*!< [31:16] STM8S Standard Peripheral Library main version V2.3.0*/
182: #define __STM8S_STDPERIPH_VERSION_MAIN ((uint8_t)0x02) /*!< [31:24] main version
*/
183: #define __STM8S_STDPERIPH_VERSION_SUB1 ((uint8_t)0x03) /*!< [23:16] sub1 version
*/
184: #define __STM8S_STDPERIPH_VERSION_SUB2 ((uint8_t)0x00) /*!< [15:8] sub2 version
*/
185: #define __STM8S_STDPERIPH_VERSION_RC ((uint8_t)0x00) /*!< [7:0] release
candidate */
186: #define __STM8S_STDPERIPH_VERSION ( (__STM8S_STDPERIPH_VERSION_MAIN << 24)\
187: |(__STM8S_STDPERIPH_VERSION_SUB1 << 16)\
188: |(__STM8S_STDPERIPH_VERSION_SUB2 << 8)\
189: |(__STM8S_STDPERIPH_VERSION_RC))
190:
191: /******************************************************************************/
192:
193: /* Includes ------------------------------------------------------------------*/
194:
195: /* Exported types and constants ----------------------------------------------*/
196:
197: /** @addtogroup Exported_types
198: * @{
199: */
200:
201: /**
202: * IO definitions
203: *
204: * define access restrictions to peripheral registers
205: */
206: #define __I volatile const /*!< defines 'read only' permissions */
207: #define __O volatile /*!< defines 'write only' permissions */
208: #define __IO volatile /*!< defines 'read / write' permissions */
209:
210: /*!< Signed integer types */
211: typedef signed char int8_t;
212: typedef signed short int16_t;
213: typedef signed long int32_t;
214:
215: /*!< Unsigned integer types */
216: typedef unsigned char uint8_t;
217: typedef unsigned short uint16_t;
218: typedef unsigned long uint32_t;
219:
220: /*!< STM8 Standard Peripheral Library old types (maintained for legacy purpose) */
221:
222: typedef int32_t s32;
223: typedef int16_t s16;
342: */
343: #define ADC1_CSR_RESET_VALUE ((uint8_t)0x00)
344: #define ADC1_CR1_RESET_VALUE ((uint8_t)0x00)
345: #define ADC1_CR2_RESET_VALUE ((uint8_t)0x00)
346: #define ADC1_CR3_RESET_VALUE ((uint8_t)0x00)
347: #define ADC1_TDRL_RESET_VALUE ((uint8_t)0x00)
348: #define ADC1_TDRH_RESET_VALUE ((uint8_t)0x00)
349: #define ADC1_HTRL_RESET_VALUE ((uint8_t)0x03)
350: #define ADC1_HTRH_RESET_VALUE ((uint8_t)0xFF)
351: #define ADC1_LTRH_RESET_VALUE ((uint8_t)0x00)
352: #define ADC1_LTRL_RESET_VALUE ((uint8_t)0x00)
353: #define ADC1_AWCRH_RESET_VALUE ((uint8_t)0x00)
354: #define ADC1_AWCRL_RESET_VALUE ((uint8_t)0x00)
355: /**
356: * @}
357: */
358:
359: /** @addtogroup ADC1_Registers_Bits_Definition
360: * @{
361: */
362: #define ADC1_CSR_EOC ((uint8_t)0x80) /*!< End of Conversion mask */
363: #define ADC1_CSR_AWD ((uint8_t)0x40) /*!< Analog Watch Dog Status mask */
364: #define ADC1_CSR_EOCIE ((uint8_t)0x20) /*!< Interrupt Enable for EOC mask */
365: #define ADC1_CSR_AWDIE ((uint8_t)0x10) /*!< Analog Watchdog interrupt enable
mask */
366: #define ADC1_CSR_CH ((uint8_t)0x0F) /*!< Channel selection bits mask */
367:
368: #define ADC1_CR1_SPSEL ((uint8_t)0x70) /*!< Prescaler selection mask */
369: #define ADC1_CR1_CONT ((uint8_t)0x02) /*!< Continuous conversion mask */
370: #define ADC1_CR1_ADON ((uint8_t)0x01) /*!< A/D Converter on/off mask */
371:
372: #define ADC1_CR2_EXTTRIG ((uint8_t)0x40) /*!< External trigger enable mask */
373: #define ADC1_CR2_EXTSEL ((uint8_t)0x30) /*!< External event selection mask */
374: #define ADC1_CR2_ALIGN ((uint8_t)0x08) /*!< Data Alignment mask */
375: #define ADC1_CR2_SCAN ((uint8_t)0x02) /*!< Scan mode mask */
376:
377: #define ADC1_CR3_DBUF ((uint8_t)0x80) /*!< Data Buffer Enable mask */
378: #define ADC1_CR3_OVR ((uint8_t)0x40) /*!< Overrun Status Flag mask */
379:
380: #endif /* (STM8S105) ||(STM8S103) || (STM8S005) ||(STM8S003) || (STM8S001) ||
(STM8S903) || (STM8AF626x) || (STM8AF622x) */
381: /**
382: * @}
383: */
384:
385: /*----------------------------------------------------------------------------*/
386: /**
387: * @brief Analog to Digital Converter (ADC2)
388: */
389: #if defined(STM8S208) || defined(STM8S207) || defined (STM8S007) || defined
(STM8AF52Ax) || defined (STM8AF62Ax)
390: typedef struct ADC2_struct
391: {
392: __IO uint8_t CSR; /*!< ADC2 control status register */
393: __IO uint8_t CR1; /*!< ADC2 configuration register 1 */
394: __IO uint8_t CR2; /*!< ADC2 configuration register 2 */
395: uint8_t RESERVED; /*!< Reserved byte */
396: __IO uint8_t DRH; /*!< ADC2 Data high */
397: __IO uint8_t DRL; /*!< ADC2 Data low */
398: __IO uint8_t TDRH; /*!< ADC2 Schmitt trigger disable register high */
399: __IO uint8_t TDRL; /*!< ADC2 Schmitt trigger disable register low */
400: }
401: ADC2_TypeDef;
402:
403: /** @addtogroup ADC2_Registers_Reset_Value
404: * @{
405: */
406: #define ADC2_CSR_RESET_VALUE ((uint8_t)0x00)
407: #define ADC2_CR1_RESET_VALUE ((uint8_t)0x00)
408: #define ADC2_CR2_RESET_VALUE ((uint8_t)0x00)
409: #define ADC2_TDRL_RESET_VALUE ((uint8_t)0x00)
410: #define ADC2_TDRH_RESET_VALUE ((uint8_t)0x00)
411: /**
412: * @}
413: */
414:
415: /** @addtogroup ADC2_Registers_Bits_Definition
416: * @{
417: */
418: #define ADC2_CSR_EOC ((uint8_t)0x80) /*!< End of Conversion mask */
419: #define ADC2_CSR_EOCIE ((uint8_t)0x20) /*!< Interrupt Enable for EOC mask */
420: #define ADC2_CSR_CH ((uint8_t)0x0F) /*!< Channel selection bits mask */
421:
422: #define ADC2_CR1_SPSEL ((uint8_t)0x70) /*!< Prescaler selection mask */
423: #define ADC2_CR1_CONT ((uint8_t)0x02) /*!< Continuous conversion mask */
424: #define ADC2_CR1_ADON ((uint8_t)0x01) /*!< A/D Converter on/off mask */
425:
426: #define ADC2_CR2_EXTTRIG ((uint8_t)0x40) /*!< External trigger enable mask */
427: #define ADC2_CR2_EXTSEL ((uint8_t)0x30) /*!< External event selection mask */
428: #define ADC2_CR2_ALIGN ((uint8_t)0x08) /*!< Data Alignment mask */
429:
430: #endif /* (STM8S208) ||(STM8S207) || defined (STM8S007) || (STM8AF62Ax) ||
(STM8AF52Ax) */
431: /**
432: * @}
433: */
434:
435: /*----------------------------------------------------------------------------*/
436:
437: /**
438: * @brief Auto Wake Up (AWU) peripheral registers.
439: */
440: typedef struct AWU_struct
441: {
442: __IO uint8_t CSR; /*!< AWU Control status register */
443: __IO uint8_t APR; /*!< AWU Asynchronous prescaler buffer */
444: __IO uint8_t TBR; /*!< AWU Time base selection register */
445: }
446: AWU_TypeDef;
447:
448: /** @addtogroup AWU_Registers_Reset_Value
449: * @{
450: */
451: #define AWU_CSR_RESET_VALUE ((uint8_t)0x00)
452: #define AWU_APR_RESET_VALUE ((uint8_t)0x3F)
453: #define AWU_TBR_RESET_VALUE ((uint8_t)0x00)
454:
455: /**
456: * @}
457: */
458:
459: /** @addtogroup AWU_Registers_Bits_Definition
460: * @{
461: */
462:
463: #define AWU_CSR_AWUF ((uint8_t)0x20) /*!< Interrupt flag mask */
464: #define AWU_CSR_AWUEN ((uint8_t)0x10) /*!< Auto Wake-up enable mask */
465: #define AWU_CSR_MSR ((uint8_t)0x01) /*!< LSI Measurement enable mask */
466:
467: #define AWU_APR_APR ((uint8_t)0x3F) /*!< Asynchronous Prescaler divider mask */
468:
469: #define AWU_TBR_AWUTB ((uint8_t)0x0F) /*!< Timebase selection mask */
470:
471: /**
472: * @}
473: */
474:
475: /*----------------------------------------------------------------------------*/
476: /**
477: * @brief Beeper (BEEP) peripheral registers.
478: */
479:
480: typedef struct BEEP_struct
481: {
482: __IO uint8_t CSR; /*!< BEEP Control status register */
483: }
484: BEEP_TypeDef;
485:
486: /** @addtogroup BEEP_Registers_Reset_Value
487: * @{
488: */
489: #define BEEP_CSR_RESET_VALUE ((uint8_t)0x1F)
490: /**
491: * @}
492: */
493:
494: /** @addtogroup BEEP_Registers_Bits_Definition
495: * @{
496: */
497: #define BEEP_CSR_BEEPSEL ((uint8_t)0xC0) /*!< Beeper frequency selection mask */
498: #define BEEP_CSR_BEEPEN ((uint8_t)0x20) /*!< Beeper enable mask */
499: #define BEEP_CSR_BEEPDIV ((uint8_t)0x1F) /*!< Beeper Divider prescalar mask */
500: /**
501: * @}
502: */
503:
504: /*----------------------------------------------------------------------------*/
505: /**
506: * @brief Clock Controller (CLK)
507: */
508: typedef struct CLK_struct
509: {
510: __IO uint8_t ICKR; /*!< Internal Clocks Control Register */
511: __IO uint8_t ECKR; /*!< External Clocks Control Register */
512: uint8_t RESERVED; /*!< Reserved byte */
513: __IO uint8_t CMSR; /*!< Clock Master Status Register */
514: __IO uint8_t SWR; /*!< Clock Master Switch Register */
515: __IO uint8_t SWCR; /*!< Switch Control Register */
516: __IO uint8_t CKDIVR; /*!< Clock Divider Register */
517: __IO uint8_t PCKENR1; /*!< Peripheral Clock Gating Register 1 */
774: /*CNTRL*/
775: #define TIM1_CNTRL_CNT ((uint8_t)0xFF) /*!< Counter Value (LSB) mask. */
776: /*PSCH*/
777: #define TIM1_PSCH_PSC ((uint8_t)0xFF) /*!< Prescaler Value (MSB) mask. */
778: /*PSCL*/
779: #define TIM1_PSCL_PSC ((uint8_t)0xFF) /*!< Prescaler Value (LSB) mask. */
780: /*ARR*/
781: #define TIM1_ARRH_ARR ((uint8_t)0xFF) /*!< Autoreload Value (MSB) mask. */
782: #define TIM1_ARRL_ARR ((uint8_t)0xFF) /*!< Autoreload Value (LSB) mask. */
783: /*RCR*/
784: #define TIM1_RCR_REP ((uint8_t)0xFF) /*!< Repetition Counter Value mask. */
785: /*CCR1*/
786: #define TIM1_CCR1H_CCR1 ((uint8_t)0xFF) /*!< Capture/Compare 1 Value (MSB) mask. *
787: #define TIM1_CCR1L_CCR1 ((uint8_t)0xFF) /*!< Capture/Compare 1 Value (LSB) mask. *
788: /*CCR2*/
789: #define TIM1_CCR2H_CCR2 ((uint8_t)0xFF) /*!< Capture/Compare 2 Value (MSB) mask. *
790: #define TIM1_CCR2L_CCR2 ((uint8_t)0xFF) /*!< Capture/Compare 2 Value (LSB) mask. *
791: /*CCR3*/
792: #define TIM1_CCR3H_CCR3 ((uint8_t)0xFF) /*!< Capture/Compare 3 Value (MSB) mask. *
793: #define TIM1_CCR3L_CCR3 ((uint8_t)0xFF) /*!< Capture/Compare 3 Value (LSB) mask. *
794: /*CCR4*/
795: #define TIM1_CCR4H_CCR4 ((uint8_t)0xFF) /*!< Capture/Compare 4 Value (MSB) mask. *
796: #define TIM1_CCR4L_CCR4 ((uint8_t)0xFF) /*!< Capture/Compare 4 Value (LSB) mask. *
797: /*BKR*/
798: #define TIM1_BKR_MOE ((uint8_t)0x80) /*!< Main Output Enable mask. */
799: #define TIM1_BKR_AOE ((uint8_t)0x40) /*!< Automatic Output Enable mask. */
800: #define TIM1_BKR_BKP ((uint8_t)0x20) /*!< Break Polarity mask. */
801: #define TIM1_BKR_BKE ((uint8_t)0x10) /*!< Break Enable mask. */
802: #define TIM1_BKR_OSSR ((uint8_t)0x08) /*!< Off-State Selection for Run mode
mask. */
803: #define TIM1_BKR_OSSI ((uint8_t)0x04) /*!< Off-State Selection for Idle mode
mask. */
804: #define TIM1_BKR_LOCK ((uint8_t)0x03) /*!< Lock Configuration mask. */
805: /*DTR*/
806: #define TIM1_DTR_DTG ((uint8_t)0xFF) /*!< Dead-Time Generator set-up mask. */
807: /*OISR*/
808: #define TIM1_OISR_OIS4 ((uint8_t)0x40) /*!< Output Idle state 4 (OC4 output)
mask. */
809: #define TIM1_OISR_OIS3N ((uint8_t)0x20) /*!< Output Idle state 3 (OC3N output)
mask. */
810: #define TIM1_OISR_OIS3 ((uint8_t)0x10) /*!< Output Idle state 3 (OC3 output)
mask. */
811: #define TIM1_OISR_OIS2N ((uint8_t)0x08) /*!< Output Idle state 2 (OC2N output)
mask. */
812: #define TIM1_OISR_OIS2 ((uint8_t)0x04) /*!< Output Idle state 2 (OC2 output)
mask. */
813: #define TIM1_OISR_OIS1N ((uint8_t)0x02) /*!< Output Idle state 1 (OC1N output)
mask. */
814: #define TIM1_OISR_OIS1 ((uint8_t)0x01) /*!< Output Idle state 1 (OC1 output)
mask. */
815: /**
816: * @}
817: */
818:
819: /*----------------------------------------------------------------------------*/
820: /**
821: * @brief 16-bit timer (TIM2)
822: */
823:
824: typedef struct TIM2_struct
825: {
826: __IO uint8_t CR1; /*!< control register 1 */
827: #if defined(STM8S103) || defined(STM8S003) || defined(STM8S001)
828: uint8_t RESERVED1; /*!< Reserved register */
829: uint8_t RESERVED2; /*!< Reserved register */
830: #endif
831: __IO uint8_t IER; /*!< interrupt enable register */
832: __IO uint8_t SR1; /*!< status register 1 */
833: __IO uint8_t SR2; /*!< status register 2 */
834: __IO uint8_t EGR; /*!< event generation register */
835: __IO uint8_t CCMR1; /*!< CC mode register 1 */
836: __IO uint8_t CCMR2; /*!< CC mode register 2 */
837: __IO uint8_t CCMR3; /*!< CC mode register 3 */
838: __IO uint8_t CCER1; /*!< CC enable register 1 */
839: __IO uint8_t CCER2; /*!< CC enable register 2 */
840: __IO uint8_t CNTRH; /*!< counter high */
841: __IO uint8_t CNTRL; /*!< counter low */
842: __IO uint8_t PSCR; /*!< prescaler register */
843: __IO uint8_t ARRH; /*!< auto-reload register high */
844: __IO uint8_t ARRL; /*!< auto-reload register low */
845: __IO uint8_t CCR1H; /*!< capture/compare register 1 high */
846: __IO uint8_t CCR1L; /*!< capture/compare register 1 low */
847: __IO uint8_t CCR2H; /*!< capture/compare register 2 high */
848: __IO uint8_t CCR2L; /*!< capture/compare register 2 low */
849: __IO uint8_t CCR3H; /*!< capture/compare register 3 high */
850: __IO uint8_t CCR3L; /*!< capture/compare register 3 low */
851: }
852: TIM2_TypeDef;
853:
854: /** @addtogroup TIM2_Registers_Reset_Value
855: * @{
856: */
857:
858: #define TIM2_CR1_RESET_VALUE ((uint8_t)0x00)
859: #define TIM2_IER_RESET_VALUE ((uint8_t)0x00)
860: #define TIM2_SR1_RESET_VALUE ((uint8_t)0x00)
861: #define TIM2_SR2_RESET_VALUE ((uint8_t)0x00)
862: #define TIM2_EGR_RESET_VALUE ((uint8_t)0x00)
863: #define TIM2_CCMR1_RESET_VALUE ((uint8_t)0x00)
864: #define TIM2_CCMR2_RESET_VALUE ((uint8_t)0x00)
865: #define TIM2_CCMR3_RESET_VALUE ((uint8_t)0x00)
866: #define TIM2_CCER1_RESET_VALUE ((uint8_t)0x00)
867: #define TIM2_CCER2_RESET_VALUE ((uint8_t)0x00)
868: #define TIM2_CNTRH_RESET_VALUE ((uint8_t)0x00)
869: #define TIM2_CNTRL_RESET_VALUE ((uint8_t)0x00)
870: #define TIM2_PSCR_RESET_VALUE ((uint8_t)0x00)
871: #define TIM2_ARRH_RESET_VALUE ((uint8_t)0xFF)
872: #define TIM2_ARRL_RESET_VALUE ((uint8_t)0xFF)
873: #define TIM2_CCR1H_RESET_VALUE ((uint8_t)0x00)
874: #define TIM2_CCR1L_RESET_VALUE ((uint8_t)0x00)
875: #define TIM2_CCR2H_RESET_VALUE ((uint8_t)0x00)
876: #define TIM2_CCR2L_RESET_VALUE ((uint8_t)0x00)
877: #define TIM2_CCR3H_RESET_VALUE ((uint8_t)0x00)
878: #define TIM2_CCR3L_RESET_VALUE ((uint8_t)0x00)
879:
880: /**
881: * @}
882: */
883:
884: /** @addtogroup TIM2_Registers_Bits_Definition
885: * @{
886: */
887: /*CR1*/
888: #define TIM2_CR1_ARPE ((uint8_t)0x80) /*!< Auto-Reload Preload Enable mask. */
889: #define TIM2_CR1_OPM ((uint8_t)0x08) /*!< One Pulse Mode mask. */
890: #define TIM2_CR1_URS ((uint8_t)0x04) /*!< Update Request Source mask. */
891: #define TIM2_CR1_UDIS ((uint8_t)0x02) /*!< Update DIsable mask. */
892: #define TIM2_CR1_CEN ((uint8_t)0x01) /*!< Counter Enable mask. */
893: /*IER*/
894: #define TIM2_IER_CC3IE ((uint8_t)0x08) /*!< Capture/Compare 3 Interrupt Enable
mask. */
895: #define TIM2_IER_CC2IE ((uint8_t)0x04) /*!< Capture/Compare 2 Interrupt Enable
mask. */
896: #define TIM2_IER_CC1IE ((uint8_t)0x02) /*!< Capture/Compare 1 Interrupt Enable
mask. */
897: #define TIM2_IER_UIE ((uint8_t)0x01) /*!< Update Interrupt Enable mask. */
898: /*SR1*/
899: #define TIM2_SR1_CC3IF ((uint8_t)0x08) /*!< Capture/Compare 3 Interrupt Flag
mask. */
900: #define TIM2_SR1_CC2IF ((uint8_t)0x04) /*!< Capture/Compare 2 Interrupt Flag
mask. */
901: #define TIM2_SR1_CC1IF ((uint8_t)0x02) /*!< Capture/Compare 1 Interrupt Flag
mask. */
902: #define TIM2_SR1_UIF ((uint8_t)0x01) /*!< Update Interrupt Flag mask. */
903: /*SR2*/
904: #define TIM2_SR2_CC3OF ((uint8_t)0x08) /*!< Capture/Compare 3 Overcapture Flag
mask. */
905: #define TIM2_SR2_CC2OF ((uint8_t)0x04) /*!< Capture/Compare 2 Overcapture Flag
mask. */
906: #define TIM2_SR2_CC1OF ((uint8_t)0x02) /*!< Capture/Compare 1 Overcapture Flag
mask. */
907: /*EGR*/
908: #define TIM2_EGR_CC3G ((uint8_t)0x08) /*!< Capture/Compare 3 Generation mask. */
909: #define TIM2_EGR_CC2G ((uint8_t)0x04) /*!< Capture/Compare 2 Generation mask. */
910: #define TIM2_EGR_CC1G ((uint8_t)0x02) /*!< Capture/Compare 1 Generation mask. */
911: #define TIM2_EGR_UG ((uint8_t)0x01) /*!< Update Generation mask. */
912: /*CCMR*/
913: #define TIM2_CCMR_ICxPSC ((uint8_t)0x0C) /*!< Input Capture x Prescaler mask. */
914: #define TIM2_CCMR_ICxF ((uint8_t)0xF0) /*!< Input Capture x Filter mask. */
915: #define TIM2_CCMR_OCM ((uint8_t)0x70) /*!< Output Compare x Mode mask. */
916: #define TIM2_CCMR_OCxPE ((uint8_t)0x08) /*!< Output Compare x Preload Enable mask.
*/
917: #define TIM2_CCMR_CCxS ((uint8_t)0x03) /*!< Capture/Compare x Selection mask. */
918: /*CCER1*/
919: #define TIM2_CCER1_CC2P ((uint8_t)0x20) /*!< Capture/Compare 2 output Polarity
mask. */
920: #define TIM2_CCER1_CC2E ((uint8_t)0x10) /*!< Capture/Compare 2 output enable mask.
*/
921: #define TIM2_CCER1_CC1P ((uint8_t)0x02) /*!< Capture/Compare 1 output Polarity
mask. */
922: #define TIM2_CCER1_CC1E ((uint8_t)0x01) /*!< Capture/Compare 1 output enable mask.
*/
923: /*CCER2*/
924: #define TIM2_CCER2_CC3P ((uint8_t)0x02) /*!< Capture/Compare 3 output Polarity
mask. */
925: #define TIM2_CCER2_CC3E ((uint8_t)0x01) /*!< Capture/Compare 3 output enable mask.
*/
926: /*CNTR*/
927: #define TIM2_CNTRH_CNT ((uint8_t)0xFF) /*!< Counter Value (MSB) mask. */
928: #define TIM2_CNTRL_CNT ((uint8_t)0xFF) /*!< Counter Value (LSB) mask. */
929: /*PSCR*/
930: #define TIM2_PSCR_PSC ((uint8_t)0xFF) /*!< Prescaler Value (MSB) mask. */
931: /*ARR*/
932: #define TIM2_ARRH_ARR ((uint8_t)0xFF) /*!< Autoreload Value (MSB) mask. */
933: #define TIM2_ARRL_ARR ((uint8_t)0xFF) /*!< Autoreload Value (LSB) mask. */
934: /*CCR1*/
935: #define TIM2_CCR1H_CCR1 ((uint8_t)0xFF) /*!< Capture/Compare 1 Value (MSB) mask. *
936: #define TIM2_CCR1L_CCR1 ((uint8_t)0xFF) /*!< Capture/Compare 1 Value (LSB) mask. *
937: /*CCR2*/
938: #define TIM2_CCR2H_CCR2 ((uint8_t)0xFF) /*!< Capture/Compare 2 Value (MSB) mask. *
939: #define TIM2_CCR2L_CCR2 ((uint8_t)0xFF) /*!< Capture/Compare 2 Value (LSB) mask. *
940: /*CCR3*/
941: #define TIM2_CCR3H_CCR3 ((uint8_t)0xFF) /*!< Capture/Compare 3 Value (MSB) mask. *
942: #define TIM2_CCR3L_CCR3 ((uint8_t)0xFF) /*!< Capture/Compare 3 Value (LSB) mask. *
943:
944: /**
945: * @}
946: */
947:
948: /*----------------------------------------------------------------------------*/
949: /**
950: * @brief 16-bit timer (TIM3)
951: */
952: typedef struct TIM3_struct
953: {
954: __IO uint8_t CR1; /*!< control register 1 */
955: __IO uint8_t IER; /*!< interrupt enable register */
956: __IO uint8_t SR1; /*!< status register 1 */
957: __IO uint8_t SR2; /*!< status register 2 */
958: __IO uint8_t EGR; /*!< event generation register */
959: __IO uint8_t CCMR1; /*!< CC mode register 1 */
960: __IO uint8_t CCMR2; /*!< CC mode register 2 */
961: __IO uint8_t CCER1; /*!< CC enable register 1 */
962: __IO uint8_t CNTRH; /*!< counter high */
963: __IO uint8_t CNTRL; /*!< counter low */
964: __IO uint8_t PSCR; /*!< prescaler register */
965: __IO uint8_t ARRH; /*!< auto-reload register high */
966: __IO uint8_t ARRL; /*!< auto-reload register low */
967: __IO uint8_t CCR1H; /*!< capture/compare register 1 high */
968: __IO uint8_t CCR1L; /*!< capture/compare register 1 low */
969: __IO uint8_t CCR2H; /*!< capture/compare register 2 high */
970: __IO uint8_t CCR2L; /*!< capture/compare register 2 low */
971: }
972: TIM3_TypeDef;
973:
974: /** @addtogroup TIM3_Registers_Reset_Value
975: * @{
976: */
977:
978: #define TIM3_CR1_RESET_VALUE ((uint8_t)0x00)
979: #define TIM3_IER_RESET_VALUE ((uint8_t)0x00)
980: #define TIM3_SR1_RESET_VALUE ((uint8_t)0x00)
981: #define TIM3_SR2_RESET_VALUE ((uint8_t)0x00)
982: #define TIM3_EGR_RESET_VALUE ((uint8_t)0x00)
983: #define TIM3_CCMR1_RESET_VALUE ((uint8_t)0x00)
984: #define TIM3_CCMR2_RESET_VALUE ((uint8_t)0x00)
985: #define TIM3_CCER1_RESET_VALUE ((uint8_t)0x00)
986: #define TIM3_CNTRH_RESET_VALUE ((uint8_t)0x00)
987: #define TIM3_CNTRL_RESET_VALUE ((uint8_t)0x00)
988: #define TIM3_PSCR_RESET_VALUE ((uint8_t)0x00)
1038: /*PSCR*/
1039: #define TIM3_PSCR_PSC ((uint8_t)0xFF) /*!< Prescaler Value (MSB) mask. */
1040: /*ARR*/
1041: #define TIM3_ARRH_ARR ((uint8_t)0xFF) /*!< Autoreload Value (MSB) mask. */
1042: #define TIM3_ARRL_ARR ((uint8_t)0xFF) /*!< Autoreload Value (LSB) mask. */
1043: /*CCR1*/
1044: #define TIM3_CCR1H_CCR1 ((uint8_t)0xFF) /*!< Capture/Compare 1 Value (MSB) mask. *
1045: #define TIM3_CCR1L_CCR1 ((uint8_t)0xFF) /*!< Capture/Compare 1 Value (LSB) mask. *
1046: /*CCR2*/
1047: #define TIM3_CCR2H_CCR2 ((uint8_t)0xFF) /*!< Capture/Compare 2 Value (MSB) mask. *
1048: #define TIM3_CCR2L_CCR2 ((uint8_t)0xFF) /*!< Capture/Compare 2 Value (LSB) mask. *
1049: /**
1050: * @}
1051: */
1052:
1053: /*----------------------------------------------------------------------------*/
1054: /**
1055: * @brief 8-bit system timer (TIM4)
1056: */
1057:
1058: typedef struct TIM4_struct
1059: {
1060: __IO uint8_t CR1; /*!< control register 1 */
1061: #if defined(STM8S103) || defined(STM8S003) || defined(STM8S001)
1062: uint8_t RESERVED1; /*!< Reserved register */
1063: uint8_t RESERVED2; /*!< Reserved register */
1064: #endif
1065: __IO uint8_t IER; /*!< interrupt enable register */
1066: __IO uint8_t SR1; /*!< status register 1 */
1067: __IO uint8_t EGR; /*!< event generation register */
1068: __IO uint8_t CNTR; /*!< counter register */
1069: __IO uint8_t PSCR; /*!< prescaler register */
1070: __IO uint8_t ARR; /*!< auto-reload register */
1071: }
1072: TIM4_TypeDef;
1073:
1074: /** @addtogroup TIM4_Registers_Reset_Value
1075: * @{
1076: */
1077:
1078: #define TIM4_CR1_RESET_VALUE ((uint8_t)0x00)
1079: #define TIM4_IER_RESET_VALUE ((uint8_t)0x00)
1080: #define TIM4_SR1_RESET_VALUE ((uint8_t)0x00)
1081: #define TIM4_EGR_RESET_VALUE ((uint8_t)0x00)
1082: #define TIM4_CNTR_RESET_VALUE ((uint8_t)0x00)
1083: #define TIM4_PSCR_RESET_VALUE ((uint8_t)0x00)
1084: #define TIM4_ARR_RESET_VALUE ((uint8_t)0xFF)
1085:
1086: /**
1087: * @}
1088: */
1089:
1090: /** @addtogroup TIM4_Registers_Bits_Definition
1091: * @{
1092: */
1093: /*CR1*/
1094: #define TIM4_CR1_ARPE ((uint8_t)0x80) /*!< Auto-Reload Preload Enable mask. */
1095: #define TIM4_CR1_OPM ((uint8_t)0x08) /*!< One Pulse Mode mask. */
1096: #define TIM4_CR1_URS ((uint8_t)0x04) /*!< Update Request Source mask. */
1097: #define TIM4_CR1_UDIS ((uint8_t)0x02) /*!< Update DIsable mask. */
1249: /*CCMR*/
1250: #define TIM5_CCMR_TIxDirect_Set ((uint8_t)0x01)
1251: /**
1252: * @}
1253: */
1254:
1255: /*----------------------------------------------------------------------------*/
1256: /**
1257: * @brief 8-bit system timer with synchro module(TIM6)
1258: */
1259:
1260: typedef struct TIM6_struct
1261: {
1262: __IO uint8_t CR1; /*!< control register 1 */
1263: __IO uint8_t CR2; /*!< control register 2 */
1264: __IO uint8_t SMCR; /*!< Synchro mode control register */
1265: __IO uint8_t IER; /*!< interrupt enable register */
1266: __IO uint8_t SR1; /*!< status register 1 */
1267: __IO uint8_t EGR; /*!< event generation register */
1268: __IO uint8_t CNTR; /*!< counter register */
1269: __IO uint8_t PSCR; /*!< prescaler register */
1270: __IO uint8_t ARR; /*!< auto-reload register */
1271: }
1272: TIM6_TypeDef;
1273: /** @addtogroup TIM6_Registers_Reset_Value
1274: * @{
1275: */
1276: #define TIM6_CR1_RESET_VALUE ((uint8_t)0x00)
1277: #define TIM6_CR2_RESET_VALUE ((uint8_t)0x00)
1278: #define TIM6_SMCR_RESET_VALUE ((uint8_t)0x00)
1279: #define TIM6_IER_RESET_VALUE ((uint8_t)0x00)
1280: #define TIM6_SR1_RESET_VALUE ((uint8_t)0x00)
1281: #define TIM6_EGR_RESET_VALUE ((uint8_t)0x00)
1282: #define TIM6_CNTR_RESET_VALUE ((uint8_t)0x00)
1283: #define TIM6_PSCR_RESET_VALUE ((uint8_t)0x00)
1284: #define TIM6_ARR_RESET_VALUE ((uint8_t)0xFF)
1285:
1286: /**
1287: * @}
1288: */
1289:
1290: /** @addtogroup TIM6_Registers_Bits_Definition
1291: * @{
1292: */
1293: /* CR1*/
1294: #define TIM6_CR1_ARPE ((uint8_t)0x80) /*!< Auto-Reload Preload Enable Mask. */
1295: #define TIM6_CR1_OPM ((uint8_t)0x08) /*!< One Pulse Mode Mask. */
1296: #define TIM6_CR1_URS ((uint8_t)0x04) /*!< Update Request Source Mask. */
1297: #define TIM6_CR1_UDIS ((uint8_t)0x02) /*!< Update DIsable Mask. */
1298: #define TIM6_CR1_CEN ((uint8_t)0x01) /*!< Counter Enable Mask. */
1299: /* CR2*/
1300: #define TIM6_CR2_MMS ((uint8_t)0x70) /*!< MMS Selection Mask. */
1301: /* SMCR*/
1302: #define TIM6_SMCR_MSM ((uint8_t)0x80) /*!< Master/Slave Mode Mask. */
1303: #define TIM6_SMCR_TS ((uint8_t)0x70) /*!< Trigger Selection Mask. */
1304: #define TIM6_SMCR_SMS ((uint8_t)0x07) /*!< Slave Mode Selection Mask. */
1305: /* IER*/
1306: #define TIM6_IER_TIE ((uint8_t)0x40) /*!< Trigger Interrupt Enable Mask. */
1307: #define TIM6_IER_UIE ((uint8_t)0x01) /*!< Update Interrupt Enable Mask. */
1308: /* SR1*/
1369:
1370: /** @addtogroup I2C_Registers_Bits_Definition
1371: * @{
1372: */
1373:
1374: #define I2C_CR1_NOSTRETCH ((uint8_t)0x80) /*!< Clock Stretching Disable (Slave
mode) */
1375: #define I2C_CR1_ENGC ((uint8_t)0x40) /*!< General Call Enable */
1376: #define I2C_CR1_PE ((uint8_t)0x01) /*!< Peripheral Enable */
1377:
1378: #define I2C_CR2_SWRST ((uint8_t)0x80) /*!< Software Reset */
1379: #define I2C_CR2_POS ((uint8_t)0x08) /*!< Acknowledge */
1380: #define I2C_CR2_ACK ((uint8_t)0x04) /*!< Acknowledge Enable */
1381: #define I2C_CR2_STOP ((uint8_t)0x02) /*!< Stop Generation */
1382: #define I2C_CR2_START ((uint8_t)0x01) /*!< Start Generation */
1383:
1384: #define I2C_FREQR_FREQ ((uint8_t)0x3F) /*!< Peripheral Clock Frequency */
1385:
1386: #define I2C_OARL_ADD ((uint8_t)0xFE) /*!< Interface Address bits [7..1] */
1387: #define I2C_OARL_ADD0 ((uint8_t)0x01) /*!< Interface Address bit0 */
1388:
1389: #define I2C_OARH_ADDMODE ((uint8_t)0x80) /*!< Addressing Mode (Slave mode) */
1390: #define I2C_OARH_ADDCONF ((uint8_t)0x40) /*!< Address Mode Configuration */
1391: #define I2C_OARH_ADD ((uint8_t)0x06) /*!< Interface Address bits [9..8] */
1392:
1393: #define I2C_DR_DR ((uint8_t)0xFF) /*!< Data Register */
1394:
1395: #define I2C_SR1_TXE ((uint8_t)0x80) /*!< Data Register Empty (transmitters) *
1396: #define I2C_SR1_RXNE ((uint8_t)0x40) /*!< Data Register not Empty (receivers)
*/
1397: #define I2C_SR1_STOPF ((uint8_t)0x10) /*!< Stop detection (Slave mode) */
1398: #define I2C_SR1_ADD10 ((uint8_t)0x08) /*!< 10-bit header sent (Master mode) */
1399: #define I2C_SR1_BTF ((uint8_t)0x04) /*!< Byte Transfer Finished */
1400: #define I2C_SR1_ADDR ((uint8_t)0x02) /*!< Address sent (master mode)/matched
(slave mode) */
1401: #define I2C_SR1_SB ((uint8_t)0x01) /*!< Start Bit (Master mode) */
1402:
1403: #define I2C_SR2_WUFH ((uint8_t)0x20) /*!< Wake-up from Halt */
1404: #define I2C_SR2_OVR ((uint8_t)0x08) /*!< Overrun/Underrun */
1405: #define I2C_SR2_AF ((uint8_t)0x04) /*!< Acknowledge Failure */
1406: #define I2C_SR2_ARLO ((uint8_t)0x02) /*!< Arbitration Lost (master mode) */
1407: #define I2C_SR2_BERR ((uint8_t)0x01) /*!< Bus Error */
1408:
1409: #define I2C_SR3_GENCALL ((uint8_t)0x10) /*!< General Call Header (Slave mode) */
1410: #define I2C_SR3_TRA ((uint8_t)0x04) /*!< Transmitter/Receiver */
1411: #define I2C_SR3_BUSY ((uint8_t)0x02) /*!< Bus Busy */
1412: #define I2C_SR3_MSL ((uint8_t)0x01) /*!< Master/Slave */
1413:
1414: #define I2C_ITR_ITBUFEN ((uint8_t)0x04) /*!< Buffer Interrupt Enable */
1415: #define I2C_ITR_ITEVTEN ((uint8_t)0x02) /*!< Event Interrupt Enable */
1416: #define I2C_ITR_ITERREN ((uint8_t)0x01) /*!< Error Interrupt Enable */
1417:
1418: #define I2C_CCRL_CCR ((uint8_t)0xFF) /*!< Clock Control Register (Master mode)
*/
1419:
1420: #define I2C_CCRH_FS ((uint8_t)0x80) /*!< Master Mode Selection */
1421: #define I2C_CCRH_DUTY ((uint8_t)0x40) /*!< Fast Mode Duty Cycle */
1422: #define I2C_CCRH_CCR ((uint8_t)0x0F) /*!< Clock Control Register in
Fast/Standard mode (Master mode) bits [11..8] */
1423:
1481: * @{
1482: */
1483:
1484: #define EXTI_CR1_RESET_VALUE ((uint8_t)0x00)
1485: #define EXTI_CR2_RESET_VALUE ((uint8_t)0x00)
1486:
1487: /**
1488: * @}
1489: */
1490:
1491: /** @addtogroup EXTI_Registers_Bits_Definition
1492: * @{
1493: */
1494:
1495: #define EXTI_CR1_PDIS ((uint8_t)0xC0) /*!< PORTD external interrupt sensitivity
bits mask */
1496: #define EXTI_CR1_PCIS ((uint8_t)0x30) /*!< PORTC external interrupt sensitivity
bits mask */
1497: #define EXTI_CR1_PBIS ((uint8_t)0x0C) /*!< PORTB external interrupt sensitivity
bits mask */
1498: #define EXTI_CR1_PAIS ((uint8_t)0x03) /*!< PORTA external interrupt sensitivity
bits mask */
1499:
1500: #define EXTI_CR2_TLIS ((uint8_t)0x04) /*!< Top level interrupt sensitivity bit mask
*/
1501: #define EXTI_CR2_PEIS ((uint8_t)0x03) /*!< PORTE external interrupt sensitivity
bits mask */
1502:
1503: /**
1504: * @}
1505: */
1506:
1507:
1508:
1509: /*----------------------------------------------------------------------------*/
1510: /**
1511: * @brief FLASH program and Data memory (FLASH)
1512: */
1513:
1514: typedef struct FLASH_struct
1515: {
1516: __IO uint8_t CR1; /*!< Flash control register 1 */
1517: __IO uint8_t CR2; /*!< Flash control register 2 */
1518: __IO uint8_t NCR2; /*!< Flash complementary control register 2 */
1519: __IO uint8_t FPR; /*!< Flash protection register */
1520: __IO uint8_t NFPR; /*!< Flash complementary protection register */
1521: __IO uint8_t IAPSR; /*!< Flash in-application programming status register */
1522: uint8_t RESERVED1; /*!< Reserved byte */
1523: uint8_t RESERVED2; /*!< Reserved byte */
1524: __IO uint8_t PUKR; /*!< Flash program memory unprotection register */
1525: uint8_t RESERVED3; /*!< Reserved byte */
1526: __IO uint8_t DUKR; /*!< Data EEPROM unprotection register */
1527: }
1528: FLASH_TypeDef;
1529:
1530: /** @addtogroup FLASH_Registers_Reset_Value
1531: * @{
1532: */
1533:
1534: #define FLASH_CR1_RESET_VALUE ((uint8_t)0x00)
1650:
1651: /** @addtogroup WWDG_Registers_Bits_Definition
1652: * @{
1653: */
1654:
1655: #define WWDG_CR_WDGA ((uint8_t)0x80) /*!< WDGA bit mask */
1656: #define WWDG_CR_T6 ((uint8_t)0x40) /*!< T6 bit mask */
1657: #define WWDG_CR_T ((uint8_t)0x7F) /*!< T bits mask */
1658:
1659: #define WWDG_WR_MSB ((uint8_t)0x80) /*!< MSB bit mask */
1660: #define WWDG_WR_W ((uint8_t)0x7F) /*!< W bits mask */
1661:
1662: /**
1663: * @}
1664: */
1665:
1666: /*----------------------------------------------------------------------------*/
1667: /**
1668: * @brief Reset Controller (RST)
1669: */
1670:
1671: typedef struct RST_struct
1672: {
1673: __IO uint8_t SR; /*!< Reset status register */
1674: }
1675: RST_TypeDef;
1676:
1677: /** @addtogroup RST_Registers_Bits_Definition
1678: * @{
1679: */
1680:
1681: #define RST_SR_EMCF ((uint8_t)0x10) /*!< EMC reset flag bit mask */
1682: #define RST_SR_SWIMF ((uint8_t)0x08) /*!< SWIM reset flag bit mask */
1683: #define RST_SR_ILLOPF ((uint8_t)0x04) /*!< Illegal opcode reset flag bit mask */
1684: #define RST_SR_IWDGF ((uint8_t)0x02) /*!< IWDG reset flag bit mask */
1685: #define RST_SR_WWDGF ((uint8_t)0x01) /*!< WWDG reset flag bit mask */
1686:
1687: /**
1688: * @}
1689: */
1690:
1691: /*----------------------------------------------------------------------------*/
1692: /**
1693: * @brief Serial Peripheral Interface (SPI)
1694: */
1695:
1696: typedef struct SPI_struct
1697: {
1698: __IO uint8_t CR1; /*!< SPI control register 1 */
1699: __IO uint8_t CR2; /*!< SPI control register 2 */
1700: __IO uint8_t ICR; /*!< SPI interrupt control register */
1701: __IO uint8_t SR; /*!< SPI status register */
1702: __IO uint8_t DR; /*!< SPI data I/O register */
1703: __IO uint8_t CRCPR; /*!< SPI CRC polynomial register */
1704: __IO uint8_t RXCRCR; /*!< SPI Rx CRC register */
1705: __IO uint8_t TXCRCR; /*!< SPI Tx CRC register */
1706: }
1707: SPI_TypeDef;
1708:
1709: /** @addtogroup SPI_Registers_Reset_Value
1710: * @{
1711: */
1712:
1713: #define SPI_CR1_RESET_VALUE ((uint8_t)0x00) /*!< Control Register 1 reset value
*/
1714: #define SPI_CR2_RESET_VALUE ((uint8_t)0x00) /*!< Control Register 2 reset value
*/
1715: #define SPI_ICR_RESET_VALUE ((uint8_t)0x00) /*!< Interrupt Control Register
reset value */
1716: #define SPI_SR_RESET_VALUE ((uint8_t)0x02) /*!< Status Register reset value */
1717: #define SPI_DR_RESET_VALUE ((uint8_t)0x00) /*!< Data Register reset value */
1718: #define SPI_CRCPR_RESET_VALUE ((uint8_t)0x07) /*!< Polynomial Register reset value
*/
1719: #define SPI_RXCRCR_RESET_VALUE ((uint8_t)0x00) /*!< RX CRC Register reset value */
1720: #define SPI_TXCRCR_RESET_VALUE ((uint8_t)0x00) /*!< TX CRC Register reset value */
1721:
1722: /**
1723: * @}
1724: */
1725:
1726: /** @addtogroup SPI_Registers_Bits_Definition
1727: * @{
1728: */
1729:
1730: #define SPI_CR1_LSBFIRST ((uint8_t)0x80) /*!< Frame format mask */
1731: #define SPI_CR1_SPE ((uint8_t)0x40) /*!< Enable bits mask */
1732: #define SPI_CR1_BR ((uint8_t)0x38) /*!< Baud rate control mask */
1733: #define SPI_CR1_MSTR ((uint8_t)0x04) /*!< Master Selection mask */
1734: #define SPI_CR1_CPOL ((uint8_t)0x02) /*!< Clock Polarity mask */
1735: #define SPI_CR1_CPHA ((uint8_t)0x01) /*!< Clock Phase mask */
1736:
1737: #define SPI_CR2_BDM ((uint8_t)0x80) /*!< Bi-directional data mode enable mask
*/
1738: #define SPI_CR2_BDOE ((uint8_t)0x40) /*!< Output enable in bi-directional mode
mask */
1739: #define SPI_CR2_CRCEN ((uint8_t)0x20) /*!< Hardware CRC calculation enable mask
*/
1740: #define SPI_CR2_CRCNEXT ((uint8_t)0x10) /*!< Transmit CRC next mask */
1741: #define SPI_CR2_RXONLY ((uint8_t)0x04) /*!< Receive only mask */
1742: #define SPI_CR2_SSM ((uint8_t)0x02) /*!< Software slave management mask */
1743: #define SPI_CR2_SSI ((uint8_t)0x01) /*!< Internal slave select mask */
1744:
1745: #define SPI_ICR_TXEI ((uint8_t)0x80) /*!< Tx buffer empty interrupt enable mask
*/
1746: #define SPI_ICR_RXEI ((uint8_t)0x40) /*!< Rx buffer empty interrupt enable mask
*/
1747: #define SPI_ICR_ERRIE ((uint8_t)0x20) /*!< Error interrupt enable mask */
1748: #define SPI_ICR_WKIE ((uint8_t)0x10) /*!< Wake-up interrupt enable mask */
1749:
1750: #define SPI_SR_BSY ((uint8_t)0x80) /*!< Busy flag */
1751: #define SPI_SR_OVR ((uint8_t)0x40) /*!< Overrun flag */
1752: #define SPI_SR_MODF ((uint8_t)0x20) /*!< Mode fault */
1753: #define SPI_SR_CRCERR ((uint8_t)0x10) /*!< CRC error flag */
1754: #define SPI_SR_WKUP ((uint8_t)0x08) /*!< Wake-Up flag */
1755: #define SPI_SR_TXE ((uint8_t)0x02) /*!< Transmit buffer empty */
1756: #define SPI_SR_RXNE ((uint8_t)0x01) /*!< Receive buffer not empty */
1757:
1758: /**
1759: * @}
1760: */
1761:
1762: /*----------------------------------------------------------------------------*/
1763: /**
1764: * @brief Universal Synchronous Asynchronous Receiver Transmitter (UART1)
1765: */
1766:
1767: typedef struct UART1_struct
1768: {
1769: __IO uint8_t SR; /*!< UART1 status register */
1770: __IO uint8_t DR; /*!< UART1 data register */
1771: __IO uint8_t BRR1; /*!< UART1 baud rate register */
1772: __IO uint8_t BRR2; /*!< UART1 DIV mantissa[11:8] SCIDIV fraction */
1773: __IO uint8_t CR1; /*!< UART1 control register 1 */
1774: __IO uint8_t CR2; /*!< UART1 control register 2 */
1775: __IO uint8_t CR3; /*!< UART1 control register 3 */
1776: __IO uint8_t CR4; /*!< UART1 control register 4 */
1777: __IO uint8_t CR5; /*!< UART1 control register 5 */
1778: __IO uint8_t GTR; /*!< UART1 guard time register */
1779: __IO uint8_t PSCR; /*!< UART1 prescaler register */
1780: }
1781: UART1_TypeDef;
1782:
1783: /** @addtogroup UART1_Registers_Reset_Value
1784: * @{
1785: */
1786:
1787: #define UART1_SR_RESET_VALUE ((uint8_t)0xC0)
1788: #define UART1_BRR1_RESET_VALUE ((uint8_t)0x00)
1789: #define UART1_BRR2_RESET_VALUE ((uint8_t)0x00)
1790: #define UART1_CR1_RESET_VALUE ((uint8_t)0x00)
1791: #define UART1_CR2_RESET_VALUE ((uint8_t)0x00)
1792: #define UART1_CR3_RESET_VALUE ((uint8_t)0x00)
1793: #define UART1_CR4_RESET_VALUE ((uint8_t)0x00)
1794: #define UART1_CR5_RESET_VALUE ((uint8_t)0x00)
1795: #define UART1_GTR_RESET_VALUE ((uint8_t)0x00)
1796: #define UART1_PSCR_RESET_VALUE ((uint8_t)0x00)
1797:
1798: /**
1799: * @}
1800: */
1801:
1802: /** @addtogroup UART1_Registers_Bits_Definition
1803: * @{
1804: */
1805:
1806: #define UART1_SR_TXE ((uint8_t)0x80) /*!< Transmit Data Register Empty mask */
1807: #define UART1_SR_TC ((uint8_t)0x40) /*!< Transmission Complete mask */
1808: #define UART1_SR_RXNE ((uint8_t)0x20) /*!< Read Data Register Not Empty mask */
1809: #define UART1_SR_IDLE ((uint8_t)0x10) /*!< IDLE line detected mask */
1810: #define UART1_SR_OR ((uint8_t)0x08) /*!< OverRun error mask */
1811: #define UART1_SR_NF ((uint8_t)0x04) /*!< Noise Flag mask */
1812: #define UART1_SR_FE ((uint8_t)0x02) /*!< Framing Error mask */
1813: #define UART1_SR_PE ((uint8_t)0x01) /*!< Parity Error mask */
1814:
1815: #define UART1_BRR1_DIVM ((uint8_t)0xFF) /*!< LSB mantissa of UART1DIV [7:0] mask *
1816:
1817: #define UART1_BRR2_DIVM ((uint8_t)0xF0) /*!< MSB mantissa of UART1DIV [11:8] mask
*/
1818: #define UART1_BRR2_DIVF ((uint8_t)0x0F) /*!< Fraction bits of UART1DIV [3:0] mask
*/
1819:
1820: #define UART1_CR1_R8 ((uint8_t)0x80) /*!< Receive Data bit 8 */
1821: #define UART1_CR1_T8 ((uint8_t)0x40) /*!< Transmit data bit 8 */
1822: #define UART1_CR1_UARTD ((uint8_t)0x20) /*!< UART1 Disable (for low power
consumption) */
1823: #define UART1_CR1_M ((uint8_t)0x10) /*!< Word length mask */
1824: #define UART1_CR1_WAKE ((uint8_t)0x08) /*!< Wake-up method mask */
1825: #define UART1_CR1_PCEN ((uint8_t)0x04) /*!< Parity Control Enable mask */
1826: #define UART1_CR1_PS ((uint8_t)0x02) /*!< UART1 Parity Selection */
1827: #define UART1_CR1_PIEN ((uint8_t)0x01) /*!< UART1 Parity Interrupt Enable mask *
1828:
1829: #define UART1_CR2_TIEN ((uint8_t)0x80) /*!< Transmitter Interrupt Enable mask */
1830: #define UART1_CR2_TCIEN ((uint8_t)0x40) /*!< Transmission Complete Interrupt
Enable mask */
1831: #define UART1_CR2_RIEN ((uint8_t)0x20) /*!< Receiver Interrupt Enable mask */
1832: #define UART1_CR2_ILIEN ((uint8_t)0x10) /*!< IDLE Line Interrupt Enable mask */
1833: #define UART1_CR2_TEN ((uint8_t)0x08) /*!< Transmitter Enable mask */
1834: #define UART1_CR2_REN ((uint8_t)0x04) /*!< Receiver Enable mask */
1835: #define UART1_CR2_RWU ((uint8_t)0x02) /*!< Receiver Wake-Up mask */
1836: #define UART1_CR2_SBK ((uint8_t)0x01) /*!< Send Break mask */
1837:
1838: #define UART1_CR3_LINEN ((uint8_t)0x40) /*!< Alternate Function output mask */
1839: #define UART1_CR3_STOP ((uint8_t)0x30) /*!< STOP bits [1:0] mask */
1840: #define UART1_CR3_CKEN ((uint8_t)0x08) /*!< Clock Enable mask */
1841: #define UART1_CR3_CPOL ((uint8_t)0x04) /*!< Clock Polarity mask */
1842: #define UART1_CR3_CPHA ((uint8_t)0x02) /*!< Clock Phase mask */
1843: #define UART1_CR3_LBCL ((uint8_t)0x01) /*!< Last Bit Clock pulse mask */
1844:
1845: #define UART1_CR4_LBDIEN ((uint8_t)0x40) /*!< LIN Break Detection Interrupt Enable
mask */
1846: #define UART1_CR4_LBDL ((uint8_t)0x20) /*!< LIN Break Detection Length mask */
1847: #define UART1_CR4_LBDF ((uint8_t)0x10) /*!< LIN Break Detection Flag mask */
1848: #define UART1_CR4_ADD ((uint8_t)0x0F) /*!< Address of the UART1 node mask */
1849:
1850: #define UART1_CR5_SCEN ((uint8_t)0x20) /*!< Smart Card Enable mask */
1851: #define UART1_CR5_NACK ((uint8_t)0x10) /*!< Smart Card Nack Enable mask */
1852: #define UART1_CR5_HDSEL ((uint8_t)0x08) /*!< Half-Duplex Selection mask */
1853: #define UART1_CR5_IRLP ((uint8_t)0x04) /*!< Irda Low Power Selection mask */
1854: #define UART1_CR5_IREN ((uint8_t)0x02) /*!< Irda Enable mask */
1855:
1856: /**
1857: * @}
1858: */
1859:
1860: /*----------------------------------------------------------------------------*/
1861: /**
1862: * @brief Universal Synchronous Asynchronous Receiver Transmitter (UART2)
1863: */
1864:
1865: typedef struct UART2_struct
1866: {
1867: __IO uint8_t SR; /*!< UART1 status register */
1868: __IO uint8_t DR; /*!< UART1 data register */
1869: __IO uint8_t BRR1; /*!< UART1 baud rate register */
1870: __IO uint8_t BRR2; /*!< UART1 DIV mantissa[11:8] SCIDIV fraction */
1871: __IO uint8_t CR1; /*!< UART1 control register 1 */
1872: __IO uint8_t CR2; /*!< UART1 control register 2 */
1873: __IO uint8_t CR3; /*!< UART1 control register 3 */
1874: __IO uint8_t CR4; /*!< UART1 control register 4 */
1875: __IO uint8_t CR5; /*!< UART1 control register 5 */
1932: #define UART2_CR2_ILIEN ((uint8_t)0x10) /*!< IDLE Line Interrupt Enable mask */
1933: #define UART2_CR2_TEN ((uint8_t)0x08) /*!< Transmitter Enable mask */
1934: #define UART2_CR2_REN ((uint8_t)0x04) /*!< Receiver Enable mask */
1935: #define UART2_CR2_RWU ((uint8_t)0x02) /*!< Receiver Wake-Up mask */
1936: #define UART2_CR2_SBK ((uint8_t)0x01) /*!< Send Break mask */
1937:
1938: #define UART2_CR3_LINEN ((uint8_t)0x40) /*!< Alternate Function output mask */
1939: #define UART2_CR3_STOP ((uint8_t)0x30) /*!< STOP bits [1:0] mask */
1940: #define UART2_CR3_CKEN ((uint8_t)0x08) /*!< Clock Enable mask */
1941: #define UART2_CR3_CPOL ((uint8_t)0x04) /*!< Clock Polarity mask */
1942: #define UART2_CR3_CPHA ((uint8_t)0x02) /*!< Clock Phase mask */
1943: #define UART2_CR3_LBCL ((uint8_t)0x01) /*!< Last Bit Clock pulse mask */
1944:
1945: #define UART2_CR4_LBDIEN ((uint8_t)0x40) /*!< LIN Break Detection Interrupt Enable
mask */
1946: #define UART2_CR4_LBDL ((uint8_t)0x20) /*!< LIN Break Detection Length mask */
1947: #define UART2_CR4_LBDF ((uint8_t)0x10) /*!< LIN Break Detection Flag mask */
1948: #define UART2_CR4_ADD ((uint8_t)0x0F) /*!< Address of the UART2 node mask */
1949:
1950: #define UART2_CR5_SCEN ((uint8_t)0x20) /*!< Smart Card Enable mask */
1951: #define UART2_CR5_NACK ((uint8_t)0x10) /*!< Smart Card Nack Enable mask */
1952: #define UART2_CR5_IRLP ((uint8_t)0x04) /*!< Irda Low Power Selection mask */
1953: #define UART2_CR5_IREN ((uint8_t)0x02) /*!< Irda Enable mask */
1954:
1955: #define UART2_CR6_LDUM ((uint8_t)0x80) /*!< LIN Divider Update Method */
1956: #define UART2_CR6_LSLV ((uint8_t)0x20) /*!< LIN Slave Enable */
1957: #define UART2_CR6_LASE ((uint8_t)0x10) /*!< LIN Auto synchronization Enable */
1958: #define UART2_CR6_LHDIEN ((uint8_t)0x04) /*!< LIN Header Detection Interrupt
Enable */
1959: #define UART2_CR6_LHDF ((uint8_t)0x02) /*!< LIN Header Detection Flag */
1960: #define UART2_CR6_LSF ((uint8_t)0x01) /*!< LIN Synch Field */
1961:
1962: /**
1963: * @}
1964: */
1965:
1966:
1967: /*----------------------------------------------------------------------------*/
1968: /**
1969: * @brief LIN Universal Asynchronous Receiver Transmitter (UART3)
1970: */
1971:
1972: typedef struct UART3_struct
1973: {
1974: __IO uint8_t SR; /*!< status register */
1975: __IO uint8_t DR; /*!< data register */
1976: __IO uint8_t BRR1; /*!< baud rate register */
1977: __IO uint8_t BRR2; /*!< DIV mantissa[11:8] SCIDIV fraction */
1978: __IO uint8_t CR1; /*!< control register 1 */
1979: __IO uint8_t CR2; /*!< control register 2 */
1980: __IO uint8_t CR3; /*!< control register 3 */
1981: __IO uint8_t CR4; /*!< control register 4 */
1982: uint8_t RESERVED; /*!< Reserved byte */
1983: __IO uint8_t CR6; /*!< control register 5 */
1984: }
1985: UART3_TypeDef;
1986:
1987: /** @addtogroup UART3_Registers_Reset_Value
1988: * @{
1989: */
1990:
1991: #define UART3_SR_RESET_VALUE ((uint8_t)0xC0)
1992: #define UART3_BRR1_RESET_VALUE ((uint8_t)0x00)
1993: #define UART3_BRR2_RESET_VALUE ((uint8_t)0x00)
1994: #define UART3_CR1_RESET_VALUE ((uint8_t)0x00)
1995: #define UART3_CR2_RESET_VALUE ((uint8_t)0x00)
1996: #define UART3_CR3_RESET_VALUE ((uint8_t)0x00)
1997: #define UART3_CR4_RESET_VALUE ((uint8_t)0x00)
1998: #define UART3_CR6_RESET_VALUE ((uint8_t)0x00)
1999:
2000: /**
2001: * @}
2002: */
2003:
2004: /** @addtogroup UART3_Registers_Bits_Definition
2005: * @{
2006: */
2007:
2008: #define UART3_SR_TXE ((uint8_t)0x80) /*!< Transmit Data Register Empty mask */
2009: #define UART3_SR_TC ((uint8_t)0x40) /*!< Transmission Complete mask */
2010: #define UART3_SR_RXNE ((uint8_t)0x20) /*!< Read Data Register Not Empty mask */
2011: #define UART3_SR_IDLE ((uint8_t)0x10) /*!< IDLE line detected mask */
2012: #define UART3_SR_OR ((uint8_t)0x08) /*!< OverRun error mask */
2013: #define UART3_SR_NF ((uint8_t)0x04) /*!< Noise Flag mask */
2014: #define UART3_SR_FE ((uint8_t)0x02) /*!< Framing Error mask */
2015: #define UART3_SR_PE ((uint8_t)0x01) /*!< Parity Error mask */
2016:
2017: #define UART3_BRR1_DIVM ((uint8_t)0xFF) /*!< LSB mantissa of UARTDIV [7:0] mask *
2018:
2019: #define UART3_BRR2_DIVM ((uint8_t)0xF0) /*!< MSB mantissa of UARTDIV [11:8] mask
*/
2020: #define UART3_BRR2_DIVF ((uint8_t)0x0F) /*!< Fraction bits of UARTDIV [3:0] mask
*/
2021:
2022: #define UART3_CR1_R8 ((uint8_t)0x80) /*!< Receive Data bit 8 */
2023: #define UART3_CR1_T8 ((uint8_t)0x40) /*!< Transmit data bit 8 */
2024: #define UART3_CR1_UARTD ((uint8_t)0x20) /*!< UART Disable (for low power
consumption) */
2025: #define UART3_CR1_M ((uint8_t)0x10) /*!< Word length mask */
2026: #define UART3_CR1_WAKE ((uint8_t)0x08) /*!< Wake-up method mask */
2027: #define UART3_CR1_PCEN ((uint8_t)0x04) /*!< Parity control enable mask */
2028: #define UART3_CR1_PS ((uint8_t)0x02) /*!< Parity selection bit mask */
2029: #define UART3_CR1_PIEN ((uint8_t)0x01) /*!< Parity interrupt enable bit mask */
2030:
2031: #define UART3_CR2_TIEN ((uint8_t)0x80) /*!< Transmitter Interrupt Enable mask */
2032: #define UART3_CR2_TCIEN ((uint8_t)0x40) /*!< Transmission Complete Interrupt
Enable mask */
2033: #define UART3_CR2_RIEN ((uint8_t)0x20) /*!< Receiver Interrupt Enable mask */
2034: #define UART3_CR2_ILIEN ((uint8_t)0x10) /*!< IDLE Line Interrupt Enable mask */
2035: #define UART3_CR2_TEN ((uint8_t)0x08) /*!< Transmitter Enable mask */
2036: #define UART3_CR2_REN ((uint8_t)0x04) /*!< Receiver Enable mask */
2037: #define UART3_CR2_RWU ((uint8_t)0x02) /*!< Receiver Wake-Up mask */
2038: #define UART3_CR2_SBK ((uint8_t)0x01) /*!< Send Break mask */
2039:
2040: #define UART3_CR3_LINEN ((uint8_t)0x40) /*!< Alternate Function output mask */
2041: #define UART3_CR3_STOP ((uint8_t)0x30) /*!< STOP bits [1:0] mask */
2042:
2043: #define UART3_CR4_LBDIEN ((uint8_t)0x40) /*!< LIN Break Detection Interrupt Enable
mask */
2044: #define UART3_CR4_LBDL ((uint8_t)0x20) /*!< LIN Break Detection Length mask */
2045: #define UART3_CR4_LBDF ((uint8_t)0x10) /*!< LIN Break Detection Flag mask */
2046: #define UART3_CR4_ADD ((uint8_t)0x0F) /*!< Address of the UART3 node mask */
2047:
2048: #define UART3_CR6_LDUM ((uint8_t)0x80) /*!< LIN Divider Update Method */
2049: #define UART3_CR6_LSLV ((uint8_t)0x20) /*!< LIN Slave Enable */
2050: #define UART3_CR6_LASE ((uint8_t)0x10) /*!< LIN Auto synchronization Enable */
2051: #define UART3_CR6_LHDIEN ((uint8_t)0x04) /*!< LIN Header Detection Interrupt
Enable */
2052: #define UART3_CR6_LHDF ((uint8_t)0x02) /*!< LIN Header Detection Flag */
2053: #define UART3_CR6_LSF ((uint8_t)0x01) /*!< LIN Synch Field */
2054:
2055: /**
2056: * @}
2057: */
2058:
2059: /*----------------------------------------------------------------------------*/
2060: /**
2061: * @brief Universal Synchronous Asynchronous Receiver Transmitter (UART4)
2062: */
2063: #if defined(STM8AF622x)
2064: typedef struct UART4_struct
2065: {
2066: __IO uint8_t SR; /*!< UART4 status register */
2067: __IO uint8_t DR; /*!< UART4 data register */
2068: __IO uint8_t BRR1; /*!< UART4 baud rate register */
2069: __IO uint8_t BRR2; /*!< UART4 DIV mantissa[11:8] SCIDIV fraction */
2070: __IO uint8_t CR1; /*!< UART4 control register 1 */
2071: __IO uint8_t CR2; /*!< UART4 control register 2 */
2072: __IO uint8_t CR3; /*!< UART4 control register 3 */
2073: __IO uint8_t CR4; /*!< UART4 control register 4 */
2074: __IO uint8_t CR5; /*!< UART4 control register 5 */
2075: __IO uint8_t CR6; /*!< UART4 control register 6 */
2076: __IO uint8_t GTR; /*!< UART4 guard time register */
2077: __IO uint8_t PSCR; /*!< UART4 prescaler register */
2078: }
2079: UART4_TypeDef;
2080:
2081: /** @addtogroup UART4_Registers_Reset_Value
2082: * @{
2083: */
2084:
2085: #define UART4_SR_RESET_VALUE ((uint8_t)0xC0)
2086: #define UART4_BRR1_RESET_VALUE ((uint8_t)0x00)
2087: #define UART4_BRR2_RESET_VALUE ((uint8_t)0x00)
2088: #define UART4_CR1_RESET_VALUE ((uint8_t)0x00)
2089: #define UART4_CR2_RESET_VALUE ((uint8_t)0x00)
2090: #define UART4_CR3_RESET_VALUE ((uint8_t)0x00)
2091: #define UART4_CR4_RESET_VALUE ((uint8_t)0x00)
2092: #define UART4_CR5_RESET_VALUE ((uint8_t)0x00)
2093: #define UART4_CR6_RESET_VALUE ((uint8_t)0x00)
2094: #define UART4_GTR_RESET_VALUE ((uint8_t)0x00)
2095: #define UART4_PSCR_RESET_VALUE ((uint8_t)0x00)
2096:
2097: /**
2098: * @}
2099: */
2100:
2101: /** @addtogroup UART4_Registers_Bits_Definition
2102: * @{
2103: */
2104:
2105: #define UART4_SR_TXE ((uint8_t)0x80) /*!< Transmit Data Register Empty mask */
2106: #define UART4_SR_TC ((uint8_t)0x40) /*!< Transmission Complete mask */
2107: #define UART4_SR_RXNE ((uint8_t)0x20) /*!< Read Data Register Not Empty mask */
2108: #define UART4_SR_IDLE ((uint8_t)0x10) /*!< IDLE line detected mask */
2109: #define UART4_SR_OR ((uint8_t)0x08) /*!< OverRun error mask */
2110: #define UART4_SR_NF ((uint8_t)0x04) /*!< Noise Flag mask */
2111: #define UART4_SR_FE ((uint8_t)0x02) /*!< Framing Error mask */
2112: #define UART4_SR_PE ((uint8_t)0x01) /*!< Parity Error mask */
2113:
2114: #define UART4_BRR1_DIVM ((uint8_t)0xFF) /*!< LSB mantissa of UART4DIV [7:0] mask *
2115:
2116: #define UART4_BRR2_DIVM ((uint8_t)0xF0) /*!< MSB mantissa of UART4DIV [11:8] mask
*/
2117: #define UART4_BRR2_DIVF ((uint8_t)0x0F) /*!< Fraction bits of UART4DIV [3:0] mask
*/
2118:
2119: #define UART4_CR1_R8 ((uint8_t)0x80) /*!< Receive Data bit 8 */
2120: #define UART4_CR1_T8 ((uint8_t)0x40) /*!< Transmit data bit 8 */
2121: #define UART4_CR1_UARTD ((uint8_t)0x20) /*!< UART4 Disable (for low power
consumption) */
2122: #define UART4_CR1_M ((uint8_t)0x10) /*!< Word length mask */
2123: #define UART4_CR1_WAKE ((uint8_t)0x08) /*!< Wake-up method mask */
2124: #define UART4_CR1_PCEN ((uint8_t)0x04) /*!< Parity Control Enable mask */
2125: #define UART4_CR1_PS ((uint8_t)0x02) /*!< UART4 Parity Selection */
2126: #define UART4_CR1_PIEN ((uint8_t)0x01) /*!< UART4 Parity Interrupt Enable mask *
2127:
2128: #define UART4_CR2_TIEN ((uint8_t)0x80) /*!< Transmitter Interrupt Enable mask */
2129: #define UART4_CR2_TCIEN ((uint8_t)0x40) /*!< Transmission Complete Interrupt
Enable mask */
2130: #define UART4_CR2_RIEN ((uint8_t)0x20) /*!< Receiver Interrupt Enable mask */
2131: #define UART4_CR2_ILIEN ((uint8_t)0x10) /*!< IDLE Line Interrupt Enable mask */
2132: #define UART4_CR2_TEN ((uint8_t)0x08) /*!< Transmitter Enable mask */
2133: #define UART4_CR2_REN ((uint8_t)0x04) /*!< Receiver Enable mask */
2134: #define UART4_CR2_RWU ((uint8_t)0x02) /*!< Receiver Wake-Up mask */
2135: #define UART4_CR2_SBK ((uint8_t)0x01) /*!< Send Break mask */
2136:
2137: #define UART4_CR3_LINEN ((uint8_t)0x40) /*!< Alternate Function output mask */
2138: #define UART4_CR3_STOP ((uint8_t)0x30) /*!< STOP bits [1:0] mask */
2139: #define UART4_CR3_CKEN ((uint8_t)0x08) /*!< Clock Enable mask */
2140: #define UART4_CR3_CPOL ((uint8_t)0x04) /*!< Clock Polarity mask */
2141: #define UART4_CR3_CPHA ((uint8_t)0x02) /*!< Clock Phase mask */
2142: #define UART4_CR3_LBCL ((uint8_t)0x01) /*!< Last Bit Clock pulse mask */
2143:
2144: #define UART4_CR4_LBDIEN ((uint8_t)0x40) /*!< LIN Break Detection Interrupt Enable
mask */
2145: #define UART4_CR4_LBDL ((uint8_t)0x20) /*!< LIN Break Detection Length mask */
2146: #define UART4_CR4_LBDF ((uint8_t)0x10) /*!< LIN Break Detection Flag mask */
2147: #define UART4_CR4_ADD ((uint8_t)0x0F) /*!< Address of the UART4 node mask */
2148:
2149: #define UART4_CR5_SCEN ((uint8_t)0x20) /*!< Smart Card Enable mask */
2150: #define UART4_CR5_NACK ((uint8_t)0x10) /*!< Smart Card Nack Enable mask */
2151: #define UART4_CR5_HDSEL ((uint8_t)0x08) /*!< Half-Duplex Selection mask */
2152: #define UART4_CR5_IRLP ((uint8_t)0x04) /*!< Irda Low Power Selection mask */
2153: #define UART4_CR5_IREN ((uint8_t)0x02) /*!< Irda Enable mask */
2154:
2155: #define UART4_CR6_LDUM ((uint8_t)0x80) /*!< LIN Divider Update Method */
2156: #define UART4_CR6_LSLV ((uint8_t)0x20) /*!< LIN Slave Enable */
2157: #define UART4_CR6_LASE ((uint8_t)0x10) /*!< LIN Auto synchronization Enable */
2158: #define UART4_CR6_LHDIEN ((uint8_t)0x04) /*!< LIN Header Detection Interrupt
Enable */
PSPad editor 5.0.7 (775) www.pspad.com 16/03/2024 19:58:29 JaganathanSankaran
stm8s.h Page:40/51
D:\Users\Jagan\Workspace\FanControl_Gitworkspace\Fan_project\lib\inc\ Last modification: 10/03/2024 21:31:40