📄 pins.h
字号:
//*****************************************************************************
//
// pins.h - Maps logical pin names to physical device pins.
//
// Copyright (c) 2007-2008 Luminary Micro, Inc. All rights reserved.
//
// Software License Agreement
//
// Luminary Micro, Inc. (LMI) is supplying this software for use solely and
// exclusively on LMI's microcontroller products.
//
// The software is owned by LMI and/or its suppliers, and is protected under
// applicable copyright laws. All rights are reserved. You may not combine
// this software with "viral" open-source software in order to form a larger
// program. Any use in violation of the foregoing restrictions may subject
// the user to criminal sanctions under applicable laws, as well as to civil
// liability for the breach of the terms and conditions of this license.
//
// THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
// OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
// LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
// CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
//
// This is part of revision 716 of the BLDC motor application.
//
//*****************************************************************************
#ifndef __PINS_H__
#define __PINS_H__
//*****************************************************************************
//
//! \page pins_intro Introduction
//!
//! The pins on the microcontroller are connected to a variety of external
//! devices. The defines in this file provide a name more descriptive than
//! "PB0" for the various devices connected to the microcontroller pins.
//!
//! These defines are provided in <tt>pins.h</tt>.
//
//*****************************************************************************
//*****************************************************************************
//
//! \defgroup pins_api Definitions
//! @{
//
//*****************************************************************************
//*****************************************************************************
//
//! The GPIO port on which the UART0 Rx pin resides.
//
//*****************************************************************************
#define PIN_UART0RX_PORT GPIO_PORTA_BASE
//*****************************************************************************
//
//! The GPIO pin on which the UART0 Rx pin resides.
//
//*****************************************************************************
#define PIN_UART0RX_PIN GPIO_PIN_0
//*****************************************************************************
//
//! The GPIO port on which the UART0 Tx pin resides.
//
//*****************************************************************************
#define PIN_UART0TX_PORT GPIO_PORTA_BASE
//*****************************************************************************
//
//! The GPIO pin on which the UART0 Tx pin resides.
//
//*****************************************************************************
#define PIN_UART0TX_PIN GPIO_PIN_1
//*****************************************************************************
//
//! The GPIO port on which the phase A low side pin resides.
//
//*****************************************************************************
#define PIN_PHASEA_LOW_PORT GPIO_PORTF_BASE
//*****************************************************************************
//
//! The GPIO pin on which the phase A low side pin resides.
//
//*****************************************************************************
#define PIN_PHASEA_LOW_PIN GPIO_PIN_1
//*****************************************************************************
//
//! The PWM channel on which the phase A low side resides.
//
//*****************************************************************************
#define PWM_PHASEA_LOW (1 << 1)
//*****************************************************************************
//
//! The GPIO port on which the phase A high side pin resides.
//
//*****************************************************************************
#define PIN_PHASEA_HIGH_PORT GPIO_PORTF_BASE
//*****************************************************************************
//
//! The GPIO pin on which the phase A high side pin resides.
//
//*****************************************************************************
#define PIN_PHASEA_HIGH_PIN GPIO_PIN_0
//*****************************************************************************
//
//! The PWM channel on which the phase A high side resides.
//
//*****************************************************************************
#define PWM_PHASEA_HIGH (1 << 0)
//*****************************************************************************
//
//! The GPIO port on which the quadrature encoder index pin resides.
//
//*****************************************************************************
#define PIN_INDEX_PORT GPIO_PORTB_BASE
//*****************************************************************************
//
//! The GPIO pin on which the quadrature encoder index pin resides.
//
//*****************************************************************************
#define PIN_INDEX_PIN GPIO_PIN_2
//*****************************************************************************
//
//! The GPIO port on which the user push button resides.
//
//*****************************************************************************
#define PIN_SWITCH_PORT GPIO_PORTB_BASE
//*****************************************************************************
//
//! The GPIO pin on which the user push button resides.
//
//*****************************************************************************
#define PIN_SWITCH_PIN GPIO_PIN_3
//*****************************************************************************
//
//! The bit lane of the GPIO pin on which the user push button resides.
//
//*****************************************************************************
#define PIN_SWITCH_PIN_BIT 3
//*****************************************************************************
//
//! The GPIO port on which the run LED resides.
//
//*****************************************************************************
#define PIN_LEDRUN_PORT GPIO_PORTG_BASE
//*****************************************************************************
//
//! The GPIO pin on which the run LED resides.
//
//*****************************************************************************
#define PIN_LEDRUN_PIN GPIO_PIN_0
//*****************************************************************************
//
//! The GPIO port on which the fault LED resides.
//
//*****************************************************************************
#define PIN_LEDFAULT_PORT GPIO_PORTC_BASE
//*****************************************************************************
//
//! The GPIO pin on which the fault LED resides.
//
//*****************************************************************************
#define PIN_LEDFAULT_PIN GPIO_PIN_5
//*****************************************************************************
//
//! The GPIO port on which the quadrature encoder channel A pin resides.
//
//*****************************************************************************
#define PIN_ENCA_PORT GPIO_PORTC_BASE
//*****************************************************************************
//
//! The GPIO pin on which the quadrature encoder channel A pin resides.
//
//*****************************************************************************
#define PIN_ENCA_PIN GPIO_PIN_4
//*****************************************************************************
//
//! The GPIO port on which the quadrature encoder channel B pin resides.
//
//*****************************************************************************
#define PIN_ENCB_PORT GPIO_PORTC_BASE
//*****************************************************************************
//
//! The GPIO pin on which the quadrature encoder channel B pin resides.
//
//*****************************************************************************
#define PIN_ENCB_PIN GPIO_PIN_7
//*****************************************************************************
//
//! The GPIO port on which the brake pin resides.
//
//*****************************************************************************
#define PIN_BRAKE_PORT GPIO_PORTC_BASE
//*****************************************************************************
//
//! The GPIO pin on which the brake pin resides.
//
//*****************************************************************************
#define PIN_BRAKE_PIN GPIO_PIN_6
//*****************************************************************************
//
//! The GPIO port on which the phase B low side pin resides.
//
//*****************************************************************************
#define PIN_PHASEB_LOW_PORT GPIO_PORTD_BASE
//*****************************************************************************
//
//! The GPIO pin on which the phase B low side pin resides.
//
//*****************************************************************************
#define PIN_PHASEB_LOW_PIN GPIO_PIN_3
//*****************************************************************************
//
//! The PWM channel on which the phase B low side resides.
//
//*****************************************************************************
#define PWM_PHASEB_LOW (1 << 3)
//*****************************************************************************
//
//! The GPIO port on which the phase B high side pin resides.
//
//*****************************************************************************
#define PIN_PHASEB_HIGH_PORT GPIO_PORTD_BASE
//*****************************************************************************
//
//! The GPIO pin on which the phase B high side pin resides.
//
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -