/* --COPYRIGHT--,BSD
* Copyright (c) 2012, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* --/COPYRIGHT--*/
//*****************************************************************************
//
//timer_d.c - Driver for the TIMER Module.
//
//*****************************************************************************
#include "inc/hw_regaccess.h"
#include "assert.h"
#include "timer_d.h"
#include "tlv.h"
#ifdef __IAR_SYSTEMS_ICC__
#include "deprecated/IAR/msp430xgeneric.h"
#else
#include "deprecated/CCS/msp430xgeneric.h"
#endif
static void privateTimerDProcessClockSourceDivider (uint32_t baseAddress,
uint16_t clockSourceDivider);
//*****************************************************************************
//
//! Starts TimerD counter
//!
//! \param baseAddress is the base address of the TimerA module.
//! \param clockSource selects Clock source. Valid values are
//! \b TIMER_D_CONTINUOUS_MODE [Default value]
//! \b TIMER_D_UPDOWN_MODE
//! \b TIMER_D_UP_MODE
//! Modified register is \b TDxCTL0
//!
//!NOTE: This function assumes that the timer has been previously configured
//! using TIMER_D_configureContinuousMode, TIMER_D_configureUpMode or
//!TIMER_D_configureUpDownMode.
//!
//! \return None
//
//*****************************************************************************
void TIMER_D_startCounter ( uint32_t baseAddress,
uint16_t timerMode
)
{
assert(
(TIMER_D_UPDOWN_MODE == timerMode) ||
(TIMER_D_CONTINUOUS_MODE == timerMode) ||
(TIMER_D_UP_MODE == timerMode)
);
HWREG16(baseAddress + OFS_TDxCTL0) |= timerMode;
}
//*****************************************************************************
//
//! Configures timer in continuous mode.
//!
//! \param baseAddress is the base address of the Timer module.
//! \param clockSource selects Clock source. Valid values are
//! \b TIMER_D_CLOCKSOURCE_EXTERNAL_TDCLK [Default value]
//! \b TIMER_D_CLOCKSOURCE_ACLK
//! \b TIMER_D_CLOCKSOURCE_SMCLK
//! \b TIMER_D_CLOCKSOURCE_INVERTED_EXTERNAL_TDCLK
//! \param clockSourceDivider is the divider for Clock source.
//! Valid values are
//! \b TIMER_D_CLOCKSOURCE_DIVIDER_1 [Default value]
//! \b TIMER_D_CLOCKSOURCE_DIVIDER_2
//! \b TIMER_D_CLOCKSOURCE_DIVIDER_4
//! \b TIMER_D_CLOCKSOURCE_DIVIDER_8
//! \b TIMER_D_CLOCKSOURCE_DIVIDER_3
//! \b TIMER_D_CLOCKSOURCE_DIVIDER_5
//! \b TIMER_D_CLOCKSOURCE_DIVIDER_6
//! \b TIMER_D_CLOCKSOURCE_DIVIDER_7
//! \b TIMER_D_CLOCKSOURCE_DIVIDER_10
//! \b TIMER_D_CLOCKSOURCE_DIVIDER_12
//! \b TIMER_D_CLOCKSOURCE_DIVIDER_14
//! \b TIMER_D_CLOCKSOURCE_DIVIDER_16
//! \b TIMER_D_CLOCKSOURCE_DIVIDER_20
//! \b TIMER_D_CLOCKSOURCE_DIVIDER_24
//! \b TIMER_D_CLOCKSOURCE_DIVIDER_28
//! \b TIMER_D_CLOCKSOURCE_DIVIDER_32
//! \b TIMER_D_CLOCKSOURCE_DIVIDER_40
//! \b TIMER_D_CLOCKSOURCE_DIVIDER_48
//! \b TIMER_D_CLOCKSOURCE_DIVIDER_56
//! \b TIMER_D_CLOCKSOURCE_DIVIDER_64
//! \param clockingMode is the selected clock mode register values.
//! Valid values are
//! \b TIMER_D_CLOCKINGMODE_EXTERNAL_CLOCK [Default value]
//! \b TIMER_D_CLOCKINGMODE_HIRES_LOCAL_CLOCK
//! \b TIMER_D_CLOCKINGMODE_AUXILIARY_CLK
//! \param timerInterruptEnable_TDIE is to enable or disable timer interrupt
//! Valid values are
//! \b TIMER_D_TDIE_INTERRUPT_ENABLE
//! \b TIMER_D_TDIE_INTERRUPT_DISABLE [Default value]
//! \param timerClear decides if timer clock divider, count direction, count
//! need to be reset. Valid values are
//! \b TIMER_D_DO_CLEAR
//! \b TIMER_D_SKIP_CLEAR [Default value]
//!
//! Modified registers are \b TDxCTL0 and \b TDxCTL1
//!
//!This API does not start the timer. Timer needs to be started when required
//!using the TIMER_D_start API.
//!
//! \return None
//
//*****************************************************************************
void TIMER_D_configureContinuousMode ( uint32_t baseAddress,
uint16_t clockSource,
uint16_t clockSourceDivider,
uint16_t clockingMode,
uint16_t timerInterruptEnable_TDIE,
uint16_t timerClear
)
{
assert(
(TIMER_D_DO_CLEAR == timerClear) ||
(TIMER_D_SKIP_CLEAR == timerClear)
);
assert(
(TIMER_D_TDIE_INTERRUPT_ENABLE == timerInterruptEnable_TDIE) ||
(TIMER_D_TDIE_INTERRUPT_DISABLE == timerInterruptEnable_TDIE)
);
assert(
(TIMER_D_CLOCKSOURCE_EXTERNAL_TDCLK == clockSource) ||
(TIMER_D_CLOCKSOURCE_ACLK == clockSource) ||
(TIMER_D_CLOCKSOURCE_SMCLK == clockSource) ||
(TIMER_D_CLOCKSOURCE_INVERTED_EXTERNAL_TDCLK == clockSource)
);
assert(
(TIMER_D_CLOCKSOURCE_DIVIDER_1 == clockSourceDivider) ||
(TIMER_D_CLOCKSOURCE_DIVIDER_2 == clockSourceDivider) ||
(TIMER_D_CLOCKSOURCE_DIVIDER_4 == clockSourceDivider) ||
(TIMER_D_CLOCKSOURCE_DIVIDER_8 == clockSourceDivider) ||
(TIMER_D_CLOCKSOURCE_DIVIDER_3 == clockSourceDivider) ||
(TIMER_D_CLOCKSOURCE_DIVIDER_5 == clockSourceDivider) ||
(TIMER_D_CLOCKSOURCE_DIVIDER_6 == clockSourceDivider) ||
(TIMER_D_CLOCKSOURCE_DIVIDER_7 == clockSourceDivider) ||
(TIMER_D_CLOCKSOURCE_DIVIDER_10 == clockSourceDivider) ||
(TIMER_D_CLOCKSOURCE_DIVIDER_12 == clockSourceDivider) ||
(TIMER_D_CLOCKSOURCE_DIVIDER_14 == clockSourceDivider) ||
(TIMER_D_CLOCKSOURCE_DIVIDER_16 == clockSourceDivider) ||
(TIMER_D_CLOCKSOURCE_DIVIDER_20 == clockSourceDivider) ||
(TIMER_D_CLOCKSOURCE_DIVIDER_24 == clockSourceDivider) ||
(TIMER_D_CLOCKSOURCE_DIVIDER_28 == clockSourceDivider) ||
(TIMER_D_CLOCKSOURCE_DIVIDER_32 == clockSourceDivider) ||
(TIMER_D_CLOCKSOURCE_DIVIDER_40 == clockSourceDivider) ||
(TIMER_D_CLOCKSOURCE_DIVIDER_48 == clockSourceDivider) ||
(TIMER_D_CLOCKSOURCE_DIVIDER_56 == clockSourceDivider) ||
(TIMER_D_CLOCKSOURCE_DIVIDER_64 == clockSourceDivider)
);
assert(
(TIMER_D_CLOCKINGMODE_EXTERNAL_CLOCK == clockingMode) ||
(TIMER_D_CLOCKINGMODE_HIRES_LOCAL_CLOCK == clockingMode) ||
(TIMER_D_C
没有合适的资源?快使用搜索试试~ 我知道了~
AY-LDC1000_MSP430F5529LP.zip_MSP430F5529LP
共219个文件
h:54个
c:48个
pp:48个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 28 浏览量
2022-09-20
22:39:35
上传
评论
收藏 885KB ZIP 举报
温馨提示
艾研科技 ay-ldc1000 评估板驱动,适用于exp-msp430f5529lp 实现大部分功能
资源推荐
资源详情
资源评论
收起资源包目录
AY-LDC1000_MSP430F5529LP.zip_MSP430F5529LP (219个子文件)
timer_d.c 87KB
timer_b.c 70KB
timer_a.c 66KB
gpio.c 56KB
ucs.c 54KB
eusci_b_i2c.c 49KB
eusci_i2c.c 48KB
usci_b_i2c.c 44KB
usci_i2c.c 44KB
adc12_a.c 44KB
sd24_b.c 38KB
adc10_a.c 36KB
pmm.c 33KB
dac12_a.c 31KB
eusci_a_uart.c 30KB
rtc_a.c 30KB
eusci_uart.c 30KB
usci_a_uart.c 28KB
rtc_c.c 28KB
usci_uart.c 28KB
dma.c 27KB
rtc_b.c 26KB
comp_b.c 24KB
eusci_a_uartbaudrate.c 24KB
eusci_euartbaudrate.c 23KB
eusci_spi.c 21KB
eusci_a_spi.c 21KB
eusci_b_spi.c 21KB
tec.c 20KB
aes.c 19KB
usci_spi.c 19KB
usci_a_spi.c 19KB
usci_b_spi.c 19KB
mpy32.c 18KB
sys.c 18KB
ldopwr.c 16KB
usci_uartbaudrate.c 12KB
usci_a_uartbaudrate.c 12KB
ref.c 12KB
tlv.c 12KB
flash.c 11KB
sfr.c 11KB
bak_batt.c 9KB
main.c 8KB
wdt_a.c 7KB
crc.c 7KB
ram.c 4KB
pmap.c 4KB
.ccsproject 479B
MSP430F5529.ccxml 822B
lnk_msp430f5529.cmd 14KB
.cproject 24KB
msp430xgeneric.h 560KB
msp430xgeneric.h 550KB
timer_d.h 23KB
timer_b.h 18KB
timer_a.h 16KB
adc12_a.h 14KB
sd24_b.h 14KB
hw_memmap.h 13KB
adc10_a.h 13KB
eusci_b_i2c.h 11KB
eusci_i2c.h 11KB
rtc_c.h 11KB
rtc_a.h 10KB
tlv.h 10KB
eusci_uart.h 10KB
ucs.h 9KB
eusci_a_uart.h 9KB
usci_i2c.h 9KB
usci_b_i2c.h 9KB
usci_uart.h 9KB
usci_a_uart.h 9KB
dma.h 9KB
dac12_a.h 8KB
rtc_b.h 8KB
tec.h 8KB
comp_b.h 8KB
eusci_spi.h 7KB
eusci_b_spi.h 7KB
eusci_a_spi.h 7KB
gpio.h 7KB
sys.h 6KB
usci_spi.h 6KB
usci_b_spi.h 6KB
usci_a_spi.h 6KB
ldopwr.h 6KB
pmm.h 5KB
mpy32.h 5KB
sfr.h 5KB
in430.h 5KB
aes.h 5KB
bak_batt.h 5KB
ref.h 4KB
wdt_a.h 4KB
flash.h 4KB
usci_uartbaudrate.h 3KB
eusci_euartbaudrate.h 3KB
LDC1000_cmd.h 3KB
usci_a_uartbaudrate.h 3KB
共 219 条
- 1
- 2
- 3
资源评论
御道御小黑
- 粉丝: 58
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功