Beispiel #1
0
void clock(u8 phase) {
	static u8 i;

	if(phase) {
		gpio_set_gpio_pin(B10);

		// clear last round
		for(i=0;i<8;i++)
			m.triggers[i] = 0;

		// main
		if(!m.freezes[0])
			cascades_trigger(0);

		// ensure bounds, output triggers
		for(i=0;i<8;i++) {
			if(m.positions[i] < 0)
				m.positions[i] = 0;
			else if(m.positions[i] > m.points[i])
				m.positions[i] = m.points[i];

			// send out
			if(m.triggers[i] && !m.mutes[i])
				gpio_set_gpio_pin(outs[i]);
		}

		monomeFrameDirty++;
	}
	else {
		for(i=0;i<8;i++) gpio_clr_gpio_pin(outs[i]);

		gpio_clr_gpio_pin(B10);
 	}
}
/*! \brief Led Task to scroll led before reset
 */
void led_task()
{
  switch(step_led_task)
  {
    case 0:
      gpio_clr_gpio_pin(LED1_GPIO);
      gpio_set_gpio_pin(LED2_GPIO);
      gpio_set_gpio_pin(LED3_GPIO);
      step_led_task=1;
      cpu_delay_ms(300,FOSC0);
      break;
    case 1:
      gpio_set_gpio_pin(LED1_GPIO);
      gpio_clr_gpio_pin(LED2_GPIO);
      gpio_set_gpio_pin(LED3_GPIO);
      step_led_task=2;
      cpu_delay_ms(300,FOSC0);
      break;
    case 2:
      gpio_set_gpio_pin(LED1_GPIO);
      gpio_set_gpio_pin(LED2_GPIO);
      gpio_clr_gpio_pin(LED3_GPIO);
      step_led_task=0;
      cpu_delay_ms(300,FOSC0);
      break;
    default :
      gpio_clr_gpio_pin(LED1_GPIO);
      gpio_set_gpio_pin(LED2_GPIO);
      gpio_set_gpio_pin(LED3_GPIO);
      step_led_task=1;
      cpu_delay_ms(300,FOSC0);
      break;
  }
}
	void display(volatile int32_t numero){//muestra numero en los leds
	int8_t numerox = (int8_t)numero;
	if (numerox & (1 << 0)) //checa el bit0
	{
		gpio_clr_gpio_pin(LED3_GPIO);
	}else{
		gpio_set_gpio_pin(LED3_GPIO);
		
	}
	if (numerox & (1 << 1)) //checa el bit0
	{
		gpio_clr_gpio_pin(LED2_GPIO);
		}else{
		gpio_set_gpio_pin(LED2_GPIO);
		
	}
	if (numerox & (1<<2)) //checa el bit0
	{
		gpio_clr_gpio_pin(LED1_GPIO);
		}else{
		gpio_set_gpio_pin(LED1_GPIO);
		
	}
	if (numerox & (1<<3)) //checa el bit0
	{
		gpio_clr_gpio_pin(LED0_GPIO);
		}else{
		gpio_set_gpio_pin(LED0_GPIO);
		
	}
	
	
	
	}
unsigned int FC_startup_h2(void)
{
	unsigned int fc_state;
	
	//open h2 valve
	gpio_set_gpio_pin(H2_VALVE);
	//purge valve closed
	gpio_clr_gpio_pin(PURGE_VALVE);
	//relays open
	gpio_clr_gpio_pin(START_RELAY);
	gpio_clr_gpio_pin(MOTOR_RELAY);
	gpio_clr_gpio_pin(RES_RELAY);
	gpio_clr_gpio_pin(CAP_RELAY);
	
	//input h2 until voltage reaches 30
	if ((get_FCVOLT() < 30000)|(millis()-start_delay<1000)) //if voltage is less than 30V
	{
		//keep the hydrogen coming
		fc_state = FC_STATE_STARTUP_H2;
	}
	else
	{
		//voltage is 30 then go to start up purge
		fc_state = FC_STATE_STARTUP_PURGE;
	}
	return(fc_state);
}
Beispiel #5
0
/** \brief Drive Y lines to ground. */
static void inline rtouch_ground_y_surface(void)
{
	gpio_enable_gpio_pin(rtouch_gpio_ymap[1].pin);
	gpio_enable_gpio_pin(rtouch_gpio_ymap[0].pin);

	gpio_clr_gpio_pin(rtouch_gpio_ymap[0].pin);
	gpio_clr_gpio_pin(rtouch_gpio_ymap[1].pin);
}
unsigned int FC_standby(void)
{
	unsigned int fc_state;
	if (gpio_get_pin_value(START))
	{
		fc_state = FC_STATE_STARTUP_FANS;
		gpio_clr_gpio_pin(LED_STOP);
		gpio_set_gpio_pin(LED_START);
	}
	else
	{
		//make sure fuel cell stays off
		//Supply valve closed
		gpio_clr_gpio_pin(H2_VALVE);
		//purge valve closed
		gpio_clr_gpio_pin(PURGE_VALVE);
		//relays open
		gpio_clr_gpio_pin(MOTOR_RELAY);
		gpio_clr_gpio_pin(RES_RELAY);
		gpio_clr_gpio_pin(CAP_RELAY);
		//led's off
		gpio_clr_gpio_pin(LED_RUN);
		gpio_clr_gpio_pin(LED_START);
		gpio_clr_gpio_pin(LED_STOP);
		//fan low
		FANUpdate(0);
		fc_state = FC_STATE_STANDBY;
	}
	return(fc_state);
}
//! @brief Get data report from Host
//!
void hid_report_out(void)
{
  int led_number;
  int led_state;

   if(Is_usb_out_received(EP_HID_GENERIC_OUT))
   {
      Usb_reset_endpoint_fifo_access(EP_HID_GENERIC_OUT);
      memset(rxbuf, 0, RXBUF_SIZE);
      usb_read_ep_rxpacket(EP_HID_GENERIC_OUT, &rxbuf, RXBUF_SIZE, NULL);
      Usb_ack_out_received_free(EP_HID_GENERIC_OUT);
      // The Data has been read and stored in rxbuf

      led_state      = rxbuf[0]&0x0F; // RepportOUT[0] is LEDS value
      led_number     = rxbuf[1]&0x0F;
      switch (led_number)
      {
         case 1:
            if(led_state)
            {   gpio_clr_gpio_pin(LED0_GPIO);   }
            else { gpio_set_gpio_pin(LED0_GPIO);}
            break;
         case 2:
            if(led_state)
            {   gpio_clr_gpio_pin(LED1_GPIO);   }
            else { gpio_set_gpio_pin(LED1_GPIO);}
            break;
         case 3:
            if(led_state)
            {   gpio_clr_gpio_pin(LED2_GPIO);   }
            else { gpio_set_gpio_pin(LED2_GPIO);}
            break;
         case 4:
            if(led_state)
            {   gpio_clr_gpio_pin(LED3_GPIO);   }
            else { gpio_set_gpio_pin(LED3_GPIO);}
            break;
      }

   }

   //** Check if we received DFU mode command from host
   if(jump_bootloader)
   {
      uint32_t volatile tempo;
      gpio_set_gpio_pin(LED0_GPIO);
      gpio_set_gpio_pin(LED1_GPIO);
      gpio_set_gpio_pin(LED2_GPIO);
      gpio_set_gpio_pin(LED3_GPIO);
      Usb_detach();                          // Detach actual generic HID application
      for(tempo=0;tempo<70000;tempo++);      // Wait some time before
      //start_boot();                          // Jumping to bootloader
      while(1);
   }
}
unsigned int FC_startup_purge(void)
{
	unsigned int fc_state;
	
	//h2 valve still open
	gpio_set_gpio_pin(H2_VALVE);
	//close startup relay
	if((gpio_get_gpio_pin_output_value(RES_RELAY)|gpio_get_gpio_pin_output_value(CAP_RELAY))==0)
		{
			gpio_set_gpio_pin(START_RELAY);
		}
	//motor relay still open
	gpio_clr_gpio_pin(MOTOR_RELAY);
	//RES relay open
	gpio_clr_gpio_pin(RES_RELAY);
	//CAP relay still open
	gpio_clr_gpio_pin(CAP_RELAY);
	
	//open purge valve and start timer
	if(gpio_get_gpio_pin_output_value(PURGE_VALVE) == 0)
	{
		purge_timer = millis();
	}

	gpio_set_gpio_pin(PURGE_VALVE);
	gpio_set_gpio_pin(LED0);
	
	//balazs has pseudo code purge for 3 seconds
	if(millis() - purge_timer < 3000)
	{
		fc_state = FC_STATE_STARTUP_PURGE;
	}
	else //3 seconds are over
	{
		//close purge valve
		gpio_clr_gpio_pin(PURGE_VALVE);
		gpio_clr_gpio_pin(LED0);
		
		//supply valve still open
		gpio_set_gpio_pin(H2_VALVE);
		
		//open start up relay
		gpio_clr_gpio_pin(START_RELAY);
		
		//other relays still open
		gpio_clr_gpio_pin(RES_RELAY);
		gpio_clr_gpio_pin(MOTOR_RELAY);
		gpio_clr_gpio_pin(CAP_RELAY);
		
		delay_timer1 = millis(); //reset delay timer to have delay at start of charge
		
		repress_delay = millis();
		//go to repressurized delay
		fc_state = FC_STATE_REPRESSURIZE;
	}
	return(fc_state);
}
void sys_clk_gen_start(void)
{
#if UC3L
#ifdef DEBUG_ON
  if(conf_clocks_uc3l())
  {
    gpio_clr_gpio_pin(LED0_GPIO); gpio_clr_gpio_pin(LED1_GPIO);
    gpio_clr_gpio_pin(LED2_GPIO); gpio_clr_gpio_pin(LED3_GPIO);
    while(1); // ERROR
  }
#else
  conf_clocks_uc3l();
#endif
#elif UC3A || UC3B || UC3C
#ifdef DEBUG_ON
  if(conf_clocks_uc3_extosc0())
  {
    gpio_clr_gpio_pin(LED0_GPIO); gpio_clr_gpio_pin(LED1_GPIO);
    gpio_clr_gpio_pin(LED2_GPIO); gpio_clr_gpio_pin(LED3_GPIO);
    while(1); // ERROR
  }
#else
  conf_clocks_uc3_extosc0();
#endif
#endif
}
unsigned int FC_shutdown(void)
{
	unsigned int fc_state;
	gpio_clr_gpio_pin(LED_START);
	gpio_clr_gpio_pin(LED_RUN);
	gpio_set_gpio_pin(LED_STOP);
	//close valves
	gpio_clr_gpio_pin(H2_VALVE);
	gpio_clr_gpio_pin(PURGE_VALVE);
	//close relays
	gpio_clr_gpio_pin(MOTOR_RELAY);
	gpio_clr_gpio_pin(START_RELAY);
	gpio_clr_gpio_pin(RES_RELAY);
	gpio_clr_gpio_pin(CAP_RELAY);
	//fans to max
	FANUpdate(1024);	
	if(0)
	{
		//option of leaving shutdown state and restarting
		fc_state = FC_STATE_STANDBY;
	}
	else
	{
		fc_state = FC_STATE_SHUTDOWN;
	}
	return(fc_state);
}
Beispiel #11
0
/** \brief Drive X lines to ground. */
static void inline rtouch_ground_x_surface(void)
{
	/* To avoid a spike due to a Y-surface that is tristated and
	 * X-surface that was gradiented we need to set XH as input first.
	 * Otherwise the voltage on the signal line will rise to VDD. This is
	 * not an issue to the measurement but it helps to let the signal look
	 * nice and thus we perhaps improve the EMI a bit. */
	gpio_enable_gpio_pin(rtouch_gpio_xmap[1].pin);
	gpio_enable_gpio_pin(rtouch_gpio_xmap[0].pin);

	/* set output low */
	gpio_clr_gpio_pin(rtouch_gpio_xmap[1].pin);
	gpio_clr_gpio_pin(rtouch_gpio_xmap[0].pin);
}
void IBN_LED_Tests (unsigned char nParamsGet_u8, unsigned char CMD_u8, unsigned int Param_u32, unsigned char* String_pu8)
{
    if (0 == nParamsGet_u8)
    {
        CI_LocalPrintf ("LED test functions\r\n");
        CI_LocalPrintf ("\r\n");
        CI_LocalPrintf ("0   [0,1]  LED RED       off,on\r\n");
        CI_LocalPrintf ("1   [0,1]  LED GREEN     off,on\r\n");
        CI_LocalPrintf ("2   [0,1]  LED RED+GREEN off,on\r\n");
        CI_LocalPrintf ("\r\n");
        return;
    }
    switch (CMD_u8)
    {
        case 0:
            if (0 == Param_u32)
            {
                gpio_clr_gpio_pin (TOOL_LED_RED_PIN);
            }
            else
            {
                gpio_set_gpio_pin (TOOL_LED_RED_PIN);
            }
            break;

        case 1:
            if (0 == Param_u32)
            {
                gpio_clr_gpio_pin (TOOL_LED_GREEN_PIN);
            }
            else
            {
                gpio_set_gpio_pin (TOOL_LED_GREEN_PIN);
            }
            break;
        case 2:
            if (0 == Param_u32)
            {
                gpio_clr_gpio_pin (TOOL_LED_GREEN_PIN);
                gpio_clr_gpio_pin (TOOL_LED_RED_PIN);
            }
            else
            {
                gpio_set_gpio_pin (TOOL_LED_GREEN_PIN);
                gpio_set_gpio_pin (TOOL_LED_RED_PIN);
            }
            break;
    }
}
Beispiel #13
0
/*! \brief Write a command to the NAND flash device.
 *
 *  This function will write a command to the NAND flash device, it is used
 *  by the other functions internally in the NAND GPIO driver.
 *
 *  \param nfd Pointer to the nand_driver_data struct which
 *             holds all vital data about the NAND GPIO driver.
 *  \param command Command to write to the NAND flash device.
 */
static void _nand_gpio_write_cmd(struct nand_driver_data *nfd,
		const uint8_t command)
{
	_nand_gpio_write_io(nfd, command);
	gpio_set_gpio_pin(nfd->gpio_cont_port, nfd->gpio_cle);
	gpio_clr_gpio_pin(nfd->gpio_cont_port, nfd->gpio_we);

	//_delay_ns(t_wp);

	gpio_set_gpio_pin(nfd->gpio_cont_port, nfd->gpio_we);

	//_delay_ns(t_alh);

	gpio_clr_gpio_pin(nfd->gpio_cont_port, nfd->gpio_cle);
}
Beispiel #14
0
void vMACBWaitForInput( unsigned long ulTimeOut )
{
#ifdef FREERTOS_USED
  // Just wait until we are signled from an ISR that data is available, or
  // we simply time out.
  xSemaphoreTake( xSemaphore, ulTimeOut );
#else
unsigned long i;
  gpio_clr_gpio_pin(LED0_GPIO);
  i = ulTimeOut * 1000;  
  // wait for an interrupt to occurs
  do
  {
    if ( DataToRead == TRUE )
    {
      // IT occurs, reset interrupt flag
      portENTER_CRITICAL();
      DataToRead = FALSE;    
      portEXIT_CRITICAL();
      break;	
    }
    i--;
  }
  while(i != 0);
  gpio_set_gpio_pin(LED0_GPIO);  
#endif
}
__interrupt
#endif
static void int_handler_usart(void)
{
  if( USART->csr & AVR32_USART_RXRDY_MASK )
  {
    U8 i, status;
    i = (USART->rhr & AVR32_USART_RHR_RXCHR_MASK) >> AVR32_USART_RHR_RXCHR_OFFSET;
    status = fifo_push_uint8(&fifo_desc_usart, i);
    if( status==FIFO_ERROR_OVERFLOW )
    {
      // error
      gpio_clr_gpio_pin(RX_LED);
      gpio_clr_gpio_pin(TX_LED);
    }
  }
Beispiel #16
0
__interrupt
#endif
static void dmaca_transfer_int_handler(void)
{
	uint32_t dma_status;

	gpio_clr_gpio_pin(DMACA_RAM2RAM_EVAL_LED1);

	// Clear the DMA Transfer Complete interrupt for channel 2.
	AVR32_DMACA.cleartfr = (1 << AVR32_DMACA_CLEARTFR_CLEAR2_OFFSET);

	// We can use the StatusInt register because we're using only one DMACA channel.
	dma_status = AVR32_DMACA.statusint;
	if(dma_status & (AVR32_DMACA_STATUSINT_DSTT_MASK | AVR32_DMACA_STATUSINT_SRCT_MASK | AVR32_DMACA_STATUSINT_BLOCK_MASK))
		gpio_clr_gpio_pin(DMACA_RAM2RAM_EVAL_LED3);
}
Beispiel #17
0
bool controller_key_back(void)
{
  static bool start = false;
  static t_cpu_time tempo;

  if (!IS_JOYSTICK_KEY_PRESSED())
  {
    gpio_set_gpio_pin(LED0_GPIO);
    start = false;
    return false;
  }

  if (!start)
  {
    cpu_set_timeout(cpu_ms_2_cy(1000, static_fcpu_hz), &tempo);
    start = true;
  }

  if (cpu_is_timeout(&tempo))
  {
    gpio_clr_gpio_pin(LED0_GPIO);
    no_store = true;
    start = false;
    return true;
  }

  gpio_set_gpio_pin(LED0_GPIO);
  return false;
}
Beispiel #18
0
void stop() {
	p_playing = 0;
	if(es.edge == eStandard) {
		gpio_clr_gpio_pin(B00);
		edge_state = 0;
		// legato = 0;
	}
}
Beispiel #19
0
__interrupt
#endif
static void dmaca_error_int_handler(void)
{
	uint32_t dma_status;

	// This interrupt should ideally not happen. If it does, the DMACA transfer is
	// cancelled and the channel is disabled.

	gpio_clr_gpio_pin(DMACA_RAM2RAM_EVAL_LED2);

	// Clear the DMACA Error interrupt for channel 2.
	AVR32_DMACA.clearerr = (1 << AVR32_DMACA_CLEARERR_CLEAR2_OFFSET);

	// We can use the StatusInt register because we're using only one DMACA channel.
	dma_status = AVR32_DMACA.statusint;
	if(dma_status & (AVR32_DMACA_STATUSINT_DSTT_MASK | AVR32_DMACA_STATUSINT_SRCT_MASK | AVR32_DMACA_STATUSINT_BLOCK_MASK))
		gpio_clr_gpio_pin(DMACA_RAM2RAM_EVAL_LED4);
}
Beispiel #20
0
static void handle_Switch4(s32 data) { 
  // mode switch
  if(data > 0) {
    if(pages_toggle_play()) {
      gpio_set_gpio_pin(LED_MODE_PIN);
    } else {
      gpio_clr_gpio_pin(LED_MODE_PIN);
    }
  }
}
Beispiel #21
0
/** \brief Drive voltage gradient on Y surface (YL=GND, YH=VDD). */
static void inline rtouch_gradient_y_surface(void)
{
	gpio_enable_gpio_pin(rtouch_gpio_ymap[1].pin);
	gpio_enable_gpio_pin(rtouch_gpio_ymap[0].pin);

	gpio_disable_pin_pull_up(rtouch_gpio_ymap[0].pin);
	gpio_disable_pin_pull_up(rtouch_gpio_ymap[1].pin);

	gpio_clr_gpio_pin(rtouch_gpio_ymap[0].pin);
	gpio_set_gpio_pin(rtouch_gpio_ymap[1].pin);
}
Beispiel #22
0
/*! \brief Write an I/O value to the I/O port on the NAND flash.
 *
 *  This internal function writes a value to the I/O port on the NAND flash.
 *  It is mandatory to send appropriate NAND flash commands before trying to
 *  write any values.
 *
 *  \param nfd Pointer to the nand_driver_data struct which
 *             holds all vital data about the NAND GPIO driver.
 *
 *  \param data Data to write to the I/O port on the NAND flash.
 */
static inline void
nand_gpio_write_io(struct nand_driver_data *nfd, const uint8_t data)
{
	_nand_gpio_write_io(nfd, data);

	gpio_clr_gpio_pin(nfd->gpio_cont_port, nfd->gpio_we);
	_delay_ns(t_wp);

	gpio_set_gpio_pin(nfd->gpio_cont_port, nfd->gpio_we);
	_delay_ns(t_wh);
}
Beispiel #23
0
// this gets called whenever there is a clock trigger
void clock(u8 phase) {
	if(phase) {
		gpio_set_gpio_pin(B10); // set the clock output
		
		// here you would do whatever should happen on each clock trigger
		// like advancing a step in a sequencer
		// don't to anything too long here - consider using timers for that
	}
	else {
		gpio_clr_gpio_pin(B10); // clear the clock output
 	}
}
Beispiel #24
0
//! \brief Protect all the flashes
//!
void nf_protect( void )
{
  U32 i_dev;

  // Wait until the end of any pending internal programming (Cache Program cmd).
  for( i_dev=0 ; i_dev<NF_N_DEVICES ; i_dev++ )
  {
    nf_select( i_dev );
    nf_wait_busy();
  }
  gpio_clr_gpio_pin(NF_WP_PIN);
}
Beispiel #25
0
void bfin_start_transfer(void) {
  // FIXME
  volatile u64 delay;
  gpio_set_gpio_pin(BFIN_RESET_PIN);  
  delay = 30; while (--delay > 0) {;;}
  gpio_clr_gpio_pin(BFIN_RESET_PIN);
  delay = 30; while (--delay > 0) {;;}
  gpio_set_gpio_pin(BFIN_RESET_PIN);  
  delay = 3000; while (--delay > 0) {;;}

  spi_selectChip(BFIN_SPI, BFIN_SPI_NPCS);
}
Beispiel #26
0
// LED0_GPIO - mounted led0, contended for by uac
// LED1_GPIO - mounted led1, contended for by uac
// PTT_1 - one of these three gets set eventually
// PTT_2
// PTT_3
void widget_blink(char *dotspace) {
	// take the number of clocks per second, divide by the dits per second
	const int32_t us_per_dot = 1000000 / (BLINKY_WPM * PARIS_DPW / 60);
	// start off
	LED_Off(LED0); LED_Off(LED1);
	// until a nul terminator
	while (*dotspace != 0) {
		// on for dot, off for anything else
		if (*dotspace == '.') {
			gpio_clr_gpio_pin(PTT_1); gpio_clr_gpio_pin(PTT_2); gpio_clr_gpio_pin(PTT_3);
		} else if (*dotspace == ' ') {
			gpio_set_gpio_pin(PTT_1); gpio_set_gpio_pin(PTT_2); gpio_set_gpio_pin(PTT_3);
		} else {
			break;
		}
		// increment dotspace code
		dotspace += 1;
		// count down the dot clock
		widget_delay_rtc(us_per_dot);
	}
	gpio_set_gpio_pin(PTT_1); gpio_set_gpio_pin(PTT_2); gpio_set_gpio_pin(PTT_3);
}
Beispiel #27
0
//! Call Back called by can_drv
void can_out_callback_channel0(U8 handle, U8 event)
{
	/* Reception of Wakeup frame */
	if (handle == NO_MOB) {
		/* Disable Wake-Up Mode */
		CANIF_disable_wakeup(CAN_CHANNEL_EXAMPLE);
		/* Clear Interrupt Flag */
		CANIF_clr_interrupt_status(CAN_CHANNEL_EXAMPLE);
		gpio_clr_gpio_pin(LED0_GPIO);
	}
	else {
		/* Reception of Data frame */
		appli_rx_msg.can_msg->data.u64 = 
			can_get_mob_data(CAN_CHANNEL_EXAMPLE,handle).u64;
		appli_rx_msg.can_msg->id = can_get_mob_id(CAN_CHANNEL_EXAMPLE,handle);
		appli_rx_msg.dlc = can_get_mob_dlc(CAN_CHANNEL_EXAMPLE,handle);
		appli_rx_msg.status = event;
		can_mob_free(CAN_CHANNEL_EXAMPLE,handle);
		nb_message_received_on_channel0 = 1;
		gpio_clr_gpio_pin(LED1_GPIO);
	}
}
Beispiel #28
0
/*! \brief Read an I/O value from the I/O port on the NAND flash.
 *
 *  This internal function reads a value from the I/O port on the NAND flash.
 *  It is mandatory to send appropriate NAND flash commands before trying to
 *  read out any values.
 *
 *  \param nfd Pointer to the nand_driver_data struct which
 *             holds all vital data about the NAND GPIO driver.
 *
 *  \return I/O value read from the device.
 */
static inline uint8_t
nand_gpio_read_io(const struct nand_driver_data *nfd)
{
	static uint8_t byte;
	gpio_clr_gpio_pin(nfd->gpio_cont_port, nfd->gpio_re);
	_delay_ns(t_rc);
	
	byte = *(nfd->gpio_io_pin);

	gpio_set_gpio_pin(nfd->gpio_cont_port, nfd->gpio_re);
	
	return byte;
}
//!
//! @brief This function initializes the hardware/software resources
//! required for device CDC task.
//!
void uac2_AK5394A_task_init(void) {
	current_freq.frequency = 96000;
	AK5394A_task_init(FALSE);

	gpio_clr_gpio_pin(SAMPLEFREQ_VAL1);
	gpio_set_gpio_pin(SAMPLEFREQ_VAL0);

	xTaskCreate(uac2_AK5394A_task,
				configTSK_AK5394A_NAME,
				configTSK_AK5394A_STACK_SIZE,
				NULL,
				UAC2_configTSK_AK5394A_PRIORITY,
				NULL);
}
Beispiel #30
0
__interrupt
#endif
void touch_button_isr(void)
{
  manage_button_isr(QT1081_TOUCH_SENSOR_UP, JOYSTICK_STATUS_UP, JOYSTICK_STATUS_RELEASED_UP);
  manage_button_isr(QT1081_TOUCH_SENSOR_DOWN, JOYSTICK_STATUS_DOWN, JOYSTICK_STATUS_RELEASED_DOWN);
  manage_button_isr(QT1081_TOUCH_SENSOR_RIGHT, JOYSTICK_STATUS_RIGHT, JOYSTICK_STATUS_RELEASED_RIGHT);
  manage_button_isr(QT1081_TOUCH_SENSOR_LEFT, JOYSTICK_STATUS_LEFT, JOYSTICK_STATUS_RELEASED_LEFT);
  manage_button_isr(QT1081_TOUCH_SENSOR_ENTER, JOYSTICK_STATUS_PRESSED, JOYSTICK_STATUS_RELEASED_PRESSED);

  if (IS_JOYSTICK_KEY_UP())
    gpio_clr_gpio_pin(LED1_GPIO);
  else
    gpio_set_gpio_pin(LED1_GPIO);
  if (IS_JOYSTICK_KEY_PRESSED())
    gpio_clr_gpio_pin(LED2_GPIO);
  else
    gpio_set_gpio_pin(LED2_GPIO);
  if (IS_JOYSTICK_KEY_DOWN())
    gpio_clr_gpio_pin(LED3_GPIO);
  else
    gpio_set_gpio_pin(LED3_GPIO);
}