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

C++ PIO_LISTSIZE函数代码示例

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

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



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

示例1: SensorsTestInit

void SensorsTestInit()
{
	char pinDirection = 0;
	int i;
	PIO_Configure(aDigitalOuts, PIO_LISTSIZE(aDigitalOuts));
	PIO_Configure(digitalIns, PIO_LISTSIZE(digitalIns));
	PIO_Configure(sensorsPower, PIO_LISTSIZE(sensorsPower));
	
	PMC_EnablePeripheral(AT91C_ID_PIOB);
	PMC_EnablePeripheral(AT91C_ID_PIOA);
	
	SelectAng0();		// select analog port 0 to be mesured instead of BattVoltage
	SensorPowerOn();	// turn on the Vcc line
	
	if(PMC_IsPeriphEnabled(AT91C_ID_TWI) == 0){
		PIO_Configure(twiPortPins, PIO_LISTSIZE(twiPortPins));
		PMC_EnablePeripheral(AT91C_ID_TWI);
		
		TWI_ConfigureMaster(AT91C_BASE_TWI,TWCK,MCK);
	}
	
	// set all pins on pullup chip to output
	WritePullupData(0x00,&pinDirection,1);
	WritePullupData(0x01,&pinDirection,1);
	
	for(i = 0;i < 8;i++){
		if(i>1) AnalogPullup(i,0);  // disable Analog pullups for output test
		DigitalPullup(i,1);		// enable all digital pullups
	}
}
开发者ID:BotBallARDroneAPI,项目名称:CBC_Library,代码行数:30,代码来源:sensors.c


示例2: AccelInit

unsigned char AccelInit(void)
{	
	PIO_Configure(accIntPins, PIO_LISTSIZE(accIntPins));
	
	if(PMC_IsPeriphEnabled(AT91C_ID_TWI) == 0){
		PIO_Configure(twiPins, PIO_LISTSIZE(twiPins));
		
		PMC_EnablePeripheral(AT91C_ID_TWI);
	
		TWI_ConfigureMaster(AT91C_BASE_TWI,TWCK,MCK);
	}
	usleep(10000);

#ifdef STACCEL
	// ST Accelerometer
	char setup[4];
	setup[0] = (1<<5)|(2<<3)|7; // Normal power, data rate = 400Hz, ZYX axis enabled
	setup[1] = 0; // Do not add filter stuff
	setup[2] = (2<<0); // Data ready interrupt on INT 2 pad
	setup[3] = (0<<4); // do update between reads, and set scale to +/- 2g's
	WriteAccelData(0x20|(1<<7),setup,4);
#else
	// Freescale Accelerometer
	//AccelCalibration();	
	AccelSetScale(2);	
	AccelSetCalibration();
	
#endif
	SetPitCallback(AccelCallback,3);
	
	return 0;
}
开发者ID:BotBallARDroneAPI,项目名称:CBC_Library,代码行数:32,代码来源:accel.c


示例3: glcd_init

//---------------------------
void glcd_init(void)
{
	unsigned int tcmr,tfmr;
	unsigned char i;
  
  PIO_Configure(GLcdpins,PIO_LISTSIZE(GLcdpins));
	PIO_Configure(sscPins, PIO_LISTSIZE(sscPins));	
	
	PIO_Set(&GLcdpins[3]);
	PIO_Set(&GLcdpins[4]);
	
	SSC_Configure(AT91C_BASE_SSC,AT91C_ID_SSC,500000,BOARD_MCK);
    
  tcmr=AT91C_SSC_CKS_TK|AT91C_SSC_CKO_DATA_TX|AT91C_SSC_START_CONTINOUS;
  tfmr=SSC_DATLEN(8)|SSC_DATNB(15)|SSC_FSLEN(16)|AT91C_SSC_FSOS_LOW|AT91C_SSC_FSDEN ;
    
  SSC_ConfigureTransmitter(AT91C_BASE_SSC,tcmr,tfmr);
  SSC_EnableTransmitter(AT91C_BASE_SSC);
	
	PIO_Set(&GLcdpins[5]); 
  //PIO_Clear(&GLcdpins[5]);
	for(i = 0; i < 3; i++);
  GLCD_WriteCommand((DISPLAY_ON_CMD | ON), i);
	
}	
开发者ID:naminic,项目名称:Grafical-Lcd-Arm,代码行数:26,代码来源:glcd.c


示例4: ILI9488_InitInterface

static void ILI9488_InitInterface(void)
{

    PIO_Configure(ILI9488_Reset, PIO_LISTSIZE(ILI9488_Reset));    
    PIO_Configure(spi_pins, PIO_LISTSIZE(spi_pins));


    PIO_Configure(ILI9488_Pwm, PIO_LISTSIZE(ILI9488_Pwm));
    /* Enable PWM peripheral clock */
    PMC_EnablePeripheral(ID_PWM0);

    /* Set clock A and clock B */
    // set for 14.11 KHz for CABC control
    //    mode = PWM_CLK_PREB(0x0A) | (PWM_CLK_DIVB(110)) | 
    //           PWM_CLK_PREA(0x0A) | (PWM_CLK_DIVA(110));
    PWMC_ConfigureClocks(PWM0, 14200, 0,  BOARD_MCK);

    /* Configure PWM channel 1 for LED0  */
    PWMC_DisableChannel(PWM0, CHANNEL_PWM_LCD);

    PWMC_ConfigureChannel(PWM0, CHANNEL_PWM_LCD, PWM_CMR_CPRE_CLKA,0,PWM_CMR_CPOL);
    PWMC_SetPeriod(PWM0, CHANNEL_PWM_LCD, 16);
    PWMC_SetDutyCycle(PWM0, CHANNEL_PWM_LCD, 8);
    PWMC_EnableChannel(PWM0, CHANNEL_PWM_LCD);

    SPI_Configure(ILI9488, ILI9488_ID, (SPI_MR_MSTR | SPI_MR_MODFDIS | SPI_PCS( ILI9488_cs )));
    SPI_ConfigureNPCS( ILI9488, ILI9488_cs, 
            SPI_CSR_CPOL | SPI_CSR_BITS_9_BIT | 
            SPI_DLYBS(100, BOARD_MCK) | SPI_DLYBCT(100, BOARD_MCK) |
            SPI_SCBR( 35000000, BOARD_MCK) ) ;  

    SPI_Enable(ILI9488);

}
开发者ID:BlueSkyGjj,项目名称:SAMV71_softpack,代码行数:34,代码来源:ili9488.c


示例5: ADS7843_Initialize

/**
 * \brief Initialization of the SPI for communication with ADS7843 component.
 */
extern void ADS7843_Initialize( void )
{
    volatile uint32_t uDummy;

    /* Configure pins */
    PIO_Configure(pinsSPI, PIO_LISTSIZE(pinsSPI));

    PIO_Configure(pinBusy, PIO_LISTSIZE(pinBusy));

    SPI_Configure(BOARD_TSC_SPI_BASE,
                  BOARD_TSC_SPI_ID,
                  SPI_MR_MSTR | SPI_MR_MODFDIS | SPI_PCS(BOARD_TSC_NPCS) /* Value of the SPI configuration register. */
    );

    SPI_ConfigureNPCS(BOARD_TSC_SPI_BASE, BOARD_TSC_NPCS,
                      SPI_CSR_NCPHA | SPI_CSR_DLYBS(DELAY_BEFORE_SPCK) |
                      SPI_CSR_DLYBCT(DELAY_BETWEEN_CONS_COM) | SPI_CSR_SCBR(0xC8) );

    SPI_Enable(BOARD_TSC_SPI_BASE);

    for (uDummy=0; uDummy<100000; uDummy++);

    uDummy = REG_SPI_SR;
    uDummy = REG_SPI_RDR;

    SendCommand(CMD_ENABLE_PENIRQ);
}
开发者ID:tjohann,项目名称:sam3_p256_libboard,代码行数:30,代码来源:ads7843.c


示例6: UART_Configure

extern void UART_Configure( uint32_t baudrate, uint32_t masterClock)
{
#if 0
    const Pin pPins[] = CONSOLE_PINS;

    /* Configure PIO */
    PIO_Configure(pPins, PIO_LISTSIZE(pPins));

    uint32_t mode = US_MR_USART_MODE_RS485 | US_MR_USCLKS_MCK
                    | US_MR_CHRL_8_BIT | US_MR_PAR_NO | US_MR_NBSTOP_1_BIT
                    | US_MR_CHMODE_NORMAL;

    PMC->PMC_PCER0 = 1 << CONSOLE_ID;

    USART_Configure( USART1, mode, CONSOLE_BAUDRATE, BOARD_MCK ) ;

    USART1->US_IDR = 0xFFFFFFFF ;

    NVIC_EnableIRQ( USART1_IRQn ) ;
    USART_SetTransmitterEnabled( USART1, 1 ) ;
#else

#ifdef CONSOLE_USART_USE_UART1
    const Pin pPins[] = {{1 << 3, PIOB, ID_PIOB, PIO_PERIPH_A, PIO_DEFAULT}};
    Uart *pUart = CONSOLE_USART;
#else
    const Pin pPins[] = CONSOLE_PINS;
    Uart *pUart = (Uart *)CONSOLE_USART;
#endif
    /* Configure PIO */
    PIO_Configure(pPins, PIO_LISTSIZE(pPins));

    /* Configure PMC */
#ifdef CONSOLE_USART_USE_UART1
    PMC->PMC_PCER0 = 1 << ID_UART1;
#else
    PMC->PMC_PCER0 = 1 << CONSOLE_ID;
#endif

    /* Reset and disable receiver & transmitter */
    pUart->UART_CR = UART_CR_RSTRX | UART_CR_RSTTX
                   | UART_CR_RXDIS | UART_CR_TXDIS;

    /* Configure mode */
    pUart->UART_MR =  UART_MR_PAR_NO | US_MR_CHRL_8_BIT;

    /* Configure baudrate */
    /* Asynchronous, no oversampling */
    pUart->UART_BRGR = (masterClock / baudrate) / 16;

    /* Disable PDC channel */
    pUart->UART_PTCR = UART_PTCR_RXTDIS | UART_PTCR_TXTDIS;

    /* Enable receiver and transmitter */
    pUart->UART_CR = UART_CR_RXEN | UART_CR_TXEN;
#endif
}
开发者ID:makerpc,项目名称:bricklib,代码行数:57,代码来源:uart_console.c


示例7: GPIO_Init

void GPIO_Init(void)
{  
  
    PIO_Configure( pinsSwitches,  PIO_LISTSIZE(pinsSwitches) );
    PIO_Configure( pinsGpios,    PIO_LISTSIZE(pinsGpios)     );          
    //PIO_InitializeInterrupts( AT91C_AIC_PRIOR_LOWEST );     
    //LED_Configure(LED_DS1);
    //LED_Configure(LED_DS2);
    
}
开发者ID:nustpq,项目名称:bridge_host,代码行数:10,代码来源:gpio.c


示例8: main

//------------------------------------------------------------------------------
/// Initializes the CCID driver and runs it.
/// \return Unused (ANSI-C compatibility)
//------------------------------------------------------------------------------
int main( void )
{
    // Initialize traces
    TRACE_CONFIGURE(DBGU_STANDARD, 115200, BOARD_MCK);
    printf("-- USB Device CCID Project %s --\n\r", SOFTPACK_VERSION);
    printf("-- %s\n\r", BOARD_NAME);
    printf("-- Compiled: %s %s --\n\r", __DATE__, __TIME__);

    // If they are present, configure Vbus & Wake-up pins
    PIO_InitializeInterrupts(0);

    // Configure IT on Smart Card
    ConfigureCardDetection();

    // Configure ISO7816 driver
    PIO_Configure(pinsISO7816, PIO_LISTSIZE(pinsISO7816));
    PIO_Configure(pinsPower, PIO_LISTSIZE(pinsPower));

    /* power up the card */
    PIO_Set(&pinsPower[0]);

    ISO7816_Init( pinIso7816RstMC );

    // USB audio driver initialization
    CCIDDriver_Initialize();

    // connect if needed
    VBUS_CONFIGURE();
    while (USBD_GetState() < USBD_STATE_CONFIGURED);

    CCID_Insertion();

    // Infinite loop
    while (1) {

        if( USBState == STATE_SUSPEND ) {
            TRACE_DEBUG("suspend  !\n\r");
            LowPowerMode();
            USBState = STATE_IDLE;
        }
        if( USBState == STATE_RESUME ) {
            // Return in normal MODE
            TRACE_DEBUG("resume !\n\r");
            NormalPowerMode();
            USBState = STATE_IDLE;
        }
        CCID_SmartCardRequest();
    }
    return 0;
}
开发者ID:amsterr,项目名称:at91work,代码行数:54,代码来源:main.c


示例9: ShallEraseBootstrap

static unsigned char ShallEraseBootstrap()
{
    const Pin pButtons[] = {PINS_PUSHBUTTONS};
    unsigned char buttonIdx;

    // Configure all PIO corresponding to buttons in input
    PIO_Configure(pButtons, PIO_LISTSIZE(pButtons));
    for (buttonIdx = 0; buttonIdx < PIO_LISTSIZE(pButtons); ++buttonIdx) {
        // Check if button is pressed
        if (!PIO_Get(&(pButtons[buttonIdx]))) {
            return 1;
        }
    }
    return 0;
}
开发者ID:Heather,项目名称:Pyramid-Head,代码行数:15,代码来源:main.c


示例10: USART1_UART_Init

void USART1_UART_Init(unsigned int baudrate) {
  unsigned int mode = AT91C_US_USMODE_NORMAL
                        | AT91C_US_CLKS_CLOCK
                        | AT91C_US_CHRL_8_BITS
                        | AT91C_US_PAR_NONE
                        | AT91C_US_NBSTOP_1_BIT
                        | AT91C_US_CHMODE_NORMAL;

    // Configure pins
    PIO_Configure(pins, PIO_LISTSIZE(pins));

    // Enable the peripheral clock in the PMC
    PMC_EnablePeripheral(AT91C_ID_US0);

    // Configure the USART in the desired mode
    USART_Configure(AT91C_BASE_US0, mode, baudrate, BOARD_MCK);

    // Configure the RXBUFF interrupt
    AT91C_BASE_US0->US_IER = AT91C_US_RXRDY;
    AIC_ConfigureIT(AT91C_ID_US0, 0, ISR_Usart0);
    AIC_EnableIT(AT91C_ID_US0);

    // Enable receiver & transmitter
    USART_SetTransmitterEnabled(AT91C_BASE_US0, 1);
    USART_SetReceiverEnabled(AT91C_BASE_US0, 1);
}
开发者ID:Diggen85,项目名称:a-culfw,代码行数:26,代码来源:hal_usart.c


示例11: _ConfigurePIOs

/**
 * Initialize PIOs
 */
static void _ConfigurePIOs(void)
{
    /* Configure SDcard pins */
    PIO_Configure(pinsSd, PIO_LISTSIZE(pinsSd));
    /* Configure SD card detection */
    CardDetectConfigure();
}
开发者ID:BlueSkyGjj,项目名称:SAMV71_softpack,代码行数:10,代码来源:main.c


示例12: LCDD_SetBacklight

/**
 * \brief Set the backlight of the LCD.
 *
 * \param level   Backlight brightness level [1..16], 1 means maximum brightness.
 */
void LCDD_SetBacklight (uint32_t level)
{
    uint32_t i;
    const Pin pPins[] = {BOARD_BACKLIGHT_PIN};

    /* Ensure valid level */
    level = (level < 1) ? 1 : level;
    level = (level > 16) ? 16 : level;

    /* Enable pins */
    PIO_Configure(pPins, PIO_LISTSIZE(pPins));

    /* Switch off backlight */
    PIO_Clear(pPins);
    i = 600 * (BOARD_MCK / 1000000);    /* wait for at least 500us */
    while(i--);

    /* Set new backlight level */
    for (i = 0; i < level; i++) {
        PIO_Clear(pPins);
        PIO_Clear(pPins);
        PIO_Clear(pPins);

        PIO_Set(pPins);
        PIO_Set(pPins);
        PIO_Set(pPins);
    }
}
开发者ID:calao-systems,项目名称:calao-samba,代码行数:33,代码来源:lcdd.c


示例13: i2c_eeprom_slave_init

void i2c_eeprom_slave_init(void) {
	uint64_t uid = uid_get_uid64();

	memcpy(eeprom.memory, &uid, sizeof(uint64_t));

	eeprom.offset = 0;
	eeprom.acquire = 0;
	eeprom.page = 0;

	const Pin twi_pins[] = {PINS_TWI_STACK};

	// Configure TWI pins
	PIO_Configure(twi_pins, PIO_LISTSIZE(twi_pins));

	// Enable TWI peripheral clock
	PMC->PMC_PCER0 = 1 << ID_TWI1;

	// Configure TWI interrupts
	NVIC_DisableIRQ(TWI1_IRQn);
	NVIC_ClearPendingIRQ(TWI1_IRQn);
	NVIC_SetPriority(TWI1_IRQn, PRIORITY_EEPROM_SLAVE_TWI1);
	NVIC_EnableIRQ(TWI1_IRQn);

    // Configure TWI as slave, with address I2C_EEPROM_SLAVE_ADDRESS
    TWI_ConfigureSlave(TWI_STACK, I2C_EEPROM_SLAVE_ADDRESS);

    // Enable TWI interrupt
    TWI_EnableIt(TWI_STACK, TWI_IER_SVACC);
}
开发者ID:copterpilot,项目名称:bricklib,代码行数:29,代码来源:i2c_eeprom_slave.c


示例14: imu_startblink

void imu_startblink(void) {
	imu_leds_on(true);
	Pin pins[] = {PINS_IMU_LED};
	for(uint8_t i = 0; i < 6; i++) {
		pins[i].type = PIO_OUTPUT_1;
	}

	PIO_Configure(pins, PIO_LISTSIZE(pins));

	for(uint8_t i = 0; i < 41; i++) {
		TC0->TC_CHANNEL[0].TC_RA = blink_lookup[i];
		TC0->TC_CHANNEL[1].TC_RA = blink_lookup[i];
		TC0->TC_CHANNEL[2].TC_RB = blink_lookup[i];
		PWMC_SetDutyCycle(PWM, 3, blink_lookup[40-i]);
		SLEEP_MS(6);
	}
	for(uint8_t i = 0; i < 41; i++) {
		TC0->TC_CHANNEL[0].TC_RA = blink_lookup[40-i];
		TC0->TC_CHANNEL[1].TC_RA = blink_lookup[40-i];
		TC0->TC_CHANNEL[2].TC_RB = blink_lookup[40-i];
		PWMC_SetDutyCycle(PWM, 3, blink_lookup[i]);
		SLEEP_MS(6);

	}
	for(uint8_t i = 0; i < 41; i++) {
		TC0->TC_CHANNEL[0].TC_RA = blink_lookup[i];
		TC0->TC_CHANNEL[1].TC_RA = blink_lookup[i];
		TC0->TC_CHANNEL[2].TC_RB = blink_lookup[i];
		PWMC_SetDutyCycle(PWM, 3, blink_lookup[40-i]);
		SLEEP_MS(6);
	}

	imu_leds_on(false);
}
开发者ID:makerpc,项目名称:imu-v2-brick,代码行数:34,代码来源:imu.c


示例15: _ILI9488_Spi_HW_Initialize

/**
 * \brief ILI9488 Hardware Initialization for SPI/SMC LCD.
 */
static void _ILI9488_Spi_HW_Initialize(void)
{
	/* Pin configurations */
	PIO_Configure(&lcd_spi_reset_pin, 1);
	PIO_Configure(&lcd_spi_cds_pin, 1);
	PIO_Configure(lcd_pins, PIO_LISTSIZE(lcd_pins));
	PIO_Configure(&lcd_spi_pwm_pin, 1);

	/* Enable PWM peripheral clock */
	PMC_EnablePeripheral(ID_PWM0);
	PMC_EnablePeripheral(ID_SPI0);
	/* Set clock A and clock B */
	// set for 14.11 KHz for CABC control
	//mode = PWM_CLK_PREB(0x0A) | (PWM_CLK_DIVB(110)) |
	//PWM_CLK_PREA(0x0A) | (PWM_CLK_DIVA(110));
	PWMC_ConfigureClocks(PWM0, 14200, 0,  BOARD_MCK);

	/* Configure PWM channel 1 for LED0  */
	PWMC_DisableChannel(PWM0, CHANNEL_PWM_LCD);

	PWMC_ConfigureChannel(PWM0, CHANNEL_PWM_LCD, PWM_CMR_CPRE_CLKA, 0,
						  PWM_CMR_CPOL);
	PWMC_SetPeriod(PWM0, CHANNEL_PWM_LCD, 16);
	PWMC_SetDutyCycle(PWM0, CHANNEL_PWM_LCD, 8);
	PWMC_EnableChannel(PWM0, CHANNEL_PWM_LCD);

	SPI_Configure(ILI9488_SPI, ID_SPI0, (SPI_MR_MSTR | SPI_MR_MODFDIS
										 | SPI_PCS(SMC_EBI_LCD_CS)));
	SPI_ConfigureNPCS(ILI9488_SPI,
					  SMC_EBI_LCD_CS,
					  SPI_CSR_CPOL | SPI_CSR_BITS_8_BIT | SPI_DLYBS(6, BOARD_MCK)
					  | SPI_DLYBCT(100, BOARD_MCK) | SPI_SCBR(20000000, BOARD_MCK));
	SPI_Enable(ILI9488_SPI);
}
开发者ID:codingzhouk,项目名称:LiteOS_Kernel,代码行数:37,代码来源:ili9488_spi.c


示例16: main

/**
 *  \brief usart-hard-handshaking Application entry point..
 *
 *  Configures USART0 in hardware handshaking mode and
 *  Timer Counter 0 to generate an interrupt every second. Then, starts the first
 *  transfer on the USART and wait in an endless loop.
 *
 *  \return Unused (ANSI-C compatibility).
 *  \callgraph
 */
extern int main( void )
{
    /* Disable watchdog*/
    WDT_Disable( WDT ) ;

    /* Configure pins*/
    PIO_Configure( pins, PIO_LISTSIZE( pins ) ) ;

    /* Configure USART and display startup trace*/
    _ConfigureUsart() ;

    printf( "-- USART Hardware Handshaking Example %s --\n\r", SOFTPACK_VERSION ) ;
    printf( "-- %s\n\r", BOARD_NAME ) ;
    printf( "-- Compiled: %s %s --\n\r", __DATE__, __TIME__ ) ;

    /* Configure TC0 to generate a 1s tick*/
    _ConfigureTc0() ;

    /* Start receiving data and start timer*/
    USART_ReadBuffer( BOARD_USART_BASE, pBuffer, BUFFER_SIZE ) ;
    BOARD_USART_BASE->US_IER = US_IER_RXBUFF ;
    TC_Start( TC0, 0 ) ;

    /* Infinite loop*/
    while ( 1 ) ;
}
开发者ID:cxjlante,项目名称:at91sam3s,代码行数:36,代码来源:main.c


示例17: UART_Configure

/**
 * \brief Configures an USART peripheral with the specified parameters.
 *
 * \param baudrate  Baudrate at which the USART should operate (in Hz).
 * \param masterClock  Frequency of the system master clock (in Hz).
 */
extern void UART_Configure( uint32_t dwBaudRate, uint32_t dwMasterClock )
{
    const Pin pPins[] = CONSOLE_PINS ;
    Uart *pUart = CONSOLE_USART ;

    /* Configure PIO */
    PIO_PinConfigure( pPins, PIO_LISTSIZE( pPins ) ) ;

    /* Enable clock for UART */
    /* In SAM3X, the clock for UART is always enabled. */
    /* PMC->PMC_PCER0 = 1 << CONSOLE_ID ; */

    /* Reset and disable receiver & transmitter */
    pUart->UART_CR = UART_CR_RSTRX | UART_CR_RSTTX | UART_CR_RXDIS | UART_CR_TXDIS ;

    /* Configure mode */
    pUart->UART_MR =  UART_MR_PAR_NO ;

    /* Configure baudrate */
    /* Asynchronous, no oversampling */
    pUart->UART_BRGR = (dwMasterClock / dwBaudRate) / 16 ;

    /* Disable PDC channel */
    pUart->UART_PTCR = UART_PTCR_RXTDIS | UART_PTCR_TXTDIS ;

    /* Enable receiver and transmitter */
    pUart->UART_CR = UART_CR_RXEN | UART_CR_TXEN ;

    _ucIsConsoleInitialized=1 ;

    /* Disable buffering for printf(). */
#if ( defined (__GNUC__) && !defined (__SAMBA__) )
    setvbuf(stdout, (char *)NULL, _IONBF, 0);
#endif
}
开发者ID:xtremekforever,项目名称:sam-ba,代码行数:41,代码来源:uart_console.c


示例18: UART_Configure

/**
 * \brief Configures an UART peripheral with the specified parameters.
 *
 * \param baudrate  Baudrate at which the UART should operate (in Hz).
 * \param masterClock  Frequency of the system master clock (in Hz).
 */
extern void UART_Configure( uint32_t baudrate, uint32_t masterClock)
{
    const Pin pPins[] = {PINS_UART};
    Uart *pUart = UART_UART;

    /* Configure PIO */
    PIO_Configure(pPins, PIO_LISTSIZE(pPins));

    /* Configure PMC */
    PMC->PMC_PCER0 = 1 << UART_ID;

    /* Reset and disable receiver & transmitter */
    pUart->UART_CR = UART_CR_RSTRX | UART_CR_RSTTX
                   | UART_CR_RXDIS | UART_CR_TXDIS;

    /* Configure mode */
    pUart->UART_MR =  UART_MR_PAR_NO;

    /* Configure baudrate */
    /* Asynchronous, no oversampling */
    pUart->UART_BRGR = (masterClock / baudrate) / 16;

    /* Disable PDC channel */
    pUart->UART_PTCR = UART_PTCR_RXTDIS | UART_PTCR_TXTDIS;

    /* Enable receiver and transmitter */
    pUart->UART_CR = UART_CR_RXEN | UART_CR_TXEN;

    _ucIsConsoleInitialized=1 ;
}
开发者ID:modul,项目名称:iris,代码行数:36,代码来源:uart_console.c


示例19: LCDD_SetBacklight

//------------------------------------------------------------------------------
/// Set the backlight of the LCD.
/// \param level   Backlight brightness level [1..32], 32 is maximum level.
//------------------------------------------------------------------------------
void LCDD_SetBacklight (unsigned int level)
{
    unsigned int i;
    const Pin pPins[] = {BOARD_BACKLIGHT_PIN};

    // Enable pins
    PIO_Configure(pPins, PIO_LISTSIZE(pPins));

    // Switch off backlight
    PIO_Clear(pPins);
    i = 600 * (BOARD_MCK / 1000000);    // wait for at least 500us
    while(i--);

    // Set new backlight level
    for (i = 0; i < level; i++) {

      
        PIO_Clear(pPins);
        PIO_Clear(pPins);
        PIO_Clear(pPins);
        
        
        PIO_Set(pPins);
        PIO_Set(pPins);
        PIO_Set(pPins);

//        PIO_Clear(pPins);
//        PIO_Clear(pPins);
//        PIO_Clear(pPins);
    }
//    PIO_Set(pPins);
}
开发者ID:craiglink,项目名称:at91lib,代码行数:36,代码来源:lcdd_hx8347.c


示例20: StartUPInitKBD

void StartUPInitKBD(void)
{
//	PIO Init

 AT91C_BASE_PMC->PMC_PCER = 1 << (AT91C_ID_PIOB);
//INPUT
	//--PIOB_BASE->PIO_OER  = LINES_MASK ;//* Defines the PIOs as output

	AT91C_BASE_PIOB->PIO_ODR   = (unsigned long)COLUMNS_MASK;//LINES_MASK;
	AT91C_BASE_PIOB->PIO_CODR  = (unsigned long)COLUMNS_MASK;
	AT91C_BASE_PIOB->PIO_IFER  = (unsigned long)COLUMNS_MASK;

//OUTPUT
	// PIOB_BASE->PIO_ODR   = COLUMNS_MASK;
	AT91C_BASE_PIOB->PIO_OER   = (unsigned long)LINES_MASK;//COLUMNS_MASK;
	AT91C_BASE_PIOB->PIO_CODR  = (unsigned long)LINES_MASK;//COLUMNS_MASK;
	
//	PIO Init
    AT91C_BASE_PIOB->PIO_IDR   = (unsigned long)(LINES_MASK|COLUMNS_MASK);
    AT91C_BASE_PIOB->PIO_MDDR  = (unsigned long)(LINES_MASK|COLUMNS_MASK);
    AT91C_BASE_PIOB->PIO_PER   = (unsigned long)(LINES_MASK|COLUMNS_MASK);
	AT91C_BASE_PIOB->PIO_SODR      = (unsigned long)LINES_MASK;

  PIO_Configure(pinsKbdAux, PIO_LISTSIZE(pinsKbdAux));

}
开发者ID:Flyagin,项目名称:BS-MRZV,代码行数:26,代码来源:KbdDrv.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ PIO_Set函数代码示例发布时间:2022-05-30
下一篇:
C++ PIO_Get函数代码示例发布时间: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