本文整理汇总了C++中MAP_PRCMPeripheralClkEnable函数的典型用法代码示例。如果您正苦于以下问题:C++ MAP_PRCMPeripheralClkEnable函数的具体用法?C++ MAP_PRCMPeripheralClkEnable怎么用?C++ MAP_PRCMPeripheralClkEnable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MAP_PRCMPeripheralClkEnable函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pin_obj_configure
/******************************************************************************
DEFINE PRIVATE FUNCTIONS
******************************************************************************/
STATIC void pin_obj_configure (const pin_obj_t *self) {
// Skip all this if the pin is to be used in analog mode
if (self->type != PYBPIN_ANALOG_TYPE) {
// verify the alternate function
pin_verify_af (self->af);
// PIN_MODE_0 means it stays as a pin, else, another peripheral will take control of it
if (self->af == PIN_MODE_0) {
// enable the peripheral clock for the GPIO port of this pin
switch (self->port) {
case PORT_A0:
MAP_PRCMPeripheralClkEnable(PRCM_GPIOA0, PRCM_RUN_MODE_CLK | PRCM_SLP_MODE_CLK);
break;
case PORT_A1:
MAP_PRCMPeripheralClkEnable(PRCM_GPIOA1, PRCM_RUN_MODE_CLK | PRCM_SLP_MODE_CLK);
break;
case PORT_A2:
MAP_PRCMPeripheralClkEnable(PRCM_GPIOA2, PRCM_RUN_MODE_CLK | PRCM_SLP_MODE_CLK);
break;
case PORT_A3:
MAP_PRCMPeripheralClkEnable(PRCM_GPIOA3, PRCM_RUN_MODE_CLK | PRCM_SLP_MODE_CLK);
break;
default:
break;
}
// configure the direction
MAP_GPIODirModeSet(self->port, self->bit, self->mode);
}
// now set the alternate function, strenght and type
MAP_PinModeSet (self->pin_num, self->af);
}
MAP_PinConfigSet(self->pin_num, self->strength, self->type);
}
示例2: lp3p0_restore_soc_data
//****************************************************************************
//
//! \brief This function restore the backed up data (after S3)
//!
//! \param none
//!
//! \return none
//
//****************************************************************************
void lp3p0_restore_soc_data(void)
{
/* Invoking the default CC3xxx service impl. */
cc_restore_soc_data();
//
// Configure the pinmux settings for the peripherals exercised
//
PinMuxConfig();
cc_gpio_restore_context();
#ifdef DEBUG_GPIO
cc_gpio_write(tGPIODbgHndl, GPIO_09, 1);
#endif
/* Initialize timer services */
MAP_PRCMPeripheralClkEnable(PRCM_TIMERA0, PRCM_RUN_MODE_CLK|
PRCM_SLP_MODE_CLK);
/* ungates the clk for the shared SPI*/
MAP_PRCMPeripheralClkEnable(PRCM_SSPI, PRCM_RUN_MODE_CLK|
PRCM_SLP_MODE_CLK);
/* Initialize the DMA module */
MAP_PRCMPeripheralClkEnable(PRCM_UDMA, PRCM_RUN_MODE_CLK|
PRCM_SLP_MODE_CLK);
MAP_uDMAControlBaseSet(dma_ctrl_table);
MAP_uDMAEnable();
MAP_PRCMIntEnable(PRCM_INT_SLOW_CLK_CTR);
}
示例3: PinMuxConfig
//*****************************************************************************
void
PinMuxConfig(void)
{
//
// Enable Peripheral Clocks
//
MAP_PRCMPeripheralClkEnable(PRCM_UARTA0, PRCM_RUN_MODE_CLK);
MAP_PRCMPeripheralClkEnable(PRCM_GPIOA1, PRCM_RUN_MODE_CLK);
//
// Configure PIN_55 for UART0 UART0_TX
//
MAP_PinTypeUART(PIN_55, PIN_MODE_3);
//
// Configure PIN_57 for UART0 UART0_RX
//
MAP_PinTypeUART(PIN_57, PIN_MODE_3);
//
// Configure PIN_64 for GPIOOutput
//
MAP_PinTypeGPIO(PIN_64, PIN_MODE_0, false);
MAP_GPIODirModeSet(GPIOA1_BASE, 0x2, GPIO_DIR_MODE_OUT);
//
// Configure PIN_02 for GPIOOutput
//
MAP_PinTypeGPIO(PIN_02, PIN_MODE_0, false);
MAP_GPIODirModeSet(GPIOA1_BASE, 0x8, GPIO_DIR_MODE_OUT);
}
示例4: InterruptTestInit
//*****************************************************************************
//
//! \InterruptTestInit
//!
//! Performs initialization.
//! This function is called at the start of the test to enable any peripherals
//! used during the test.
//!
//! \param None.
//!
//! \return None.
//
//*****************************************************************************
static void
InterruptTestInit(void)
{
//
// Enable and Reset the timer blocks
//
MAP_PRCMPeripheralClkEnable(PRCM_TIMERA0, PRCM_RUN_MODE_CLK);
MAP_PRCMPeripheralClkEnable(PRCM_TIMERA1, PRCM_RUN_MODE_CLK);
MAP_PRCMPeripheralClkEnable(PRCM_TIMERA2, PRCM_RUN_MODE_CLK);
MAP_PRCMPeripheralReset(PRCM_TIMERA0);
MAP_PRCMPeripheralReset(PRCM_TIMERA1);
MAP_PRCMPeripheralReset(PRCM_TIMERA2);
//
// Remember the timer interrupt priorities and priority group settings as
// they are on entry so that we can restore them on exit.
//
g_ulTimer0APriority = MAP_IntPriorityGet(INT_TIMERA0A);
g_ulTimer1APriority = MAP_IntPriorityGet(INT_TIMERA1A);
g_lPriorityGrouping = MAP_IntPriorityGroupingGet();
SysTickInit();
}
示例5: InitPWMModules
//****************************************************************************
//
//! Sets up the identified timers as PWM to drive the peripherals
//!
//! \param none
//!
//! This function sets up the folowing
//! 1. TIMERA2 (TIMER B) as RED of RGB light
//! 2. TIMERA3 (TIMER B) as YELLOW of RGB light
//! 3. TIMERA3 (TIMER A) as GREEN of RGB light
//!
//! \return None.
//
//****************************************************************************
void InitPWMModules()
{
//
// Initialization of timers to generate PWM output
//
MAP_PRCMPeripheralClkEnable(PRCM_TIMERA2, PRCM_RUN_MODE_CLK);
MAP_PRCMPeripheralClkEnable(PRCM_TIMERA3, PRCM_RUN_MODE_CLK);
//
// TIMERA2 (TIMER B) as RED of RGB light. GPIO 9 --> PWM_5
//
SetupTimerPWMMode(TIMERA2_BASE, TIMER_B,
(TIMER_CFG_SPLIT_PAIR | TIMER_CFG_B_PWM), 1);
//
// TIMERA3 (TIMER B) as YELLOW of RGB light. GPIO 10 --> PWM_6
//
SetupTimerPWMMode(TIMERA3_BASE, TIMER_A,
(TIMER_CFG_SPLIT_PAIR | TIMER_CFG_A_PWM | TIMER_CFG_B_PWM), 1);
//
// TIMERA3 (TIMER A) as GREEN of RGB light. GPIO 11 --> PWM_7
//
SetupTimerPWMMode(TIMERA3_BASE, TIMER_B,
(TIMER_CFG_SPLIT_PAIR | TIMER_CFG_A_PWM | TIMER_CFG_B_PWM), 1);
MAP_TimerEnable(TIMERA2_BASE,TIMER_B);
MAP_TimerEnable(TIMERA3_BASE,TIMER_A);
MAP_TimerEnable(TIMERA3_BASE,TIMER_B);
}
示例6: PinMuxConfig
//*****************************************************************************
void
PinMuxConfig(void)
{
//
// Enable Peripheral Clocks
//
MAP_PRCMPeripheralClkEnable(PRCM_UARTA0, PRCM_RUN_MODE_CLK);
MAP_PRCMPeripheralClkEnable(PRCM_I2CA0, PRCM_RUN_MODE_CLK);
//
// Configure PIN_55 for UART0 UART0_TX
//
MAP_PinTypeUART(PIN_55, PIN_MODE_3);
//
// Configure PIN_57 for UART0 UART0_RX
//
MAP_PinTypeUART(PIN_57, PIN_MODE_3);
//
// Configure PIN_01 for I2C0 I2C_SCL
//
MAP_PinTypeI2C(PIN_01, PIN_MODE_1);
//
// Configure PIN_02 for I2C0 I2C_SDA
//
MAP_PinTypeI2C(PIN_02, PIN_MODE_1);
}
示例7: Board_openUART
/*
* ======== Board_openUART ========
* Initialize the UART driver.
* Initialize the UART port's pins.
* Open the UART port.
*/
UART_Handle Board_openUART(UInt uartPortIndex, UART_Params *uartParams)
{
/* Initialize the UART driver */
/* By design, UART_init() is idempotent */
UART_init();
/* initialize the pins associated with the respective UART */
switch(uartPortIndex) {
case 0:
/* Serial */
/* enable UART1 clock */
MAP_PRCMPeripheralClkEnable(PRCM_UARTA1, PRCM_RUN_MODE_CLK);
/*
* Configure LaunchPad P2.9 as a UART1: UART1 TX (via USB port)
* device pin: 55 (UART1_TX)
* Wiring id : 12
*/
MAP_PinTypeUART(PIN_55, PIN_MODE_6);
/*
* Configure LaunchPad P3.3 as a UART1: UART1 RX (via USB port)
* device pin: 57 (UART1_RX)
* Wiring id : 23
*/
MAP_PinTypeUART(PIN_57, PIN_MODE_6);
break;
case 1:
/* Serial1 */
/* enable UART0 clock */
MAP_PRCMPeripheralClkEnable(PRCM_UARTA0, PRCM_RUN_MODE_CLK);
/*
* Configure LaunchPad P1.4 as a UART0: UART0 TX
* device pin: 3 (UART0_TX)
* Wiring id : 4
*/
MAP_PinTypeUART(PIN_03, PIN_MODE_7);
/*
* Configure LaunchPad P1.3 as a UART0: UART0 RX
* device pin: 4 (UART0_RX)
* Wiring id : 3
*/
MAP_PinTypeUART(PIN_04, PIN_MODE_7);
break;
default:
return (NULL);
}
/* open the UART */
return (UART_open(uartPortIndex, uartParams));
}
示例8: Board_initGeneral
/*
* ======== Board_initGeneral ========
*/
void Board_initGeneral(void)
{
/* Reset DMA + other essential peripheral initialization
* ASSUMED by the simplelink and driverlib libraries
*/
PRCMCC3200MCUInit();
/* Configure pins as specified in the current configuration */
/*
* ======== Enable Peripheral Clocks ========
* Enable all clocks (because wiring can use any pin in any mode
* at runtime)
*/
MAP_PRCMPeripheralClkEnable(PRCM_CAMERA, PRCM_RUN_MODE_CLK);
MAP_PRCMPeripheralClkEnable(PRCM_GSPI, PRCM_RUN_MODE_CLK);
MAP_PRCMPeripheralClkEnable(PRCM_I2CA0, PRCM_RUN_MODE_CLK);
MAP_PRCMPeripheralClkEnable(PRCM_I2S, PRCM_RUN_MODE_CLK);
MAP_PRCMPeripheralClkEnable(PRCM_SDHOST, PRCM_RUN_MODE_CLK);
MAP_PRCMPeripheralClkEnable(PRCM_TIMERA0, PRCM_RUN_MODE_CLK);
MAP_PRCMPeripheralClkEnable(PRCM_TIMERA1, PRCM_RUN_MODE_CLK);
MAP_PRCMPeripheralClkEnable(PRCM_TIMERA2, PRCM_RUN_MODE_CLK);
MAP_PRCMPeripheralClkEnable(PRCM_TIMERA3, PRCM_RUN_MODE_CLK);
}
示例9: InitGPIO
void InitGPIO(void)
{
/* Activate GPIO clock per port. Not sure of which ports we use, so enable everything */
MAP_PRCMPeripheralClkEnable(PRCM_GPIOA0, PRCM_RUN_MODE_CLK);
MAP_PRCMPeripheralClkEnable(PRCM_GPIOA1, PRCM_RUN_MODE_CLK);
MAP_PRCMPeripheralClkEnable(PRCM_GPIOA2, PRCM_RUN_MODE_CLK);
MAP_PRCMPeripheralClkEnable(PRCM_GPIOA3, PRCM_RUN_MODE_CLK);
MAP_PRCMPeripheralClkEnable(PRCM_GPIOA4, PRCM_RUN_MODE_CLK);
/* Configure UART pins */
MAP_PinTypeUART(PIN_55, PIN_MODE_3);
MAP_PinTypeUART(PIN_57, PIN_MODE_3);
/* Configure I2C pins */
MAP_PinTypeI2C(PIN_01, PIN_MODE_1);
MAP_PinTypeI2C(PIN_02, PIN_MODE_1);
/* COngifure current sense ADC inputs */
MAP_PinTypeADC(AISEN,PIN_MODE_255);
MAP_PinTypeADC(BISEN,PIN_MODE_255);
MAP_ADCChannelEnable(ADC_BASE, AISENx);
MAP_ADCChannelEnable(ADC_BASE, BISENx);
MAP_ADCEnable(ADC_BASE);
/* Set pin mode for DIP and LED pins */
MAP_PinTypeGPIO(RLED, PIN_MODE_0, false);
MAP_PinTypeGPIO(BLED, PIN_MODE_0, false);
MAP_PinTypeGPIO(DIP1, PIN_MODE_0, false);
MAP_PinTypeGPIO(DIP2, PIN_MODE_0, false);
MAP_PinTypeGPIO(DIP3, PIN_MODE_0, false);
MAP_PinTypeGPIO(DIP4, PIN_MODE_0, false);
MAP_PinTypeGPIO(ODO1, PIN_MODE_0, false);
MAP_PinTypeGPIO(ODO2, PIN_MODE_0, false);
/* Get port name and bin number from GPIO number (TI lookup table) LED, DIP, ODO */
GPIO_IF_GetPortNPin(RLEDx, &port_rled, &pin_rled);
GPIO_IF_GetPortNPin(BLEDx, &port_bled, &pin_bled);
GPIO_IF_GetPortNPin(DIP1x, &port_dip1, &pin_dip1);
GPIO_IF_GetPortNPin(DIP2x, &port_dip2, &pin_dip2);
GPIO_IF_GetPortNPin(DIP3x, &port_dip3, &pin_dip3);
GPIO_IF_GetPortNPin(DIP4x, &port_dip4, &pin_dip4);
GPIO_IF_GetPortNPin(ODO1x, &port_odo1, &pin_odo1);
GPIO_IF_GetPortNPin(ODO2x, &port_odo2, &pin_odo2);
/* Set pin direction LED, DIP, ODO */
GPIODirModeSet(port_rled, pin_rled, 1);
GPIODirModeSet(port_bled, pin_bled, 1);
GPIODirModeSet(port_dip1, pin_dip1, 0);
GPIODirModeSet(port_dip2, pin_dip2, 0);
GPIODirModeSet(port_dip3, pin_dip3, 0);
GPIODirModeSet(port_dip4, pin_dip4, 0);
GPIODirModeSet(port_odo1, pin_odo1, 0);
GPIODirModeSet(port_odo2, pin_odo2, 0);
}
示例10: board_init
/**
* @brief Initialize the board
*/
void board_init(void) {
MAP_PRCMPeripheralClkEnable(PRCM_GPIOA0, PRCM_RUN_MODE_CLK);
MAP_PRCMPeripheralClkEnable(PRCM_GPIOA1, PRCM_RUN_MODE_CLK);
MAP_PRCMPeripheralClkEnable(PRCM_GPIOA2, PRCM_RUN_MODE_CLK);
MAP_PRCMPeripheralClkEnable(PRCM_GPIOA3, PRCM_RUN_MODE_CLK);
/* initialize the CPU */
cpu_init();
/* initialize the boards LEDs */
led_init();
}
示例11: main
int main() {
#ifndef USE_TIRTOS
MAP_IntVTableBaseSet((unsigned long) &g_pfnVectors[0]);
#endif
MAP_IntEnable(FAULT_SYSTICK);
MAP_IntMasterEnable();
PRCMCC3200MCUInit();
/* Console UART init. */
MAP_PRCMPeripheralClkEnable(CONSOLE_UART_PERIPH, PRCM_RUN_MODE_CLK);
MAP_PinTypeUART(PIN_55, PIN_MODE_3); /* PIN_55 -> UART0_TX */
MAP_PinTypeUART(PIN_57, PIN_MODE_3); /* PIN_57 -> UART0_RX */
MAP_UARTConfigSetExpClk(
CONSOLE_UART, MAP_PRCMPeripheralClockGet(CONSOLE_UART_PERIPH),
CONSOLE_BAUD_RATE,
(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));
MAP_UARTFIFOLevelSet(CONSOLE_UART, UART_FIFO_TX1_8, UART_FIFO_RX4_8);
MAP_UARTFIFOEnable(CONSOLE_UART);
setvbuf(stdout, NULL, _IOLBF, 0);
setvbuf(stderr, NULL, _IOLBF, 0);
cs_log_set_level(LL_INFO);
cs_log_set_file(stdout);
LOG(LL_INFO, ("Hello, world!"));
MAP_PinTypeI2C(PIN_01, PIN_MODE_1); /* SDA */
MAP_PinTypeI2C(PIN_02, PIN_MODE_1); /* SCL */
I2C_IF_Open(I2C_MASTER_MODE_FST);
/* Set up the red LED. Note that amber and green cannot be used as they share
* pins with I2C. */
MAP_PRCMPeripheralClkEnable(PRCM_GPIOA1, PRCM_RUN_MODE_CLK);
MAP_PinTypeGPIO(PIN_64, PIN_MODE_0, false);
MAP_GPIODirModeSet(GPIOA1_BASE, 0x2, GPIO_DIR_MODE_OUT);
GPIO_IF_LedConfigure(LED1);
GPIO_IF_LedOn(MCU_RED_LED_GPIO);
if (VStartSimpleLinkSpawnTask(8) != 0) {
LOG(LL_ERROR, ("Failed to create SL task"));
}
if (!mg_start_task(MG_TASK_PRIORITY, MG_TASK_STACK_SIZE, mg_init)) {
LOG(LL_ERROR, ("Failed to create MG task"));
}
osi_start();
return 0;
}
示例12: WDT_IF_Init
//****************************************************************************
//
//! Initialize the watchdog timer
//!
//! \param fpAppWDTCB is the WDT interrupt handler to be registered
//! \param uiReloadVal is the reload value to be set to the WDT
//!
//! This function
//! 1. Initializes the WDT
//!
//! \return None.
//
//****************************************************************************
void WDT_IF_Init(fAPPWDTDevCallbk fpAppWDTCB,
unsigned int uiReloadVal)
{
//
// Enable the peripherals used by this example.
//
MAP_PRCMPeripheralClkEnable(PRCM_WDT, PRCM_RUN_MODE_CLK);
//
// Unlock to be able to configure the registers
//
MAP_WatchdogUnlock(WDT_BASE);
if(fpAppWDTCB != NULL)
{
#ifdef USE_TIRTOS
osi_InterruptRegister(INT_WDT, fpAppWDTCB, INT_PRIORITY_LVL_1);
#else
MAP_WatchdogIntRegister(WDT_BASE,fpAppWDTCB);
#endif
}
//
// Set the watchdog timer reload value
//
MAP_WatchdogReloadSet(WDT_BASE,uiReloadVal);
//
// Start the timer. Once the timer is started, it cannot be disable.
//
MAP_WatchdogEnable(WDT_BASE);
}
示例13: PerformPRCMSleepWDTWakeup
//****************************************************************************
//
//! Implements Sleep followed by wakeup using WDT timeout
//!
//! \param none
//!
//! This function
//! 1. Implements Sleep followed by wakeup using WDT
//!
//! \return None.
//
//****************************************************************************
void PerformPRCMSleepWDTWakeup()
{
//
// Initialize the WDT
//
WDT_IF_Init(AppWDTCallBackHandler, (4 * SYS_CLK));
//
// Enable the Sleep Clock
//
MAP_PRCMPeripheralClkEnable(PRCM_WDT, PRCM_SLP_MODE_CLK);
//
// Enter SLEEP...WaitForInterrupt ARM intrinsic
//
DBG_PRINT("WDT_SLEEP: Entering Sleep\n\r");
MAP_UtilsDelay(80000);
MAP_PRCMSleepEnter();
DBG_PRINT("WDT_SLEEP: Exiting Sleep\n\r");
//
// Disable the Sleep Clock
//
MAP_PRCMPeripheralClkDisable(PRCM_WDT, PRCM_SLP_MODE_CLK);
//
// Deinitialize the WDT
//
WDT_IF_DeInit();
//
// PowerOff WDT
//
MAP_PRCMPeripheralClkDisable(PRCM_WDT, PRCM_RUN_MODE_CLK);
}
示例14: main
int main() {
MAP_IntVTableBaseSet((unsigned long) &g_pfnVectors[0]);
MAP_IntEnable(FAULT_SYSTICK);
MAP_IntMasterEnable();
PRCMCC3200MCUInit();
cc3200_leds_init();
/* Console UART init. */
MAP_PRCMPeripheralClkEnable(CONSOLE_UART_PERIPH, PRCM_RUN_MODE_CLK);
MAP_PinTypeUART(PIN_55, PIN_MODE_3); /* PIN_55 -> UART0_TX */
MAP_PinTypeUART(PIN_57, PIN_MODE_3); /* PIN_57 -> UART0_RX */
MAP_UARTConfigSetExpClk(
CONSOLE_UART, MAP_PRCMPeripheralClockGet(CONSOLE_UART_PERIPH),
CONSOLE_BAUD_RATE,
(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));
MAP_UARTFIFODisable(CONSOLE_UART);
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);
VStartSimpleLinkSpawnTask(8);
osi_TaskCreate(v7_task, (const signed char *) "v7", V7_STACK_SIZE + 256, NULL,
3, NULL);
osi_TaskCreate(blinkenlights_task, (const signed char *) "blink", 256, NULL,
9, NULL);
osi_start();
return 0;
}
示例15: mgos_uart_hal_init
bool mgos_uart_hal_init(struct mgos_uart_state *us) {
uint32_t base = cc32xx_uart_get_base(us->uart_no);
uint32_t periph, int_no;
void (*int_handler)();
/* TODO(rojer): Configurable pin mappings? */
if (us->uart_no == 0) {
periph = PRCM_UARTA0;
int_no = INT_UARTA0;
int_handler = u0_int;
MAP_PinTypeUART(PIN_55, PIN_MODE_3); /* UART0_TX */
MAP_PinTypeUART(PIN_57, PIN_MODE_3); /* UART0_RX */
} else if (us->uart_no == 1) {
periph = PRCM_UARTA1;
int_no = INT_UARTA1;
int_handler = u1_int;
MAP_PinTypeUART(PIN_07, PIN_MODE_5); /* UART1_TX */
MAP_PinTypeUART(PIN_08, PIN_MODE_5); /* UART1_RX */
} else {
return false;
}
struct cc32xx_uart_state *ds =
(struct cc32xx_uart_state *) calloc(1, sizeof(*ds));
ds->base = base;
cs_rbuf_init(&ds->isr_rx_buf, CC32xx_UART_ISR_RX_BUF_SIZE);
us->dev_data = ds;
MAP_PRCMPeripheralClkEnable(periph, PRCM_RUN_MODE_CLK);
MAP_UARTIntDisable(base, ~0); /* Start with ints disabled. */
MAP_IntRegister(int_no, int_handler);
MAP_IntPrioritySet(int_no, INT_PRIORITY_LVL_1);
MAP_IntEnable(int_no);
return true;
}