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

C++ PIO_Set函数代码示例

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

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



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

示例1: motors_init

void motors_init()
{
  PIO_Configure(&pin_m0_en, 1);
  PIO_Configure(&pin_m1_en, 1);
  PIO_Configure(&pin_m2_en, 1);
  PIO_Configure(&pin_m_brake, 1);
  PIO_Configure(&pin_m0_dir, 1);
  PIO_Configure(&pin_m1_dir, 1);
  PIO_Configure(&pin_m2_dir, 1);
  PMC_EnablePeripheral(ID_PWM); // power up pwm controller plz
  PIO_Configure(&pin_m0_vref, 1); // PWML0
  PIO_Configure(&pin_m1_vref, 1); // PWMH1
  PIO_Configure(&pin_m2_vref, 1); // PWMH3
  PWM->PWM_CH_NUM[0].PWM_CMR = 0; // pass-through divider. 64 MHz clock.
  PWM->PWM_CH_NUM[0].PWM_CPRD = 255; // 8-bit current control, 125 kHz cycle 
  PWM->PWM_CH_NUM[0].PWM_CDTY = 0; // zero duty for now
  PWM->PWM_CH_NUM[1].PWM_CMR = 0; 
  PWM->PWM_CH_NUM[1].PWM_CPRD = 255; 
  PWM->PWM_CH_NUM[1].PWM_CDTY = 255;
  PWM->PWM_CH_NUM[3].PWM_CMR = 0;
  PWM->PWM_CH_NUM[3].PWM_CPRD = 255;
  PWM->PWM_CH_NUM[3].PWM_CDTY = 255;
  PWM->PWM_ENA = 0xb; // enable channels 0,1,3
  PIO_Set(&pin_m_brake);
  PIO_Set(&pin_m0_en);
  PIO_Set(&pin_m1_en);
  PIO_Set(&pin_m2_en);
}
开发者ID:jinpyojeon,项目名称:TRIN_EARL,代码行数:28,代码来源:motors.c


示例2: 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


示例3: 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:olivierschonken,项目名称:sam3x_bootloader,代码行数:33,代码来源:lcdd.c


示例4: vMBPortSerialEnable

void
vMBPortSerialEnable( BOOL xRxEnable, BOOL xTxEnable )
{

    if( xRxEnable )
    {
        USART_SetReceiverEnabled( xUSARTHWMappings[ucUsedPort].pUsart, 1 );
        USART_EnableIt( xUSARTHWMappings[ucUsedPort].pUsart, US_IDR_RXRDY );
    }
    else
    {
        USART_DisableIt( xUSARTHWMappings[ucUsedPort].pUsart, US_IDR_RXRDY );
        USART_SetReceiverEnabled( xUSARTHWMappings[ucUsedPort].pUsart, 0 );
    }

    if( xTxEnable )
    {
        if( NULL != xUSARTHWMappings[ucUsedPort].USARTNotREPin )
        {
            PIO_Set( xUSARTHWMappings[ucUsedPort].USARTNotREPin );
        }
        if( NULL != xUSARTHWMappings[ucUsedPort].USARTDEPin )
        {
            PIO_Set( xUSARTHWMappings[ucUsedPort].USARTDEPin );
        }
        USART_SetTransmitterEnabled( xUSARTHWMappings[ucUsedPort].pUsart, 1 );
        USART_EnableIt( xUSARTHWMappings[ucUsedPort].pUsart, US_IER_TXRDY );
        USART_DisableIt( xUSARTHWMappings[ucUsedPort].pUsart, US_IER_TXEMPTY );
    }
    else
    {
        USART_DisableIt( xUSARTHWMappings[ucUsedPort].pUsart, US_IDR_TXRDY );
        USART_EnableIt( xUSARTHWMappings[ucUsedPort].pUsart, US_IER_TXEMPTY );
    }
}
开发者ID:BackupTheBerlios,项目名称:freemodbus,代码行数:35,代码来源:portserial.c


示例5: motor_enaxis

void motor_enaxis(unsigned char axis, unsigned char en){
    switch(axis){
        case(0):
            if(!en)
                PIO_Set(&XEN);
            else
                PIO_Clear(&XEN);
            break;
        case(1):
            if(!en)
                PIO_Set(&YEN);
            else
                PIO_Clear(&YEN);
            break;
        case(2):
            if(!en)
                PIO_Set(&ZEN);
            else
                PIO_Clear(&ZEN);
            break;
        case(3):
            if(!en)
                PIO_Set(&E0EN);
            else
                PIO_Clear(&E0EN);
            break;
        case(4):
            if(!en)
                PIO_Set(&E1EN);
            else
                PIO_Clear(&E1EN);
            break;
    }
}
开发者ID:minimaster,项目名称:4pi,代码行数:34,代码来源:motoropts.c


示例6: vParTestSetLED

void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue )
{
    if( uxLED < partestNUM_LEDS ) {
        if( xValue ) {
            /* Turn the LED on. */
            portENTER_CRITICAL();
            {
                if( xLEDPins[ uxLED ].type == PIO_OUTPUT_0 ) {
                    PIO_Set( &( xLEDPins[ uxLED ]) );
                } else {
                    PIO_Clear( &( xLEDPins[ uxLED ] ) );
                }
            }
            portEXIT_CRITICAL();
        } else {
            /* Turn the LED off. */
            portENTER_CRITICAL();
            {
                if( xLEDPins[ uxLED ].type == PIO_OUTPUT_0 ) {
                    PIO_Clear( &( xLEDPins[ uxLED ] ) );
                } else {
                    PIO_Set( &( xLEDPins[ uxLED ] ) );
                }
            }
            portEXIT_CRITICAL();
        }
    }
}
开发者ID:peterliu2,项目名称:FreeRTOS,代码行数:28,代码来源:ParTest.c


示例7: 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


示例8: motor_setdir

void motor_setdir(unsigned char axis, unsigned char dir){
    switch(axis){
        case(0):
            if(dir)
                PIO_Set(&XDIR);
            else
                PIO_Clear(&XDIR);
            break;
        case(1):
            if(dir)
                PIO_Set(&YDIR);
            else
                PIO_Clear(&YDIR);
            break;
        case(2):
            if(dir)
                PIO_Set(&ZDIR);
            else
                PIO_Clear(&ZDIR);
            break;
        case(3):
            if(dir)
                PIO_Set(&E0DIR);
            else
                PIO_Clear(&E0DIR);
            break;
        case(4):
            if(dir)
                PIO_Set(&E1DIR);
            else
                PIO_Clear(&E1DIR);
            break;
    }
}
开发者ID:minimaster,项目名称:4pi,代码行数:34,代码来源:motoropts.c


示例9: GLCD_DisableController

//------------------------
//-------------------------------------------------------------------------------------------------
//
//-------------------------------------------------------------------------------------------------
void GLCD_DisableController(unsigned char controller)
{
switch(controller){
	case 0 : PIO_Set(&GLcdpins[4]); break;
	case 1 : PIO_Set(&GLcdpins[3]); break;
	}
}
开发者ID:naminic,项目名称:Grafical-Lcd-Arm,代码行数:11,代码来源:glcd.c


示例10: stepper_enable

void stepper_enable(void) {
	PIO_Set(&pin_reset);
	PIO_Clear(&pin_enable);
	PIO_Set(&pin_sleep);
	stepper_state = STEPPER_STATE_STOP;
	stepper_speedramp_state = STEPPER_SPEEDRAMP_STATE_STOP;
}
开发者ID:Nic2012,项目名称:stepper-brick,代码行数:7,代码来源:stepper.c


示例11: AD5206_sendbit

void AD5206_sendbit(unsigned char bit){
    volatile unsigned int uDummy;
    for (uDummy=0; uDummy<512; ++uDummy);
    PIO_Clear(&SCK);
    if(bit)
        PIO_Set(&MOSI);
    else
        PIO_Clear(&MOSI);
    for (uDummy=0; uDummy<512; ++uDummy);
    PIO_Set(&SCK);
}
开发者ID:minimaster,项目名称:4pi,代码行数:11,代码来源:motoropts.c


示例12: main

int main(void) {
	device_init();
	init_display();

	PIO_Set(&display_pins[0]);
	PIO_Clear(&display_pins[1]);
	PIO_Clear(&display_pins[2]);
	PIO_Set(&display_pins[3]);
	while(1){

	}
}
开发者ID:raviyellani,项目名称:alarm,代码行数:12,代码来源:main.c


示例13: motor_setopts

void motor_setopts(unsigned char axis, unsigned char ustepbits, unsigned char current){
    Pin MS1;
    Pin MS2;
    
    unsigned char channel;
    switch(axis){
        case 0:
            MS1=XMS1;
            MS2=XMS2;
            channel=3;
            break;
        case 1:
            MS1=YMS1;
            MS2=YMS2;
            channel=1;
            break;
        case 2:
            MS1=ZMS1;
            MS2=ZMS2;
            channel=0;
            break;
        case 3:
            MS1=E0MS1;
            MS2=E0MS2;
            channel=2;
            break;
        case 4:
            MS1=E1MS1;
            MS2=E1MS2;
            channel=5;
            break;
        case 6:
            ustepbits=4;
            channel=4;
            break;
        default:
            return;
    }
    if(ustepbits<4){
        if(ustepbits&1)
            PIO_Set(&MS1);
        else
            PIO_Clear(&MS1);
        if(ustepbits&2)
            PIO_Set(&MS2);
        else
            PIO_Clear(&MS2);
    }
    AD5206_setchan(channel,current);

	//printf("Setting channel %u to current value %u and ustep value %u\r\n",channel, current, ustepbits);
	
}
开发者ID:minimaster,项目名称:4pi,代码行数:53,代码来源:motoropts.c


示例14: lcd_putchar

// ============================================================================
void lcd_putchar(char ch)
{
        PIO_Set(&Lcdpins[0]);
	setD4567(ch);
        PIO_Set(&Lcdpins[1]);
	clcd_minDelay();
        PIO_Clear(&Lcdpins[1]);
	clcd_minDelay();
	setD4567(ch<<4);
        PIO_Set(&Lcdpins[1]);
	clcd_minDelay();
        PIO_Clear(&Lcdpins[1]);
	clcd_Delay();
}
开发者ID:naminic,项目名称:Arm-Alphanumeric-LCD,代码行数:15,代码来源:lcd4bit.c


示例15: lcd_command

// ============================================================================
void lcd_command(char cmd)	//Sends Command to LCD
{
        PIO_Clear(&Lcdpins[0]);
	setD4567(cmd);
        PIO_Set(&Lcdpins[1]);
	clcd_minDelay();
        PIO_Clear(&Lcdpins[1]);
	clcd_minDelay();
	setD4567(cmd<<4);
        PIO_Set(&Lcdpins[1]);
	clcd_minDelay();
        PIO_Clear(&Lcdpins[1]);
	clcd_Delay();
}
开发者ID:naminic,项目名称:Arm-Alphanumeric-LCD,代码行数:15,代码来源:lcd4bit.c


示例16: motor_setup

void motor_setup(){
    Pin MOTPINS[]={XMS1,XMS2,XEN,XSTEP,XDIR,YMS1,YMS2,YEN,YSTEP,YDIR,ZMS1,ZMS2,ZEN,ZSTEP,ZDIR,E0MS1,E0MS2,E0EN,E0STEP,E0DIR,E1MS1,E1MS2,E1EN,E1STEP,E1DIR,};
    PIO_Configure(MOTPINS,25);
    PIO_Set(&XEN);
    PIO_Set(&YEN);
    PIO_Set(&ZEN);
    PIO_Set(&E0EN);
    PIO_Set(&E1EN);
    AD5206_setup();
    int i;
    for(i=0;i<5;i++)
        motor_setopts(i,pa.axis_ustep[i],pa.axis_current[i]);
    printf("done setting up motors\r\n\n");
}
开发者ID:minimaster,项目名称:4pi,代码行数:14,代码来源:motoropts.c


示例17: GLCD_WriteData

//-------------------------------------
void GLCD_WriteData(unsigned char dataToWrite)
{
unsigned int byte;
DELAY() 	
PIO_Clear(&GLcdpins[2]);
PIO_Set(&GLcdpins[0]);	
byte = dataToWrite;
DATAPORT(byte);	
GLCD_EnableController(screen_x / 64);
PIO_Set(&GLcdpins[1]);
DELAY();	
PIO_Clear(&GLcdpins[1]);	
GLCD_DisableController(screen_x / 64);
screen_x++;
}
开发者ID:naminic,项目名称:Grafical-Lcd-Arm,代码行数:16,代码来源:glcd.c


示例18: sam3u_e4k_power

/*! \brief Enable or disable Power of E4K
 *  \param[in] e4k E4K reference
 *  \param[in] on Enable (1) or disable (0) Power
 */
void sam3u_e4k_power(struct e4k_state *e4k, int on)
{
	if (on)
		PIO_Set(&pin_pwdn);
	else
		PIO_Clear(&pin_pwdn);
}
开发者ID:JiaoXianjun,项目名称:osmo-sdr,代码行数:11,代码来源:tuner_e4k_transport.c


示例19: main

int main(void)
{
	/// Init DBGU
	TRACE_CONFIGURE(DBGU_STANDARD, 115200, BOARD_MCK);
	printf("-- %s: blink-interrupt Project with at91lib v%s --\n\r", BOARD_NAME, SOFTPACK_VERSION);
	printf("-- Compiled: %s %s --\n\r", __DATE__, __TIME__);

	/// Init PIOA & PIOB interrupt
	PIO_InitializeInterrupts(0);

	/// Init LED
	PIO_Configure(&pinLed, 1);
	TRACE_INFO("LED:\n\r");

	/// Configure and enable the interrupt
	PIO_ConfigureIt(&pinButton, (void (*)(const Pin *)) User_InterruptHandler);
	PIO_EnableIt(&pinButton);

	while (1)
	{
		PIO_Set(&pinLed);
		delay(1000);

		PIO_Clear(&pinLed);
		delay(1000);
	}
}
开发者ID:stormdesign,项目名称:netduino-native,代码行数:27,代码来源:blinkIT.c


示例20: set_pin

void set_pin(const Pin *pin, const uint8_t state)
{
  if (state)
    PIO_Set(pin);
  else
    PIO_Clear(pin);
}
开发者ID:jinpyojeon,项目名称:TRIN_EARL,代码行数:7,代码来源:strain.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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