Microchip® Advanced Software Framework

sercom_interrupt.h File Reference

SAM Serial Peripheral Interface Driver.

Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries.

#include "sercom.h"
#include <system_interrupt.h>

Typedefs

typedef void(* sercom_handler_t )(uint8_t instance)
 

Functions

enum system_interrupt_vector _sercom_get_interrupt_vector (Sercom *const sercom_instance)
 
void _sercom_set_handler (const uint8_t instance, const sercom_handler_t interrupt_handler)
 

Variables

void * _sercom_instances [SERCOM_INST_NUM]
 

typedef void(* sercom_handler_t)(uint8_t instance)

enum system_interrupt_vector _sercom_get_interrupt_vector ( Sercom *const  sercom_instance)

Returns the system interrupt vector.

Parameters
[in]sercom_instanceInstance pointer
Returns
Enum of system interrupt vector
Return values
SYSTEM_INTERRUPT_MODULE_SERCOM0
SYSTEM_INTERRUPT_MODULE_SERCOM1
SYSTEM_INTERRUPT_MODULE_SERCOM2
SYSTEM_INTERRUPT_MODULE_SERCOM3
SYSTEM_INTERRUPT_MODULE_SERCOM4
SYSTEM_INTERRUPT_MODULE_SERCOM5
SYSTEM_INTERRUPT_MODULE_SERCOM6
SYSTEM_INTERRUPT_MODULE_SERCOM7

References _sercom_get_sercom_inst_index(), _SERCOM_INTERRUPT_VECT_NUM, and MREPEAT.

Referenced by spi_disable(), spi_enable(), usart_disable(), and usart_enable().

void _sercom_set_handler ( const uint8_t  instance,
const sercom_handler_t  interrupt_handler 
)

Saves the given callback handler.

Parameters
[in]instanceInstance index.
[in]interrupt_handlerPointer to instance callback handler.

References _handler_table_initialized, _sercom_default_handler(), _sercom_instances, _sercom_interrupt_handlers, and NULL.

Referenced by spi_init(), and usart_init().

void* _sercom_instances[SERCOM_INST_NUM]