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

C++ port_pin_set_output_level函数代码示例

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

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



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

示例1: hal_ctrlPinInit

/*==============================================================================
  hal_ctrlPinInit()
 =============================================================================*/
void * 	hal_ctrlPinInit(en_targetExtPin_t e_pinType)
{
	struct port_config pin_conf;
	port_get_config_defaults(&pin_conf);
	pinDesc_t * p_pin = NULL;
	
	/* Configure SPI interface */
	port_get_config_defaults(&pin_conf);

	switch (e_pinType){
		case E_TARGET_RADIO_RST:
			pin_conf.direction  = PORT_PIN_DIR_OUTPUT;
			port_pin_set_config(st_rst, &pin_conf);	//	RST_PIN
			port_pin_set_output_level(st_rst, true);	//	RST_PIN
			p_pin = &st_rst;
			break;
		case E_TARGET_RADIO_SLPTR:
			pin_conf.direction  = PORT_PIN_DIR_OUTPUT;
			port_pin_set_config(st_slp_tr, &pin_conf);	//	SLP_PIN
			port_pin_set_output_level(st_slp_tr, true);	//	SLP_PIN
			p_pin = &st_slp_tr;
			break;
		default:
			free(p_pin);
			break;
	}

	return p_pin;
} /* hal_ctrlPinInit */
开发者ID:kamejoko80,项目名称:emb6,代码行数:32,代码来源:target.c


示例2: SPI_Read_AD5421

void SPI_Read_AD5421(uint8_t* data)
{
	port_pin_set_output_level(PIN_PA18, 0);
	//spi_read_buffer_wait(&spi_master_instance_AD5421, data, 3, 0);
	spi_transceive_buffer_wait(&spi_master_instance_AD5421, data, data, 3);
	port_pin_set_output_level(PIN_PA18, 1);	
}
开发者ID:rmnsfx,项目名称:DVA141,代码行数:7,代码来源:main.c


示例3: SPI_Read_ADXL

void SPI_Read_ADXL(uint8_t* data)
{	
	port_pin_set_output_level(PIN_PA06, 0);
	//spi_read_buffer_wait(&spi_master_instance_ADXL, data, 2, 0);
	spi_transceive_buffer_wait(&spi_master_instance_ADXL, data, data, 2);
	port_pin_set_output_level(PIN_PA06, 1);
}
开发者ID:rmnsfx,项目名称:DVA141,代码行数:7,代码来源:main.c


示例4: ksz8851snl_hard_reset

/**
 * \internal
 * \brief Perform hardware reset of the PHY.
 */
static inline void ksz8851snl_hard_reset(void)
{
	/* Perform hardware reset with respect to the reset timing from the datasheet. */
	port_pin_set_output_level(KSZ8851SNL_RSTN_PIN, false);
	delay_ms(100);
	port_pin_set_output_level(KSZ8851SNL_RSTN_PIN, true);
	delay_ms(100);
}
开发者ID:ThucVD2704,项目名称:femto-usb-blink-example,代码行数:12,代码来源:ksz8851snl.c


示例5: led_set

/**
 * \brief Set LED0 on Xplained board on/off
 */
void led_set(bool state)
{
	if (state) {
		port_pin_set_output_level(LED_0_PIN, LED_0_ACTIVE);
	} else {
		port_pin_set_output_level(LED_0_PIN, LED_0_INACTIVE);
	}	
}
开发者ID:pthorod,项目名称:atmel_samd,代码行数:11,代码来源:leds.c


示例6: update_led_state

/* Updates the board LED to the current button state. */
static void update_led_state(void)
{
	bool pin_state = port_pin_get_input_level(BUTTON_0_PIN);
	if (pin_state) {
		port_pin_set_output_level(LED_0_PIN, LED_0_INACTIVE);
	} else {
		port_pin_set_output_level(LED_0_PIN, LED_0_ACTIVE);
	}
}
开发者ID:jkman357,项目名称:samd21-gpio-spi,代码行数:10,代码来源:main.c


示例7: nm_bsp_reset

/**
 *	@fn		nm_bsp_reset
 *	@brief	Reset NMC1500 SoC by setting CHIP_EN and RESET_N signals low,
 *           CHIP_EN high then RESET_N high
 */
void nm_bsp_reset(void)
{
	port_pin_set_output_level(CONF_WINC_PIN_CHIP_ENABLE, false);
	port_pin_set_output_level(CONF_WINC_PIN_RESET, false);
	nm_bsp_sleep(100);
	port_pin_set_output_level(CONF_WINC_PIN_CHIP_ENABLE, true);
	nm_bsp_sleep(100);
	port_pin_set_output_level(CONF_WINC_PIN_RESET, true);
	nm_bsp_sleep(100);
}
开发者ID:malachi-iot,项目名称:asf,代码行数:15,代码来源:nm_bsp_saml22.c


示例8: leds_arch_set

void
leds_arch_set(unsigned char new_led_status)
{
  led_status = new_led_status;
  if (led_status & LEDS_GREEN) {
    port_pin_set_output_level(LED_0_PIN, LED_0_ACTIVE);
  } else {
    port_pin_set_output_level(LED_0_PIN, LED_0_INACTIVE);
  }
}
开发者ID:EasyRF,项目名称:contiki,代码行数:10,代码来源:leds-arch.c


示例9: RH

//------------  --------------------
//-----湿度读取子程序 ------------
//----------------------  ----------
//----以下变量均为全局变量--------
//----温度高8位== U8T_data_H------
//----温度低8位== U8T_data_L------
//----湿度高8位== U8RH_data_H-----
//----湿度低8位== U8RH_data_L-----
//----校验 8位 == U8checkdata-----
//----调用相关子程序如下----------
//---- delay_us();, delay_ms();COM();
//---------------------    -----------
void RH(void)
{
	//主机拉低18ms
	port_pin_set_config(DATA, &pinc);
	port_pin_set_output_level(DATA, false);
	delay_ms(18);
	port_pin_set_output_level(DATA, true);
	//总线由上拉电阻拉高 主机延时20us
	delay_us(20);
	//主机设为输入 判断从机响应信号
	port_pin_set_output_level(DATA, true);
	port_pin_set_config(DATA, &pini);
	//判断从机是否有低电平响应信号 如不响应则跳出,响应则向下运行
	
	if(!port_pin_get_input_level(DATA)) //T !
	{
		U8FLAG=2;
		//判断从机是否发出 80us 的低电平响应信号是否结束
		
		while((!port_pin_get_input_level(DATA))&&U8FLAG++);
		U8FLAG=2;
		
		//判断从机是否发出 80us 的高电平,如发出则进入数据接收状态
		while((port_pin_get_input_level(DATA))&&U8FLAG++);
		//数据接收状态
		Run_COM();
		
		U8RH_data_H_temp=U8comdata;
		Run_COM();
		U8RH_data_L_temp=U8comdata;
		Run_COM();
		U8T_data_H_temp=U8comdata;
		Run_COM();
		U8T_data_L_temp=U8comdata;
		Run_COM();
		U8checkdata_temp=U8comdata;
		port_pin_set_config(DATA, &pinc);
		port_pin_set_output_level(DATA, true);
		//数据校验
		
		U8Temp=(U8T_data_H_temp+U8T_data_L_temp+U8RH_data_H_temp+U8RH_data_L_temp);
		
		if(U8Temp==U8checkdata_temp)
		{
			
			U8RH_data_H=U8RH_data_H_temp;
			U8RH_data_L=U8RH_data_L_temp;
			U8T_data_H=U8T_data_H_temp;
			U8T_data_L=U8T_data_L_temp;
			U8checkdata=U8checkdata_temp;
			
		}//fi
	}//fi
}
开发者ID:agdhun,项目名称:Multifrt,代码行数:66,代码来源:dht11.c


示例10: rf212_init

/**
 * \brief      Init the radio
 * \return     Returns success/fail
 * \retval 0   Success
 */
static int
rf212_init(void)
{
  volatile uint8_t regtemp;
   uint8_t radio_state;  /* don't optimize this away, it's important */
  //uint8_t temp;
  PRINTF("RF212: init.\n");

  /* init SPI and GPIOs, wake up from sleep/power up. */
  //rf212_arch_init();
  trx_spi_init();
 
  /* reset will put us into TRX_OFF state */
  /* reset the radio core */
  port_pin_set_output_level(AT86RFX_RST_PIN, false);
  delay_cycles_ms(1);
  port_pin_set_output_level(AT86RFX_RST_PIN, true);
  
  port_pin_set_output_level(AT86RFX_SLP_PIN, false); /*wakeup from sleep*/

  /* before enabling interrupts, make sure we have cleared IRQ status */
  regtemp = trx_reg_read(RF212_REG_IRQ_STATUS);
  printf("After wake from sleep\n");
  radio_state = rf212_status();
  printf("After arch read reg: state 0x%04x\n", radio_state);
 
  /* Assign regtemp to regtemp to avoid compiler warnings */
  regtemp = regtemp;
if(radio_state == STATE_P_ON) {
	trx_reg_write(RF212_REG_TRX_STATE, TRXCMD_TRX_OFF);
	}  
  trx_irq_init((FUNC_PTR)rf212_interrupt_poll);
  ENABLE_TRX_IRQ();  
  system_interrupt_enable_global();
  /* Configure the radio using the default values except these. */
  trx_reg_write(RF212_REG_TRX_CTRL_1,      RF212_REG_TRX_CTRL_1_CONF);
  trx_reg_write(RF212_REG_PHY_CC_CCA,      RF212_REG_PHY_CC_CCA_CONF);
  trx_reg_write(RF212_REG_PHY_TX_PWR_CONF, RF212_REG_PHY_TX_PWR_CONF);
  //temp = rf212_arch_read_reg(RF212_REG_TRX_CTRL_2);
  trx_reg_write(RF212_REG_TRX_CTRL_2, RF212_REG_TRX_CTRL_2_CONF);
  trx_reg_write(RF212_REG_IRQ_MASK,        RF212_REG_IRQ_MASK_CONF);
#if HW_CSMA_FRAME_RETRIES
  trx_bit_write(SR_MAX_FRAME_RETRIES, 3);
  trx_bit_write(SR_MAX_CSMA_RETRIES, 4);
#else  
  trx_bit_write(SR_MAX_FRAME_RETRIES, 0);
  trx_bit_write(SR_MAX_CSMA_RETRIES, 7);
#endif  
  SetPanId(IEEE802154_CONF_PANID);
  rf_generate_random_seed();
  /* start the radio process */
  process_start(&rf212_radio_process, NULL);
  return 0;
}
开发者ID:songjw0820,项目名称:contiki_atmel,代码行数:59,代码来源:rf212b.c


示例11: write_buffer

/*---------------------------------------------------------------------------*/
static int
write_buffer(const unsigned char * buffer, uint8_t len)
{
  port_pin_set_output_level(RS485_TXE, true);
  if (usart_write_buffer_wait(&usart_instance, buffer, len) == STATUS_OK) {
    port_pin_set_output_level(RS485_TXE, false);
    return len;
  } else {
    return -1;
  }
}
开发者ID:EasyRF,项目名称:contiki,代码行数:12,代码来源:uart_rs485.c


示例12: write_byte

/*---------------------------------------------------------------------------*/
static int
write_byte(const unsigned char b)
{
  port_pin_set_output_level(RS485_TXE, true);
  if (usart_write_wait(&usart_instance, b) == STATUS_OK) {
    port_pin_set_output_level(RS485_TXE, false);
    return 1;
  } else {
    return -1;
  }
}
开发者ID:EasyRF,项目名称:contiki,代码行数:12,代码来源:uart_rs485.c


示例13: nm_bsp_deinit

/**
 *	@fn		nm_bsp_deinit
 *	@brief	De-iInitialize BSP
 *	@return	0 in case of success and -1 in case of failure
 */
sint8 nm_bsp_deinit(void)
{
	struct port_config pin_conf;
	port_get_config_defaults(&pin_conf);
	/* Configure control pins as input no pull up. */
	pin_conf.direction  = PORT_PIN_DIR_INPUT;
	pin_conf.input_pull = PORT_PIN_PULL_NONE;
	port_pin_set_output_level(CONF_WINC_PIN_CHIP_ENABLE, false);
	port_pin_set_output_level(CONF_WINC_PIN_RESET, false);
	port_pin_set_config(CONF_WINC_SPI_INT_PIN, &pin_conf);
	return M2M_SUCCESS;
}
开发者ID:malachi-iot,项目名称:asf,代码行数:17,代码来源:nm_bsp_saml22.c


示例14: _hal_ledInit

void _hal_ledInit( void )
{
    struct port_config pin_conf;
    port_get_config_defaults(&pin_conf);

    /* Configure LEDs as outputs, turn them off */
    pin_conf.direction = PORT_PIN_DIR_OUTPUT;
    port_pin_set_config(LED_0_PIN, &pin_conf);
    port_pin_set_output_level(LED_0_PIN, LED_0_INACTIVE);
    port_pin_set_config(LED_1_PIN, &pin_conf);
    port_pin_set_output_level(LED_1_PIN, LED_1_INACTIVE);
    port_pin_set_config(LED_2_PIN, &pin_conf);
    port_pin_set_output_level(LED_2_PIN, LED_2_INACTIVE);
}
开发者ID:lucasmarwagner,项目名称:emb-6_dtls,代码行数:14,代码来源:samd21.c


示例15: init_chip_pins

/*
 *	@fn		init_chip_pins
 *	@brief	Initialize reset, chip enable and wake pin
 */
static void init_chip_pins(void)
{
	struct port_config pin_conf;

	port_get_config_defaults(&pin_conf);

	/* Configure control pins as output. */
	pin_conf.direction  = PORT_PIN_DIR_OUTPUT;
	port_pin_set_config(CONF_WINC_PIN_RESET, &pin_conf);
	port_pin_set_config(CONF_WINC_PIN_CHIP_ENABLE, &pin_conf);
	port_pin_set_config(CONF_WINC_PIN_WAKE, &pin_conf);
	port_pin_set_output_level(CONF_WINC_PIN_CHIP_ENABLE, false);
	port_pin_set_output_level(CONF_WINC_PIN_RESET, false);
}
开发者ID:malachi-iot,项目名称:asf,代码行数:18,代码来源:nm_bsp_saml22.c


示例16: led_task

static void led_task (void *pvParameters)
{
	(void)pvParameters;

	for(;;)
	{
		
		vTaskDelay( 1000 );
		port_pin_set_output_level(LED_0_PIN, LED_0_ACTIVE);
		vTaskDelay( 1000 );
		port_pin_set_output_level(LED_0_PIN, LED_0_INACTIVE);
	}
	/* Should never go there */
	vTaskDelete(worker1_id);
}
开发者ID:navinars,项目名称:etz-main,代码行数:15,代码来源:main.c


示例17: main

/**
 * \brief Application entry point.
 *
 * \return Unused (ANSI-C compatibility).
 */
int main(void)
{
	//SystemInit();
	
	// Set the registers for input and output
	board_led_setup();
	
	system_init();
	
	port_pin_set_output_level(LED_DEBUG, false);
	
	while ( !system_clock_source_is_ready(SYSTEM_CLOCK_SOURCE_DPLL) ) {
	}
	

	/* Initialize the SAM system */
	
	// TCC Configuration
	tcc_configure_function();		// Counter Configuration
	tcc_callback_configuration();	// Timer Callback Configuration
	
	// Run SERCOM Setup
	bastian_complete_sercom_setup();	

	system_interrupt_enable_global();	// Enable all sources of interrupt
	//spi_transceive_buffer_job(&spi_slave, slave_empty_response_buffer, slave_rx_buffer, SYSTEM_SLAVE_RX_BYTES_TO_RECEIVE);
	// Send IrDA data only once
	//
	//usart_read_buffer_job(&irda_master, slave_rx_buffer, 1);	// Read only one character
	
    while (1) {
		//usart_read_buffer_job(&irda_master, slave_rx_buffer, 1);	// Read only one character	
		
    }
}
开发者ID:afvasquez,项目名称:LM_CBSS_Slat_Source,代码行数:40,代码来源:main.c


示例18: main

int main(void)
{
//! [main_setup]
//! [system_init]
	system_init();
//! [system_init]
//! [run_config]
	configure_spi_master();
//! [run_config]
//! [main_setup]

//! [main_use_case]
//! [inf_loop]
	while (true) {
		/* Infinite loop */
		if(!port_pin_get_input_level(BUTTON_0_PIN)) {
			//! [select_slave]
			spi_select_slave(&spi_master_instance, &slave, true);
			//! [select_slave]
			//! [write]
			spi_write_buffer_wait(&spi_master_instance, buffer, BUF_LENGTH);
			//! [write]
			//! [deselect_slave]
			spi_select_slave(&spi_master_instance, &slave, false);
			//! [deselect_slave]
			//! [light_up]
			port_pin_set_output_level(LED_0_PIN, LED0_ACTIVE);
			//! [light_up]
		}
	}
//! [inf_loop]
//! [main_use_case]
}
开发者ID:InSoonPark,项目名称:asf,代码行数:33,代码来源:qs_spi_master_basic.c


示例19: open

/*---------------------------------------------------------------------------*/
static int
open(int32_t baudrate, uart_rx_char_callback char_cb, uart_rx_frame_callback frame_cb)
{
  struct usart_config config_usart;
  struct port_config pin_conf;

  usart_get_config_defaults(&config_usart);

  config_usart.baudrate    = baudrate;
  config_usart.mux_setting = RS485_SERCOM_MUX_SETTING;
  config_usart.pinmux_pad0 = RS485_SERCOM_PINMUX_PAD0;
  config_usart.pinmux_pad1 = RS485_SERCOM_PINMUX_PAD1;
  config_usart.pinmux_pad2 = RS485_SERCOM_PINMUX_PAD2;
  config_usart.pinmux_pad3 = RS485_SERCOM_PINMUX_PAD3;

  while (usart_init(&usart_instance, RS485_MODULE, &config_usart) != STATUS_OK) {}

  usart_enable(&usart_instance);

  port_get_config_defaults(&pin_conf);
  pin_conf.direction = PORT_PIN_DIR_OUTPUT;
  port_pin_set_config(RS485_TXE, &pin_conf);
  port_pin_set_output_level(RS485_TXE, false);

  char_callback = char_cb;

  usart_register_callback(&usart_instance,
                          usart_read_callback, USART_CALLBACK_BUFFER_RECEIVED);

  usart_enable_callback(&usart_instance, USART_CALLBACK_BUFFER_RECEIVED);

  usart_read_job(&usart_instance, &rx_char);

  return 1;
}
开发者ID:EasyRF,项目名称:contiki,代码行数:36,代码来源:uart_rs485.c


示例20: IIC_Init

static void IIC_Init(void)
{
	IIC_SCL(1);
	IIC_SDA(1);
	
	port_get_config_defaults(&pin_clk);
	pin_clk.direction = PORT_PIN_DIR_OUTPUT;	
	port_pin_set_config(PIN_I2C_CLK, &pin_clk);
	port_pin_set_output_level(PIN_I2C_CLK, 1);

	port_get_config_defaults(&pin_data);
	pin_data.direction = PORT_PIN_DIR_OUTPUT;	
	port_pin_set_config(PIN_I2C_DATA, &pin_clk);
	port_pin_set_output_level(PIN_I2C_DATA, 1);
	
}
开发者ID:jkman357,项目名称:samd21-gpio-spi,代码行数:16,代码来源:main.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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