• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GPIOPinConfigure函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GPIOPinConfigure函数的典型用法代码示例。如果您正苦于以下问题:C++ GPIOPinConfigure函数的具体用法?C++ GPIOPinConfigure怎么用?C++ GPIOPinConfigure使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GPIOPinConfigure函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: main

int main(void) {
    SysCtlClockSet(
    SYSCTL_SYSDIV_5 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN);

    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);
    GPIOPinConfigure(GPIO_PA0_U0RX);
    GPIOPinConfigure(GPIO_PA1_U0TX);
    GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);

    UARTClockSourceSet(UART0_BASE, UART_CLOCK_PIOSC);
    UARTStdioConfig(0, 115200, 16000000);

    ADCSequenceDisable(ADC0_BASE, 1);
    ADCSequenceConfigure(ADC0_BASE, 1, ADC_TRIGGER_PROCESSOR, 0);
    ADCSequenceStepConfigure(ADC0_BASE, 1, 0, ADC_CTL_TS);
    ADCSequenceStepConfigure(ADC0_BASE, 1, 1, ADC_CTL_TS);
    ADCSequenceStepConfigure(ADC0_BASE, 1, 2, ADC_CTL_TS);
    ADCSequenceStepConfigure(ADC0_BASE, 1, 3,
    ADC_CTL_TS | ADC_CTL_IE | ADC_CTL_END);
    ADCSequenceEnable(ADC0_BASE, 1);

    UARTprintf("This is ADC examlpe");

    while (1) {
        UARTprintf("Temperature is: %d \210 C\n", ADC_getVal());
        SysCtlDelay(40000000 / 3);
    }
}
开发者ID:datho1801,项目名称:TivaC_TUT,代码行数:30,代码来源:main.c


示例2: EK_LM4F120XL_initSDSPI

/*
 *  ======== EK_LM4F120XL_initSDSPI ========
 */
Void EK_LM4F120XL_initSDSPI(Void)
{
    /* Enable the peripherals used by the SD Card */
    SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI2);

    /* Configure pad settings */
    GPIOPadConfigSet(GPIO_PORTB_BASE,
            GPIO_PIN_4 | GPIO_PIN_7,
            GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD);

    GPIOPadConfigSet(GPIO_PORTB_BASE,
            GPIO_PIN_6,
            GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD_WPU);

    GPIOPadConfigSet(GPIO_PORTA_BASE,
            GPIO_PIN_5,
            GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD);

    GPIOPinConfigure(GPIO_PB4_SSI2CLK);
    GPIOPinConfigure(GPIO_PB6_SSI2RX);
    GPIOPinConfigure(GPIO_PB7_SSI2TX);

    /*
     * These GPIOs are connected to PB6 and PB7 and need to be brought into a
     * GPIO input state so they don't interfere with SPI communications.
     */
    GPIOPinTypeGPIOInput(GPIO_PORTD_BASE, GPIO_PIN_0);
    GPIOPinTypeGPIOInput(GPIO_PORTD_BASE, GPIO_PIN_1);

    SDSPI_init();
}
开发者ID:kawfey,项目名称:motherboard,代码行数:34,代码来源:EK_LM4F120XL.c


示例3: InitConsole

//*****************************************************************************
//
// This function sets up UART0 to be used for a console to display information
// as the example is running.
//
//*****************************************************************************
void
InitConsole(void)
{
    //
    // Enable GPIO port A which is used for UART0 pins.
    // TODO: change this to whichever GPIO port you are using.
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);

    //
    // Configure the pin muxing for UART0 functions on port A0 and A1.
    // This step is not necessary if your part does not support pin muxing.
    // TODO: change this to select the port/pin you are using.
    //
    GPIOPinConfigure(GPIO_PA0_U0RX);
    GPIOPinConfigure(GPIO_PA1_U0TX);

    //
    // Select the alternate (UART) function for these pins.
    // TODO: change this to select the port/pin you are using.
    //
    GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);

    //
    // Initialize the UART for console I/O.
    //
    UARTStdioInit(0);
}
开发者ID:martinvEsiee,项目名称:AlgoCarto,代码行数:34,代码来源:differential.c


示例4: SysCtlPeripheralEnable

//Initialize as a slave
void TwoWire::begin(uint8_t address)
{

  if(i2cModule == NOT_ACTIVE) {
      i2cModule = BOOST_PACK_WIRE;
  }

  SysCtlPeripheralEnable(g_uli2cPeriph[i2cModule]);
  GPIOPinConfigure(g_uli2cConfig[i2cModule][0]);
  GPIOPinConfigure(g_uli2cConfig[i2cModule][1]);
  GPIOPinTypeI2C(g_uli2cBase[i2cModule], g_uli2cSDAPins[i2cModule]);
  GPIOPinTypeI2CSCL(g_uli2cBase[i2cModule], g_uli2cSCLPins[i2cModule]);
  slaveAddress = address;

  //Enable slave interrupts
  IntEnable(g_uli2cInt[i2cModule]);
  I2CSlaveIntEnableEx(SLAVE_BASE, I2C_SLAVE_INT_DATA | I2C_SLAVE_INT_STOP);
  HWREG(SLAVE_BASE + I2C_O_SICR) =
          I2C_SICR_DATAIC | I2C_SICR_STARTIC | I2C_SICR_STOPIC;

  //Setup as a slave device
  I2CMasterDisable(MASTER_BASE);
  I2CSlaveEnable(SLAVE_BASE);
  I2CSlaveInit(SLAVE_BASE, address);

  IntMasterEnable();

}
开发者ID:fughilli,项目名称:NATCAR2015,代码行数:29,代码来源:Wire.cpp


示例5: motors_init

void motors_init(void) {

	int i;
	uint8_t pin_mask;
	uint32_t motor_per;

	// Set Pins to output/PWM in GPIO
	SysCtlPeripheralEnable(SYSCTL_PERIPH_PWM1);
	GPIOPinConfigure(GPIO_PF2_M1PWM6);
	GPIOPinConfigure(GPIO_PF3_M1PWM7);
	GPIOPinTypePWM(GPIO_PORTF_BASE, GPIO_PIN_2 | GPIO_PIN_3);

	// Configure the pin for standby control
	GPIOPinTypeGPIOOutput(GPIO_PORTA_BASE, GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6);

	SysCtlPWMClockSet(SYSCTL_PWMDIV_64);
	// Configure the PWM for each pin:
	// Turn on the generators and set the PW to 0
	// The output is still OFF. Turn on with set_motor_pwm_state
	for (i = 0; i < NUM_MOTORS; i++) {
		PWMGenConfigure(motors[i].pwm_base_module, motors[i].pwm_generator, PWM_GEN_MODE_DOWN | PWM_GEN_MODE_NO_SYNC);
		motor_per = calc_cycles(MOTOR_PERIOD);
		PWMGenPeriodSet(motors[i].pwm_base_module, motors[i].pwm_generator, motor_per);
		PWMPulseWidthSet(motors[i].pwm_base_module, motors[i].pwm_pin, 0);
		PWMGenEnable(motors[i].pwm_base_module, motors[i].pwm_generator);
		pin_mask = 1 << (0x0000000F & motors[i].pwm_pin);
		PWMOutputState(motors[i].pwm_base_module, pin_mask, 0);
	}

}
开发者ID:AntMaan,项目名称:Micromouse,代码行数:30,代码来源:motor.c


示例6: EK_LM4F120XL_initI2C

/*
 *  ======== LM4F120H5QR_initI2C ========
 */
Void EK_LM4F120XL_initI2C(Void)
{
    /* I2C1 Init */
    /* Enable the peripheral */
    SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C1);

    /* Configure the appropriate pins to be I2C instead of GPIO. */
    GPIOPinConfigure(GPIO_PA6_I2C1SCL);
    GPIOPinConfigure(GPIO_PA7_I2C1SDA);
    GPIOPinTypeI2CSCL(GPIO_PORTA_BASE, GPIO_PIN_6);
    GPIOPinTypeI2C(GPIO_PORTA_BASE, GPIO_PIN_7);

    /* I2C3 Init */
    /* Enable the peripheral */
    SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C3);

    /* Configure the appropriate pins to be I2C instead of GPIO. */
    GPIOPinConfigure(GPIO_PD0_I2C3SCL);
    GPIOPinConfigure(GPIO_PD1_I2C3SDA);
    GPIOPinTypeI2CSCL(GPIO_PORTD_BASE, GPIO_PIN_0);
    GPIOPinTypeI2C(GPIO_PORTD_BASE, GPIO_PIN_1);

    /*
     * These GPIOs are connected to PD0 and PD1 and need to be brought into a
     * GPIO input state so they don't interfere with I2C communications.
     */
    GPIOPinTypeGPIOInput(GPIO_PORTB_BASE, GPIO_PIN_6);
    GPIOPinTypeGPIOInput(GPIO_PORTB_BASE, GPIO_PIN_7);

    I2C_init();
}
开发者ID:kawfey,项目名称:motherboard,代码行数:34,代码来源:EK_LM4F120XL.c


示例7: ConfigureUARTSensores

void ConfigureUARTSensores() {
	
		//
    // Enable the GPIO Peripheral used by the UART.
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);

    //
    // Enable UART2
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_UART4);

    //
    // Configure GPIO Pins for UART mode.
    //
    GPIOPinConfigure(GPIO_PC4_U4RX);
    GPIOPinConfigure(GPIO_PC5_U4TX);
    GPIOPinTypeUART(GPIO_PORTC_BASE, GPIO_PIN_4 | GPIO_PIN_5);

    //
    // Use the internal 16MHz oscillator as the UART clock source.
    //
    UARTClockSourceSet(UART4_BASE, UART_CLOCK_PIOSC);
		UARTConfigSetExpClk(UART4_BASE, 16000000, SERIAL_SPEED,
                        (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
                         UART_CONFIG_PAR_NONE));
		
		UARTEnable(UART4_BASE);
}
开发者ID:Teider,项目名称:QuIES,代码行数:29,代码来源:serial.c


示例8: main

int main(void)
{
	uint32_t ui32Index;
	uint32_t ui32Data;

	SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);

	SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI0);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);

	GPIOPinConfigure(GPIO_PA2_SSI0CLK);
	GPIOPinConfigure(GPIO_PA3_SSI0FSS);
	GPIOPinConfigure(GPIO_PA5_SSI0TX);
	GPIOPinTypeSSI(GPIO_PORTA_BASE,GPIO_PIN_5|GPIO_PIN_3|GPIO_PIN_2);

	SSIConfigSetExpClk(SSI0_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_0, SSI_MODE_MASTER, 10000, 16);
	SSIEnable(SSI0_BASE);

	while(1)
	{
		for(ui32Index = 0; ui32Index < NUM_SSI_DATA; ui32Index++)
		{
			ui32Data = (Reverse(pui8DataTx[ui32Index]) << 8) + (1 << ui32Index);
			SSIDataPut(SSI0_BASE, ui32Data);
			while(SSIBusy(SSI0_BASE))
			{
			}
		}

	}

}
开发者ID:eXamadeus,项目名称:SR03-Robot,代码行数:32,代码来源:main.c


示例9: I2C_Init0

void I2C_Init0(void)
{
   SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C0);

   //reset I2C module
   SysCtlPeripheralReset(SYSCTL_PERIPH_I2C0);

   //enable GPIO peripheral that contains I2C
   SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);

   // Configure the pin muxing for I2C0 functions on port B2 and B3.
   GPIOPinConfigure(GPIO_PB2_I2C0SCL);
   GPIOPinConfigure(GPIO_PB3_I2C0SDA);

   // Select the I2C function for these pins.
   GPIOPinTypeI2CSCL(GPIO_PORTB_BASE, GPIO_PIN_2);
   GPIOPinTypeI2C(GPIO_PORTB_BASE, GPIO_PIN_3);

   // Enable and initialize the I2C0 master module.  Use the system clock for
   // the I2C0 module.  The last parameter sets the I2C data transfer rate.
   // If false the data rate is set to 100kbps and if true the data rate will
   // be set to 400kbps.
   I2CMasterInitExpClk(I2C0_BASE, SysCtlClockGet(), false);

   //Thrasher - Why was this here?
   //clear I2C FIFOs
   //HWREG(I2C0_BASE + I2C_O_FIFOCTL) = 80008000;
}
开发者ID:thrasher8390,项目名称:TIVA_Hardware,代码行数:28,代码来源:I2C.c


示例10: main

int main()
{
	SysCtlClockSet(SYSCTL_SYSDIV_2_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);

	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI2);
	GPIOPinConfigure(GPIO_PB4_SSI2CLK);
	GPIOPinConfigure(GPIO_PB7_SSI2TX);
	GPIOPinTypeSSI(GPIO_PORTB_BASE,GPIO_PIN_4|GPIO_PIN_7);
	SSIConfigSetExpClk(SSI2_BASE,SysCtlClockGet(),SSI_FRF_MOTO_MODE_0,SSI_MODE_MASTER,2000000,8);
	SSIEnable(SSI2_BASE);

	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
	GPIOPinTypeGPIOOutput(GPIO_PORTA_BASE, GPIO_PIN_2|GPIO_PIN_3);
	GPIOPinWrite(GPIO_PORTA_BASE,GPIO_PIN_2,0);
	GPIOPinWrite(GPIO_PORTA_BASE,GPIO_PIN_3,0);

	GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE, GPIO_PIN_6);
	GPIOPinWrite(GPIO_PORTB_BASE,GPIO_PIN_6,0);

	while(1)
	{
		SSIDataPut(SSI2_BASE,0xAA);
		latch();
		SysCtlDelay(SysCtlClockGet()/10);

		SSIDataPut(SSI2_BASE,0x55);
		latch();
		SysCtlDelay(SysCtlClockGet()/10);
	}
}
开发者ID:anshuman94,项目名称:StarShipXP,代码行数:31,代码来源:main.c


示例11: PSO_UART0Config

/******************************************************************************
 * UART-0 Configuration VCP (Virtual Com Port)
 * ----------------------------------------------------------------------------
 * UART 0 -> Port A -> Pins PA0(Tx) & PA1(Rx)
 * 9600-8N1
 *
 ******************************************************************************/
void PSO_UART0Config()
{
	SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);	/* Enable UART Module 0 */
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);	/* Enable GPIO Port A for UART-0 use */

	GPIOPinConfigure(GPIO_PA0_U0RX);
	GPIOPinConfigure(GPIO_PA1_U0TX);
	GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);

	UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), 115200,
	                    UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
	                    UART_CONFIG_PAR_NONE);

	/* UART-0 interrupt configuration */
	UARTDisable(UART0_BASE);
	UARTFIFOEnable(UART0_BASE);

	IntEnable(INT_UART0);

	UARTFIFOLevelSet(UART0_BASE, UART_FIFO_TX1_8, UART_FIFO_RX7_8);

	UARTIntEnable(UART0_BASE, UART_INT_RX);  // | UART_INT_RT
	UARTEnable(UART0_BASE);
	UARTFIFOEnable(UART0_BASE);
}
开发者ID:monkaco,项目名称:PSO,代码行数:32,代码来源:pso_init+(Rogério+Lima's+conflicted+copy+2015-11-22).c


示例12: tm4c129EthInitGpio

void tm4c129EthInitGpio(NetInterface *interface)
{
//DK-TM4C129X evaluation board?
#if defined(USE_DK_TM4C129X)
   //Enable GPIO clocks
   SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
   SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOK);

   //Select the relevant alternate function for PF1, PK4 and PK6
   GPIOPinConfigure(GPIO_PF1_EN0LED2);
   GPIOPinConfigure(GPIO_PK4_EN0LED0);
   GPIOPinConfigure(GPIO_PK6_EN0LED1);

   //Configure Ethernet LED pins for proper operation
   GPIOPinTypeEthernetLED(GPIO_PORTF_BASE, GPIO_PIN_1);
   GPIOPinTypeEthernetLED(GPIO_PORTK_BASE, GPIO_PIN_4 | GPIO_PIN_6);

//EK-TM4C1294XL evaluation board?
#elif defined(USE_EK_TM4C1294XL)
   //Enable GPIO clock
   SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);

   //Select the relevant alternate function for PF0 and PF4
   GPIOPinConfigure(GPIO_PF0_EN0LED0);
   GPIOPinConfigure(GPIO_PF4_EN0LED1);

   //Configure Ethernet LED pins for proper operation
   GPIOPinTypeEthernetLED(GPIO_PORTF_BASE, GPIO_PIN_0 | GPIO_PIN_4);
#endif
}
开发者ID:woo2,项目名称:gatekeeper-v2,代码行数:30,代码来源:tm4c129_eth.c


示例13: ConfigureUART

//*****************************************************************************
//
// Configure the UART and its pins.  This must be called before UARTprintf().
//
//*****************************************************************************
void ConfigureUART(void) {
	
    //
    // Enable the GPIO Peripheral used by the UART.
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);

    //
    // Enable UART0
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);

    //
    // Configure GPIO Pins for UART mode.
    //
    GPIOPinConfigure(GPIO_PA0_U0RX);
    GPIOPinConfigure(GPIO_PA1_U0TX);
    GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);

    //
    // Use the internal 16MHz oscillator as the UART clock source.
    //
    UARTClockSourceSet(UART0_BASE, UART_CLOCK_PIOSC);
		UARTConfigSetExpClk(UART0_BASE, 16000000, SERIAL_SPEED,
                        (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
                         UART_CONFIG_PAR_NONE));

		UARTEnable(UART0_BASE);
}
开发者ID:Teider,项目名称:QuIES,代码行数:34,代码来源:serial.c


示例14: main

//*****************************************************************************
//
// Print "Hello world!" to the UART on the Stellaris evaluation board.
//
//*****************************************************************************
int
main(void)
{
    //
    // Set the clocking to run directly from the crystal.
    //
    ROM_SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
                       SYSCTL_XTAL_16MHZ);

    //
    // Initialize the UART.
    //
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    GPIOPinConfigure(GPIO_PA0_U0RX);
    GPIOPinConfigure(GPIO_PA1_U0TX);
    ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
    UARTStdioInit(0);

    //
    // Hello!
    //
    UARTprintf("\033[2JHello World!\n");

    //
    // Finished.
    //
    while(1)
    {
    }
}
开发者ID:Razofiter,项目名称:Luminary-Micro-Library,代码行数:35,代码来源:hello.c


示例15: main

int main(void) {
	SysCtlClockSet(SYSCTL_SYSDIV_4|SYSCTL_SYSDIV_5| SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
	GPIOPinConfigure(GPIO_PA0_U0RX);
	GPIOPinConfigure(GPIO_PA1_U0TX);
	GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
	ADCSequenceConfigure(ADC0_BASE, 1, ADC_TRIGGER_PROCESSOR, 0);
	ADCSequenceStepConfigure(ADC0_BASE, 1, 0, ADC_CTL_TS);
	ADCSequenceStepConfigure(ADC0_BASE, 1, 1, ADC_CTL_TS);
	ADCSequenceStepConfigure(ADC0_BASE, 1, 2, ADC_CTL_TS);
	ADCSequenceStepConfigure(ADC0_BASE,1,3,ADC_CTL_TS|ADC_CTL_IE|ADC_CTL_END);
	ADCSequenceEnable(ADC0_BASE, 1);
	UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), 115200,
			(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));

	ledPinConfig();
	while (1)
	{
		Test2();
		//print_temc();
		SysCtlDelay(SysCtlClockGet()/3);

	}
}
开发者ID:CS308-2016,项目名称:BinC,代码行数:27,代码来源:main.c


示例16: main

int main(void)
{
  My_Init();
  Init_Timer();
  Init_I2C();
  Init_Sensors();
  SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
  GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1);
    /////////////////////////////////
  SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
  		SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
  		GPIOPinConfigure(GPIO_PA0_U0RX);
  		GPIOPinConfigure(GPIO_PA1_U0TX);
  		GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
  		SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); //enable GPIO port for LED
  		GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_2); //enable pin for LED PF2
  		UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), 115200,
  				(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));
  		IntMasterEnable(); //enable processor interrupts
  		IntEnable(INT_UART0); //enable the UART interrupt
  		UARTIntEnable(UART0_BASE, UART_INT_RX | UART_INT_RT); //only enable RX and TX interrupts
/////////////////////////////////
  Kalman_Sim_initialize();

  while(1)
  {
    Read_Accelerometer();
    Calculate_Acc();
    Read_Compass();
    Compass_Heading();
    Calculate_Compass();
    Read_Gyro();
    Calculate_Gyro();

    fgyro[0]    = sen_data.gyro_x;
    fgyro[1]	= sen_data.gyro_y;
    fgyro[2]	= sen_data.gyro_z;

    facc[0]     = sen_data.accel_x;
    facc[1]	= sen_data.accel_y;
    facc[2]	= sen_data.accel_z;

    fmag[0]     = sen_data.magnetom_x;
    fmag[1]	= sen_data.magnetom_y;
    fmag[2]	= sen_data.magnetom_z;


    Kalman_Sim_step();

    data[0]=Out1[0];
    data[1]=Out1[1];
    data[2]=Out1[2];



      Timer_CyRun();

  }
}
开发者ID:nemo1992,项目名称:9DOF,代码行数:59,代码来源:main.c


示例17: rt_hw_luminaryif_init

int rt_hw_luminaryif_init(void)
{
	rt_err_t result;
	unsigned long ulUser0, ulUser1;

	/* Enable and Reset the Ethernet Controller. */
	SysCtlPeripheralEnable(SYSCTL_PERIPH_ETH);
	SysCtlPeripheralReset(SYSCTL_PERIPH_ETH);

	/*
	Enable Port F for Ethernet LEDs.
	LED0        Bit 3   Output
	LED1        Bit 2   Output
	*/
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
    /* GPIODirModeSet and GPIOPadConfigSet */
    GPIOPinTypeEthernetLED(GPIO_PORTF_BASE, GPIO_PIN_2 | GPIO_PIN_3);
    GPIOPinConfigure(GPIO_PF2_LED1);
    GPIOPinConfigure(GPIO_PF3_LED0);

	FlashUserSet(0x00371200, 0x00563412); /* OUI:00-12-37 (hex) Texas Instruments, only for test */
	/* Configure the hardware MAC address */
	FlashUserGet(&ulUser0, &ulUser1);
	if((ulUser0 == 0xffffffff) || (ulUser1 == 0xffffffff))
	{
		rt_kprintf("Fatal error in geting MAC address\n");
	}

	/* init rt-thread device interface */
	luminaryif_dev_entry.parent.parent.init		= luminaryif_init;
	luminaryif_dev_entry.parent.parent.open	= luminaryif_open;
	luminaryif_dev_entry.parent.parent.close	= luminaryif_close;
	luminaryif_dev_entry.parent.parent.read	= luminaryif_read;
	luminaryif_dev_entry.parent.parent.write	= luminaryif_write;
	luminaryif_dev_entry.parent.parent.control	= luminaryif_control;
	luminaryif_dev_entry.parent.eth_rx		= luminaryif_rx;
	luminaryif_dev_entry.parent.eth_tx			= luminaryif_tx;

	/*
	Convert the 24/24 split MAC address from NV ram into a 32/16 split MAC
	address needed to program the hardware registers, then program the MAC
	address into the Ethernet Controller registers.
	*/
	luminaryif_dev_entry.dev_addr[0] = ((ulUser0 >>  0) & 0xff);
	luminaryif_dev_entry.dev_addr[1] = ((ulUser0 >>  8) & 0xff);
	luminaryif_dev_entry.dev_addr[2] = ((ulUser0 >> 16) & 0xff);
	luminaryif_dev_entry.dev_addr[3] = ((ulUser1 >>  0) & 0xff);
	luminaryif_dev_entry.dev_addr[4] = ((ulUser1 >>  8) & 0xff);
	luminaryif_dev_entry.dev_addr[5] = ((ulUser1 >> 16) & 0xff);

	/* Program the hardware with it's MAC address (for filtering). */
	EthernetMACAddrSet(ETH_BASE, luminaryif_dev_entry.dev_addr);

	rt_sem_init(&tx_sem, "emac", 1, RT_IPC_FLAG_FIFO);

	result = eth_device_init(&(luminaryif_dev->parent), "E0");

	return result;
}
开发者ID:304471720,项目名称:rt-thread,代码行数:59,代码来源:luminaryif.c


示例18: initializeUART

/**
 * usage: this method sets up the environment to make sure the UART interface can be used
 * @method initializeUART
 * @author: patrik.szabo
 * @param *none*
 * @return *none*
 */
void initializeUART() {
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
	GPIOPinConfigure(GPIO_PA0_U0RX);
	GPIOPinConfigure(GPIO_PA1_U0TX);
	GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
	UART_init();
}
开发者ID:pszabo1,项目名称:altitude-click-tiva-board,代码行数:15,代码来源:myuart.c


示例19: UART_Init

void UART_Init(void){
  SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
  SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
  GPIOPinConfigure(GPIO_PA0_U0RX);
  GPIOPinConfigure(GPIO_PA1_U0TX);
  GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
  UARTStdioConfig(0,BAUD_RATE,50000000);
}
开发者ID:jsnowboard,项目名称:EE-445L,代码行数:8,代码来源:main.c


示例20: uart1Init

void uart1Init(void) {
	SysCtlPeripheralEnable(SYSCTL_PERIPH_UART1);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
	GPIOPinConfigure(GPIO_PB0_U1RX);
	GPIOPinConfigure(GPIO_PB1_U1TX);
	GPIOPinTypeUART(GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1);
	UARTConfigSetExpClk(UART1_BASE, SysCtlClockGet(), 38400,(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));
}
开发者ID:HarshitPatel,项目名称:Three-Wheel-Omnidrive-Module-Tests,代码行数:8,代码来源:init.c



注:本文中的GPIOPinConfigure函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GPIOPinIntClear函数代码示例发布时间:2022-05-30
下一篇:
C++ GPIOPadConfigSet函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap