MSP432 快速开发指南:如何利用 DriverLib 进行快速开发

博主分享不易,请给一键三连哦(关注 + 点赞 + 收藏),你的鼓励是博主分享的动力。

1 前言

1.1 内容简介

1.1_1

    MSP432P401R LaunchPad - Red 2.x (Red) (后续补上~)

1.2 快速链接

1.3 操作环境

    操作系统:Win10 专业版

2 基本介绍

    DriverLib 的文件目录如下图:
2_1
    这里我只介绍几个快速上手需要的文件夹。

Files描述
\doc库用户指南文档(包括离线网页和 PDF)
\driverlib库文件(包括外设库的.c.h文件及 CCS、EWARM、GCC、Keil 下的lib文件)
\examplesAPI 使用示例(包括CCS、EWARM、GCC、Keil 下的 API 示例程序)
\inc头文件(包括 CMSIS 及其他的相关头文件)

3 使用介绍

3.1 \doc 使用

    这里关于 \doc 的使用,只讲述外设库函数如何查看函数介绍及程序示例,以 GPIO 为例。其他的新惊喜请自行去解锁。

  1. 打开 MSP432_DriverLib_API_Guide-MSP432P4xx-3_21_00_05.html 离线网页(文件目录:\msp432_driverlib_3_21_00_05\doc\MSP432P4xx)
    3.1_1
    (PS:MSP432_DriverLib_Users_Guide-MSP432P4xx-3_21_00_05.pdf 也是 API 的用户指南,但是建议使用离线网页,优点的话后面会讲到)
  2. 点击 Modules
    3.1_2
  3. 点击 GPIO
    3.1_3
  4. 网页右侧有书签栏,点击 Functions
    3.1_4
  5. 点击 GPIO_setAsOutputPin
    3.1_5
  6. 这样我们就可以看到 GPIO_setAsOutputPin 函数的介绍了
    3.1_6
    (如果你的浏览器有翻译插件,就可以将网页翻译成中文,对于看英文就头痛的开发者就友好多了;当然这个翻译很有可能是不准确的,还是建议返回英文)
    3.1_7
  7. GPIO 程序示例
    3.1_8
    (特不靠谱)英 > 中
    3.1_9

3.2 \driverlib 使用

    \driverlib 中是库文件,这个的使用方法比较简单,就不再讲了。

3.3 \examples 使用

    \examples 中是各外设程序示例,这里围绕 GPIO 输出示例程序来讲述使用方法。

  1. 打开 gpio_toggle_output.uvprojx(文件目录:\msp432_driverlib_3_21_00_05\examples\MSP432P4xx\gpio\gpio_toggle_output\keil)
    3.3_1
  2. 工程界面如下,.c 文件中有相关操作介绍和图表示意
    3.3_2
  3. main 函数如下,和离线网页中 GPIO 程序示例是一样的
    3.3_4
  4. 更改仿真器为 CMSIS-DAP Debugger
    3.3_5
  5. Flash Download 界面中,勾选 Reset and Run,以便程序下载后自动运行
    3.3_6
  6. 编译工程
    3.3_7
  7. 下载程序,可以看到小火箭旁边的 LED 灯在闪烁
    1.1_1

3.4 \inc 使用

    \driverlib 中是 CMSIS 头文件和芯片相关头文件,这个的使用方法也比较简单,就不再讲了。

4 结束

    本教程由 Brendon Tan 原创发布,版权所有。该文档仅供个人学习交流使用,不得用于其他用途, 禁止商用, 转载或公开使用请联系作者授权。
    此教程由本人独立整理,如有不当之处,欢迎指正。

  • 13
    点赞
  • 68
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
MSP432 低功耗高性能并存10.1 Digital I/O Introduction The digital I/O features include: • Independently programmable individual I/Os • Any combination of input or output • Individually configurable interrupts for ports (available for certain ports only) • Independent input and output data registers • Individually configurable pullup or pulldown resistors • Wake-up capability from ultra-low power modes (available for certain ports only) • Individually configurable high drive I/Os (available for certain I/Os only) Devices within the family may have up to eleven digital I/O ports implemented (P1 to P10 and PJ). Most ports contain eight I/O lines; however, some ports may contain less (see the device-specific data sheet for ports available). Each I/O line is individually configurable for input or output direction, and each can be individually read or written. Each I/O line is individually configurable for pullup or pulldown resistors. Certain ports have interrupt and wake-up capability from ultra-low power modes (see device specific data sheet for ports with interrupt and wake-up capability). Each interrupt can be individually enabled and configured to provide an interrupt on a rising or falling edge of an input signal. All interrupts are fed into an encoded Interrupt Vector register, allowing the application to determine which sub-pin of a port has generated the event. Individual ports can be accessed as byte-wide ports or can be combined into half-word-wide ports. Port pairs P1 and P2, P3 and P4, P5 and P6, P7 and P8, and so on, are associated with the names PA, PB, PC, PD, and so on, respectively. All port registers are handled in this manner with this naming convention. The main exception are the interrupt vector registers, for example, interrupts for ports P1 and P2 must be handled through P1IV and P2IV, PAIV does not exist. When writing to port PA with half-word operations, all 16 bits are written to the port. When writing to the lower byte of port PA using byte operations,

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值