CSL_init.c (MSP430 & IAR)

54 篇文章 2 订阅
28 篇文章 1 订阅

源码转自: https://docs.google.com/viewer?pid=sites&srcid=ZGVmYXVsdGRvbWFpbnxtaWNyb3JvYm90aWNzbGFib3JhdG9yeXxneDozNmUxOWY5Mjk3OTMzOGJm&docid=c9324b44940f445906e9f2223be5dadd%7C453122719589940673d062e71b9fe92c&chan=DwAAABsLPZTLW7EBhWtqmGJbduI%3D&a=v&rel=zip;z122;CSL_init.c

使用CCS5.2 打开 controlSUITE 的工程时, 编译一次, 就可以使用 F3 快捷键来打开函数和变量的定义出. 可以查看很多源代码. 

===============================================================================================================================

/*
 *  ======== CSL_init.c ========
 *  DO NOT MODIFY THIS FILE - CHANGES WILL BE OVERWRITTEN
 */
 
/* external peripheral initialization functions */
extern void GPIO_init(void);
extern void BCSplus_init(void);
extern void USCI_B0_init(void);
extern void USCI_A0_init(void);
extern void System_init(void);
extern void WDTplus_init(void);

#include <msp430.h>

/*
 *  ======== CSL_init =========
 *  Initialize all configured CSL peripherals
 */
void CSL_init(void)
{
    /* Stop watchdog timer from timing out during initial start-up. */
    WDTCTL = WDTPW + WDTHOLD;

    /* initialize Config for the MSP430 GPIO */
    GPIO_init();

    /* initialize Config for the MSP430 2xx family clock systems (BCS) */
    BCSplus_init();

    /* initialize Config for the MSP430 USCI_B0 */
    USCI_B0_init();

    /* initialize Config for the MSP430 USCI_A0 */
    USCI_A0_init();

    /* initialize Config for the MSP430 System Registers */
    System_init();

    /* initialize Config for the MSP430 WDT+ */
    WDTplus_init();

}

/*
 *  ======== Interrupt Function Definitions ========
 */
/* --COPYRIGHT--,EPL
 *  Copyright (c) 2010 Texas Instruments and others.
 *  All rights reserved. This program and the accompanying materials
 *  are made available under the terms of the Eclipse Public License v1.0
 *  which accompanies this distribution, and is available at
 *  http://www.eclipse.org/legal/epl-v10.html
 * 
 *  Contributors:
 *      Texas Instruments - initial implementation
 * 
 * --/COPYRIGHT--*/

/* Interrupt Function Prototypes */
extern void USCIAB0RX_ISR(void);
extern void USCIAB0TX_ISR(void);
extern void USCIAB0RX_ISR(void);
extern void USCIAB0RX_ISR(void);






/*
 *  ======== USCI A0/B0 TX Interrupt Handler Generation ========
 */
#pragma vector=USCIAB0TX_VECTOR
__interrupt void USCI0TX_ISR_HOOK(void)
{

        /* USCI_B0 Transmit Interrupt Handler */
        USCIAB0TX_ISR();

        /* No change in operating mode on exit */
}

/*
 *  ======== USCI A0/B0 RX Interrupt Handler Generation ========
 */
#pragma vector=USCIAB0RX_VECTOR
__interrupt void USCI0RX_ISR_HOOK(void)
{
    if (IFG2 & UCA0RXIFG) {
                /* USCI_A0 Receive Interrupt Handler */
                USCIAB0RX_ISR();

                /* No change in operating mode on exit */
    }
    else if (UCB0STAT & UCSTTIFG) {
                /* USCI_B0 I2C Start Condition Interrupt Handler */
                USCIAB0RX_ISR();

                /* No change in operating mode on exit */
    }
    else if (UCB0STAT & UCSTPIFG) {
                /* USCI_B0 I2C Stop Condition Interrupt Handler */
                USCIAB0RX_ISR();

                /* No change in operating mode on exit */
    }
}




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值