本文整理汇总了C++中ROM_GPIOPinTypeGPIOOutput函数的典型用法代码示例。如果您正苦于以下问题:C++ ROM_GPIOPinTypeGPIOOutput函数的具体用法?C++ ROM_GPIOPinTypeGPIOOutput怎么用?C++ ROM_GPIOPinTypeGPIOOutput使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ROM_GPIOPinTypeGPIOOutput函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: spi_gpio_init
void spi_gpio_init(uint8_t int_flag)
{
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
//F0-----MISO ----- INPUT
ROM_GPIOPinTypeGPIOInput(GPIO_PORTF_BASE, GPIO_PIN_0);
//F1,F2,F3:MOSI,CLK,CSN ----- OUTPUT
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3);
//CE-----PA6 ----- OUTPUT
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTA_BASE, GPIO_PIN_6);
//IRQ-----PA7 ----- INPUT
ROM_GPIOPinTypeGPIOInput(GPIO_PORTA_BASE, GPIO_PIN_7);
if(int_flag == 1) //开引脚外部中断
{
GPIOIntTypeSet(GPIO_PORTA_BASE,GPIO_PIN_7,GPIO_FALLING_EDGE);
GPIOIntEnable(GPIO_PORTA_BASE,GPIO_INT_PIN_7); //打开PA7外部中断进行数据读取
GPIOIntRegister(GPIO_PORTA_BASE, PA7_int_hander);//指定外部中断处理函数
}
else
{
GPIOIntDisable(GPIO_PORTA_BASE,GPIO_INT_PIN_7);
}
}
示例2: GPIO_Initial
void GPIO_Initial(void)
{
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTA_BASE, GPIO_PIN_6); //Laser
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE, GPIO_PIN_2|GPIO_PIN_4); //预留、吹风机
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTD_BASE, GPIO_PIN_0| \
GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3); //振镜Y、X、CLK、SYN
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTE_BASE, GPIO_PIN_0|GPIO_PIN_1|\
GPIO_PIN_2|GPIO_PIN_3 | GPIO_PIN_5); //预留、塔灯红、绿、黄、光闸、抽风机
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|\
GPIO_PIN_3|GPIO_PIN_4); //板上显示灯:红、蓝、绿;LCD复位
ROM_GPIOPadConfigSet(GPIO_PORTB_BASE, GPIO_PIN_3, \
GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU); //冷水机开关信号
ROM_GPIOPinTypeGPIOInput(GPIO_PORTC_BASE, GPIO_PIN_6); //测速
ROM_GPIOPinTypeGPIOInput(GPIO_PORTD_BASE, GPIO_PIN_6); //手动开关、运行模式
HWREG(GPIO_PORTD_BASE+GPIO_O_LOCK) = GPIO_LOCK_KEY;
HWREG(GPIO_PORTD_BASE+GPIO_O_CR) |= 0x80;
HWREG(GPIO_PORTD_BASE+GPIO_O_AFSEL) &= ~(0x80);
HWREG(GPIO_PORTD_BASE+GPIO_O_DEN) |= 0x80;
ROM_GPIOPinTypeGPIOInput(GPIO_PORTC_BASE, GPIO_PIN_7);
HWREG(GPIO_PORTD_BASE+GPIO_O_LOCK) = 0;
}
示例3: init_lcd
// Fonction qui initialise le LCD
void init_lcd(void) {
// Enable ports on board
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
// Configure pins
ROM_GPIOPadConfigSet(GPIO_PORTE_BASE, 0xFF, GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD_WPD);
// Enable data as output
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTJ_BASE, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2);
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTE_BASE, 0xFF); // Toutes les pins
// Default values of pins to zero
ROM_GPIOPinWrite(GPIO_PORTJ_BASE, LCD_RS | LCD_RW | LCD_E, 0x00);
ROM_GPIOPinWrite(GPIO_PORTE_BASE, 0xFF, 0x00);
// Set LCD to 2line mode
wait();
ROM_GPIOPinWrite(GPIO_PORTJ_BASE, LCD_RS | LCD_RW, LCD_RS_Instruction | LCD_RW_Write);
ROM_GPIOPinWrite(GPIO_PORTJ_BASE, LCD_E, LCD_E);
ROM_GPIOPinWrite(GPIO_PORTE_BASE, 0xFF, 0x38);
ROM_GPIOPinWrite(GPIO_PORTJ_BASE, LCD_E, 0);
// Activate cursor blinking
wait();
ROM_GPIOPinWrite(GPIO_PORTJ_BASE, LCD_RS | LCD_RW, LCD_RS_Instruction | LCD_RW_Write);
ROM_GPIOPinWrite(GPIO_PORTJ_BASE, LCD_E, LCD_E);
ROM_GPIOPinWrite(GPIO_PORTE_BASE, 0xFF, 0x0F);
ROM_GPIOPinWrite(GPIO_PORTJ_BASE, LCD_E, 0);
// Clear LCD
clear();
}
示例4: Config_PWM
static void Config_PWM(void)
{
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
ROM_GPIOPinConfigure(GPIO_PB6_T0CCP0);
ROM_GPIOPinConfigure(GPIO_PB2_T3CCP0);
ROM_GPIOPinTypeTimer(GPIO_PORTB_BASE, GPIO_PIN_2 | GPIO_PIN_6);
// Configure timer
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER3);
ROM_TimerConfigure(TIMER0_BASE, TIMER_CFG_SPLIT_PAIR | TIMER_CFG_A_PWM);
ROM_TimerLoadSet(TIMER0_BASE, TIMER_A, DEFAULT);
ROM_TimerMatchSet(TIMER0_BASE, TIMER_A, DEFAULT); // PWM
ROM_TimerEnable(TIMER0_BASE, TIMER_A);
ROM_TimerConfigure(TIMER3_BASE, TIMER_CFG_SPLIT_PAIR | TIMER_CFG_A_PWM);
ROM_TimerLoadSet(TIMER3_BASE, TIMER_A, DEFAULT);
ROM_TimerMatchSet(TIMER3_BASE, TIMER_A, DEFAULT); // PWM
ROM_TimerControlLevel(TIMER3_BASE, TIMER_A, true);
ROM_TimerEnable(TIMER3_BASE, TIMER_A);
ROM_SysCtlPeripheralEnable(DRV_ENABLE_LEFT_CHN_PERIPHERAL);
ROM_SysCtlPeripheralEnable(DRV_ENABLE_RIGHT_CHN_PERIPHERAL);
ROM_GPIOPinTypeGPIOOutput(DRV_ENABLE_LEFT_CHN_PORT, DRV_ENABLE_LEFT_CHN_PIN);
ROM_GPIOPinTypeGPIOOutput(DRV_ENABLE_RIGHT_CHN_PORT, DRV_ENABLE_RIGHT_CHN_PIN);
ROM_GPIOPinWrite(DRV_ENABLE_LEFT_CHN_PORT, DRV_ENABLE_LEFT_CHN_PIN, 0);
ROM_GPIOPinWrite(DRV_ENABLE_RIGHT_CHN_PORT, DRV_ENABLE_RIGHT_CHN_PIN, 0);
}
示例5: main
//*****************************************************************************
//
// PoC2Repeater
//
//*****************************************************************************
int
main(void)
{
// Set the clocking to run directly from the crystal at 120MHz.
g_ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
SYSCTL_OSC_MAIN |
SYSCTL_USE_PLL |
SYSCTL_CFG_VCO_480), 120000000);
// Enable the peripherals
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART7);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOJ);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPION);
// Enable the GPIO pins for the LEDs (PN0 and PN1).
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTN_BASE, GPIO_PIN_0);
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTN_BASE, GPIO_PIN_1);
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_0);
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_4);
// ButtonsInit
ROM_GPIODirModeSet(GPIO_PORTJ_BASE, ALL_BUTTONS, GPIO_DIR_MODE_IN);
MAP_GPIOPadConfigSet(GPIO_PORTJ_BASE, ALL_BUTTONS,
GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);
// Enable processor interrupts.
ROM_IntMasterEnable();
// Set GPIO PC4 and PC5 as UART pins.
GPIOPinConfigure(GPIO_PC4_U7RX);
GPIOPinConfigure(GPIO_PC5_U7TX);
ROM_GPIOPinTypeUART(GPIO_PORTC_BASE, GPIO_PIN_4 | GPIO_PIN_5);
// Configure the UART for 115,200, 8-N-1 operation.
ROM_UARTConfigSetExpClk(UART7_BASE, g_ui32SysClock, 115200,
(UART_CONFIG_WLEN_8 |
UART_CONFIG_STOP_ONE |
UART_CONFIG_PAR_NONE));
// Enable the UART interrupt.
ROM_IntEnable(INT_UART7);
ROM_UARTIntEnable(UART7_BASE, UART_INT_RX | UART_INT_RT);
// Reset message info
for(uint8_t i = 0; i < MSG; i++)
message[i] = 0;
// Loop forever echoing data through the UART.
while(1)
{
}
}
示例6: LED_Display_init
void LED_Display_init(void)
{
ROM_SysCtlPeripheralEnable(LED1_PERIPHERAL);
ROM_SysCtlPeripheralEnable(LED2_PERIPHERAL);
ROM_SysCtlPeripheralEnable(LED3_PERIPHERAL);
ROM_GPIOPinTypeGPIOOutput(LED1_PORT, LED1_PIN);
ROM_GPIOPinTypeGPIOOutput(LED2_PORT, LED2_PIN);
ROM_GPIOPinTypeGPIOOutput(LED3_PORT, LED3_PIN);
LED1_OFF();
LED2_OFF();
LED3_OFF();
}
示例7: InitialiseDisplayTFT
void InitialiseDisplayTFT(void)
{
/* Enable peripherals */
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI2);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
SysCtlDelay(100);
/* Set command and reset pin as outputs */
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTA_BASE, TFT_RESET_PIN | TFT_COMMAND_PIN);
/* Enable CS pin as output */
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE, GPIO_PIN_5);
/* Enable pin PB7 for SSI2 SSI2TX */
ROM_GPIOPinConfigure(GPIO_PB7_SSI2TX);
ROM_GPIOPinTypeSSI(GPIO_PORTB_BASE, GPIO_PIN_7);
/* Enable pin PB6 for SSI2 SSI2RX */
ROM_GPIOPinConfigure(GPIO_PB6_SSI2RX);
ROM_GPIOPinTypeSSI(GPIO_PORTB_BASE, GPIO_PIN_6);
/* Enable pin PB4 for SSI2 SSI2CLK */
ROM_GPIOPinConfigure(GPIO_PB4_SSI2CLK);
ROM_GPIOPinTypeSSI(GPIO_PORTB_BASE, GPIO_PIN_4);
/* Configure the SSI2 port to run at 15.0MHz */
ROM_SSIConfigSetExpClk(SSI2_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_0,
SSI_MODE_MASTER, 15000000, 8);
ROM_SSIEnable(SSI2_BASE);
/* Reset the display */
TFT_RESET_HIGH;
my_delay_tft(100);
TFT_RESET_LOW;
my_delay_tft(100);
TFT_RESET_HIGH;
my_delay_tft(100);
/* Send command sequence */
init_sequence_tft();
cursor_y = cursor_x = 0;
textcolor = 0xFFFF;
textbgcolor = 0x0000;
wrap = 1;
}
示例8: io_init
//*****************************************************************************
//
// Initialize the IO used in this demo
//
//*****************************************************************************
void
io_init(void)
{
//
// Configure Port F0 for as an output for the status LED.
//
ROM_GPIOPinTypeGPIOOutput(LED_PORT_BASE, LED_PIN);
//
// Initialize LED to OFF (0)
//
ROM_GPIOPinWrite(LED_PORT_BASE, LED_PIN, 0);
//
// Enable the peripherals used by this example.
//
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER2);
//
// Configure the timer used to pace the animation.
//
ROM_TimerConfigure(TIMER2_BASE, TIMER_CFG_PERIODIC);
//
// Setup the interrupts for the timer timeouts.
//
ROM_IntEnable(INT_TIMER2A);
ROM_TimerIntEnable(TIMER2_BASE, TIMER_TIMA_TIMEOUT);
//
// Set the timer for the current animation speed. This enables the
// timer as a side effect.
//
io_set_timer(g_ulAnimSpeed);
}
示例9: ROM_GPIOPinTypeGPIOOutput
void TwoWire::forceStop(void) {
//force a stop to release the bus
ROM_GPIOPinTypeGPIOOutput(g_uli2cBase[i2cModule],
g_uli2cSCLPins[i2cModule] | g_uli2cSDAPins[i2cModule]);
ROM_GPIOPinWrite(g_uli2cBase[i2cModule], g_uli2cSDAPins[i2cModule], 0);
ROM_GPIOPinWrite(g_uli2cBase[i2cModule],
g_uli2cSCLPins[i2cModule], g_uli2cSCLPins[i2cModule]);
ROM_GPIOPinWrite(g_uli2cBase[i2cModule],
g_uli2cSDAPins[i2cModule], g_uli2cSDAPins[i2cModule]);
ROM_GPIOPinTypeI2C(g_uli2cBase[i2cModule], g_uli2cSDAPins[i2cModule]);
ROM_GPIOPinTypeI2CSCL(g_uli2cBase[i2cModule], g_uli2cSCLPins[i2cModule]);
//reset I2C controller
//without resetting the I2C controller, the I2C module will
//bring the bus back to it's erroneous state
ROM_SysCtlPeripheralReset(g_uli2cPeriph[i2cModule]);
while(!ROM_SysCtlPeripheralReady(g_uli2cPeriph[i2cModule]));
ROM_I2CMasterInitExpClk(MASTER_BASE, F_CPU, speedMode);//Bus speed
if(speedMode==I2C_SPEED_FASTMODE_PLUS)//Force 1Mhz
{
uint32_t ui32TPR = ((F_CPU + (2 * 10 * 1000000l) - 1) / (2 * 10 * 1000000l)) - 1;
HWREG(MASTER_BASE + I2C_O_MTPR) = ui32TPR;
}
}
示例10: Init_LED
void Init_LED()
{
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_4); //配置PF4为数值输出
ROM_GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_4, GPIO_PIN_4); //PF4,输出高电平
}
示例11: init
void init()
{
ROM_FPUEnable();
ROM_FPULazyStackingEnable();
ROM_SysCtlClockSet(SYSCTL_SYSDIV_2_5 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
GPIO_PORTB_DIR_R = 0x00;
GPIO_PORTB_DEN_R = 0xff;
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, LED_RED|LED_GREEN|LED_BLUE);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
ROM_GPIOPinConfigure(GPIO_PA0_U0RX);
ROM_GPIOPinConfigure(GPIO_PA1_U0TX);
ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
UARTStdioInit(0);
ROM_SysTickPeriodSet(ROM_SysCtlClockGet() / 1000000);
ROM_SysTickEnable();
ROM_SysTickIntEnable();
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);
ROM_TimerConfigure(TIMER0_BASE, TIMER_CFG_32_BIT_PER);
reset();
}
示例12: MCInitGpio
void MCInitGpio()
{
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
// PIN1, PIN2 - In1B,In2B (MotorB) ; PIN4,PIN5 - In1A,In2A
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTE_BASE,GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_4|GPIO_PIN_5);
}
示例13: lcd_init
void lcd_init() {
ROM_SysCtlPeripheralEnable(LCD_PORTENABLE);
ROM_GPIOPinTypeGPIOOutput(LCD_PORT, (LCD_RS | LCD_E | LCD_D4 | LCD_D5 | LCD_D6 | LCD_D7));
// Please refer to the HLCD_D44780 datasheet for how these initializations work!
ROM_SysCtlDelay(ROM_SysCtlClockGet()/3/2);
ROM_GPIOPinWrite(LCD_PORT, LCD_RS, 0x00);
ROM_GPIOPinWrite(LCD_PORT, LCD_D4 | LCD_D5 | LCD_D6 | LCD_D7, 0x30);
ROM_GPIOPinWrite(LCD_PORT, LCD_E, 0x02);ROM_SysCtlDelay((20e-6)*ROM_SysCtlClockGet()/3); ROM_GPIOPinWrite(LCD_PORT, LCD_E, 0x00);
ROM_SysCtlDelay((50e-3)*ROM_SysCtlClockGet()/3);
ROM_GPIOPinWrite(LCD_PORT, LCD_D4 | LCD_D5 | LCD_D6 | LCD_D7, 0x30);
ROM_GPIOPinWrite(LCD_PORT, LCD_E, 0x02);ROM_SysCtlDelay((20e-6)*ROM_SysCtlClockGet()/3);ROM_GPIOPinWrite(LCD_PORT, LCD_E, 0x00);
ROM_SysCtlDelay((50e-3)*ROM_SysCtlClockGet()/3);
ROM_GPIOPinWrite(LCD_PORT, LCD_D4 | LCD_D5 | LCD_D6 | LCD_D7, 0x30);
ROM_GPIOPinWrite(LCD_PORT, LCD_E, 0x02);ROM_SysCtlDelay((20e-6)*ROM_SysCtlClockGet()/3); ROM_GPIOPinWrite(LCD_PORT, LCD_E, 0x00);
ROM_SysCtlDelay((10e-3)*ROM_SysCtlClockGet()/3);
ROM_GPIOPinWrite(LCD_PORT, LCD_D4 | LCD_D5 | LCD_D6 | LCD_D7, 0x20);
ROM_GPIOPinWrite(LCD_PORT, LCD_E, 0x02);ROM_SysCtlDelay((20e-6)*ROM_SysCtlClockGet()/3); ROM_GPIOPinWrite(LCD_PORT, LCD_E, 0x00);
ROM_SysCtlDelay((10e-3)*ROM_SysCtlClockGet()/3);
lcd_command(LCD_CLEARDISPLAY); // Clear the screen.
lcd_command(0x06); // Cursor moves right.
lcd_command(LCD_DISPLAYCONTROL | LCD_DISPLAYON | LCD_CURSOROFF | LCD_BLINKOFF); // Don't show any cursor, turn on LCD.
}
示例14: main
int main(void)
{
//
// Device configuration: PLL is used, crystal of 16 MHz, main clock is the source clock
// System clock divider = 4
//
ROM_SysCtlClockSet(SYSCTL_SYSDIV_4|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
//
// PF2 as output (blue led)
//
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, LED_RED|LED_BLUE|LED_GREEN);
ButtonsInit(); // Init buttons
// Loop
while(1)
{
In = ROM_GPIOPinRead(BUTTONS_GPIO_BASE, RIGHT_BUTTON); // Read PORTF 0
if (In==0){
ROM_GPIOPinWrite(GPIO_PORTF_BASE, LED_BLUE, LED_BLUE); // Turn on LED BLUE
ROM_GPIOPinWrite(GPIO_PORTF_BASE, LED_RED, 0);
}
else {
ROM_GPIOPinWrite(GPIO_PORTF_BASE, LED_RED, LED_RED); // Turn on LED RED
ROM_GPIOPinWrite(GPIO_PORTF_BASE, LED_BLUE, 0);
}
}
}
示例15: sys_setup
static void sys_setup(void)
{
ROM_FPULazyStackingEnable();
ROM_SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_2);
}