资源简介
此代码主要功能为:通过MSP430F5359控制TI公司的DAC7811系列的模数转换器件
代码片段和文件信息
/* --COPYRIGHT--BSD
* Copyright (c) 2016 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--*/
//*****************************************************************************
//
// adc10_a.c - Driver for the adc10_a Module.
//
//*****************************************************************************
//*****************************************************************************
//
//! \addtogroup adc10_a_api adc10_a
//! @{
//
//*****************************************************************************
#include “inc/hw_memmap.h“
#ifdef __MSP430_HAS_ADC10_A__
#include “adc10_a.h“
#include
bool ADC10_A_init(uint16_t baseAddress
uint16_t sampleHoldSignalSourceSelect
uint8_t clockSourceSelect
uint16_t clockSourceDivider)
{
bool retVal = STATUS_SUCCESS;
//Turn OFF ADC10_A Module & Clear Interrupt Registers
HWREG16(baseAddress + OFS_ADC10IFG) &= 0x0000; //Reset ALL interrupt flags
//Set ADC10_A Control 1
HWREG16(baseAddress + OFS_ADC10CTL1) =
sampleHoldSignalSourceSelect //Setup the Sample-and-Hold Source
+ (clockSourceDivider & ADC10DIV_7) //Set Clock Divider
+ clockSourceSelect; //Setup Clock Source
//Set ADC10_A Control 2
HWREG16(baseAddress + OFS_ADC10CTL2) =
(clockSourceDivider & (ADC10PDIV_1 | ADC10PDIV_2)) //Set
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2016-07-23 15:29 DAC7811\
目录 0 2016-07-23 15:29 DAC7811\driverlib\
文件 8506 2016-03-25 06:04 DAC7811\driverlib\adc10_a.c
文件 46199 2016-03-25 06:04 DAC7811\driverlib\adc10_a.h
文件 10195 2016-03-25 06:04 DAC7811\driverlib\adc12_a.c
文件 51549 2016-03-25 06:04 DAC7811\driverlib\adc12_a.h
文件 11811 2016-03-25 06:04 DAC7811\driverlib\aes.c
文件 17694 2016-03-25 06:04 DAC7811\driverlib\aes.h
文件 3897 2016-06-13 10:38 DAC7811\driverlib\battbak.c
文件 12103 2016-06-13 10:28 DAC7811\driverlib\battbak.h
文件 8416 2016-03-25 06:04 DAC7811\driverlib\comp_b.c
文件 28029 2016-03-25 06:04 DAC7811\driverlib\comp_b.h
文件 3475 2016-03-25 06:04 DAC7811\driverlib\crc.c
文件 8427 2016-03-25 06:04 DAC7811\driverlib\crc.h
文件 10517 2016-03-25 06:04 DAC7811\driverlib\ctsd16.c
文件 37498 2016-03-25 06:04 DAC7811\driverlib\ctsd16.h
文件 9400 2016-03-25 06:04 DAC7811\driverlib\dac12_a.c
文件 32950 2016-03-25 06:04 DAC7811\driverlib\dac12_a.h
文件 6534 2016-03-25 06:04 DAC7811\driverlib\dma.c
文件 31783 2016-03-25 06:04 DAC7811\driverlib\dma.h
文件 2554 2016-06-13 09:07 DAC7811\driverlib\driverlib.h
文件 7686 2016-03-25 06:04 DAC7811\driverlib\eusci_a_spi.c
文件 22600 2016-03-25 06:04 DAC7811\driverlib\eusci_a_spi.h
文件 9550 2016-03-25 06:04 DAC7811\driverlib\eusci_a_uart.c
文件 27154 2016-03-25 06:04 DAC7811\driverlib\eusci_a_uart.h
文件 19039 2016-03-25 06:04 DAC7811\driverlib\eusci_b_i2c.c
文件 44753 2016-03-25 06:04 DAC7811\driverlib\eusci_b_i2c.h
文件 7618 2016-03-25 06:04 DAC7811\driverlib\eusci_b_spi.c
文件 22600 2016-03-25 06:04 DAC7811\driverlib\eusci_b_spi.h
文件 8824 2016-03-25 06:04 DAC7811\driverlib\flashctl.c
文件 11304 2016-03-25 06:04 DAC7811\driverlib\flashctl.h
............此处省略209个文件信息
- 上一篇:人体跟踪源代码,用visual c++
- 下一篇:Bmp2jpeg图片格式转换
评论
共有 条评论