|
发表于 2017-12-6 12:01:31
|
显示全部楼层
bug依然存在
- /**
- ******************************************************************************
- * @file stm8s.h
- * @author MCD Application Team
- * @version V2.2.0
- * @date 30-September-2014
- * @brief This file contains all HW registers definitions and memory mapping.
- ******************************************************************************
- * @attention
- *
- * <h2><center>© COPYRIGHT 2014 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.
- *
- ******************************************************************************
- */
复制代码
TIM2的定义
- /*----------------------------------------------------------------------------*/
- /**
- * @brief 16-bit timer (TIM2)
- */
- typedef struct TIM2_struct
- {
- __IO uint8_t CR1; /*!< control register 1 */
- #if defined(STM8S103) || defined(STM8S003)
- uint8_t RESERVED1; /*!< Reserved register */
- uint8_t RESERVED2; /*!< Reserved register */
- #endif
- __IO uint8_t IER; /*!< interrupt enable register */
- __IO uint8_t SR1; /*!< status register 1 */
- __IO uint8_t SR2; /*!< status register 2 */
- __IO uint8_t EGR; /*!< event generation register */
- __IO uint8_t CCMR1; /*!< CC mode register 1 */
- __IO uint8_t CCMR2; /*!< CC mode register 2 */
- __IO uint8_t CCMR3; /*!< CC mode register 3 */
- __IO uint8_t CCER1; /*!< CC enable register 1 */
- __IO uint8_t CCER2; /*!< CC enable register 2 */
- __IO uint8_t CNTRH; /*!< counter high */
- __IO uint8_t CNTRL; /*!< counter low */
- __IO uint8_t PSCR; /*!< prescaler register */
- __IO uint8_t ARRH; /*!< auto-reload register high */
- __IO uint8_t ARRL; /*!< auto-reload register low */
- __IO uint8_t CCR1H; /*!< capture/compare register 1 high */
- __IO uint8_t CCR1L; /*!< capture/compare register 1 low */
- __IO uint8_t CCR2H; /*!< capture/compare register 2 high */
- __IO uint8_t CCR2L; /*!< capture/compare register 2 low */
- __IO uint8_t CCR3H; /*!< capture/compare register 3 high */
- __IO uint8_t CCR3L; /*!< capture/compare register 3 low */
- }
- TIM2_TypeDef;
复制代码
规格书里TIM2的描述:
TIM2_TypeDef里的寄存器地址从IER开始都偏移了2个位置. |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|