本文整理汇总了C++中INTC_register_interrupt函数的典型用法代码示例。如果您正苦于以下问题:C++ INTC_register_interrupt函数的具体用法?C++ INTC_register_interrupt怎么用?C++ INTC_register_interrupt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了INTC_register_interrupt函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: can_bus_enable_interrupt
U8 can_bus_enable_interrupt(U8 ch)
{
if ((ch > 1))
return CAN_CMD_REFUSED;
if (ch==0)
{
INTC_register_interrupt(&can0_tx_handler, AVR32_CANIF_TXOK_IRQ_0, CAN0_INT_TX_LEVEL);
INTC_register_interrupt(&can0_rx_handler, AVR32_CANIF_RXOK_IRQ_0, CAN0_INT_RX_LEVEL);
INTC_register_interrupt(&can0_busoff_handler, AVR32_CANIF_BUS_OFF_IRQ_0, CAN0_INT_BOFF_LEVEL);
INTC_register_interrupt(&can0_cerr_handler, AVR32_CANIF_ERROR_IRQ_0, CAN0_INT_ERR_LEVEL);
INTC_register_interrupt(&can0_wakeup_handler, AVR32_CANIF_WAKE_UP_IRQ_0, CAN0_INT_WAKE_UP_LEVEL);
CANIF_enable_interrupt(ch);
}
else if (ch == 1)
{
INTC_register_interrupt(&can1_tx_handler, AVR32_CANIF_TXOK_IRQ_1, CAN1_INT_TX_LEVEL);
INTC_register_interrupt(&can1_rx_handler, AVR32_CANIF_RXOK_IRQ_1, CAN1_INT_RX_LEVEL);
INTC_register_interrupt(&can1_busoff_handler, AVR32_CANIF_BUS_OFF_IRQ_1, CAN1_INT_BOFF_LEVEL);
INTC_register_interrupt(&can1_cerr_handler, AVR32_CANIF_ERROR_IRQ_1, CAN1_INT_ERR_LEVEL);
INTC_register_interrupt(&can1_wakeup_handler, AVR32_CANIF_WAKE_UP_IRQ_1, CAN1_INT_WAKE_UP_LEVEL);
CANIF_enable_interrupt(ch);
}
return CAN_CMD_ACCEPTED;
}
开发者ID:fschill,项目名称:MavBoot,代码行数:26,代码来源:can_bus.c
示例2: Actividad2
void Actividad2(void){
pm_switch_to_osc0(&AVR32_PM, FOSC0, OSC0_STARTUP); //osc0 a 12Mhz
center=0;
//Interrupciones
Disable_global_interrupt();
INTC_init_interrupts();
INTC_register_interrupt(&tecla_lrc_isr, 71, 0);
INTC_register_interrupt(&tecla_lrc_isr, 70,0);
gpio_enable_pin_interrupt(QT1081_TOUCH_SENSOR_LEFT,GPIO_RISING_EDGE);
gpio_enable_pin_interrupt(QT1081_TOUCH_SENSOR_RIGHT,GPIO_RISING_EDGE);
gpio_enable_pin_interrupt(QT1081_TOUCH_SENSOR_ENTER,GPIO_RISING_EDGE);
gpio_enable_pin_interrupt(QT1081_TOUCH_SENSOR_UP,GPIO_RISING_EDGE);
gpio_enable_pin_interrupt(QT1081_TOUCH_SENSOR_DOWN,GPIO_RISING_EDGE);
Enable_global_interrupt();
while (1){}
}
开发者ID:AldricLopez,项目名称:EVK1105,代码行数:27,代码来源:PrimerExamenPractico.c
示例3: register_interrupts
// register interrupts
void register_interrupts(void) {
// enable interrupts on GPIO inputs
gpio_enable_pin_interrupt( NMI, GPIO_PIN_CHANGE);
// gpio_enable_pin_interrupt( B08, GPIO_PIN_CHANGE);
// gpio_enable_pin_interrupt( B09, GPIO_PIN_CHANGE);
gpio_enable_pin_interrupt( A00, GPIO_RISING_EDGE);
gpio_enable_pin_interrupt( A01, GPIO_RISING_EDGE);
gpio_enable_pin_interrupt( A02, GPIO_RISING_EDGE);
gpio_enable_pin_interrupt( A03, GPIO_RISING_EDGE);
gpio_enable_pin_interrupt( A04, GPIO_RISING_EDGE);
gpio_enable_pin_interrupt( A05, GPIO_RISING_EDGE);
gpio_enable_pin_interrupt( A06, GPIO_RISING_EDGE);
gpio_enable_pin_interrupt( A07, GPIO_RISING_EDGE);
// PA00-A07
INTC_register_interrupt( &irq_port0_line0, AVR32_GPIO_IRQ_0, UI_IRQ_PRIORITY);
// PA08 - PA15
INTC_register_interrupt( &irq_port0_line1, AVR32_GPIO_IRQ_0 + (AVR32_PIN_PA08 / 8), UI_IRQ_PRIORITY);
// PB08 - PB15
// INTC_register_interrupt( &irq_port1_line1, AVR32_GPIO_IRQ_0 + (AVR32_PIN_PB08 / 8), UI_IRQ_PRIORITY);
// register TC interrupt
INTC_register_interrupt(&irq_tc, APP_TC_IRQ, APP_TC_IRQ_PRIORITY);
// register uart interrupt
// INTC_register_interrupt(&irq_usart, AVR32_USART0_IRQ, UI_IRQ_PRIORITY);
}
开发者ID:monome,项目名称:libavr32,代码行数:31,代码来源:init_teletype.c
示例4: main
/*! \brief Main function. Execution starts here.
*
* \retval 42 Fatal error.
*/
int main(void)
{
// Configure system clocks.
if (pcl_configure_clocks(&pcl_freq_param) != PASS)
return 42;
// Initialize USB clock (on PLL1)
pcl_configure_usb_clock();
// Initialize usart comm
init_dbg_rs232(pcl_freq_param.pba_f);
#if BOARD == EVK1105
Disable_global_interrupt();
/* Register interrupt handler to the interrupt controller
* up, down buttons on PB22, PB23 -> GPIO_IRQ_6
*/
INTC_register_interrupt(&touch_button_isr, AVR32_GPIO_IRQ_6, 0);
/* all gpios between PB23 - PB31) */
INTC_register_interrupt(&touch_button_isr, AVR32_GPIO_IRQ_7, 0);
Enable_global_interrupt();
#endif
// Initialize USB task
usb_task_init();
#if USB_DEVICE_FEATURE == true
// Initialize device mouse USB task
device_mouse_hid_task_init();
#endif
#if USB_HOST_FEATURE == true
//host_keyboard_hid_task_init();
// Initialize host mouse USB task
host_mouse_hid_task_init();
#endif
#ifdef FREERTOS_USED
// Start OS scheduler
vTaskStartScheduler();
portDBG_TRACE("FreeRTOS returned.");
return 42;
#else
// No OS here. Need to call each task in round-robin mode.
while (true)
{
usb_task();
#if USB_DEVICE_FEATURE == true
device_mouse_hid_task();
#endif
#if USB_HOST_FEATURE == true
//host_keyboard_hid_task();
host_mouse_hid_task();
#endif
}
#endif // FREERTOS_USED
}
开发者ID:AndreyMostovov,项目名称:asf,代码行数:61,代码来源:hid_example.c
示例5: b_pushb3_init
/*!
* \brief Init the push button 3 sensor.
*
* \return true upon success, false if error.
*/
bool b_pushb3_init ( void )
{
portCHAR token[6];
// Get the xCFGMutex.
if( pdTRUE == x_supervisor_SemaphoreTake( xCFGMutex, 20 ) )
{
// get the field
if (config_file_get_value(SENSOR_PB3_CONFIG_FILE, "alarm" , token) >= 0)
{
// update value
if (!strcmp(token, "on"))
{
bAlarm3 = pdTRUE;
}
}
// Release the xCFGMutex.
x_supervisor_SemaphoreGive( xCFGMutex );
}
/* configure push button to produce IT on input change */
gpio_enable_pin_interrupt(PB3_POSITION , GPIO_PIN_CHANGE);
/* Disable all interrupts */
Disable_global_interrupt();
/* register push button 3 handler on level 3 */
INTC_register_interrupt( (__int_handler)&vpushb_ISR, AVR32_GPIO_IRQ_0 + (PB3_POSITION/8), AVR32_INTC_INT3);
/* Enable all interrupts */
Enable_global_interrupt();
return (true);
}
开发者ID:kerichsen,项目名称:asf,代码行数:34,代码来源:pushb.c
示例6: dac_pwm_init
//! Initialize the PWM to make it works as a DAC
void dac_pwm_init()
{
static const gpio_map_t DAC_PWM_GPIO_MAP =
{
{ATPASTE4(AVR32_PWM_, DAC_PWM_CHANNEL_LSB, DAC_PWM_CHANNEL_LSB_PIN, _PIN),
ATPASTE4(AVR32_PWM_, DAC_PWM_CHANNEL_LSB, DAC_PWM_CHANNEL_LSB_PIN, _FUNCTION)},
{ATPASTE4(AVR32_PWM_, DAC_PWM_CHANNEL_MSB, DAC_PWM_CHANNEL_MSB_PIN, _PIN),
ATPASTE4(AVR32_PWM_, DAC_PWM_CHANNEL_MSB, DAC_PWM_CHANNEL_MSB_PIN, _FUNCTION)}
};
INTC_register_interrupt(&dac_pwm_int_handler, AVR32_PWM_IRQ, AVR32_INTC_INT3);
gpio_enable_module(DAC_PWM_GPIO_MAP, sizeof(DAC_PWM_GPIO_MAP) / sizeof(DAC_PWM_GPIO_MAP[0]));
AVR32_PWM.channel[DAC_PWM_CHANNEL_LSB].cmr = ((AVR32_PWM_CPRE_MCK << AVR32_PWM_CPRE_OFFSET) |
AVR32_PWM_CPOL_MASK) &
~(AVR32_PWM_CALG_MASK |
AVR32_PWM_CPD_MASK);
AVR32_PWM.channel[DAC_PWM_CHANNEL_LSB].cprd = 0x000000FF;
AVR32_PWM.channel[DAC_PWM_CHANNEL_LSB].cdty = 0x00;
AVR32_PWM.channel[DAC_PWM_CHANNEL_MSB].cmr = ((AVR32_PWM_CPRE_MCK << AVR32_PWM_CPRE_OFFSET) |
AVR32_PWM_CPOL_MASK) &
~(AVR32_PWM_CALG_MASK |
AVR32_PWM_CPD_MASK);
AVR32_PWM.channel[DAC_PWM_CHANNEL_MSB].cprd = 0x000000FF;
AVR32_PWM.channel[DAC_PWM_CHANNEL_MSB].cdty = 0x80;
AVR32_PWM.ena = (1 << DAC_PWM_CHANNEL_LSB) | (1 << DAC_PWM_CHANNEL_MSB);
AVR32_PWM.ier = (1 << DAC_PWM_CHANNEL_LSB) | (1 << DAC_PWM_CHANNEL_MSB);
}
开发者ID:avrxml,项目名称:asf,代码行数:32,代码来源:adpcm_example.c
示例7: at42qt1060_register_eic_int
/** \brief Register an external interrupt handler for the touch event.
*
*/
void at42qt1060_register_eic_int(void (*touch_detect_callback)(void))
{
eic_options_t eic_options[1];
at42qt1060.touch_detect_callback = touch_detect_callback;
gpio_enable_module_pin(AT42QT1060_DETECT_PIN, AT42QT1060_EIC_EXTINT_FUNCTION);
Disable_global_interrupt();
INTC_register_interrupt(&at42qt1060_detect_eic_int_handler, AT42QT1060_EIC_EXTINT_IRQ,
AT42QT1060_EIC_EXTINT_LEVEL);
eic_options[0].eic_mode = EIC_MODE_EDGE_TRIGGERED;
eic_options[0].eic_level = EIC_EDGE_FALLING_EDGE;
eic_options[0].eic_async = EIC_SYNCH_MODE;
eic_options[0].eic_line = AT42QT1060_EIC_LINE;
eic_init(&AVR32_EIC, &eic_options[0], 1);
eic_enable_lines(&AVR32_EIC, (1 << eic_options[0].eic_line));
eic_enable_interrupt_lines(&AVR32_EIC, (1 << eic_options[0].eic_line));
Enable_global_interrupt();
return;
}
开发者ID:AndreyMostovov,项目名称:asf,代码行数:29,代码来源:at42qt1060.c
示例8: rtouch_prepare_detect
/** \brief Prepare the rtouch detect function.
*
* A touch can be detected by setting the Y lines (or X lines) as inputs and
* enabling the internal pull-ups for these pins. The other lines, X in this
* case are connected to GND. By a touch the Y lines will be pulled low and an
* interrupt can be triggered on a low level detect.
*
* This function does the registering of the interrupt handler for the touch
* detect. Currently we use a GPIO interrupt, but here it is only possible to
* trigger on edges but actually we should trigger on a low level. Anyway this
* should work too.
* Here we use the YL line as source input for the edge detection but it is
* also possible to use YH.
*/
static void inline rtouch_prepare_detect(void)
{
Disable_global_interrupt();
INTC_register_interrupt(&rtouch_detect_int_handler,
AVR32_GPIO_IRQ_0 + rtouch_gpio_ymap[0].pin / 8, 0);
Enable_global_interrupt();
}
开发者ID:InSoonPark,项目名称:asf,代码行数:21,代码来源:rtouch.c
示例9: adc_int_init
///< Initializes ADC (configures Pins, starts Clock, sets defaults)
void adc_int_init(uint32_t adc_frequency, uint8_t reference_source)
{
///< Assign and enable GPIO pins to the ADC function.
gpio_enable_module(ADCIFA_GPIO_MAP, sizeof(ADCIFA_GPIO_MAP) / sizeof(ADCIFA_GPIO_MAP[0]));
adc_config_options.frequency=adc_frequency;
adc_config_options.reference_source=reference_source;
////</ Get ADCIFA Factory Configuration
adcifa_get_calibration_data(adcifa, (adcifa_opt_t *)&adc_config_options);
if ((uint16_t)adc_config_options.offset_calibration_value == 0xFFFF)
{
///< Set default calibration if Engineering samples and part is not programmed
adc_config_options.offset_calibration_value = 0x3B;
adc_config_options.gain_calibration_value = 0x4210;
adc_config_options.sh0_calibration_value = 0x210;
adc_config_options.sh1_calibration_value = 0x210;
}
adc_config_options.offset_calibration_value = 0x3B; ///< offset correction
///< Configure ADCIFA core
adcifa_configure(adcifa, (adcifa_opt_t *)&adc_config_options, sysclk_get_peripheral_bus_hz((const volatile void *)AVR32_ADCIFA_ADDRESS));
adc_int_clear_sequencer();
continuous_mode=false;
///< Configure ADCIFA sequencer 1
//adcifa_configure_sequencer(adcifa, 1, &adcifa_sequence_opt, adcifa_sequencer1_conversion_opt);
adcifa_disable_interrupt(adcifa, 0xffffffff);
INTC_register_interrupt( (__int_handler) &process_data, AVR32_ADCIFA_SEQUENCER0_IRQ, AVR32_INTC_INT1);
//INTC_register_interrupt( (__int_handler) &process_data, AVR32_ADCIFA_SEQUENCER1_IRQ, AVR32_INTC_INT1);
//int32_t period_us=1000000 / samplingrate;
}
开发者ID:JohsBL,项目名称:MobRob,代码行数:34,代码来源:adc_int.c
示例10: controller_init
void controller_init(int cpu_hz, int hsb_hz, int pba_hz, int pbb_hz)
{
Disable_global_interrupt();
INTC_register_interrupt(&touch_button_isr, AVR32_GPIO_IRQ_6, 0);//AVR32_INTC_INT0);
// Other buttons on PB[24..26] -> GPIO_IRQ_7 (PB23 - PB31)
INTC_register_interrupt(&touch_button_isr, AVR32_GPIO_IRQ_7, 0);
gpio_enable_pin_interrupt(QT1081_TOUCH_SENSOR_UP, GPIO_PIN_CHANGE);
gpio_enable_pin_interrupt(QT1081_TOUCH_SENSOR_DOWN, GPIO_PIN_CHANGE);
gpio_enable_pin_interrupt(QT1081_TOUCH_SENSOR_RIGHT, GPIO_PIN_CHANGE);
gpio_enable_pin_interrupt(QT1081_TOUCH_SENSOR_LEFT, GPIO_PIN_CHANGE);
gpio_enable_pin_interrupt(QT1081_TOUCH_SENSOR_ENTER, GPIO_PIN_CHANGE);
// Enable interrupts globally.
Enable_global_interrupt();
static_fcpu_hz = cpu_hz;
cpu_set_timeout(cpu_ms_2_cy(JOYSTICK_KEY_DEBOUNCE_MS, static_fcpu_hz), &joystick_key_sensibility_timer);
}
开发者ID:AndreyMostovov,项目名称:asf,代码行数:16,代码来源:controller_evk1105.c
示例11: setPortAddress
int
DeviceCharacterBufferedUsart0::implPortInit(void)
{
setPortAddress(&AVR32_USART0);
gpio_enable_module_pin(OS_CFGPIN_DEVICECHARACTERBUFFEREDUSART0_RX_PIN,
OS_CFGINT_DEVICECHARACTERBUFFEREDUSART0_GPIO_FUNCTION);
gpio_enable_module_pin(OS_CFGPIN_DEVICECHARACTERBUFFEREDUSART0_TX_PIN,
OS_CFGINT_DEVICECHARACTERBUFFEREDUSART0_GPIO_FUNCTION);
usart_options_t usartConfig;
#if defined(OS_INCLUDE_OSDEVICECHARACTER_SETBAUDRATE)
if(m_baudRate == 0)
m_baudRate = OS_CFGINT_DEVICECHARACTERBUFFEREDUSART0_BAUD_RATE;
usartConfig.baudrate =m_baudRate;
#else
usartConfig.baudrate = OS_CFGINT_DEVICECHARACTERBUFFEREDUSART0_BAUD_RATE;
#endif /* defined(OS_INCLUDE_OSDEVICECHARACTER_SETBAUDRATE) */
usartConfig.channelmode = USART_NORMAL_CHMODE;
usartConfig.charlength = 8;
usartConfig.paritytype = USART_NO_PARITY;
usartConfig.stopbits = USART_1_STOPBIT;
usart_init_rs232(&AVR32_USART0, &usartConfig, OS_CFGLONG_PBA_FREQUENCY_HZ);
INTC_register_interrupt(DeviceCharacterBufferedUsart0::contextHandler,
AVR32_USART0_IRQ, OS_CFGINT_DEVICECHARACTERBUFFEREDUSART0_IRQ_PRIORITY);
// Enable the RX interrupt
AVR32_USART0.ier = AVR32_USART_IER_RXRDY_MASK;
// Do not enable TX interrupts
return 0;
}
开发者ID:micro-os-plus,项目名称:micro-os-plus-i,代码行数:35,代码来源:DeviceCharacterBufferedUsart0_Implementation.cpp
示例12: pdca_set_irq
/*! \brief Init interrupt controller and register pdca_int_handler interrupt.
*/
void pdca_set_irq(void)
{
// Disable all interrupt/exception.
Disable_global_interrupt();
// Register the compare interrupt handler to the interrupt controller
// and enable the compare interrupt.
// (__int_handler) &pdca_int_handler The handler function to register.
// AVR32_PDCA_IRQ_0 The interrupt line to register to.
// AVR32_INTC_INT2 The priority level to set for this interrupt line. INT0 is lowest.
// INTC_register_interrupt(__int_handler handler, int line, int priority);
INTC_register_interrupt( (__int_handler) &pdca_int_handler, AVR32_PDCA_IRQ_0, AVR32_INTC_INT2);
INTC_register_interrupt( (__int_handler) &spk_pdca_int_handler, AVR32_PDCA_IRQ_1, AVR32_INTC_INT1);
// Enable all interrupt/exception.
Enable_global_interrupt();
}
开发者ID:lofturj,项目名称:sdr-widget,代码行数:18,代码来源:taskAK5394A.c
示例13: encoder_init_all
void encoder_init_all ()
{
uint8_t isr_counter = 0;
Disable_global_interrupt();
/* Initialization loop, this loop inits all required IO and interrupts
* for EIC module and pins used to read encoders. */
while(isr_counter < ENCODER_COUNT)
{
/* Init io for interrupt line and state poll line. */
gpio_enable_gpio_pin(encoder_handle[isr_counter].a_pin);
gpio_enable_gpio_pin(encoder_handle[isr_counter].b_pin);
/* Set pullup for both gpio channels. */
gpio_enable_pin_pull_up(encoder_handle[isr_counter].a_pin);
gpio_enable_pin_pull_up(encoder_handle[isr_counter].b_pin);
/* Init interrupt from encoder A line */
gpio_enable_pin_interrupt(encoder_handle[isr_counter].a_pin, GPIO_FALLING_EDGE);
gpio_disable_pin_interrupt(encoder_handle[isr_counter].b_pin);
INTC_register_interrupt(&encoders_and_buttons_isr,
AVR32_GPIO_IRQ_0 + (encoder_handle[isr_counter].a_pin/8),
AVR32_INTC_INT0);
isr_counter++;
}
Enable_global_interrupt();
}
开发者ID:savpek,项目名称:TLCR-Firmware,代码行数:28,代码来源:encoder_init_all.c
示例14: dip204_example_configure_push_buttons_IT
/*!
* \brief function to configure push button to generate IT upon rising edge
*/
void dip204_example_configure_push_buttons_IT(void)
{
gpio_enable_pin_interrupt(GPIO_CHARSET , GPIO_RISING_EDGE);
gpio_enable_pin_interrupt(GPIO_BACKLIGHT_PLUS , GPIO_RISING_EDGE);
gpio_enable_pin_interrupt(GPIO_BACKLIGHT_MINUS , GPIO_RISING_EDGE);
/* Disable all interrupts */
Disable_global_interrupt();
/* register PB0 handler on level 1 */
INTC_register_interrupt( &dip204_example_PB_int_handler, AVR32_GPIO_IRQ_0 + (GPIO_BACKLIGHT_PLUS/8), AVR32_INTC_INT1);
INTC_register_interrupt( &dip204_example_PB_int_handler, AVR32_GPIO_IRQ_0 + (GPIO_BACKLIGHT_MINUS/8), AVR32_INTC_INT1);
INTC_register_interrupt( &dip204_example_PB_int_handler, AVR32_GPIO_IRQ_0 + (GPIO_CHARSET/8), AVR32_INTC_INT1);
/* Enable all interrupts */
Enable_global_interrupt();
}
开发者ID:AndreyMostovov,项目名称:asf,代码行数:20,代码来源:dip204_example.c
示例15: register_interrupts
// register interrupts
void register_interrupts(void) {
#if 1
#else
// enable interrupts on GPIO inputs
// BFIN_HWAIT
gpio_enable_pin_interrupt( BFIN_HWAIT_PIN, GPIO_RISING_EDGE);
// encoders
gpio_enable_pin_interrupt( ENC0_S0_PIN, GPIO_PIN_CHANGE);
gpio_enable_pin_interrupt( ENC0_S1_PIN, GPIO_PIN_CHANGE);
gpio_enable_pin_interrupt( ENC1_S0_PIN, GPIO_PIN_CHANGE);
gpio_enable_pin_interrupt( ENC1_S1_PIN, GPIO_PIN_CHANGE);
gpio_enable_pin_interrupt( ENC2_S0_PIN, GPIO_PIN_CHANGE);
gpio_enable_pin_interrupt( ENC2_S1_PIN, GPIO_PIN_CHANGE);
gpio_enable_pin_interrupt( ENC3_S0_PIN, GPIO_PIN_CHANGE);
gpio_enable_pin_interrupt( ENC3_S1_PIN, GPIO_PIN_CHANGE);
// switches
gpio_enable_pin_interrupt( SW0_PIN, GPIO_PIN_CHANGE);
gpio_enable_pin_interrupt( SW1_PIN, GPIO_PIN_CHANGE);
gpio_enable_pin_interrupt( SW2_PIN, GPIO_PIN_CHANGE);
gpio_enable_pin_interrupt( SW3_PIN, GPIO_PIN_CHANGE);
gpio_enable_pin_interrupt( FS0_PIN, GPIO_PIN_CHANGE);
gpio_enable_pin_interrupt( FS1_PIN, GPIO_PIN_CHANGE);
gpio_enable_pin_interrupt( SW_MODE_PIN, GPIO_PIN_CHANGE);
gpio_enable_pin_interrupt( SW_POWER_PIN, GPIO_PIN_CHANGE);
// PA24 - PA31
INTC_register_interrupt( &irq_port0_line3, AVR32_GPIO_IRQ_0 + (AVR32_PIN_PA24 / 8), UI_IRQ_PRIORITY);
// PB00 - PB07
INTC_register_interrupt( &irq_port1_line0, AVR32_GPIO_IRQ_0 + (AVR32_PIN_PB00 / 8), UI_IRQ_PRIORITY);
// PB08 - PB15
INTC_register_interrupt( &irq_port1_line1, AVR32_GPIO_IRQ_0 + (AVR32_PIN_PB08 / 8), UI_IRQ_PRIORITY);
// PB16 - PB23
INTC_register_interrupt( &irq_port1_line2, AVR32_GPIO_IRQ_0 + (AVR32_PIN_PB16 / 8), UI_IRQ_PRIORITY);
// PB24 - PB31
INTC_register_interrupt( &irq_port1_line3, AVR32_GPIO_IRQ_0 + (AVR32_PIN_PB24 / 8), UI_IRQ_PRIORITY);
// register IRQ for PDCA transfer
INTC_register_interrupt(&irq_pdca, AVR32_PDCA_IRQ_0, SYS_IRQ_PRIORITY);
// register TC interrupt
INTC_register_interrupt(&irq_tc, APP_TC_IRQ, APP_TC_IRQ_PRIORITY);
// register uart interrupt
INTC_register_interrupt(&irq_usart, AVR32_USART0_IRQ, UI_IRQ_PRIORITY);
#endif
}
开发者ID:Someone101,项目名称:aleph,代码行数:56,代码来源:interrupts.c
示例16: platform_int_init
void platform_int_init()
{
unsigned i;
for( i = 0; i < NUM_UART; i ++ )
if( usart_irqs[ i ] != -1 )
INTC_register_interrupt( phandlers[ i ], usart_irqs[ i ], AVR32_INTC_INT0 );
Enable_global_interrupt();
}
开发者ID:JNeudorf,项目名称:elua,代码行数:9,代码来源:platform_int.c
示例17: da2sEnable
/**
* Enable direct to serial
* @param enable
* @param baud
*/
void da2sEnable(char enable, uint32_t baud) {
uint32_t div;
if (enable) {
if (!da2sEnabled) {
disableUsartAndDma();
if (baud == 0)
baud = BAUD_DEFAULT;
}
if (baud) {
div = (sysclk_get_pba_hz() + (baud * (16 / 8) / 2)) / (baud * (16 / 8));
USART_DA2S.brgr = ((div >> 3) << AVR32_USART_BRGR_CD) | ((div & 7) << AVR32_USART_BRGR_FP);
}
if (!da2sEnabled) {
da2s.rx.tail = 0;
da2s.tx.head = 0;
da2s.tx.queuedTail = 0;
da2sEnabled = 1;
USART_DA2S.mr = (AVR32_USART_MR_OVER_X16 <<
AVR32_USART_MR_OVER) | (AVR32_USART_MR_MSBF_LSBF <<
AVR32_USART_MR_MSBF) | (AVR32_USART_MR_CHMODE_NORMAL <<
AVR32_USART_MR_CHMODE) | (AVR32_USART_MR_NBSTOP_1 <<
AVR32_USART_MR_NBSTOP) | (AVR32_USART_MR_PAR_NONE <<
AVR32_USART_MR_PAR) | (AVR32_USART_MR_CHRL_8 <<
AVR32_USART_MR_CHRL) | (AVR32_USART_MR_USCLKS_MCK <<
AVR32_USART_MR_USCLKS) | (AVR32_USART_MR_MODE_NORMAL <<
AVR32_USART_MR_MODE);
INTC_register_interrupt(&rxDMA, AVR32_PDCA_IRQ_2, AVR32_INTC_INT3);
INTC_register_interrupt(&txDMA, AVR32_PDCA_IRQ_1, AVR32_INTC_INT2);
DMA_USART_DA2S_TX.mar = (uint32_t) &da2s.tx.buffer[0];
DMA_USART_DA2S_RX.mar = (uint32_t) &da2s.rx.buffer[0];
DMA_USART_DA2S_TX.psr = AVR32_PDCA_PID_USART1_TX;
DMA_USART_DA2S_RX.psr = AVR32_PDCA_PID_USART1_RX;
DMA_USART_DA2S_TX.mr = AVR32_PDCA_MR_SIZE_BYTE <<
AVR32_PDCA_MR_SIZE_OFFSET;
DMA_USART_DA2S_RX.mr = AVR32_PDCA_MR_SIZE_BYTE <<
AVR32_PDCA_MR_SIZE_OFFSET;
DMA_USART_DA2S_TX.cr = AVR32_PDCA_CR_TEN_MASK;
DMA_USART_DA2S_RX.cr = AVR32_PDCA_CR_TEN_MASK;
DMA_USART_DA2S_RX.ier = AVR32_PDCA_IER_RCZ_MASK;
USART_DA2S.cr = AVR32_USART_CR_RXEN_MASK |
AVR32_USART_CR_TXEN_MASK;
}
} else if (da2sEnabled) {
开发者ID:HashFast,项目名称:hashfast-uc,代码行数:49,代码来源:da2s.c
示例18: prvSetupMACBInterrupt
static void prvSetupMACBInterrupt(volatile avr32_macb_t *macb)
{
#ifdef FREERTOS_USED
// Create the semaphore used to trigger the MACB task.
if (xSemaphore == NULL)
{
vSemaphoreCreateBinary( xSemaphore );
}
#else
// Init the variable counting the number of received frames not yet read.
DataToRead = 0;
#endif
#ifdef FREERTOS_USED
if( xSemaphore != NULL)
{
// We start by 'taking' the semaphore so the ISR can 'give' it when the
// first interrupt occurs.
xSemaphoreTake( xSemaphore, 0 );
#endif
// Setup the interrupt for MACB.
// Register the interrupt handler to the interrupt controller at interrupt level 2
INTC_register_interrupt((__int_handler)&vMACB_ISR, AVR32_MACB_IRQ, AVR32_INTC_INT2);
#if ETHERNET_CONF_USE_PHY_IT == 1
/* GPIO enable interrupt upon rising edge */
gpio_enable_pin_interrupt(EXTPHY_MACB_INTERRUPT_PIN, GPIO_FALLING_EDGE);
// Setup the interrupt for PHY.
// Register the interrupt handler to the interrupt controller at interrupt level 2
INTC_register_interrupt((__int_handler)&vPHY_ISR, (AVR32_GPIO_IRQ_0 + (EXTPHY_MACB_INTERRUPT_PIN/8)), AVR32_INTC_INT2);
/* enable interrupts on INT pin */
vWriteMDIO( macb, PHY_MICR , ( MICR_INTEN | MICR_INTOE ));
/* enable "link change" interrupt for Phy */
vWriteMDIO( macb, PHY_MISR , MISR_LINK_INT_EN );
#endif
// We want to interrupt on Rx and Tx events
macb->ier = AVR32_MACB_IER_RCOMP_MASK | AVR32_MACB_IER_TCOMP_MASK;
#ifdef FREERTOS_USED
}
#endif
}
开发者ID:novotnyjirka81,项目名称:AV6,代码行数:43,代码来源:macb.c
示例19: dip204_example_configure_joystick_IT
/*!
* \brief function to configure joystick to generate IT upon falling edge
*/
void dip204_example_configure_joystick_IT(void)
{
gpio_enable_pin_interrupt(GPIO_JOYSTICK_UP , GPIO_FALLING_EDGE);
gpio_enable_pin_interrupt(GPIO_JOYSTICK_DOWN , GPIO_FALLING_EDGE);
gpio_enable_pin_interrupt(GPIO_JOYSTICK_RIGHT , GPIO_FALLING_EDGE);
gpio_enable_pin_interrupt(GPIO_JOYSTICK_PUSH , GPIO_FALLING_EDGE);
gpio_enable_pin_interrupt(GPIO_JOYSTICK_LEFT , GPIO_FALLING_EDGE);
/* Disable all interrupts */
Disable_global_interrupt();
/* register PB0 handler on level 1 */
INTC_register_interrupt( &dip204_example_Joy_int_handler, AVR32_GPIO_IRQ_0 + (GPIO_JOYSTICK_UP/8), AVR32_INTC_INT1);
INTC_register_interrupt( &dip204_example_Joy_int_handler, AVR32_GPIO_IRQ_0 + (GPIO_JOYSTICK_DOWN/8), AVR32_INTC_INT1);
INTC_register_interrupt( &dip204_example_Joy_int_handler, AVR32_GPIO_IRQ_0 + (GPIO_JOYSTICK_RIGHT/8), AVR32_INTC_INT1);
INTC_register_interrupt( &dip204_example_Joy_int_handler, AVR32_GPIO_IRQ_0 + (GPIO_JOYSTICK_LEFT/8), AVR32_INTC_INT1);
INTC_register_interrupt( &dip204_example_Joy_int_handler, AVR32_GPIO_IRQ_0 + (GPIO_JOYSTICK_PUSH/8), AVR32_INTC_INT1);
/* Enable all interrupts */
Enable_global_interrupt();
}
开发者ID:AndreyMostovov,项目名称:asf,代码行数:22,代码来源:dip204_example.c
示例20: BUFFERED_SIO_Init
u16 BUFFERED_SIO_Init (void)
{
// IO mapping
static const gpio_map_t USART_GPIO_MAP = {
{BUFFERED_SIO_USART_RX_PIN, BUFFERED_SIO_USART_RX_FUNCTION},
{BUFFERED_SIO_USART_TX_PIN, BUFFERED_SIO_USART_TX_FUNCTION}
};
// USART options.
static const usart_options_t USART_OPTIONS = {
.baudrate = 57600 * 2,
.charlength = 8,
.paritytype = USART_NO_PARITY,
.stopbits = USART_1_STOPBIT,
.channelmode = USART_NORMAL_CHMODE
};
// Reset vars
BUFFERED_SIO_TxBuffer_StartPointer = 0;
BUFFERED_SIO_TxBuffer_EndPointer = 0;
BUFFERED_SIO_TxActiv_Sendbytes = 0;
BUFFERED_SIO_RxBuffer_StartPointer = 0;
BUFFERED_SIO_RxBuffer_EndPointer = 0;
#ifdef STICK_20_SEND_DEBUGINFOS_VIA_HID
BUFFERED_SIO_HID_TxBuffer_StartPointer = 0;
BUFFERED_SIO_HID_TxBuffer_EndPointer = 0;
BUFFERED_SIO_HID_TxActiv_Sendbytes = 0;
#endif
// Assign GPIO to USART.
gpio_enable_module (USART_GPIO_MAP, sizeof (USART_GPIO_MAP) / sizeof (USART_GPIO_MAP[0]));
// Initialize USART in RS232 mode.
usart_init_rs232 (BUFFERED_SIO_USART, &USART_OPTIONS, FPBA_HZ);
// Disable all interrupts.
Disable_global_interrupt ();
// Set ISR
INTC_register_interrupt (&BUFFERED_SIO_Usart_ISR, BUFFERED_SIO_USART_IRQ, AVR32_INTC_INT0);
// Enable USART Rx interrupt.
BUFFERED_SIO_USART->IER.rxrdy = 1;
// Enable USART Tx interrupt.
// BUFFERED_SIO_USART->IER.txempty = 1;
// Enable all interrupts.
Enable_global_interrupt ();
return (TRUE);
}
开发者ID:chenhuang511,项目名称:nitrokey-storage-firmware,代码行数:54,代码来源:BUFFERED_SIO.c
注:本文中的INTC_register_interrupt函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论