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

C++ Chip_GPIO_SetPinState函数代码示例

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

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



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

示例1: rt_led_write

static rt_size_t rt_led_write(rt_device_t dev, rt_off_t pos,
                              const void *buffer, rt_size_t size)
{
    rt_ubase_t index = 0;
    rt_ubase_t nw = size;
    const rt_uint8_t *value = buffer;

    RT_ASSERT(dev == &led.parent);
    RT_ASSERT((pos + size) <= LED_NUM);
    for (index = 0; index < nw; index++)
    {
			if (*value > 0)
			{
				 //LPC_GPIO->CLR[led.ctrl[pos + index].port] |= (1 << led.ctrl[pos + index].num);
				 //LPC_GPIO->CLR[0] |= (1 << led.ctrl[pos + index].num);
				Chip_GPIO_SetPinState(LPC_GPIO, led.ctrl[pos + index].port, led.ctrl[pos + index].num, 0UL);
			}
			else
			{
				//LPC_GPIO->SET[led.ctrl[pos + index].port] |= (1 << led.ctrl[pos + index].num);
				//LPC_GPIO->SET[0] |= (1 << led.ctrl[pos + index].num);
				Chip_GPIO_SetPinState(LPC_GPIO, led.ctrl[pos + index].port, led.ctrl[pos + index].num, 1UL);
			}
		}
    
		return index;
}
开发者ID:Magicoe,项目名称:LPC54110_Audio,代码行数:27,代码来源:drv_led.c


示例2: main

/** \brief Main function
 *
 * This is the main entry point of the software.
 *
 * \returns 0
 *
 * \remarks This function never returns. Return value is only to avoid compiler
 *          warnings or errors.
 */
int main(void)
{
   /* perform the needed initialization here */
   
   boardInit();

   while(1) {
      
      /* add your code here */
      
      /* Read TEC1 */
      if( !(Chip_GPIO_ReadPortBit( LPC_GPIO_PORT, TEC1_GPIO, TEC1_PIN )) ){

         /* Write LED with 1 */
         Chip_GPIO_SetPinState( LPC_GPIO_PORT, gpioLed1.gpioNumber, gpioLed1.gpioPin, 1);   
         Chip_GPIO_SetPinState( LPC_GPIO_PORT, gpioLed2.gpioNumber, gpioLed2.gpioPin, 0);   
 

      } else{

         /* Write LED with 0 */
         Chip_GPIO_SetPinState( LPC_GPIO_PORT, gpioLed1.gpioNumber, gpioLed1.gpioPin, 0);   
         Chip_GPIO_SetPinState( LPC_GPIO_PORT, gpioLed2.gpioNumber, gpioLed2.gpioPin, 1);   
      }
   }
   
   return 0;
}
开发者ID:ernesto-g,项目名称:prog_up_entregas,代码行数:37,代码来源:main.c


示例3: rt_led_init

static rt_err_t rt_led_init(rt_device_t dev)
{
	/*led2 Blue:P0.31 ,led1 Green:P0.30 ,led0 Red:P0_29  P38,P32*/
	Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 29, (IOCON_FUNC0 | IOCON_MODE_PULLUP | IOCON_DIGITAL_EN));
	Chip_IOCON_PinMuxSet(LPC_IOCON, 1, 10, (IOCON_FUNC0 | IOCON_MODE_PULLUP | IOCON_DIGITAL_EN));
	Chip_IOCON_PinMuxSet(LPC_IOCON, 1,  9, (IOCON_FUNC0 | IOCON_MODE_PULLUP | IOCON_DIGITAL_EN));
	
  Chip_GPIO_SetPinDIROutput(LPC_GPIO, 0, 29);
  Chip_GPIO_SetPinState(LPC_GPIO, 0, 29, false);
	
  Chip_GPIO_SetPinDIROutput(LPC_GPIO, 1, 10);
  Chip_GPIO_SetPinState(LPC_GPIO, 1, 10, true);

  Chip_GPIO_SetPinDIROutput(LPC_GPIO, 1, 9);
  Chip_GPIO_SetPinState(LPC_GPIO, 1, 9, true);
	
	led.ctrl[0].num = 29;
	led.ctrl[0].port = 0;
	
	led.ctrl[1].num = 10;
	led.ctrl[1].port = 1;
	
	led.ctrl[2].num =  9;
	led.ctrl[2].port = 1;

	return RT_EOK;
	
}
开发者ID:Magicoe,项目名称:LPC54110_Audio,代码行数:28,代码来源:drv_led.c


示例4: W5500_Init

void W5500_Init()
{
	uint8_t memsize[2][8] = { { 2, 2, 2, 2, 2, 2, 2, 2 }, { 2, 2, 2, 2, 2, 2, 2, 2 } };

	Chip_GPIO_SetPinState(LPC_GPIO, 0, 2, true);	// SSEL(CS)

	Chip_GPIO_SetPinState(LPC_GPIO, 0, 22, false);	// N_RESET
	delay_cnt(1000);
	Chip_GPIO_SetPinState(LPC_GPIO, 0, 22, true);	// N_RESET

	reg_wizchip_cs_cbfunc(wizchip_select, wizchip_deselect);
	reg_wizchip_spi_cbfunc(wizchip_read, wizchip_write);
	reg_wizchip_spiburst_cbfunc(wizchip_readburst, wizchip_writeburst);

	/* wizchip initialize*/
	if (ctlwizchip(CW_INIT_WIZCHIP, (void*) memsize) == -1) {
		//printf("WIZCHIP Initialized fail.\r\n");
		while (1);
	}

	/* For Delay */
	delay_cnt(10000);

	setRCR(3);
}
开发者ID:Wiznet,项目名称:WIZ550S2E,代码行数:25,代码来源:sspHandler.c


示例5: get_ipmb_addr

uint8_t get_ipmb_addr( void )
{
    uint8_t ga0, ga1, ga2;
    uint8_t index;

    /* Set the test pin and read all GA pins */
    Chip_GPIO_SetPinState(LPC_GPIO, GA_TEST_PORT, GA_TEST_PIN, 1);

    /* when using NAMC-EXT-RTM at least 11 instruction cycles required
     *  to have correct GA value after GA_TEST_PIN changes */
    {
		uint8_t i;
		for (i = 0; i < GPIO_GA_DELAY; i++)
			asm volatile ("nop");
	}


    ga0 = Chip_GPIO_GetPinState(LPC_GPIO, GA0_PORT, GA0_PIN);
    ga1 = Chip_GPIO_GetPinState(LPC_GPIO, GA1_PORT, GA1_PIN);
    ga2 = Chip_GPIO_GetPinState(LPC_GPIO, GA2_PORT, GA2_PIN);

    /* Clear the test pin and see if any GA pin has changed is value,
     * meaning that it is unconnected */
    Chip_GPIO_SetPinState(LPC_GPIO, GA_TEST_PORT, GA_TEST_PIN, 0);

    /* when using NAMC-EXT-RTM at least 11 instruction cycles required
     *  to have correct GA value after GA_TEST_PIN changes */
    {
		uint8_t i;
		for (i = 0; i < GPIO_GA_DELAY; i++)
			asm volatile ("nop");
	}


    if ( ga0 != Chip_GPIO_GetPinState(LPC_GPIO, GA0_PORT, GA0_PIN) )
    {
        ga0 = UNCONNECTED;
    }

    if ( ga1 != Chip_GPIO_GetPinState(LPC_GPIO, GA1_PORT, GA1_PIN) )
    {
        ga1 = UNCONNECTED;
    }

    if ( ga2 != Chip_GPIO_GetPinState(LPC_GPIO, GA2_PORT, GA2_PIN) )
    {
        ga2 = UNCONNECTED;
    }

    /* Transform the 3-based code in a decimal number */
    index = (9 * ga2) + (3 * ga1) + (1 * ga0);

    if ( index >= IPMBL_TABLE_SIZE )
    {
        return 0;
    }

    return IPMBL_TABLE[index];
}
开发者ID:qermit,项目名称:afcipm,代码行数:59,代码来源:i2c.c


示例6: task_pwm

static void task_pwm() {
	while (1) {
		Chip_GPIO_SetPinState(LPC_GPIO, 2, 0, true);
		vTaskDelay(counter);
		Chip_GPIO_SetPinState(LPC_GPIO, 2, 0, false);
		vTaskDelay(20 - counter);
	}
}
开发者ID:damianpri,项目名称:RTOS-FreeRTOS,代码行数:8,代码来源:main.c


示例7: vBootSystem

static void vBootSystem(void* pvParameters) {
	int result;
	LOG_INFO("Wait for voltage stabilization");
	vTaskDelay(1000);

	{
		int sdcard_retry_limit = SDCARD_START_RETRY_LIMIT;
		while (sdcard_retry_limit > 0) {
			LOG_INFO("Attempting to mount FAT on SDCARD");
			result = f_mount(&root_fs, "0:", 1);
			if (result == FR_OK) {
				break;
			}
			Chip_GPIO_SetPinState(LPC_GPIO, 0, 20, !Chip_GPIO_GetPinState(LPC_GPIO, 0, 20));
			vTaskDelay(200);
			sdcard_retry_limit --;
		}
		if (sdcard_retry_limit == 0) {
			LOG_ERROR("SDCard Mount failed");
			exit_error(ERROR_CODE_SDCARD_MOUNT_FAILED);
		}

		Chip_GPIO_SetPinState(LPC_GPIO, 0, 20, false);
	}

	result = logging_init_persistent();
	if (result != 0) {
		exit_error(ERROR_CODE_SDCARD_LOGGING_INIT_FAILED);
	}

	LOG_INFO("Starting real tasks");

	xTaskCreate(vFlushLogs, (signed char *) "vFlushLogs",
				256, NULL, (tskIDLE_PRIORITY + 2), NULL);

	xTaskCreate(vLEDTask1, (signed char *) "vTaskLed1",
				256, NULL, (tskIDLE_PRIORITY + 1UL),
				(xTaskHandle *) NULL);

	/* LED2 toggle thread */
	xTaskCreate(vLEDTask2, (signed char *) "vTaskLed2",
				256, NULL, (tskIDLE_PRIORITY + 1UL),
				(xTaskHandle *) NULL);

	/* LED0 toggle thread */
	xTaskCreate(vLEDTask0, (signed char *) "vTaskLed0",
				configMINIMAL_STACK_SIZE, NULL, (tskIDLE_PRIORITY + 1UL),
				(xTaskHandle *) NULL);

	mutex_i2c = xSemaphoreCreateMutex();

	xTaskCreate(vBaro, (signed char*) "Baro", 256, NULL, (tskIDLE_PRIORITY + 1UL), NULL);
//	xTaskCreate(xRadio, (signed char*) "Radio", 256, NULL, (taskIDLE_PRIORITY + 1UL), NULL);

	LOG_INFO("Initialization Complete. Clock speed is %d", SystemCoreClock);
	vTaskSuspend(boot_handle);
}
开发者ID:jmeed,项目名称:teamRocket,代码行数:57,代码来源:freertos_blinky.c


示例8: Board_LED_Set

void Board_LED_Set(uint8_t LEDNumber, bool On)
{
	if (LEDNumber == 0) {
		Chip_GPIO_SetPinState(LPC_GPIO_PORT, LED1_GPIO_PORT_NUM, LED1_GPIO_BIT_NUM, (bool) !On);
	}
	else if (LEDNumber == 1) {
		Chip_GPIO_SetPinState(LPC_GPIO_PORT, LED2_GPIO_PORT_NUM, LED2_GPIO_BIT_NUM, (bool) !On);
	}
}
开发者ID:micromint,项目名称:LPCOpen-keil-lpc43xx,代码行数:9,代码来源:board.c


示例9: AVALON_LED_Rgb

void AVALON_LED_Rgb(unsigned int rgb, bool on)
{
	/* LED Level reversal ,and LEDs mutex light */

	switch (rgb) {
	case AVALON_LED_RED:
		Chip_GPIO_SetPinState(LPC_GPIO, 0, 8, (on ^ true));
		if (on) {
			Chip_GPIO_SetPinState(LPC_GPIO, 0, 9, on);
			Chip_GPIO_SetPinState(LPC_GPIO, 0, 11, on);
		}
		break;
	case AVALON_LED_GREEN:
		Chip_GPIO_SetPinState(LPC_GPIO, 0, 9, (on ^ true));
		if (on) {
			Chip_GPIO_SetPinState(LPC_GPIO, 0, 8, on);
			Chip_GPIO_SetPinState(LPC_GPIO, 0, 11, on);
		}
		break;
	case AVALON_LED_BLUE:
		Chip_GPIO_SetPinState(LPC_GPIO, 0, 11, (on ^ true));
		if (on) {
			Chip_GPIO_SetPinState(LPC_GPIO, 0, 8, on);
			Chip_GPIO_SetPinState(LPC_GPIO, 0, 9, on);
		}
		break;
	default:
		break;
	}
}
开发者ID:Canaan-Creative,项目名称:Avalon-USB-converter,代码行数:30,代码来源:avalon_led.c


示例10: AVALON_LED_Init

void AVALON_LED_Init(void)
{
	/* Set LED's GPIO High */
	Chip_GPIO_SetPinState(LPC_GPIO, 0, 8, true);
	Chip_GPIO_SetPinState(LPC_GPIO, 0, 9, true);
	Chip_GPIO_SetPinState(LPC_GPIO, 0, 11, true);

	Chip_GPIO_SetPinDIROutput(LPC_GPIO, 0, 8);
	Chip_GPIO_SetPinDIROutput(LPC_GPIO, 0, 9);
	Chip_GPIO_SetPinDIROutput(LPC_GPIO, 0, 11);
}
开发者ID:Canaan-Creative,项目名称:Avalon-USB-converter,代码行数:11,代码来源:avalon_led.c


示例11: Board_LED_Init

static void Board_LED_Init()
{
	/* Set LEDs as output */
    Chip_SCU_PinMuxSet(LED1_PIN_PORT_NUM, LED1_PIN_BIT_NUM, (SCU_PINIO_FAST | LED1_MODE_FUNC));
    Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, LED1_GPIO_PORT_NUM, LED1_GPIO_BIT_NUM);
    Chip_SCU_PinMuxSet(LED2_PIN_PORT_NUM, LED2_PIN_BIT_NUM, (SCU_PINIO_FAST | LED2_MODE_FUNC));
    Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, LED2_GPIO_PORT_NUM, LED2_GPIO_BIT_NUM);

    /* Set initial states to off (true to disable) */
    Chip_GPIO_SetPinState(LPC_GPIO_PORT, LED1_GPIO_PORT_NUM, LED1_GPIO_BIT_NUM, (bool) true);
    Chip_GPIO_SetPinState(LPC_GPIO_PORT, LED2_GPIO_PORT_NUM, LED2_GPIO_BIT_NUM, (bool) true);
}
开发者ID:micromint,项目名称:LPCOpen-keil-lpc43xx,代码行数:12,代码来源:board.c


示例12: gpioInit

/**
 * @brief GPIO initialization.
 */
void gpioInit(void) {
    //Chip_GPIO_Init(LPC_GPIO_PORT);
	Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 0, LCD_BACKLIGHT);
	Chip_GPIO_SetPinState(LPC_GPIO_PORT, 0, LCD_BACKLIGHT, 1);

	Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 0, RANGE_POWER_PIN);
	Chip_GPIO_SetPinState(LPC_GPIO_PORT, 0, RANGE_POWER_PIN, 0);

	Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 0, MoonLander_LED);
	Chip_GPIO_SetPinState(LPC_GPIO_PORT, 0, MoonLander_LED, 0);

	Chip_GPIO_SetPinDIRInput(LPC_GPIO_PORT, 0, SW_LEFT);
	Chip_GPIO_SetPinDIRInput(LPC_GPIO_PORT, 0, SW_RIGHT);
}
开发者ID:graycatlabs,项目名称:Bicorder,代码行数:17,代码来源:bicorder.c


示例13: Board_LED_Set

/* Sets the state of a board LED to on or off */
void Board_LED_Set(uint8_t LEDNumber, bool On)
{
    /* Must connect JP3 to see LED0 and JP4 to see LED1 */
    if (LEDNumber == 0) {
        Chip_GPIO_SetPinState(LPC_GPIO_PORT, LED0_PORT, LED0_PIN, On);
    }
}
开发者ID:dlang9159,项目名称:MCU_Test_MCore,代码行数:8,代码来源:board.c


示例14: Board_Init

/* Set up and initialize all required blocks and functions related to the
   board hardware */
void Board_Init(void)
{
	/* Sets up DEBUG UART */
	DEBUGINIT();

	/* Updates SystemCoreClock global var with current clock speed */
	SystemCoreClockUpdate();

	/* Initializes GPIO */
	Chip_GPIO_Init(LPC_GPIO_PORT);

	/* Setup GPIOs for USB demos */
	Chip_SCU_PinMuxSet(0x2, 6, (SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_FUNC4));			/* P2_6 USB1_PWR_EN, USB1 VBus function */
	Chip_SCU_PinMuxSet(0x2, 5, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC2));	/* P2_5 USB1_VBUS, MUST CONFIGURE THIS SIGNAL FOR USB1 NORMAL OPERATION */
	Chip_SCU_PinMuxSet(0x1, 7, (SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_FUNC4));			/* P1_7 USB0_PWR_EN, USB0 VBus function Xplorer */
	Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 5, 6);							/* GPIO5[6] = USB1_PWR_EN */
	Chip_GPIO_SetPinState(LPC_GPIO_PORT, 5, 6, true);							/* GPIO5[6] output high */

	/* Initialize LEDs */
	Board_LED_Init();
#if defined(USE_RMII)
	Chip_ENET_RMIIEnable(LPC_ETHERNET);
#else
	Chip_ENET_MIIEnable(LPC_ETHERNET);
#endif
}
开发者ID:micromint,项目名称:LPCOpen-keil-lpc43xx,代码行数:28,代码来源:board.c


示例15: SDCardSendCommand

int SDCardSendCommand(uint8_t command, uint32_t param, uint8_t crc, void* buffer, size_t recvSize) {
	Chip_GPIO_SetPinState(LPC_GPIO, 0, 2, !Chip_GPIO_GetPinState(LPC_GPIO, 0, 2));
	if (xTaskGetSchedulerState() == taskSCHEDULER_RUNNING)
		xSemaphoreTake(xMutexSDCard, portMAX_DELAY);
	int result = SDCARD_ERROR_GENERIC;
	int wait = SDCARD_SPI_MAX_WAIT;
	int i;
	uint8_t read = 0;
	uint8_t* data = (uint8_t*) buffer;
	command += 0x40;
	SDCardSetSS();
	for (i = 0; i < SDCARD_IDLE_PRE_WAIT_ATTEMPTS; i++) {
		if (spi_transceive_byte(SDCARD_SPI_DEVICE, 0xff) == 0xff) break;
	}

	result = SDCARD_ERROR_TRANSMIT_INTERRUPTED;

	CommandBuffer[0] = command;
	CommandBuffer[1] = param >> 24;
	CommandBuffer[2] = param >> 16;
	CommandBuffer[3] = param >> 8;
	CommandBuffer[4] = param;
	CommandBuffer[5] = (crc_crc7(CommandBuffer, 5) << 1) | 1;

	spi_transceive(SDCARD_SPI_DEVICE, CommandBuffer, 6);

	for (i = 0; i < 6; i++) {
		if (CommandBuffer[i] != 0xff) {
//			MSS_GPIO_set_output(MSS_GPIO_27, 0);
			__asm volatile ("nop");
//			MSS_GPIO_set_output(MSS_GPIO_27, 1);
			goto fail;
		}
	}
开发者ID:jmeed,项目名称:teamRocket,代码行数:34,代码来源:sdcard.c


示例16: main

void
main (void)
{
  volatile int i;

  SystemInit ();

  debug_init ();
#ifdef DEBUG_LEVEL
  debug_set_level (DEBUG_LEVEL);
#endif

  /* configure LED output */
  Chip_IOCON_PinMuxSet (LPC_IOCON, LED_STATUS_PIO, IOCON_MODE_INACT | IOCON_FUNC0);
  Chip_GPIO_SetPinDIROutput (LPC_GPIO, LED_STATUS_PORT, LED_STATUS_PIN);
  Chip_GPIO_SetPinState (LPC_GPIO, LED_STATUS_PORT, LED_STATUS_PIN, false);

  DBG_NEWLINE (DBG_LEVEL_INFO);
  DBG (DBG_LEVEL_INFO, "Debug test firmware (" __GIT_SHA1__ ")");
  DBG (DBG_LEVEL_INFO, "Compiled " __DATE__ " at " __TIME__ " on " __BUILD_HOSTNAME__ " using GCC " __VERSION__ " (%d.%d-%d)", __CS_SOURCERYGXX_MAJ__, __CS_SOURCERYGXX_MIN__, __CS_SOURCERYGXX_REV__);
  DBG (DBG_LEVEL_INFO, "MCU running at %d MHz", SystemCoreClock / 1000000);

  for (i = 0; i < 0x800000; i++);

  while (1) {
    /* toggle LED */
    Chip_GPIO_SetPinToggle (LPC_GPIO, LED_STATUS_PORT, LED_STATUS_PIN);

    DBG (DBG_LEVEL_INFO, "Hello world !!!");

    for (i = 0; i < 0x400000; i++);
  }
}
开发者ID:p0llux,项目名称:ham-relay,代码行数:33,代码来源:debug.c


示例17: Board_LED_Set

/* Sets the state of a board LED to on or off */
void Board_LED_Set(uint8_t LEDNumber, bool On)
{
	if (LEDNumber < MAXLEDS) {
		/* Toggle state, low is on, high is off */
		Chip_GPIO_SetPinState(LPC_GPIO, ledports[LEDNumber], ledpins[LEDNumber], !On);
	}
}
开发者ID:jmeed,项目名称:teamRocket,代码行数:8,代码来源:board.c


示例18: ciaaWriteOutput

uint32_t ciaaWriteOutput(uint32_t outputNumber, uint32_t value)
{
	Chip_GPIO_SetPinState(LPC_GPIO_PORT,
			outputs[outputNumber].port,
			outputs[outputNumber].bit,
			value);
	return 0;
}
开发者ID:cpantel,项目名称:ciaa,代码行数:8,代码来源:ciaaIO.c


示例19: QUICKJACK_IO_Init

/* NXP_Quick_Jack io initilize detect the mic&gnd */
void QUICKJACK_IO_Init(void)
{
	uint32_t MgAcmpOutVal;
	uint32_t i = 0;

	Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 0, MnGSWENAPINNUM);
	Chip_GPIO_SetPinState(LPC_GPIO_PORT, 0, MnGSWENAPINNUM, 1);

	Chip_IOCON_PinSetMode(LPC_IOCON, IOCON_PIO14, PIN_MODE_INACTIVE);
	Chip_GPIO_SetPinDIRInput(LPC_GPIO_PORT, 0, 14);
	
	Chip_IOCON_PinSetMode(LPC_IOCON, MnGACMPOUTPIN, PIN_MODE_INACTIVE);
	Chip_GPIO_SetPinDIRInput(LPC_GPIO_PORT, 0, MnGACMPOUTPINNUM);
	
	MgAcmpOutVal = Chip_GPIO_ReadPortBit(LPC_GPIO_PORT, 0, 6);
	
	for(i=0; i<5; i++) {																									/* waiting a while */
		__NOP();
	}
	
	while(MgAcmpOutVal!= Chip_GPIO_ReadPortBit(LPC_GPIO_PORT, 0, 6)) {
		for(i=0; i<5; i++) {																									/* waiting a while */
			__NOP();
		}
		MgAcmpOutVal = Chip_GPIO_ReadPortBit(LPC_GPIO_PORT, 0, 6);
		for(i=0; i<5; i++) {																									/* waiting a while */
			__NOP();
		}
	}
	
	/* configured analog switch selectable pin */
	Chip_IOCON_PinSetMode(LPC_IOCON, MnGSWSELPIN, PIN_MODE_INACTIVE);
	Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 0, MnGSWSELPINNUM);

	if(MgAcmpOutVal==0) {
		Chip_GPIO_SetPinState(LPC_GPIO_PORT, 0, MnGSWSELPINNUM, 1);
	}
	else {
		Chip_GPIO_SetPinState(LPC_GPIO_PORT, 0, MnGSWSELPINNUM, 0);
	}

	/* enabled analog switch enabled pin */
	Chip_IOCON_PinSetMode(LPC_IOCON, MnGSWENAPIN, PIN_MODE_INACTIVE);
	Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 0, MnGSWENAPINNUM);
	Chip_GPIO_SetPinState(LPC_GPIO_PORT, 0, MnGSWENAPINNUM, 0);
}
开发者ID:Silmac,项目名称:ModulAid,代码行数:47,代码来源:board.c


示例20: Board_Audio_CodecInit

/* Initialize Audio Codec */
static Status Board_Audio_CodecInit(int micIn)
{
	/* Reset UDA1380 on board NGX Xplorer */
	Chip_SCU_PinMuxSet(0x2, 10, (SCU_MODE_PULLUP | SCU_MODE_FUNC0));
	Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 0, 14);
	Chip_GPIO_SetPinState(LPC_GPIO_PORT, 0, 14, true);
	// delay 1us
	delay(100000);
	Chip_GPIO_SetPinState(LPC_GPIO_PORT, 0, 14, false);
	delay(100000);

	if (!UDA1380_Init(UDA1380_MIC_IN_LR & - (micIn != 0))) {
		return ERROR;
	}

	return SUCCESS;
}
开发者ID:epernia,项目名称:HVM,代码行数:18,代码来源:board.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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