/* --COPYRIGHT--,BSD
* Copyright (c) 2014, 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--*/
//##### AUTO GENERATED FILE...DO NOT EDIT #####
#undef DEBUG
#define BUILD_FOR_ROM 1
#include <ti/devices/msp432p4xx/inc/msp.h>
#include <src/adc14.h>
#include <src/aes256.h>
#include <src/comp_e.h>
#include <src/cpu.h>
#include <src/crc32.h>
#include <src/cs.h>
#include <src/debug.h>
#include <src/dma.h>
#include <src/eusci.h>
#include <src/flash.h>
#include <src/fpu.h>
#include <src/gpio.h>
#include <src/i2c.h>
#include <src/interrupt.h>
#include <src/mpu.h>
#include <src/pcm.h>
#include <src/pmap.h>
#include <src/pss.h>
#include <src/ref_a.h>
#include <src/reset.h>
#include <src/rtc_c.h>
#include <src/spi.h>
#include <src/sysctl.h>
#include <src/systick.h>
#include <src/timer_a.h>
#include <src/timer32.h>
#include <src/uart.h>
#include <src/wdt_a.h>
static const uint32_t MAX_PROGRAM_NO_TLV = 5;
static const uint32_t MAX_ERASE_NO_TLV = 50;
//*****************************************************************************
//
//!
//! Returns a boolean value that tells if conversion is active/running or is
//! not acMSP432 ted.
//!
//! Originally a public function, but moved to static. External customers should
//! use the ADC14_isBusy function.
//!
//! \return true if conversion is active, false otherwise
//
//*****************************************************************************
static bool ADCIsConversionRunning(void)
{
return BITBAND_PERI(ADC14->rCTL0.r, ADC14BUSY_OFS);
}
void ADC14_enableModule(void)
{
BITBAND_PERI(ADC14->rCTL0.r, ADC14ON_OFS) = 1;
}
bool ADC14_disableModule(void)
{
if (ADCIsConversionRunning())
return false;
BITBAND_PERI(ADC14->rCTL0.r, ADC14ON_OFS) = 0;
return true;
}
static volatile uint32_t* const _ctlRegs[32] =
{ &ADC14->rMCTL0.r, &ADC14->rMCTL1.r, &ADC14->rMCTL2.r, &ADC14->rMCTL3.r,
&ADC14->rMCTL4.r, &ADC14->rMCTL5.r, &ADC14->rMCTL6.r, &ADC14->rMCTL7.r,
&ADC14->rMCTL8.r, &ADC14->rMCTL9.r, &ADC14->rMCTL10.r,
&ADC14->rMCTL11.r, &ADC14->rMCTL12.r, &ADC14->rMCTL13.r,
&ADC14->rMCTL14.r, &ADC14->rMCTL15.r, &ADC14->rMCTL16.r,
&ADC14->rMCTL17.r, &ADC14->rMCTL18.r, &ADC14->rMCTL19.r,
&ADC14->rMCTL20.r, &ADC14->rMCTL21.r, &ADC14->rMCTL22.r,
&ADC14->rMCTL23.r, &ADC14->rMCTL24.r, &ADC14->rMCTL25.r,
&ADC14->rMCTL26.r, &ADC14->rMCTL27.r, &ADC14->rMCTL28.r,
&ADC14->rMCTL29.r, &ADC14->rMCTL30.r, &ADC14->rMCTL31.r };
static uint_fast8_t _getIndexForMemRegister(uint32_t reg)
{
switch (reg)
{
case ADC_MEM0:
return 0;
case ADC_MEM1:
return 1;
case ADC_MEM2:
return 2;
case ADC_MEM3:
return 3;
case ADC_MEM4:
return 4;
case ADC_MEM5:
return 5;
case ADC_MEM6:
return 6;
case ADC_MEM7:
return 7;
case ADC_MEM8:
return 8;
case ADC_MEM9:
return 9;
case ADC_MEM10:
return 10;
case ADC_MEM11:
return 11;
case ADC_MEM12:
return 12;
case ADC_MEM13:
return 13;
case ADC_MEM14:
return 14;
case ADC_MEM15:
return 15;
case ADC_MEM16:
return 16;
case ADC_MEM17:
return 17;
case ADC_MEM18:
return 18;
case ADC_MEM19:
return 19;
case ADC_MEM20:
return 20;
case ADC_MEM21:
return 21;
case ADC_MEM22:
return 22;
case ADC_MEM23:
return 23;
case ADC_MEM24:
return 24;
case ADC_MEM25:
return 25;
case ADC_MEM26:
return 26;
case ADC_MEM27:
return 27;
case ADC_MEM28:
return 28;
case ADC_MEM29:
return 29;
case ADC_MEM30:
return 30;
case ADC_MEM31:
return 31;
default:
ASSERT(false);
return ADC_INVALID_MEM;
}
}
bool ADC14_initModule(uint32_t clockSource, uint32_t clockPredivider,
uint32_t clockDivider, uint32_t internalChannelMask)
{
ASSERT(
clockSource == ADC_CLOCKSOURCE_ADCOSC
|| clockSource == ADC_CLOCKSOURCE_SYSOSC
|| clockSource == ADC_CLOCKSOURCE_ACLK
|| clockSource == ADC_CLOCKSOURCE_MCLK
|| clockSource == ADC_CLOCKSOURCE_SMCLK
|| clockSource == ADC_CLOCKSOURCE_HSMCLK);
ASSERT(
clockPredivider == ADC_PREDIVIDER_1
|| clockPredivider == ADC_PREDIVIDER_4
|| clockPredivider == ADC_PREDIVIDER_32
|| clockPredivider == ADC_PREDIVIDER_64);
ASSERT(
clockDivider == ADC_DIVIDER_1 || clockDivider == ADC_DIVIDER_2
|| clockDivider == ADC_DIVIDER_3
|| clockDivider == ADC_DIVIDER_4
|| clockDivider == ADC_DIVIDER_5
|| clockDivider == ADC_DIVIDER_6
|| clockDivider == ADC_DIVIDER_7
|| clockDivider == ADC_DIVIDER_8);
ASSERT(
!(internalChannelMask
& ~(ADC_MAPINTCH3 | ADC_MAPINTCH2 | ADC_MAPINTCH1
| ADC_MAPINTCH0 | ADC_TEMPSENSEMAP | ADC_BATTMAP)));
if (ADCIsConversionRunning())
return false;
ADC14->rCTL0.r = (ADC14->rCTL0.r
& ~(ADC14PDIV_M | ADC14DIV_M | ADC14SSEL_M))
| clockDivider | clockPredivider | clockSource;
ADC14->rCTL1.r = (ADC14->rCTL1.r
& ~(ADC_MAPINTCH3 | ADC_MAPINTCH2 | ADC_MAPINTCH1 | ADC_MAPINTCH0
| ADC_TEMPSENSEMAP | ADC_BATTMAP)) | internalChannelMask;
return true;
}
void ADC14_setResolution(uint32_t resolution)
{
ASSERT(
resolution == ADC_8BIT || resolution == ADC_10BIT
|| resolution == ADC_12BIT || resolution == ADC_14BIT);
ADC14->rCTL1.r = (ADC14->rCTL1.r & ~ADC14RES_M) | resolution;
}
uint_fast32_t ADC14_getResolution(void)
{
return ADC14->rCTL1.r & ADC14RES_M;
}
bool ADC14_setSampleHoldTrigger(uint32_t source, bool invertSignal)
{
ASSERT(
source == ADC_TRIGGER_ADCSC || source == ADC_TRIGGER_SOURCE1
|| source == ADC_TRIGGER_SOURCE2
|| source == ADC_TRIGGER_SOURCE3
|| source == ADC_TRIGGER_SOURCE4
|| source == ADC_TRIGGER_SOURCE5
|| source == ADC_TRIGGER_SOURCE6
|| source == ADC_TRIGGER_SOURCE7);
if (ADCIsConversionRunning())
return false;
if (invertSignal)
{
ADC14->rCTL0.r = (ADC14->rCTL0.r
没有合适的资源?快使用搜索试试~ 我知道了~
2022年电子设计大赛,C题——小车跟随行驶系统,控制代码的一部分。.zip
共781个文件
h:226个
c:184个
o:62个
需积分: 5 0 下载量 75 浏览量
2024-08-07
15:30:04
上传
评论
收藏 27.81MB ZIP 举报
温馨提示
优质项目,资源经过严格测试可直接运行成功且功能正常的情况才上传,可轻松copy复刻,拿到资料包后可轻松复现出一样的项目。 本人系统开发经验充足,有任何使用问题欢迎随时与我联系,我会及时为你解惑,提供帮助。 【资源内容】:包含完整源码+工程文件+说明(若有),项目具体内容可查看下方的资源详情。 【附带帮助】: 若还需要相关开发工具、学习资料等,我会提供帮助,提供资料,鼓励学习进步。 【本人专注计算机领域】: 有任何使用问题欢迎随时与我联系,我会及时解答,第一时间为你提供帮助,CSDN博客端可私信,为你解惑,欢迎交流。 【适合场景】: 相关项目设计中,皆可应用在项目开发、毕业设计、课程设计、期末/期中/大作业、工程实训、大创等学科竞赛比赛、初期项目立项、学习/练手等方面中 可借鉴此优质项目实现复刻,也可以基于此项目进行扩展来开发出更多功能 【无积分此资源可联系获取】 # 注意 1. 本资源仅用于开源学习和技术交流。不可商用等,一切后果由使用者承担。 2. 部分字体以及插图等来自网络,若是侵权请联系删除。积分/付费仅作为资源整理辛苦费用。
资源推荐
资源详情
资源评论
收起资源包目录
2022年电子设计大赛,C题——小车跟随行驶系统,控制代码的一部分。.zip (781个子文件)
msp432p4xx_driverlib.a 1.19MB
msp432p4xx_driverlib.a 1.19MB
msp432p4xx_driverlib.a 459KB
msp432p4xx_driverlib.a 459KB
empty.axf 172KB
empty.axf 170KB
empty_sct.Bak 464B
empty_sct.Bak 464B
keil_download.bat 150B
keil_download.bat 150B
empty.bin 824B
empty.bin 824B
msp432p401_driverlib_rom_image.c 280KB
msp432p401_driverlib_rom_image.c 280KB
flash_a.c 55KB
flash_a.c 55KB
spi.c 47KB
spi.c 47KB
flash.c 45KB
flash.c 45KB
timer_a.c 31KB
timer_a.c 31KB
i2c.c 28KB
i2c.c 28KB
cs.c 26KB
cs.c 26KB
dma.c 23KB
dma.c 23KB
adc14.c 19KB
adc14.c 19KB
pcm.c 17KB
pcm.c 17KB
SEEKFREE_ICM20602.c 16KB
SEEKFREE_ICM20602.c 16KB
interrupt.c 15KB
interrupt.c 15KB
system_msp432p401m.c 15KB
system_msp432p401r.c 15KB
system_msp432p401r.c 15KB
system_msp432p401m.c 15KB
system_msp432p401r.c 15KB
system_msp432p401r.c 15KB
uart.c 15KB
uart.c 15KB
system_msp432p411y.c 15KB
system_msp432p4011.c 15KB
system_msp432p411v.c 15KB
system_msp432p401y.c 15KB
system_msp432p4111.c 15KB
system_msp432p401v.c 15KB
system_msp432p411v.c 15KB
system_msp432p411y.c 15KB
system_msp432p401y.c 15KB
system_msp432p4011.c 15KB
system_msp432p4111.c 15KB
system_msp432p401v.c 15KB
startup_msp432p411y_ewarm.c 14KB
startup_msp432p411v_ewarm.c 14KB
startup_msp432p4111_ewarm.c 14KB
startup_msp432p411y_ewarm.c 14KB
startup_msp432p4111_ewarm.c 14KB
startup_msp432p411v_ewarm.c 14KB
startup_msp432p401r_ewarm.c 13KB
startup_msp432p401m_ewarm.c 13KB
startup_msp432p401r_ewarm.c 13KB
startup_msp432p401r_ewarm.c 13KB
startup_msp432p401r_ewarm.c 13KB
startup_msp432p401m_ewarm.c 13KB
startup_msp432p401y_ewarm.c 13KB
startup_msp432p401v_ewarm.c 13KB
startup_msp432p4011_ewarm.c 13KB
startup_msp432p401v_ewarm.c 13KB
startup_msp432p401y_ewarm.c 13KB
startup_msp432p4011_ewarm.c 13KB
startup_msp432p411y_ccs.c 13KB
startup_msp432p4111_ccs.c 13KB
startup_msp432p411v_ccs.c 13KB
startup_msp432p411v_ccs.c 13KB
startup_msp432p4111_ccs.c 13KB
startup_msp432p411y_ccs.c 13KB
startup_msp432p411y_gcc.c 13KB
startup_msp432p4111_gcc.c 13KB
startup_msp432p411v_gcc.c 13KB
startup_msp432p411v_gcc.c 13KB
startup_msp432p4111_gcc.c 13KB
startup_msp432p411y_gcc.c 13KB
startup_msp432p401r_ccs.c 12KB
startup_msp432p401m_ccs.c 12KB
startup_msp432p401r_ccs.c 12KB
startup_msp432p401r_ccs.c 12KB
startup_msp432p401m_ccs.c 12KB
startup_msp432p401r_ccs.c 12KB
startup_msp432p401r_gcc.c 12KB
startup_msp432p401m_gcc.c 12KB
startup_msp432p401r_gcc.c 12KB
startup_msp432p401m_gcc.c 12KB
startup_msp432p401r_gcc.c 12KB
startup_msp432p401r_gcc.c 12KB
sysctl_a.c 12KB
sysctl_a.c 12KB
共 781 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
资源评论
热爱技术。
- 粉丝: 2418
- 资源: 7862
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- androidx.multidex.MultiDexApplication.apk.1
- 丑子金装美化32(1).zip
- 基于Visual Basic .Net及Python技术的学校需求解决方案设计源码
- 基于Java语言的Web开发学习Demo设计源码
- 基于Java的医院排队叫号系统界面原型设计源码
- 基于Java语言的Himalaya仿喜马拉雅设计源码
- 基于PHP+HTML+CSS+JavaScript的智能电车管家设计源码
- 基于Emscripten编译的纯H5直播流播放器jessibuca设计源码
- 基于react-native的Android隐私合规配置与代码集成设计源码
- 基于JavaFX技术的全功能色彩管理器设计源码
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功