mirror of https://gerrit.osmocom.org/simtrace2
Deleted unused examples folder
This commit is contained in:
parent
b0bbb1b52e
commit
85951cef7f
|
@ -1,303 +0,0 @@
|
|||
/* ----------------------------------------------------------------------------
|
||||
* ATMEL Microcontroller Software Support
|
||||
* ----------------------------------------------------------------------------
|
||||
* Copyright (c) 2008, Atmel Corporation
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the disclaimer below.
|
||||
*
|
||||
* Atmel's name may not be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* USB Device Framework configurations.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef USBD_CONFIG_H
|
||||
#define USBD_CONFIG_H
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Headers
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
/** \addtogroup usbd_config
|
||||
*@{
|
||||
*/
|
||||
/*----------------------------------------------------------------------------
|
||||
* Constants
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
/** \addtogroup usbd_ids USBD Device IDs
|
||||
* @{
|
||||
*/
|
||||
#define USBD_VID_ATMEL 0x03EB /**< Vendor ID: Atmel */
|
||||
|
||||
#define USBD_PID_ENUM 0x0001 /**< Product ID: Enum (Core) */
|
||||
#define USBD_PID_CDCDSERIAL 0x6119 /**< Product ID: CDC Serial */
|
||||
#define USBD_PID_HIDKEYBOARD 0x6127 /**< Product ID: HID Keyboard */
|
||||
#define USBD_PID_AUDIO 0x6128 /**< Product ID: Audio devices */
|
||||
#define USBD_PID_MSD 0x6129 /**< Product ID: Massstorage */
|
||||
#define USBD_PID_CDCHID 0x6130 /**< Product ID: composite */
|
||||
#define USBD_PID_CDCAUDIO 0x6131 /**< Product ID: composite */
|
||||
#define USBD_PID_CDCMSD 0x6132 /**< Product ID: composite */
|
||||
#define USBD_PID_CDCCDC 0x6133 /**< Product ID: composite */
|
||||
#define USBD_PID_HIDAUDIO 0x6134 /**< Product ID: composite */
|
||||
#define USBD_PID_HIDMSD 0x6135 /**< Product ID: composite */
|
||||
#define USBD_PID_HIDMOUSE 0x6200 /**< Product ID: HID Mouse */
|
||||
#define USBD_PID_HIDTRANSFER 0x6201 /**< Product ID: HID Transfer */
|
||||
#define USBD_PID_CCID 0x6203 /**< Product ID: CCID */
|
||||
|
||||
#define USBD_RELEASE_1_00 0x0100 /**< Release: 1.00 */
|
||||
/** @}*/
|
||||
|
||||
/** \addtogroup usbd_general_config USBD General Configure
|
||||
* @{
|
||||
* This page lists general configurations for all USB device drivers.
|
||||
* - \ref USBD_BMATTRIBUTES
|
||||
*/
|
||||
/** default USB Device attributes configuration descriptor
|
||||
* (bus or self powered, remote wakeup) */
|
||||
#define USBD_BMATTRIBUTES BOARD_USB_BMATTRIBUTES
|
||||
/** @}*/
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* USB Device - Mass storage
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
/** \addtogroup usbd_msdd_config USB MassStorage Configure
|
||||
* @{
|
||||
* This page lists the defines used by the Mass Storage driver.
|
||||
*
|
||||
* \section msd_ep_addr Endpoint Addresses
|
||||
* - \ref MSDDriverDescriptors_BULKOUT
|
||||
* - \ref MSDDriverDescriptors_BULKIN
|
||||
*/
|
||||
/** Address of the Mass Storage bulk-out endpoint.*/
|
||||
#define MSDDriverDescriptors_BULKOUT 1
|
||||
/** Address of the Mass Storage bulk-in endpoint.*/
|
||||
#define MSDDriverDescriptors_BULKIN 2
|
||||
/** @}*/
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* USB Device - CDC Serial
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
/** \addtogroup usbd_cdc_serial_config USB CDC Serial Configure
|
||||
* @{
|
||||
* This page lists the defines used by the CDC Serial Device Driver.
|
||||
*
|
||||
* \section cdcd_ep_addr Endpoint Addresses
|
||||
* - \ref CDCDSerialDriverDescriptors_DATAOUT
|
||||
* - \ref CDCDSerialDriverDescriptors_DATAIN
|
||||
* - \ref CDCDSerialDriverDescriptors_NOTIFICATION
|
||||
*/
|
||||
/** Data OUT endpoint number */
|
||||
#define CDCDSerialDriverDescriptors_DATAOUT 1
|
||||
/** Data IN endpoint number */
|
||||
#define CDCDSerialDriverDescriptors_DATAIN 2
|
||||
/** Notification endpoint number */
|
||||
#define CDCDSerialDriverDescriptors_NOTIFICATION 3
|
||||
/** @}*/
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* USB Device - Audio
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
/** \addtogroup usbd_audio_config USB Audio General Configure
|
||||
* @{
|
||||
* This page lists definitions for USB Audio Devices Drivers.
|
||||
* - \ref
|
||||
*/
|
||||
#if defined(at91sam7s) || defined(at91sam9xe)
|
||||
/** Sample rate in Hz. */
|
||||
#define AUDDevice_SAMPLERATE 32000UL
|
||||
/** Number of channels in audio stream. */
|
||||
#define AUDDevice_NUMCHANNELS 1
|
||||
/** Number of bytes in one sample. */
|
||||
#define AUDDevice_BYTESPERSAMPLE 2
|
||||
#else
|
||||
/** Sample rate in Hz. */
|
||||
#define AUDDevice_SAMPLERATE 48000UL
|
||||
/** Number of channels in audio stream. */
|
||||
#define AUDDevice_NUMCHANNELS 2
|
||||
/** Number of bytes in one sample. */
|
||||
#define AUDDevice_BYTESPERSAMPLE 2
|
||||
#endif
|
||||
/** Number of bits in one sample. */
|
||||
#define AUDDevice_BITSPERSAMPLE (AUDDevice_BYTESPERSAMPLE * 8)
|
||||
/** Number of bytes in one USB subframe. */
|
||||
#define AUDDevice_BYTESPERSUBFRAME (AUDDevice_NUMCHANNELS * \
|
||||
AUDDevice_BYTESPERSAMPLE)
|
||||
/** Number of samples in one USB frame. */
|
||||
#define AUDDevice_SAMPLESPERFRAME (AUDDevice_SAMPLERATE / 1000 \
|
||||
* AUDDevice_NUMCHANNELS)
|
||||
/** Number of bytes in one USB frame. */
|
||||
#define AUDDevice_BYTESPERFRAME (AUDDevice_SAMPLESPERFRAME * \
|
||||
AUDDevice_BYTESPERSAMPLE)
|
||||
/** @}*/
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* USB Device - Audio - Desktop Speaker
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
/** \addtogroup usbd_audio_speaker_config USB Speaker Configure
|
||||
* @{
|
||||
* This page lists the definitions for USB Audio Speaker Device Driver.
|
||||
* - \ref AUDDSpeakerDriverDescriptors_DATAOUT
|
||||
* - \ref AUDDSpeakerDriverDescriptors_FS_INTERVAL
|
||||
* - \ref AUDDSpeakerDriverDescriptors_HS_INTERVAL
|
||||
*
|
||||
* \note for UDP, uses IN EPs that support double buffer; for UDPHS, uses
|
||||
* IN EPs that support DMA and High bandwidth.
|
||||
*/
|
||||
/** Data out endpoint number. */
|
||||
#define AUDDSpeakerDriverDescriptors_DATAOUT 0x04
|
||||
/** Endpoint polling interval 2^(x-1) * 125us */
|
||||
#define AUDDSpeakerDriverDescriptors_HS_INTERVAL 0x04
|
||||
/** Endpoint polling interval 2^(x-1) * ms */
|
||||
#define AUDDSpeakerDriverDescriptors_FS_INTERVAL 0x01
|
||||
/** @}*/
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* USB Device - Audio - Speaker Phone
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
/** \addtogroup usbd_audio_speakerphone_config USB Speaker Phone Configure
|
||||
* @{
|
||||
* This page lists the definitions for USB Audio Speaker Phone Device Driver.
|
||||
* - \ref AUDDSpeakerPhoneDriverDescriptors_DATAOUT
|
||||
* - \ref AUDDSpeakerPhoneDriverDescriptors_DATAIN
|
||||
* - \ref AUDDSpeakerPhoneDriverDescriptors_HS_INTERVAL
|
||||
* - \ref AUDDSpeakerPhoneDriverDescriptors_FS_INTERVAL
|
||||
*/
|
||||
|
||||
#if defined(at91sam7s) || defined(at91sam9xe)
|
||||
/** Data out endpoint number, size 64B */
|
||||
#define AUDDSpeakerPhoneDriverDescriptors_DATAOUT 0x01
|
||||
/** Data in endpoint number, size 64B */
|
||||
#define AUDDSpeakerPhoneDriverDescriptors_DATAIN 0x02
|
||||
#elif defined(CHIP_USB_UDP)
|
||||
/** Data out endpoint number, size 192B */
|
||||
#define AUDDSpeakerPhoneDriverDescriptors_DATAOUT 0x04
|
||||
/** Data in endpoint number, size 192B */
|
||||
#define AUDDSpeakerPhoneDriverDescriptors_DATAIN 0x05
|
||||
#elif defined(at91sam9m10ek)
|
||||
/** Data out endpoint number, size 192B */
|
||||
#define AUDDSpeakerPhoneDriverDescriptors_DATAOUT 0x01
|
||||
/** Data in endpoint number, size 192B */
|
||||
#define AUDDSpeakerPhoneDriverDescriptors_DATAIN 0x06
|
||||
#else
|
||||
/** Data out endpoint number, size 192B */
|
||||
#define AUDDSpeakerPhoneDriverDescriptors_DATAOUT 0x05
|
||||
/** Data in endpoint number, size 192B */
|
||||
#define AUDDSpeakerPhoneDriverDescriptors_DATAIN 0x06
|
||||
#endif
|
||||
/** Endpoint polling interval 2^(x-1) * 125us */
|
||||
#define AUDDSpeakerPhoneDriverDescriptors_HS_INTERVAL 0x04
|
||||
/** Endpoint polling interval 2^(x-1) * ms */
|
||||
#define AUDDSpeakerPhoneDriverDescriptors_FS_INTERVAL 0x01
|
||||
/** @}*/
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* USB Device - HID - Keyboard
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
/** \addtogroup usbd_hid_keyboard_config USB HID Keyboard Device Configure
|
||||
* @{
|
||||
* This page lists the defines used by the HID Keyboard Device Driver.
|
||||
*
|
||||
* \section hidd_k_ep_addr Endpoint Addresses
|
||||
* - \ref HIDDKeyboardDriverDescriptors_INTERRUPTIN
|
||||
* - \ref HIDDKeyboardDriverDescriptors_INTERRUPTOUT
|
||||
* \section hidd_k_ep_polling Endpoint Polling Rate
|
||||
* - \ref HIDDKeyboardDriverDescriptors_INTERRUPTIN_POLLING
|
||||
* - \ref HIDDKeyboardDriverDescriptors_INTERRUPTOUT_POLLING
|
||||
*/
|
||||
/** Interrupt IN endpoint number */
|
||||
#define HIDDKeyboardDriverDescriptors_INTERRUPTIN 1
|
||||
/** Interrupt IN endpoint polling rate (in milliseconds) */
|
||||
#define HIDDKeyboardDriverDescriptors_INTERRUPTIN_POLLING 10
|
||||
/** Interrupt OUT endpoint number */
|
||||
#define HIDDKeyboardDriverDescriptors_INTERRUPTOUT 2
|
||||
/** Interrupt OUT endpoint polling rate (in milliseconds) */
|
||||
#define HIDDKeyboardDriverDescriptors_INTERRUPTOUT_POLLING 10
|
||||
/** @}*/
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* USB Device - HID - Mouse
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
/** \addtogroup usbd_hid_mouse_config USB HID Mouse Device Configure
|
||||
* @{
|
||||
* This page lists the defines used by the HID Mouse Device Driver.
|
||||
*
|
||||
* \section hidd_m_ep_addr Endpoint Addresses
|
||||
* - \ref HIDDMouseDriverDescriptors_INTERRUPTIN
|
||||
* \section hidd_m_ep_polling Endpoint Polling Rate
|
||||
* - \ref HIDDMouseDriverDescriptors_INTERRUPTIN_POLLING
|
||||
*/
|
||||
/** Interrupt IN endpoint number */
|
||||
#define HIDDMouseDriverDescriptors_INTERRUPTIN 1
|
||||
/** Interrupt IN endpoint polling rate (in milliseconds) */
|
||||
#define HIDDMouseDriverDescriptors_INTERRUPTIN_POLLING 10
|
||||
/** @}*/
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* USB Device - HID - Transfer (Customize device)
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
/** \addtogroup usbd_hid_xfr_config USB HID Transfer Device Configure
|
||||
* @{
|
||||
* This page lists the defines used by the HID Transfer Device Driver.
|
||||
*
|
||||
* \section hidd_t_ep_addr Endpoint Addresses
|
||||
* - \ref HIDDTransferDriverDescriptors_INTERRUPTIN
|
||||
* - \ref HIDDTransferDriverDescriptors_INTERRUPTOUT
|
||||
* \section hidd_t_ep_polling Endpoint Polling Rate
|
||||
* - \ref HIDDTransferDriverDescriptors_INTERRUPTIN_POLLING
|
||||
* - \ref HIDDTransferDriverDescriptors_INTERRUPTOUT_POLLING
|
||||
*/
|
||||
/** Interrupt IN endpoint number. */
|
||||
#define HIDDTransferDriverDescriptors_INTERRUPTIN 1
|
||||
/** Polling rate in ms */
|
||||
#define HIDDTransferDriverDescriptors_INTERRUPTIN_POLLING 50
|
||||
/** Interrupt IN endpoint polling rate (in milliseconds). */
|
||||
#define HIDDTransferDriverDescriptors_INTERRUPTOUT 2
|
||||
/** Polling rate in ms */
|
||||
#define HIDDTransferDriverDescriptors_INTERRUPTOUT_POLLING 50
|
||||
/** @}*/
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* USB Device - Composite
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
/** \addtogroup usbd_composite_config USB Composite Device Configure
|
||||
* @{
|
||||
*/
|
||||
/** @}*/
|
||||
|
||||
/**@}*/
|
||||
#endif //#ifndef USBD_CONFIG_H
|
||||
|
||||
|
|
@ -1,72 +0,0 @@
|
|||
#ifndef _LIB_SAM3S_
|
||||
#define _LIB_SAM3S_
|
||||
|
||||
/*
|
||||
* Peripherals registers definitions
|
||||
*/
|
||||
#if defined sam3s4
|
||||
#elif defined sam3s2
|
||||
#elif defined sam3s1
|
||||
#else
|
||||
#warning Library does not support the specified chip, specifying sam3s4.
|
||||
#define sam3s4
|
||||
#endif
|
||||
#include "include/SAM3S.h"
|
||||
|
||||
|
||||
/* Define attribute */
|
||||
#if defined ( __CC_ARM ) /* Keil µVision 4 */
|
||||
#define WEAK __attribute__ ((weak))
|
||||
#elif defined ( __ICCARM__ ) /* IAR Ewarm 5.41+ */
|
||||
#define WEAK __weak
|
||||
#elif defined ( __GNUC__ ) /* GCC CS3 2009q3-68 */
|
||||
#define WEAK __attribute__ ((weak))
|
||||
#endif
|
||||
|
||||
/* Define NO_INIT attribute */
|
||||
#if defined ( __CC_ARM )
|
||||
#define NO_INIT
|
||||
#elif defined ( __ICCARM__ )
|
||||
#define NO_INIT __no_init
|
||||
#elif defined ( __GNUC__ )
|
||||
#define NO_INIT
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Core
|
||||
*/
|
||||
|
||||
#include "include/exceptions.h"
|
||||
|
||||
/*
|
||||
* Peripherals
|
||||
*/
|
||||
#include "include/acc.h"
|
||||
#include "include/adc.h"
|
||||
#include "include/async.h"
|
||||
#include "include/crccu.h"
|
||||
#include "include/dacc.h"
|
||||
#include "include/efc.h"
|
||||
#include "include/flashd.h"
|
||||
#include "include/hsmci.h"
|
||||
#include "include/pio.h"
|
||||
#include "include/pio_it.h"
|
||||
#include "include/pio_capture.h"
|
||||
#include "include/pmc.h"
|
||||
#include "include/pwmc.h"
|
||||
#include "include/rtc.h"
|
||||
#include "include/rtt.h"
|
||||
#include "include/spi.h"
|
||||
#include "include/spi_pdc.h"
|
||||
#include "include/ssc.h"
|
||||
#include "include/tc.h"
|
||||
#include "include/twi.h"
|
||||
#include "include/twid.h"
|
||||
#include "include/usart.h"
|
||||
//#include "include/USBD_Config.h"
|
||||
|
||||
#include "include/trace.h"
|
||||
#include "include/wdt.h"
|
||||
|
||||
#endif /* _LIB_SAM3S_ */
|
|
@ -1,97 +0,0 @@
|
|||
/* ----------------------------------------------------------------------------
|
||||
* ATMEL Microcontroller Software Support
|
||||
* ----------------------------------------------------------------------------
|
||||
* Copyright (c) 2009, Atmel Corporation
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the disclaimer below.
|
||||
*
|
||||
* Atmel's name may not be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
* Interface for default exception handlers.
|
||||
*/
|
||||
|
||||
#ifndef _EXCEPTIONS_
|
||||
#define _EXCEPTIONS_
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Types
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
/* Function prototype for exception table items (interrupt handler). */
|
||||
typedef void( *IntFunc )( void ) ;
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Exported functions
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
/* Default empty handler */
|
||||
extern void IrqHandlerNotUsed( void ) ;
|
||||
|
||||
/* Cortex-M3 core handlers */
|
||||
extern void NMI_Handler( void );
|
||||
extern void HardFault_Handler( void );
|
||||
extern void MemManage_Handler( void );
|
||||
extern void BusFault_Handler( void );
|
||||
extern void UsageFault_Handler( void );
|
||||
extern void SVC_Handler( void );
|
||||
extern void DebugMon_Handler( void );
|
||||
extern void PendSV_Handler( void );
|
||||
extern void SysTick_Handler( void );
|
||||
|
||||
/* Peripherals handlers */
|
||||
extern void ACC_IrqHandler( void ) ;
|
||||
extern void ADC_IrqHandler( void ) ;
|
||||
extern void CRCCU_IrqHandler( void ) ;
|
||||
extern void DAC_IrqHandler( void ) ;
|
||||
extern void EEFC_IrqHandler( void ) ;
|
||||
extern void MCI_IrqHandler( void ) ;
|
||||
extern void PIOA_IrqHandler( void ) ;
|
||||
extern void PIOB_IrqHandler( void ) ;
|
||||
extern void PIOC_IrqHandler( void ) ;
|
||||
extern void PMC_IrqHandler( void ) ;
|
||||
extern void PWM_IrqHandler( void ) ;
|
||||
extern void RSTC_IrqHandler( void ) ;
|
||||
extern void RTC_IrqHandler( void ) ;
|
||||
extern void RTT_IrqHandler( void ) ;
|
||||
extern void SMC_IrqHandler( void ) ;
|
||||
extern void SPI_IrqHandler( void ) ;
|
||||
extern void SSC_IrqHandler( void ) ;
|
||||
extern void SUPC_IrqHandler( void ) ;
|
||||
extern void TC0_IrqHandler( void ) ;
|
||||
extern void TC1_IrqHandler( void ) ;
|
||||
extern void TC2_IrqHandler( void ) ;
|
||||
extern void TC3_IrqHandler( void ) ;
|
||||
extern void TC4_IrqHandler( void ) ;
|
||||
extern void TC5_IrqHandler( void ) ;
|
||||
extern void TWI0_IrqHandler( void ) ;
|
||||
extern void TWI1_IrqHandler( void ) ;
|
||||
extern void UART0_IrqHandler( void ) ;
|
||||
extern void UART1_IrqHandler( void ) ;
|
||||
extern void USART0_IrqHandler( void ) ;
|
||||
extern void USART1_IrqHandler( void ) ;
|
||||
extern void USBD_IrqHandler(void);
|
||||
extern void WDT_IrqHandler( void ) ;
|
||||
|
||||
#endif /* _EXCEPTIONS_ */
|
|
@ -1,206 +0,0 @@
|
|||
/* ----------------------------------------------------------------------------
|
||||
* ATMEL Microcontroller Software Support
|
||||
* ----------------------------------------------------------------------------
|
||||
* Copyright (c) 2010, Atmel Corporation
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the disclaimer below.
|
||||
*
|
||||
* Atmel's name may not be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \section Purpose
|
||||
*
|
||||
* This file provides a basic API for PIO configuration and usage of
|
||||
* user-controlled pins. Please refer to the board.h file for a list of
|
||||
* available pin definitions.
|
||||
*
|
||||
* \section Usage
|
||||
*
|
||||
* -# Define a constant pin description array such as the following one, using
|
||||
* the existing definitions provided by the board.h file if possible:
|
||||
* \code
|
||||
* const Pin pPins[] = {PIN_USART0_TXD, PIN_USART0_RXD};
|
||||
* \endcode
|
||||
* Alternatively, it is possible to add new pins by provided the full Pin
|
||||
* structure:
|
||||
* \code
|
||||
* // Pin instance to configure PA10 & PA11 as inputs with the internal
|
||||
* // pull-up enabled.
|
||||
* const Pin pPins = {
|
||||
* (1 << 10) | (1 << 11),
|
||||
* REG_PIOA,
|
||||
* ID_PIOA,
|
||||
* PIO_INPUT,
|
||||
* PIO_PULLUP
|
||||
* };
|
||||
* \endcode
|
||||
* -# Configure a pin array by calling PIO_Configure() with a pointer to the
|
||||
* array and its size (which is computed using the PIO_LISTSIZE macro).
|
||||
* -# Change and get the value of a user-controlled pin using the PIO_Set,
|
||||
* PIO_Clear and PIO_Get methods.
|
||||
* -# Get the level being currently output by a user-controlled pin configured
|
||||
* as an output using PIO_GetOutputDataStatus().
|
||||
*/
|
||||
|
||||
#ifndef _PIO_
|
||||
#define _PIO_
|
||||
|
||||
/*
|
||||
* Headers
|
||||
*/
|
||||
|
||||
#include "chip.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/*
|
||||
* Global Definitions
|
||||
*/
|
||||
|
||||
/* The pin is controlled by the associated signal of peripheral A. */
|
||||
#define PIO_PERIPH_A 0
|
||||
/* The pin is controlled by the associated signal of peripheral B. */
|
||||
#define PIO_PERIPH_B 1
|
||||
/* The pin is controlled by the associated signal of peripheral C. */
|
||||
#define PIO_PERIPH_C 2
|
||||
/* The pin is controlled by the associated signal of peripheral D. */
|
||||
#define PIO_PERIPH_D 3
|
||||
/* The pin is an input. */
|
||||
#define PIO_INPUT 4
|
||||
/* The pin is an output and has a default level of 0. */
|
||||
#define PIO_OUTPUT_0 5
|
||||
/* The pin is an output and has a default level of 1. */
|
||||
#define PIO_OUTPUT_1 6
|
||||
|
||||
/* Default pin configuration (no attribute). */
|
||||
#define PIO_DEFAULT (0 << 0)
|
||||
/* The internal pin pull-up is active. */
|
||||
#define PIO_PULLUP (1 << 0)
|
||||
/* The internal glitch filter is active. */
|
||||
#define PIO_DEGLITCH (1 << 1)
|
||||
/* The pin is open-drain. */
|
||||
#define PIO_OPENDRAIN (1 << 2)
|
||||
|
||||
/* The internal debouncing filter is active. */
|
||||
#define PIO_DEBOUNCE (1 << 3)
|
||||
|
||||
/* Enable additional interrupt modes. */
|
||||
#define PIO_IT_AIME (1 << 4)
|
||||
|
||||
/* Interrupt High Level/Rising Edge detection is active. */
|
||||
#define PIO_IT_RE_OR_HL (1 << 5)
|
||||
/* Interrupt Edge detection is active. */
|
||||
#define PIO_IT_EDGE (1 << 6)
|
||||
|
||||
/* Low level interrupt is active */
|
||||
#define PIO_IT_LOW_LEVEL (0 | 0 | PIO_IT_AIME)
|
||||
/* High level interrupt is active */
|
||||
#define PIO_IT_HIGH_LEVEL (PIO_IT_RE_OR_HL | 0 | PIO_IT_AIME)
|
||||
/* Falling edge interrupt is active */
|
||||
#define PIO_IT_FALL_EDGE (0 | PIO_IT_EDGE | PIO_IT_AIME)
|
||||
/* Rising edge interrupt is active */
|
||||
#define PIO_IT_RISE_EDGE (PIO_IT_RE_OR_HL | PIO_IT_EDGE | PIO_IT_AIME)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Global Macros
|
||||
*/
|
||||
|
||||
/**
|
||||
* Calculates the size of an array of Pin instances. The array must be defined
|
||||
* locally (i.e. not a pointer), otherwise the computation will not be correct.
|
||||
* \param pPins Local array of Pin instances.
|
||||
* \return Number of elements in array.
|
||||
*/
|
||||
#define PIO_LISTSIZE(pPins) (sizeof(pPins) / sizeof(Pin))
|
||||
|
||||
/*
|
||||
* Global Types
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Describes the type and attribute of one PIO pin or a group of similar pins.
|
||||
* The #type# field can have the following values:
|
||||
* - PIO_PERIPH_A
|
||||
* - PIO_PERIPH_B
|
||||
* - PIO_OUTPUT_0
|
||||
* - PIO_OUTPUT_1
|
||||
* - PIO_INPUT
|
||||
*
|
||||
* The #attribute# field is a bitmask that can either be set to PIO_DEFAULt,
|
||||
* or combine (using bitwise OR '|') any number of the following constants:
|
||||
* - PIO_PULLUP
|
||||
* - PIO_DEGLITCH
|
||||
* - PIO_DEBOUNCE
|
||||
* - PIO_OPENDRAIN
|
||||
* - PIO_IT_LOW_LEVEL
|
||||
* - PIO_IT_HIGH_LEVEL
|
||||
* - PIO_IT_FALL_EDGE
|
||||
* - PIO_IT_RISE_EDGE
|
||||
*/
|
||||
typedef struct _Pin
|
||||
{
|
||||
/* Bitmask indicating which pin(s) to configure. */
|
||||
uint32_t mask;
|
||||
/* Pointer to the PIO controller which has the pin(s). */
|
||||
Pio *pio;
|
||||
/* Peripheral ID of the PIO controller which has the pin(s). */
|
||||
uint8_t id;
|
||||
/* Pin type. */
|
||||
uint8_t type;
|
||||
/* Pin attribute. */
|
||||
uint8_t attribute;
|
||||
} Pin ;
|
||||
|
||||
/*
|
||||
* Global Access Macros
|
||||
*/
|
||||
|
||||
/*
|
||||
* Global Functions
|
||||
*/
|
||||
|
||||
extern uint8_t PIO_Configure( const Pin *list, uint32_t size ) ;
|
||||
|
||||
extern void PIO_Set( const Pin *pin ) ;
|
||||
|
||||
extern void PIO_Clear( const Pin *pin ) ;
|
||||
|
||||
extern uint8_t PIO_Get( const Pin *pin ) ;
|
||||
|
||||
extern uint8_t PIO_GetOutputDataStatus( const Pin *pin ) ;
|
||||
|
||||
extern void PIO_SetDebounceFilter( const Pin *pin, uint32_t cuttoff );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* #ifndef _PIO_ */
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
/* ----------------------------------------------------------------------------
|
||||
* ATMEL Microcontroller Software Support
|
||||
* ----------------------------------------------------------------------------
|
||||
* Copyright (c) 2010, Atmel Corporation
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the disclaimer below.
|
||||
*
|
||||
* Atmel's name may not be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* \page sam3s_ppc SAM3S PIO Parallel Capture
|
||||
*
|
||||
* \section Purpose
|
||||
*
|
||||
* Interface for configuration the PIO Parallel Capture peripheral.
|
||||
*
|
||||
* \section Usage
|
||||
*
|
||||
* -# Configurate the interrupt for PIOA, can be done by PIO_InitializeInterrupts()
|
||||
* -# Initialize the PIO Parallel Capture API by filing the SpioCaptureInit structur.
|
||||
* 2 options:
|
||||
* - alwaysSampling: for sample data with or without take in account ENABLE pins.
|
||||
* - halfSampling: for sample all data or only one time out of two
|
||||
* -# Call PIO_CaptureInit() for init and enable the PDC, init the PIO capture.
|
||||
* -# Call PIO_CaptureEnable() for enable the PIO Parallel Capture.
|
||||
* -# When an interrupt is received, the PIO_CaptureHandler() is call and the respective
|
||||
* callback is launch.
|
||||
* -# When the transfer is complete, the user need to disable interrupt with
|
||||
* PIO_CaptureDisableIt(). Otherway, the PDC will send an interrupt.
|
||||
* -# The data receive by the PIO Parallel Capture is inside the buffer passed in the
|
||||
* PIO_CaptureInit().
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef PIO_CAPTURE_H
|
||||
#define PIO_CAPTURE_H
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Types
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
/** \brief PIO Parallel Capture structure for initialize.
|
||||
*
|
||||
* At the end of the transfer, the callback is invoked by the interrupt handler.
|
||||
*/
|
||||
typedef struct _SpioCaptureInit {
|
||||
|
||||
/** PIO_PCRHR register is a BYTE, HALF-WORD or WORD */
|
||||
uint8_t dsize;
|
||||
/** PDC size, data to be received */
|
||||
uint16_t dPDCsize;
|
||||
/** Data to be received */
|
||||
uint32_t *pData;
|
||||
/** Parallel Capture Mode Always Sampling */
|
||||
uint8_t alwaysSampling;
|
||||
/** Parallel Capture Mode Half Sampling */
|
||||
uint8_t halfSampling;
|
||||
/** Parallel Capture Mode First Sample */
|
||||
uint8_t modeFirstSample;
|
||||
/** Callback function invoked at Mode Data Ready */
|
||||
void (*CbkDataReady)( struct _SpioCaptureInit* );
|
||||
/** Callback function invoked at Mode Overrun Error */
|
||||
void (*CbkOverrun)( struct _SpioCaptureInit* );
|
||||
/** Callback function invoked at End of Reception Transfer */
|
||||
void (*CbkEndReception)( struct _SpioCaptureInit* );
|
||||
/** Callback function invoked at Reception Buffer Full */
|
||||
void (*CbkBuffFull)( struct _SpioCaptureInit* );
|
||||
/** Callback arguments.*/
|
||||
void *pParam;
|
||||
|
||||
} SpioCaptureInit ;
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Global Functions
|
||||
*----------------------------------------------------------------------------*/
|
||||
extern void PIO_CaptureDisableIt( uint32_t itToDisable ) ;
|
||||
extern void PIO_CaptureEnableIt( uint32_t itToEnable ) ;
|
||||
extern void PIO_CaptureEnable( void ) ;
|
||||
extern void PIO_CaptureDisable( void ) ;
|
||||
extern void PIO_CaptureInit( SpioCaptureInit* pInit ) ;
|
||||
|
||||
#endif /* #ifndef PIO_CAPTURE_H */
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
/* ----------------------------------------------------------------------------
|
||||
* ATMEL Microcontroller Software Support
|
||||
* ----------------------------------------------------------------------------
|
||||
* Copyright (c) 2008, Atmel Corporation
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the disclaimer below.
|
||||
*
|
||||
* Atmel's name may not be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \par Purpose
|
||||
*
|
||||
* Configuration and handling of interrupts on PIO status changes. The API
|
||||
* provided here have several advantages over the traditional PIO interrupt
|
||||
* configuration approach:
|
||||
* - It is highly portable
|
||||
* - It automatically demultiplexes interrupts when multiples pins have been
|
||||
* configured on a single PIO controller
|
||||
* - It allows a group of pins to share the same interrupt
|
||||
*
|
||||
* However, it also has several minor drawbacks that may prevent from using it
|
||||
* in particular applications:
|
||||
* - It enables the clocks of all PIO controllers
|
||||
* - PIO controllers all share the same interrupt handler, which does the
|
||||
* demultiplexing and can be slower than direct configuration
|
||||
* - It reserves space for a fixed number of interrupts, which can be
|
||||
* increased by modifying the appropriate constant in pio_it.c.
|
||||
*
|
||||
* \par Usage
|
||||
*
|
||||
* -# Initialize the PIO interrupt mechanism using PIO_InitializeInterrupts()
|
||||
* with the desired priority (0 ... 7).
|
||||
* -# Configure a status change interrupt on one or more pin(s) with
|
||||
* PIO_ConfigureIt().
|
||||
* -# Enable & disable interrupts on pins using PIO_EnableIt() and
|
||||
* PIO_DisableIt().
|
||||
*/
|
||||
|
||||
#ifndef _PIO_IT_
|
||||
#define _PIO_IT_
|
||||
|
||||
/*
|
||||
* Headers
|
||||
*/
|
||||
|
||||
#include "pio.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Global functions
|
||||
*/
|
||||
|
||||
extern void PIO_InitializeInterrupts( uint32_t dwPriority ) ;
|
||||
|
||||
extern void PIO_ConfigureIt( const Pin *pPin, void (*handler)( const Pin* ) ) ;
|
||||
|
||||
extern void PIO_EnableIt( const Pin *pPin ) ;
|
||||
|
||||
extern void PIO_DisableIt( const Pin *pPin ) ;
|
||||
|
||||
extern void PIO_IT_InterruptHandler( void ) ;
|
||||
|
||||
extern void PioInterruptHandler( uint32_t id, Pio *pPio ) ;
|
||||
|
||||
extern void PIO_CaptureHandler( void ) ;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* #ifndef _PIO_IT_ */
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
/* ----------------------------------------------------------------------------
|
||||
* ATMEL Microcontroller Software Support
|
||||
* ----------------------------------------------------------------------------
|
||||
* Copyright (c) 2009, Atmel Corporation
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the disclaimer below.
|
||||
*
|
||||
* Atmel's name may not be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef _PMC_
|
||||
#define _PMC_
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Headers
|
||||
*----------------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Exported functions
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern void PMC_EnablePeripheral( uint32_t dwId ) ;
|
||||
extern void PMC_DisablePeripheral( uint32_t dwId ) ;
|
||||
|
||||
extern void PMC_EnableAllPeripherals( void ) ;
|
||||
extern void PMC_DisableAllPeripherals( void ) ;
|
||||
|
||||
extern uint32_t PMC_IsPeriphEnabled( uint32_t dwId ) ;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* #ifndef _PMC_ */
|
||||
|
|
@ -1,115 +0,0 @@
|
|||
/* ----------------------------------------------------------------------------
|
||||
* ATMEL Microcontroller Software Support
|
||||
* ----------------------------------------------------------------------------
|
||||
* Copyright (c) 2009, Atmel Corporation
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the disclaimer below.
|
||||
*
|
||||
* Atmel's name may not be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* Interface for Serial Peripheral Interface (SPI) controller.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _SPI_
|
||||
#define _SPI_
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Headers
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "chip.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Macros
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
*
|
||||
* Here are several macros which should be used when configuring a SPI
|
||||
* peripheral.
|
||||
*
|
||||
* \section spi_configuration_macros SPI Configuration Macros
|
||||
* - \ref SPI_PCS
|
||||
* - \ref SPI_SCBR
|
||||
* - \ref SPI_DLYBS
|
||||
* - \ref SPI_DLYBCT
|
||||
*/
|
||||
|
||||
/** Calculate the PCS field value given the chip select NPCS value */
|
||||
#define SPI_PCS(npcs) ((~(1 << npcs) & 0xF) << 16)
|
||||
|
||||
/** Calculates the value of the CSR SCBR field given the baudrate and MCK. */
|
||||
#define SPI_SCBR(baudrate, masterClock) ((uint32_t) (masterClock / baudrate) << 8)
|
||||
|
||||
/** Calculates the value of the CSR DLYBS field given the desired delay (in ns) */
|
||||
#define SPI_DLYBS(delay, masterClock) ((uint32_t) (((masterClock / 1000000) * delay) / 1000) << 16)
|
||||
|
||||
/** Calculates the value of the CSR DLYBCT field given the desired delay (in ns) */
|
||||
#define SPI_DLYBCT(delay, masterClock) ((uint32_t) (((masterClock / 1000000) * delay) / 32000) << 24)
|
||||
|
||||
/*------------------------------------------------------------------------------ */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Exported functions
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
extern void SPI_Enable( Spi* spi ) ;
|
||||
extern void SPI_Disable( Spi* spi ) ;
|
||||
extern void SPI_EnableIt( Spi* spi, uint32_t dwSources ) ;
|
||||
extern void SPI_DisableIt( Spi* spi, uint32_t dwSources ) ;
|
||||
|
||||
extern void SPI_Configure( Spi* spi, uint32_t dwId, uint32_t dwConfiguration ) ;
|
||||
extern void SPI_ConfigureNPCS( Spi* spi, uint32_t dwNpcs, uint32_t dwConfiguration ) ;
|
||||
|
||||
extern uint32_t SPI_Read( Spi* spi ) ;
|
||||
extern void SPI_Write( Spi* spi, uint32_t dwNpcs, uint16_t wData ) ;
|
||||
|
||||
extern uint32_t SPI_GetStatus( Spi* spi ) ;
|
||||
extern uint32_t SPI_IsFinished( Spi* pSpi ) ;
|
||||
|
||||
extern void SPI_PdcEnableTx( Spi* spi ) ;
|
||||
extern void SPI_PdcDisableTx( Spi* spi ) ;
|
||||
extern void SPI_PdcEnableRx( Spi* spi ) ;
|
||||
extern void SPI_PdcDisableRx( Spi* spi ) ;
|
||||
|
||||
extern void SPI_PdcSetTx( Spi* spi, void* pvTxBuf, uint32_t dwTxCount, void* pvTxNextBuf, uint32_t dwTxNextCount ) ;
|
||||
extern void SPI_PdcSetRx( Spi* spi, void* pvRxBuf, uint32_t dwRxCount, void* pvRxNextBuf, uint32_t dwRxNextCount ) ;
|
||||
|
||||
extern uint32_t SPI_WriteBuffer( Spi* spi, void* pvBuffer, uint32_t dwLength ) ;
|
||||
|
||||
extern uint32_t SPI_ReadBuffer( Spi* spi, void* pvBuffer, uint32_t dwLength ) ;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* #ifndef _SPI_ */
|
||||
|
|
@ -1,76 +0,0 @@
|
|||
/* ----------------------------------------------------------------------------
|
||||
* ATMEL Microcontroller Software Support
|
||||
* ----------------------------------------------------------------------------
|
||||
* Copyright (c) 2009, Atmel Corporation
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the disclaimer below.
|
||||
*
|
||||
* Atmel's name may not be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \section Purpose
|
||||
*
|
||||
* Interface for configuring and using Timer Counter (TC) peripherals.
|
||||
*
|
||||
* \section Usage
|
||||
* -# Optionally, use TC_FindMckDivisor() to let the program find the best
|
||||
* TCCLKS field value automatically.
|
||||
* -# Configure a Timer Counter in the desired mode using TC_Configure().
|
||||
* -# Start or stop the timer clock using TC_Start() and TC_Stop().
|
||||
*/
|
||||
|
||||
#ifndef _TC_
|
||||
#define _TC_
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Headers
|
||||
*------------------------------------------------------------------------------*/
|
||||
|
||||
#include "chip.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Global functions
|
||||
*------------------------------------------------------------------------------*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern void TC_Configure( Tc *pTc, uint32_t dwChannel, uint32_t dwMode ) ;
|
||||
|
||||
extern void TC_Start( Tc *pTc, uint32_t dwChannel ) ;
|
||||
|
||||
extern void TC_Stop( Tc *pTc, uint32_t dwChannel ) ;
|
||||
|
||||
extern uint32_t TC_FindMckDivisor( uint32_t dwFreq, uint32_t dwMCk, uint32_t *dwDiv, uint32_t *dwTcClks, uint32_t dwBoardMCK ) ;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* #ifndef _TC_ */
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
/* ----------------------------------------------------------------------------
|
||||
* ATMEL Microcontroller Software Support
|
||||
* ----------------------------------------------------------------------------
|
||||
* Copyright (c) 2009, Atmel Corporation
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the disclaimer below.
|
||||
*
|
||||
* Atmel's name may not be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \section Purpose
|
||||
* Interface for Watchdog Timer (WDT) controller.
|
||||
*
|
||||
* \section Usage
|
||||
* -# Enable watchdog with given mode using \ref WDT_Enable().
|
||||
* -# Disable watchdog using \ref WDT_Disable()
|
||||
* -# Restart the watchdog using \ref WDT_Restart().
|
||||
* -# Get watchdog status using \ref WDT_GetStatus().
|
||||
* -# Caculate watchdog period value using \ref WDT_GetPeriod().
|
||||
*/
|
||||
|
||||
#ifndef _WDT_
|
||||
#define _WDT_
|
||||
|
||||
#include "chip.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Exported functions
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
extern void WDT_Enable( Wdt* pWDT, uint32_t dwMode ) ;
|
||||
|
||||
extern void WDT_Disable( Wdt* pWDT ) ;
|
||||
|
||||
extern void WDT_Restart( Wdt* pWDT ) ;
|
||||
|
||||
extern uint32_t WDT_GetStatus( Wdt* pWDT ) ;
|
||||
|
||||
extern uint32_t WDT_GetPeriod( uint32_t dwMs ) ;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* #ifndef _WDT_ */
|
||||
|
Loading…
Reference in New Issue