📄 stm8s105c_s.h
字号:
/* STM8S105C_S.h */
/* Copyright (c) 2003-2010 STMicroelectronics */
#ifndef __STM8S105C_S__
#define __STM8S105C_S__
/* STM8S105C_S */
/* Check MCU name */
#ifdef MCU_NAME
#define STM8S105C_S 1
#if (MCU_NAME != STM8S105C_S)
#error "wrong include file STM8S105C_S.h for chosen MCU!"
#endif
#endif
#ifdef __CSMC__
#define DEF_8BIT_REG_AT(NAME,ADDRESS) volatile unsigned char NAME @ADDRESS
#define DEF_16BIT_REG_AT(NAME,ADDRESS) volatile unsigned int NAME @ADDRESS
#endif
#ifdef __RAISONANCE__
#define DEF_8BIT_REG_AT(NAME,ADDRESS) at ADDRESS hreg NAME
#define DEF_16BIT_REG_AT(NAME,ADDRESS) at ADDRESS hreg16 NAME
#endif
/* Port A */
/*****************************************************************/
/* Port A data output latch register */
DEF_8BIT_REG_AT(PA_ODR,0x5000);
/* Port A input pin value register */
DEF_8BIT_REG_AT(PA_IDR,0x5001);
/* Port A data direction register */
DEF_8BIT_REG_AT(PA_DDR,0x5002);
/* Port A control register 1 */
DEF_8BIT_REG_AT(PA_CR1,0x5003);
/* Port A control register 2 */
DEF_8BIT_REG_AT(PA_CR2,0x5004);
/* Port B */
/*****************************************************************/
/* Port B data output latch register */
DEF_8BIT_REG_AT(PB_ODR,0x5005);
/* Port B input pin value register */
DEF_8BIT_REG_AT(PB_IDR,0x5006);
/* Port B data direction register */
DEF_8BIT_REG_AT(PB_DDR,0x5007);
/* Port B control register 1 */
DEF_8BIT_REG_AT(PB_CR1,0x5008);
/* Port B control register 2 */
DEF_8BIT_REG_AT(PB_CR2,0x5009);
/* Port C */
/*****************************************************************/
/* Port C data output latch register */
DEF_8BIT_REG_AT(PC_ODR,0x500a);
/* Port C input pin value register */
DEF_8BIT_REG_AT(PC_IDR,0x500b);
/* Port C data direction register */
DEF_8BIT_REG_AT(PC_DDR,0x500c);
/* Port C control register 1 */
DEF_8BIT_REG_AT(PC_CR1,0x500d);
/* Port C control register 2 */
DEF_8BIT_REG_AT(PC_CR2,0x500e);
/* Port D */
/*****************************************************************/
/* Port D data output latch register */
DEF_8BIT_REG_AT(PD_ODR,0x500f);
/* Port D input pin value register */
DEF_8BIT_REG_AT(PD_IDR,0x5010);
/* Port D data direction register */
DEF_8BIT_REG_AT(PD_DDR,0x5011);
/* Port D control register 1 */
DEF_8BIT_REG_AT(PD_CR1,0x5012);
/* Port D control register 2 */
DEF_8BIT_REG_AT(PD_CR2,0x5013);
/* Port E */
/*****************************************************************/
/* Port E data output latch register */
DEF_8BIT_REG_AT(PE_ODR,0x5014);
/* Port E input pin value register */
DEF_8BIT_REG_AT(PE_IDR,0x5015);
/* Port E data direction register */
DEF_8BIT_REG_AT(PE_DDR,0x5016);
/* Port E control register 1 */
DEF_8BIT_REG_AT(PE_CR1,0x5017);
/* Port E control register 2 */
DEF_8BIT_REG_AT(PE_CR2,0x5018);
/* Port G */
/*****************************************************************/
/* Port G data output latch register */
DEF_8BIT_REG_AT(PG_ODR,0x501e);
/* Port G input pin value register */
DEF_8BIT_REG_AT(PG_IDR,0x501f);
/* Port G data direction register */
DEF_8BIT_REG_AT(PG_DDR,0x5020);
/* Port G control register 1 */
DEF_8BIT_REG_AT(PG_CR1,0x5021);
/* Port G control register 2 */
DEF_8BIT_REG_AT(PG_CR2,0x5022);
/* Flash */
/*****************************************************************/
/* Flash control register 1 */
DEF_8BIT_REG_AT(FLASH_CR1,0x505a);
/* Flash control register 2 */
DEF_8BIT_REG_AT(FLASH_CR2,0x505b);
/* Flash complementary control register 2 */
DEF_8BIT_REG_AT(FLASH_NCR2,0x505c);
/* Flash protection register */
DEF_8BIT_REG_AT(FLASH_FPR,0x505d);
/* Flash complementary protection register */
DEF_8BIT_REG_AT(FLASH_NFPR,0x505e);
/* Flash in-application programming status register */
DEF_8BIT_REG_AT(FLASH_IAPSR,0x505f);
/* Flash Program memory unprotection register */
DEF_8BIT_REG_AT(FLASH_PUKR,0x5062);
/* Data EEPROM unprotection register */
DEF_8BIT_REG_AT(FLASH_DUKR,0x5064);
/* External Interrupt Control Register (ITC) */
/*****************************************************************/
/* External interrupt control register 1 */
DEF_8BIT_REG_AT(EXTI_CR1,0x50a0);
/* External interrupt control register 2 */
DEF_8BIT_REG_AT(EXTI_CR2,0x50a1);
/* Reset (RST) */
/*****************************************************************/
/* Reset status register 1 */
DEF_8BIT_REG_AT(RST_SR,0x50b3);
/* Clock Control (CLK) */
/*****************************************************************/
/* Internal clock control register */
DEF_8BIT_REG_AT(CLK_ICKR,0x50c0);
/* External clock control register */
DEF_8BIT_REG_AT(CLK_ECKR,0x50c1);
/* Clock master status register */
DEF_8BIT_REG_AT(CLK_CMSR,0x50c3);
/* Clock master switch register */
DEF_8BIT_REG_AT(CLK_SWR,0x50c4);
/* Clock switch control register */
DEF_8BIT_REG_AT(CLK_SWCR,0x50c5);
/* Clock divider register */
DEF_8BIT_REG_AT(CLK_CKDIVR,0x50c6);
/* Peripheral clock gating register 1 */
DEF_8BIT_REG_AT(CLK_PCKENR1,0x50c7);
/* Clock security system register */
DEF_8BIT_REG_AT(CLK_CSSR,0x50c8);
/* Configurable clock control register */
DEF_8BIT_REG_AT(CLK_CCOR,0x50c9);
/* Peripheral clock gating register 2 */
DEF_8BIT_REG_AT(CLK_PCKENR2,0x50ca);
/* CAN clock control register */
DEF_8BIT_REG_AT(CLK_CANCCR,0x50cb);
/* HSI clock calibration trimming register */
DEF_8BIT_REG_AT(CLK_HSITRIMR,0x50cc);
/* SWIM clock control register */
DEF_8BIT_REG_AT(CLK_SWIMCCR,0x50cd);
/* Window Watchdog (WWDG) */
/*****************************************************************/
/* WWDG Control Register */
DEF_8BIT_REG_AT(WWDG_CR,0x50d1);
/* WWDR Window Register */
DEF_8BIT_REG_AT(WWDG_WR,0x50d2);
/* Independent Watchdog (IWDG) */
/*****************************************************************/
/* IWDG Key Register */
DEF_8BIT_REG_AT(IWDG_KR,0x50e0);
/* IWDG Prescaler Register */
DEF_8BIT_REG_AT(IWDG_PR,0x50e1);
/* IWDG Reload Register */
DEF_8BIT_REG_AT(IWDG_RLR,0x50e2);
/* Auto Wake-Up (AWU) */
/*****************************************************************/
/* AWU Control/Status Register */
DEF_8BIT_REG_AT(AWU_CSR,0x50f0);
/* AWU asynchronous prescaler buffer register */
DEF_8BIT_REG_AT(AWU_APR,0x50f1);
/* AWU Timebase selection register */
DEF_8BIT_REG_AT(AWU_TBR,0x50f2);
/* Beeper (BEEP) */
/*****************************************************************/
/* BEEP Control/Status Register */
DEF_8BIT_REG_AT(BEEP_CSR,0x50f3);
/* Serial Peripheral Interface (SPI) */
/*****************************************************************/
/* SPI Control Register 1 */
DEF_8BIT_REG_AT(SPI_CR1,0x5200);
/* SPI Control Register 2 */
DEF_8BIT_REG_AT(SPI_CR2,0x5201);
/* SPI Interrupt Control Register */
DEF_8BIT_REG_AT(SPI_ICR,0x5202);
/* SPI Status Register */
DEF_8BIT_REG_AT(SPI_SR,0x5203);
/* SPI Data Register */
DEF_8BIT_REG_AT(SPI_DR,0x5204);
/* SPI CRC Polynomial Register */
DEF_8BIT_REG_AT(SPI_CRCPR,0x5205);
/* SPI Rx CRC Register */
DEF_8BIT_REG_AT(SPI_RXCRCR,0x5206);
/* SPI Tx CRC Register */
DEF_8BIT_REG_AT(SPI_TXCRCR,0x5207);
/* I2C Bus Interface (I2C) */
/*****************************************************************/
/* I2C control register 1 */
DEF_8BIT_REG_AT(I2C_CR1,0x5210);
/* I2C control register 2 */
DEF_8BIT_REG_AT(I2C_CR2,0x5211);
/* I2C frequency register */
DEF_8BIT_REG_AT(I2C_FREQR,0x5212);
/* I2C Own address register low */
DEF_8BIT_REG_AT(I2C_OARL,0x5213);
/* I2C Own address register high */
DEF_8BIT_REG_AT(I2C_OARH,0x5214);
/* I2C data register */
DEF_8BIT_REG_AT(I2C_DR,0x5216);
/* I2C status register 1 */
DEF_8BIT_REG_AT(I2C_SR1,0x5217);
/* I2C status register 2 */
DEF_8BIT_REG_AT(I2C_SR2,0x5218);
/* I2C status register 3 */
DEF_8BIT_REG_AT(I2C_SR3,0x5219);
/* I2C interrupt control register */
DEF_8BIT_REG_AT(I2C_ITR,0x521a);
/* I2C Clock control register low */
DEF_8BIT_REG_AT(I2C_CCRL,0x521b);
/* I2C Clock control register high */
DEF_8BIT_REG_AT(I2C_CCRH,0x521c);
/* I2C TRISE register */
DEF_8BIT_REG_AT(I2C_TRISER,0x521d);
/* I2C packet error checking register */
DEF_8BIT_REG_AT(I2C_PECR,0x521e);
/* LIN Universal asynch. receiver transmitter (UART2) */
/*****************************************************************/
/* UART2 Status Register */
DEF_8BIT_REG_AT(UART2_SR,0x5240);
/* UART2 Data Register */
DEF_8BIT_REG_AT(UART2_DR,0x5241);
/* UART2 Baud Rate Register 1 */
DEF_8BIT_REG_AT(UART2_BRR1,0x5242);
/* UART2 Baud Rate Register 2 */
DEF_8BIT_REG_AT(UART2_BRR2,0x5243);
/* UART2 Control Register 1 */
DEF_8BIT_REG_AT(UART2_CR1,0x5244);
/* UART2 Control Register 2 */
DEF_8BIT_REG_AT(UART2_CR2,0x5245);
/* UART2 Control Register 3 */
DEF_8BIT_REG_AT(UART2_CR3,0x5246);
/* UART2 Control Register 4 */
DEF_8BIT_REG_AT(UART2_CR4,0x5247);
/* UART2 Control Register 6 */
DEF_8BIT_REG_AT(UART2_CR6,0x5249);
/* UART2 Guard time Register */
DEF_8BIT_REG_AT(UART2_GTR,0x524a);
/* UART2 Prescaler Register */
DEF_8BIT_REG_AT(UART2_PSCR,0x524b);
/* 16-Bit Timer 1 (TIM1) */
/*****************************************************************/
/* TIM1 Control register 1 */
DEF_8BIT_REG_AT(TIM1_CR1,0x5250);
/* TIM1 Control register 2 */
DEF_8BIT_REG_AT(TIM1_CR2,0x5251);
/* TIM1 Slave Mode Control register */
DEF_8BIT_REG_AT(TIM1_SMCR,0x5252);
/* TIM1 external trigger register */
DEF_8BIT_REG_AT(TIM1_ETR,0x5253);
/* TIM1 Interrupt enable register */
DEF_8BIT_REG_AT(TIM1_IER,0x5254);
/* TIM1 Status register 1 */
DEF_8BIT_REG_AT(TIM1_SR1,0x5255);
/* TIM1 Status register 2 */
DEF_8BIT_REG_AT(TIM1_SR2,0x5256);
/* TIM1 Event Generation register */
DEF_8BIT_REG_AT(TIM1_EGR,0x5257);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -