当前位置: 首页>>代码示例>>C++>>正文


C++ MAP_SysCtlPeripheralEnable函数代码示例

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


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

示例1: twe_initQSSI

/**
 * Initializes the QSSI_COMM port to transmit or receive a data transmission
 *
 * \param RXmode - true  - initialize QSSI_COMM to read as a slave
 * 				   false - initialize QSSI_COMM to write as a master
 **/
void twe_initQSSI(uint32_t SysClkFreq, bool RXmode) {
 	// Enable Peripherals
	MAP_SysCtlPeripheralEnable(twe_QSSI_COMM_PERIPH);
 	MAP_SysCtlPeripheralEnable(twe_QSSI_COMM_CLK_FSS_GPIO_PERIPH);
 	MAP_SysCtlPeripheralEnable(twe_QSSI_COMM_XDAT01_GPIO_PERIPH);
 	MAP_SysCtlPeripheralEnable(twe_QSSI_COMM_XDAT23_GPIO_PERIPH);

 	// Set the pin muxing
 	MAP_GPIOPinConfigure(twe_QSSI_COMM_CLK_PIN_CONFIG);
 	MAP_GPIOPinConfigure(twe_QSSI_COMM_FSS_PIN_CONFIG);
 	MAP_GPIOPinConfigure(twe_QSSI_COMM_DAT0_PIN_CONFIG);
 	MAP_GPIOPinConfigure(twe_QSSI_COMM_DAT1_PIN_CONFIG);
 	MAP_GPIOPinConfigure(twe_QSSI_COMM_DAT2_PIN_CONFIG);
 	MAP_GPIOPinConfigure(twe_QSSI_COMM_DAT3_PIN_CONFIG);

 	MAP_GPIOPinTypeSSI(twe_QSSI_COMM_CLK_FSS_GPIO_BASE, twe_QSSI_COMM_CLK_PIN  | twe_QSSI_COMM_FSS_PIN);
 	MAP_GPIOPinTypeSSI(twe_QSSI_COMM_XDAT01_GPIO_BASE,  twe_QSSI_COMM_DAT0_PIN | twe_QSSI_COMM_DAT1_PIN);
 	MAP_GPIOPinTypeSSI(twe_QSSI_COMM_XDAT23_GPIO_BASE,  twe_QSSI_COMM_DAT2_PIN | twe_QSSI_COMM_DAT3_PIN);

 	// Must be in SPI Mode0 for QSSI (Advanced) mode
 	if(RXmode) {
 	MAP_SSIConfigSetExpClk(twe_QSSI_COMM_BASE, SysClkFreq, SSI_FRF_MOTO_MODE_0,
 	 					   SSI_MODE_SLAVE, twe_QSSI_COMM_BAUD, 8);
 	SSIAdvModeSet(twe_QSSI_COMM_BASE, SSI_ADV_MODE_QUAD_READ);
 	SSIDataPut(twe_QSSI_COMM_BASE,0x00);
 	}
 	else {
 		SSIConfigSetExpClk(twe_QSSI_COMM_BASE, SysClkFreq, SSI_FRF_MOTO_MODE_0,
 		 	 				   SSI_MODE_MASTER, twe_QSSI_COMM_BAUD, 8);
 		SSIAdvModeSet(twe_QSSI_COMM_BASE, SSI_ADV_MODE_QUAD_WRITE);
 	}
 	// Enable SSI
 	MAP_SSIEnable(twe_QSSI_COMM_BASE);
 	//SSIDMAEnable(ADC_SSI_BASE, SSI_DMA_RX); // Enable SSI uDMA
}
开发者ID:IMEMS,项目名称:gtbelib,代码行数:41,代码来源:tw_extension.c

示例2: main

int main(void) {
	
	MAP_SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN);
	sysClock = SysCtlClockGet();

	MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C3);
	MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);

	MAP_GPIOPinConfigure(GPIO_PD1_I2C3SDA);
	MAP_GPIOPinTypeI2C(GPIO_PORTD_BASE, GPIO_PIN_1);
	MAP_GPIOPinConfigure(GPIO_PD0_I2C3SCL);
	MAP_GPIOPinTypeI2CSCL(GPIO_PORTD_BASE, GPIO_PIN_0);

	MAP_I2CMasterInitExpClk(I2C3_BASE, sysClock, 0);

	pRTC->address = RTC_addr;
	SysCtlDelay(20000);
	setupRTC(pRTC);
	SysCtlDelay(20000);
	setTime(pRTC);
	SysCtlDelay(20000);
	getTime(pRTC);

	return 0;
}
开发者ID:MrAureliusR,项目名称:rtcdebug,代码行数:25,代码来源:main.c

示例3: rt_hw_console_init

void rt_hw_console_init(void)
{
	struct rt_lm3s_serial* serial;

	serial = &serial1;

	serial->parent.type = RT_Device_Class_Char;

	serial->hw_base = UART0_BASE;
	serial->baudrate = 115200;

	rt_memset(serial->rx_buffer, 0, sizeof(serial->rx_buffer));
	serial->read_index = serial->save_index = 0;

	/* enable UART0 clock */
    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);

	/* set UART0 pinmux */
    MAP_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);

	/* Configure the UART for 115,200, 8-N-1 operation. */
	MAP_UARTConfigSetExpClk(UART0_BASE, MAP_SysCtlClockGet(), serial->baudrate, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));

	serial->parent.init 	= rt_serial_init;
	serial->parent.open 	= rt_serial_open;
	serial->parent.close    = rt_serial_close;
	serial->parent.read 	= rt_serial_read;
	serial->parent.write    = rt_serial_write;
	serial->parent.control  = rt_serial_control;
	serial->parent.user_data= RT_NULL;

	rt_device_register(&serial->parent, "uart1", RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX | RT_DEVICE_FLAG_STREAM);
}
开发者ID:comrid1987,项目名称:jb3500,代码行数:34,代码来源:serial.c

示例4: SSITRF79x0Init

//*****************************************************************************
//
// Initializes the SSI port and determines if the TRF79x0 is available.
//
// This function must be called prior to any other function offered by the
// TRF79x0.  It configures the SSI port to run in Motorola/Freescale
// mode.
//
// \return None.
//
//*****************************************************************************
void
SSITRF79x0Init(void)
{
    //
    // Enable the peripherals used to drive the TRF79x0 on SSI.
    //
    MAP_SysCtlPeripheralEnable(TRF79X0_SSI_PERIPH);

    //
    // Enable the GPIO peripherals associated with the SSI.
    //
    MAP_SysCtlPeripheralEnable(TRF79X0_CLK_PERIPH);
    MAP_SysCtlPeripheralEnable(TRF79X0_RX_PERIPH);
    MAP_SysCtlPeripheralEnable(TRF79X0_TX_PERIPH);
    MAP_SysCtlPeripheralEnable(TRF79X0_CS_PERIPH);

    //
    // Configure the appropriate pins to be SSI instead of GPIO.  The CS
    // is configured as GPIO to support TRF79x0 SPI requirements for R/W
    // access.
    //
    MAP_GPIOPinConfigure(TRF79X0_CLK_CONFIG);
    MAP_GPIOPinConfigure(TRF79X0_RX_CONFIG);
    MAP_GPIOPinConfigure(TRF79X0_TX_CONFIG);
    MAP_GPIOPinTypeSSI(TRF79X0_CLK_BASE, TRF79X0_CLK_PIN);
    MAP_GPIOPinTypeSSI(TRF79X0_RX_BASE, TRF79X0_RX_PIN);
    MAP_GPIOPinTypeSSI(TRF79X0_TX_BASE, TRF79X0_TX_PIN);
    MAP_GPIOPinTypeGPIOOutput(TRF79X0_CS_BASE, TRF79X0_CS_PIN);

    MAP_GPIOPadConfigSet(TRF79X0_CLK_BASE, TRF79X0_CLK_PIN,
                         GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD_WPU);
    MAP_GPIOPadConfigSet(TRF79X0_RX_BASE, TRF79X0_RX_PIN,
                         GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD_WPU);
    MAP_GPIOPadConfigSet(TRF79X0_TX_BASE, TRF79X0_TX_PIN,
                         GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD_WPU);

    //
    // Deassert the SSI chip selects TRF79x0.
    //
    MAP_GPIOPinWrite(TRF79X0_CS_BASE, TRF79X0_CS_PIN, TRF79X0_CS_PIN);

    //
    // Configure the SSI port for 2MHz operation.
    //
    MAP_SSIConfigSetExpClk(TRF79X0_SSI_BASE, g_ui32SysClk,
                           SSI_FRF_MOTO_MODE_0, SSI_MODE_MASTER, SSI_CLK_RATE,
                           8);

    if(RF_DAUGHTER_TRF7970) {
        //
        // Switch from SPH=0 to SPH=1.  Required for TRF7970.
        //
        HWREG(TRF79X0_SSI_BASE + SSI_O_CR0) |= SSI_CR0_SPH;
    }

    //
    // Enable the SSI controller.
    //
    MAP_SSIEnable(TRF79X0_SSI_BASE);
}
开发者ID:peterliu2,项目名称:tivaWare,代码行数:71,代码来源:ssitrf79x0.c

示例5: BSP_InitDrivers

/**************************************************************************************************
 * @fn          BSP_InitDrivers
 *
 * @brief       Initialize all enabled BSP drivers.
 *
 * @param       none
 *
 * @return      none
 **************************************************************************************************
 */
void BSP_InitDrivers(void)
{
    /*
     * Enable GPIO peripherals used by SPI, LEDs, buttons and radio interface
     * here.
     */
#ifdef MRFI_CC2520
    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOG);
    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOH);
    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOJ);
#else
    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOJ);
    MAP_SysCtlPeripheralEnable(MOD2_CONNECTION ? SYSCTL_PERIPH_GPIOG:
                               SYSCTL_PERIPH_GPIOH);
#endif
#if (!defined BSP_NO_LEDS)
  BSP_InitLeds();
#endif

#if (!defined BSP_NO_BUTTONS)
  BSP_InitButtons();
#endif
}
开发者ID:Razofiter,项目名称:Luminary-Micro-Library,代码行数:38,代码来源:bsp_drivers.c

示例6: SPIInit

/*
 * @brief Initializes SPI unit.
 *
 * Enables peripherals
 * Configures GPIO
 * Sets radio, accelerometer, and LED as output
 * Sets word size as 0
 * @returns void
 */
void SPIInit(void) {
    volatile unsigned long ulLoop;

    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI0);
    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);

    // configure SSI pins for peripheral control
    MAP_GPIOPinTypeSSI(GPIO_PORTA_BASE, (SPI_MOSI_PIN | SPI_MISO_PIN | SPI_CLK_PIN));
    MAP_GPIOPinConfigure(GPIO_PA2_SSI0CLK);
    MAP_GPIOPinConfigure(GPIO_PA4_SSI0RX);
    MAP_GPIOPinConfigure(GPIO_PA5_SSI0TX);

    // Also, it may be better to just get rid of the pullups/downs entirely. -Jeremy
    MAP_GPIOPadConfigSet(GPIO_PORTA_BASE, (SPI_MOSI_PIN | SPI_MISO_PIN | SPI_CLK_PIN), GPIO_STRENGTH_8MA, GPIO_PIN_TYPE_STD);

#if (defined(RONE_V12) || defined(RONE_V9))
    // enable output enable peripheral for SPI
    MAP_SysCtlPeripheralEnable(SPI_ENABLE_PERIPH);
    // enable peripheral for three SPI pins
    MAP_SysCtlPeripheralEnable(SPI_SELECT_PERIPH);

    // drive select pins to correct values while they are still in input mode
    SPIDeselectISR();

    // enable output enable pin for output
    MAP_GPIOPinTypeGPIOOutput(SPI_ENABLE_PORT, SPI_ENABLE_PIN);
    // enable A,B,C SPI pins for output
    MAP_GPIOPinTypeGPIOOutput(SPI_SELECT_PORT, SPI_SELECT_PINS);

#endif
    // force the port to be enabled by the first call to SPIConfigure()
    SPIWordSize = 0;
}
开发者ID:cydvicious,项目名称:rone,代码行数:42,代码来源:spi.c

示例7: enc28j60_comm_init

static void enc28j60_comm_init(void) {
  MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
  MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
  MAP_GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE, ENC_CS);
  MAP_GPIOPinTypeGPIOInput(GPIO_PORTE_BASE, ENC_INT);

  MAP_GPIOPinWrite(ENC_CS_PORT, ENC_CS, ENC_CS);
}
开发者ID:brians444,项目名称:tiva-ads1246-lwip,代码行数:8,代码来源:main.c

示例8: httpd_init

void
httpd_init(void) {
  uip_listen(HTONS(80));

  PIN_UNUSED(j1[0]);
  PIN_UNUSED(j1[1]); // PB5
  SETUP_PIN(j1[2], GPIO_PORTB_BASE, GPIO_PIN_0, CONFIG_INPUT);
  SETUP_PIN(j1[3], GPIO_PORTB_BASE, GPIO_PIN_1, CONFIG_INPUT);
  SETUP_PIN(j1[4], GPIO_PORTE_BASE, GPIO_PIN_4, CONFIG_INPUT);
  PIN_UNUSED(j1[5]); // PE5
  PIN_UNUSED(j1[6]); // PB4
  PIN_UNUSED(j1[7]); // PA5
  SETUP_PIN(j1[8], GPIO_PORTA_BASE, GPIO_PIN_6, CONFIG_INPUT);
  SETUP_PIN(j1[9], GPIO_PORTA_BASE, GPIO_PIN_7, CONFIG_INPUT);

  PIN_UNUSED(j2[0]); // GND
  SETUP_PIN(j2[1], GPIO_PORTB_BASE, GPIO_PIN_2, CONFIG_INPUT);
  SETUP_PIN(j2[2], GPIO_PORTE_BASE, GPIO_PIN_0, CONFIG_INPUT);
  PIN_UNUSED(j2[3]); // PF0 -- not used
  PIN_UNUSED(j2[4]); // RESET
  PIN_UNUSED(j2[5]); // PB7 -- used by SSI2
  PIN_UNUSED(j2[6]); // PB6 -- used by SSI2
  SETUP_PIN(j2[7], GPIO_PORTA_BASE, GPIO_PIN_4, CONFIG_INPUT);
  SETUP_PIN(j2[8], GPIO_PORTA_BASE, GPIO_PIN_3, CONFIG_INPUT);
  SETUP_PIN(j2[9], GPIO_PORTA_BASE, GPIO_PIN_2, CONFIG_INPUT);

  PIN_UNUSED(j3[0]); // 5.0V
  PIN_UNUSED(j3[1]); // GND
  SETUP_PIN(j3[2], GPIO_PORTD_BASE, GPIO_PIN_0, CONFIG_INPUT);
  SETUP_PIN(j3[3], GPIO_PORTD_BASE, GPIO_PIN_1, CONFIG_INPUT);
  SETUP_PIN(j3[4], GPIO_PORTD_BASE, GPIO_PIN_2, CONFIG_INPUT);
  SETUP_PIN(j3[5], GPIO_PORTD_BASE, GPIO_PIN_3, CONFIG_INPUT);
  SETUP_PIN(j3[6], GPIO_PORTE_BASE, GPIO_PIN_1, CONFIG_INPUT);
  SETUP_PIN(j3[7], GPIO_PORTE_BASE, GPIO_PIN_2, CONFIG_INPUT);
  SETUP_PIN(j3[8], GPIO_PORTE_BASE, GPIO_PIN_3, CONFIG_INPUT);
  SETUP_PIN(j3[9], GPIO_PORTF_BASE, GPIO_PIN_1, CONFIG_OUTPUT);

  SETUP_PIN(j4[0], GPIO_PORTF_BASE, GPIO_PIN_2, CONFIG_OUTPUT);
  SETUP_PIN(j4[1], GPIO_PORTF_BASE, GPIO_PIN_3, CONFIG_OUTPUT);
  SETUP_PIN(j4[2], GPIO_PORTB_BASE, GPIO_PIN_3, CONFIG_INPUT);
  SETUP_PIN(j4[3], GPIO_PORTC_BASE, GPIO_PIN_4, CONFIG_INPUT);
  SETUP_PIN(j4[4], GPIO_PORTC_BASE, GPIO_PIN_5, CONFIG_INPUT);
  SETUP_PIN(j4[5], GPIO_PORTC_BASE, GPIO_PIN_6, CONFIG_INPUT);
  SETUP_PIN(j4[6], GPIO_PORTC_BASE, GPIO_PIN_7, CONFIG_INPUT);
  SETUP_PIN(j4[7], GPIO_PORTD_BASE, GPIO_PIN_6, CONFIG_INPUT);
  SETUP_PIN(j4[8], GPIO_PORTD_BASE, GPIO_PIN_7, CONFIG_INPUT);
  SETUP_PIN(j4[9], GPIO_PORTF_BASE, GPIO_PIN_4, CONFIG_INPUT);

  MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
  MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);
  MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
  MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);

  configure_pins(j1, HEADER_SIZE);
  configure_pins(j2, HEADER_SIZE);
  configure_pins(j3, HEADER_SIZE);
  configure_pins(j4, HEADER_SIZE);
}
开发者ID:cubeberg,项目名称:HomeAutomation,代码行数:58,代码来源:httpd.c

示例9: MAP_SysCtlPeripheralEnable

//--------------------------------
void ssi_peripheral::Initialize() {
	MAP_SysCtlPeripheralEnable(m_rSpecification.m_nSSIPeripheral);
	MAP_SysCtlPeripheralEnable(m_rSpecification.m_nGPIOPeripheral);
	// Assign the SSI signals to the appropriate pins
	MAP_GPIOPinConfigure(m_rSpecification.m_nSSIPinRx);
	MAP_GPIOPinConfigure(m_rSpecification.m_nSSIPinClk);
	MAP_GPIOPinConfigure(m_rSpecification.m_nSSIPinTx);
	if (m_rSpecification.m_nSSIPinFss) {
		MAP_GPIOPinConfigure(m_rSpecification.m_nSSIPinFss);
	}
	// Set the GPIO AFSEL bits for the appropriate pins
	MAP_GPIOPinTypeSSI(m_rSpecification.m_nGPIOBase,
			m_rSpecification.m_nGPIOPins);
	// Set pull-up on the SSI Rx pin
	GPIOPadConfigSet(m_rSpecification.m_nGPIOBase,
			m_rSpecification.m_nGPIOInputPin, GPIO_STRENGTH_2MA,
			GPIO_PIN_TYPE_STD_WPU);
	// Set standard on the SSI output pins
	GPIOPadConfigSet(m_rSpecification.m_nGPIOBase,
			m_rSpecification.m_nGPIOOutputPins, GPIO_STRENGTH_2MA,
			GPIO_PIN_TYPE_STD);
	// Configure the SSI peripheral
	SSIConfigSetExpClk(m_rSpecification.m_nSSIBase, SysCtlClockGet(),
			m_nProtocol, SSI_MODE_MASTER, m_nBitRate, 16);
	// Enable the SSI module.
	MAP_SSIEnable(m_rSpecification.m_nSSIBase);
	// Read any residual data from the SSI port.
	while (MAP_SSIDataGetNonBlocking(m_rSpecification.m_nSSIBase, &m_nDataRx[0])) {
	}
	m_bEmpty = true;
	// Enable the SSI interrupt
	switch (m_nDevice) {
	case ssi_peripheral::SSI0:
		g_pTheSSI0 = this;
		break;
	case ssi_peripheral::SSI1:
		g_pTheSSI1 = this;
		break;
	case ssi_peripheral::SSI2:
		g_pTheSSI2 = this;
		break;
	case ssi_peripheral::SSI3:
		g_pTheSSI3 = this;
		break;
	default:
		break;
	}
	SSIIntDisable(m_rSpecification.m_nSSIBase,
	SSI_TXFF | SSI_RXFF | SSI_RXTO | SSI_RXOR);
	SSIIntClear(m_rSpecification.m_nSSIBase,
	SSI_TXFF | SSI_RXFF | SSI_RXTO | SSI_RXOR);
	(*((volatile uint32_t *) m_rSpecification.m_nSSI_CR1_R)) |= SSI_CR1_EOT; /* switch tx interrupt to eot int */
	if (m_bNonBlocking) {
		SSIIntEnable(m_rSpecification.m_nSSIBase, SSI_TXFF); /* SSI_TXFF | SSI_RXFF | SSI_RXTO | SSI_RXOR  */
		MAP_IntEnable(m_rSpecification.m_nInterrupt);
	}
}
开发者ID:anol,项目名称:justscale,代码行数:58,代码来源:ssi_peripheral.cpp

示例10: configureUART

void configureUART(){
	MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
	MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);

	//
	// Set GPIO A0 and A1 as UART pins.
	//
	MAP_GPIOPinConfigure(GPIO_PA0_U0RX);
	MAP_GPIOPinConfigure(GPIO_PA1_U0TX);
	MAP_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
	UARTStdioConfig(0,115200,MAP_SysCtlClockGet());
}
开发者ID:brNX,项目名称:purpins_firmware,代码行数:12,代码来源:main-test.cpp

示例11: MAP_SysCtlPWMClockSet

void purpinsMotors::configurePWM(){

	//Configure PWM Clock
	MAP_SysCtlPWMClockSet(SYSCTL_PWMDIV_2);

	MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
	MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);

	MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_PWM1);
	MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_PWM0);

	pwmPeriod = MAP_SysCtlClockGet() / 2 / PWM_FREQUENCY; //PWM frequency

	MAP_GPIOPinConfigure(GPIO_PF1_M1PWM5);
	MAP_GPIOPinConfigure(GPIO_PF2_M1PWM6);
	MAP_GPIOPinConfigure(GPIO_PF3_M1PWM7);
	MAP_GPIOPinConfigure(GPIO_PC4_M0PWM6);

	MAP_GPIOPinTypePWM(GPIO_PORTF_BASE, GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3);
	MAP_GPIOPinTypePWM(GPIO_PORTC_BASE, GPIO_PIN_4);


	//gen 3 for m0pwm6
	MAP_PWMGenConfigure(PWM0_BASE, PWM_GEN_3, PWM_GEN_MODE_UP_DOWN | PWM_GEN_MODE_NO_SYNC);
	//gen 3 for m1pwm6 and m1pwm7
	MAP_PWMGenConfigure(PWM1_BASE, PWM_GEN_3, PWM_GEN_MODE_UP_DOWN | PWM_GEN_MODE_NO_SYNC);
	//gen 2 for m1pwm5
	MAP_PWMGenConfigure(PWM1_BASE, PWM_GEN_2, PWM_GEN_MODE_UP_DOWN | PWM_GEN_MODE_NO_SYNC);

	//Set the Period (expressed in clock ticks)
	MAP_PWMGenPeriodSet(PWM0_BASE, PWM_GEN_3, pwmPeriod);
	MAP_PWMGenPeriodSet(PWM1_BASE, PWM_GEN_2, pwmPeriod);
	MAP_PWMGenPeriodSet(PWM1_BASE, PWM_GEN_3, pwmPeriod);

	//Set PWM duty-0%
	MAP_PWMPulseWidthSet(PWM1_BASE, PWM_OUT_5 , 0);
	MAP_PWMPulseWidthSet(PWM1_BASE, PWM_OUT_6 , 0);
	MAP_PWMPulseWidthSet(PWM1_BASE, PWM_OUT_7 , 0);
	MAP_PWMPulseWidthSet(PWM0_BASE, PWM_OUT_6 , 0);

	// Enable the PWM generators
	MAP_PWMGenEnable(PWM1_BASE, PWM_GEN_2);
	MAP_PWMGenEnable(PWM1_BASE, PWM_GEN_3);
	MAP_PWMGenEnable(PWM0_BASE, PWM_GEN_3);


	// Turn on the Output pins
	MAP_PWMOutputState(PWM1_BASE, PWM_OUT_5_BIT, true);
	MAP_PWMOutputState(PWM1_BASE, PWM_OUT_6_BIT, true);
	MAP_PWMOutputState(PWM1_BASE, PWM_OUT_7_BIT, true);
	MAP_PWMOutputState(PWM0_BASE, PWM_OUT_6_BIT, true);
}
开发者ID:brNX,项目名称:purpins_firmware,代码行数:52,代码来源:purpinsMotors.cpp

示例12: ConfigUART

void ConfigUART(uint32_t baud)
{
  // Enable the GPIO Peripheral used by the UART.
  MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
  // Enable UART0
  MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
  // Configure GPIO Pins for UART mode.
  MAP_GPIOPinConfigure(GPIO_PA0_U0RX);
  MAP_GPIOPinConfigure(GPIO_PA1_U0TX);
  MAP_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);
  UARTStdioConfig(0, baud, 16000000);
}
开发者ID:vmatos,项目名称:rosserial_tivac_socket_tutorials,代码行数:14,代码来源:freertos_demo.cpp

示例13: GPS_init

void GPS_init()
{

    dbg_printf("Initializing GPS module...");

    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART);

    MAP_GPIOPinConfigure(GPIO_PA0_U0RX);
    MAP_GPIOPinConfigure(GPIO_PA1_U0TX);
    MAP_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);

    MAP_UARTConfigSetExpClk(UART_BASE, MAP_SysCtlClockGet(), UART_SPEED, UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE);
    MAP_UARTDisable(UART_BASE);
    MAP_UARTTxIntModeSet(UART_BASE, UART_TXINT_MODE_EOT);
    MAP_UARTIntEnable(UART_BASE, UART_INT_RX | UART_INT_TX);
    MAP_IntEnable(INT_UART);
    MAP_UARTEnable(UART_BASE);
    MAP_UARTFIFODisable(UART_BASE);

    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOG);
    //
    MAP_IntEnable(INT_GPIOG);
    // Настроить прерывания на PPS
    MAP_GPIOIntTypeSet(GPIO_PORTG_BASE, GPIO_PIN_7, GPIO_FALLING_EDGE);
    MAP_GPIOPinIntEnable(GPIO_PORTG_BASE, GPIO_PIN_7);
    //

    if (tn_task_create(&task_GPS_tcb, &task_GPS_func, TASK_GPS_PRI,
        &task_GPS_stk[TASK_GPS_STK_SZ - 1], TASK_GPS_STK_SZ, 0,
        TN_TASK_START_ON_CREATION) != TERR_NO_ERR)
    {
        dbg_puts("tn_task_create(&task_GPS_tcb) error");
        goto err;
    }

    // Настроить прерывания на PPS
    //MAP_IntEnable(INT_GPIOG);
    //MAP_GPIOIntTypeSet(GPIO_PORTG_BASE, GPIO_PIN_7, GPIO_FALLING_EDGE);
    //MAP_GPIOPinIntEnable(GPIO_PORTG_BASE, GPIO_PIN_7);

    dbg_puts("[done]");

    return;
err:
    dbg_trace();
    tn_halt();
}
开发者ID:tuzhikov,项目名称:SURD,代码行数:48,代码来源:gps.c

示例14: EK_TM4C123GXL_initUART

/*
 *  ======== EK_TM4C123GXL_initUART ========
 */
void EK_TM4C123GXL_initUART(void)
{
  // Enable and configure the peripherals used by the radio uart
  //
  MAP_SysCtlPeripheralEnable(INEEDMD_RADIO_SYSCTL_PERIPH_UART);

  // Configure the alternate function for UART RTS pin
  MAP_GPIOPinConfigure(INEEDMD_GPIO_UARTRTS);
  MAP_GPIOPinTypeUART(INEEDMD_RADIO_RTS_PORT, INEEDMD_RADIO_RTS_PIN);

  // Configure the alternate function for UART CTS pin
  MAP_GPIOPinConfigure(INEEDMD_GPIO_UARTCTS);
  MAP_GPIOPinTypeUART(INEEDMD_RADIO_CTS_PORT, INEEDMD_RADIO_CTS_PIN);

  // Configure the alternate function for UART TX and RX pins
  MAP_GPIOPinConfigure(INEEDMD_GPIO_UARTTX);
  MAP_GPIOPinConfigure(INEEDMD_GPIO_UARTRX);

  // Set the TX and RX pin type for the radio uart
  MAP_GPIOPinTypeUART(INEEDMD_GPIO_TX_PORT, INEEDMD_GPIO_TX_PIN);
  MAP_GPIOPinTypeUART(INEEDMD_GPIO_RX_PORT, INEEDMD_GPIO_RX_PIN);

  //Set the UART clock source to internal
  //
//  MAP_UARTClockSourceSet(INEEDMD_RADIO_UART, UART_CLOCK_PIOSC);

  //Config the uart speed, len, stop bits and parity
  //
//  MAP_UARTConfigSetExpClk( INEEDMD_RADIO_UART, INEEDMD_RADIO_UART_CLK, INEEDMD_RADIO_UART_BAUD, ( UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE ));

  //Enable and configure the peripherals used by the debug uart
  //
  MAP_SysCtlPeripheralEnable(DEBUG_SYSCTL_PERIPH_UART);

  // Configure the debug port pins
  MAP_GPIOPinConfigure(DEBUG_TX_PIN_MUX_MODE);
  MAP_GPIOPinConfigure(DEBUG_RX_PIN_MUX_MODE);

  // Set the debug uart pin types
  MAP_GPIOPinTypeUART(DEBUG_UART_PIN_PORT, DEBUG_TX_PIN);
  MAP_GPIOPinTypeUART(DEBUG_UART_PIN_PORT, DEBUG_RX_PIN);

  //Set the clock source for the debug uart
//  UARTClockSourceSet(DEBUG_UART, UART_CLOCK_PIOSC);

  /* Initialize the UART driver */
  UART_init();
}
开发者ID:Hoxford,项目名称:tyler-woogduh,代码行数:51,代码来源:EK_TM4C123GXL.c

示例15: EK_TM4C123GXL_initSPI

/*
 *  ======== EK_TM4C123GXL_initSPI ========
 */
void EK_TM4C123GXL_initSPI(void)
{
  //INEEDMD_ADC_SPI
  //
  MAP_SysCtlPeripheralEnable(INEEDMD_ADC_SYSCTL_PRIPH_SSI);

  // Enable pin SSI CLK
  //
  MAP_GPIOPinConfigure(INEEDMD_ADC_GPIO_SSICLK);

  // Enable pin SSI TX
  //
  MAP_GPIOPinConfigure(INEEDMD_ADC_GPIO_SSITX);

  // Enable pin SSI RX
  //
  MAP_GPIOPinConfigure(INEEDMD_ADC_GPIO_SSIRX);

//  MAP_GPIOPinConfigure(GPIO_PA3_SSI0FSS);

  //Set the pins to type SSI
  //
  MAP_GPIOPinTypeSSI(INEEDMD_ADC_GPIO_PORT, (INEEDMD_ADC_SSICLK_PIN | INEEDMD_ADC_SSITX_PIN | INEEDMD_ADC_SSIRX_PIN ));//| GPIO_PIN_3));

  EK_TM4C123GXL_initDMA();
  SPI_init();
}
开发者ID:Hoxford,项目名称:tyler-woogduh,代码行数:30,代码来源:EK_TM4C123GXL.c


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