Atmel Software Framework

bsp-evk1105.c File Reference
#include <includes.h>
#include "led.h"

Data Structures

struct  bsp_intc_handler
 

Macros

#define AVR32_INTC_ICR_reg   ((volatile CPU_INT32U *)(AVR32_INTC_ADDRESS + 0x200))
 
#define BSP_INTC_INT0   0 /* lowest interrupt priority level */
 
#define BSP_INTC_INT1   1
 
#define BSP_INTC_INT2   2
 
#define BSP_INTC_INT3   3 /* highest interrupt priority level */
 
#define BSP_INTC_IPR_INTLEVEL_OFFSET   30 /* Interrupt level offset in Interrupt Priority Register */
 
#define BSP_INTC_IRQS_PER_GRP   32 /* Maximum number of interrupt request lines per group */
 
#define BSP_IRQ_COMPARE   AVR32_CORE_COMPARE_IRQ
 
#define BSP_USART0_RXD_FUNCTION   AVR32_USART0_RXD_0_0_FUNCTION
 
#define BSP_USART0_RXD_PIN   AVR32_USART0_RXD_0_0_PIN
 
#define BSP_USART0_TXD_FUNCTION   AVR32_USART0_TXD_0_0_FUNCTION
 
#define BSP_USART0_TXD_PIN   AVR32_USART0_TXD_0_0_PIN
 
#define BSP_USART1_RXD_FUNCTION   AVR32_USART1_RXD_0_0_FUNCTION
 
#define BSP_USART1_RXD_PIN   AVR32_USART1_RXD_0_0_PIN
 
#define BSP_USART1_TXD_FUNCTION   AVR32_USART1_TXD_0_0_FUNCTION
 
#define BSP_USART1_TXD_PIN   AVR32_USART1_TXD_0_0_PIN
 
#define BSP_USART2_RXD_FUNCTION   AVR32_USART2_RXD_0_0_FUNCTION
 
#define BSP_USART2_RXD_PIN   AVR32_USART2_RXD_0_0_PIN
 
#define BSP_USART2_TXD_FUNCTION   AVR32_USART2_TXD_0_0_FUNCTION
 
#define BSP_USART2_TXD_PIN   AVR32_USART2_TXD_0_0_PIN
 
#define BSP_USART3_RXD_FUNCTION   AVR32_USART3_RXD_0_0_FUNCTION
 
#define BSP_USART3_RXD_PIN   AVR32_USART3_RXD_0_0_PIN
 
#define BSP_USART3_TXD_FUNCTION   AVR32_USART3_TXD_0_0_FUNCTION
 
#define BSP_USART3_TXD_PIN   AVR32_USART3_TXD_0_0_PIN
 
#define FOSC0   (12000000) /* Frequency: Hz */
 
#define RCOSC   AVR32_PM_RCOSC_FREQUENCY /* Internal RC oscillator frequency */
 

Typedefs

typedef struct bsp_intc_handler BSP_INTC_HANDLER
 

Functions

CPU_INT32U BSP_CPU_ClkFreq (void)
 
static void BSP_FLASHC_SetWaitState (CPU_INT16U ws)
 
void BSP_GPIO_IntFlagClr (CPU_INT16U pin)
 
CPU_BOOLEAN BSP_GPIO_IntFlagRd (CPU_INT16U pin)
 
void BSP_GPIO_PinClr (CPU_INT16U pin)
 
CPU_BOOLEAN BSP_GPIO_PinGet (CPU_INT16U pin)
 
void BSP_GPIO_PinSet (CPU_INT16U pin)
 
void BSP_GPIO_PinTgl (CPU_INT16U pin)
 
void BSP_GPIO_SetFnct (CPU_INT16U pin, CPU_INT08U fnct)
 
void BSP_GPIO_SetIntMode (CPU_INT16U pin, CPU_INT08U mode)
 
void BSP_Init (void)
 
CPU_INT32U BSP_INTC_FastIntReg (CPU_FNCT_VOID handler, CPU_INT32U irq, CPU_INT32U int_level)
 
static void BSP_INTC_Init (void)
 
CPU_FNCT_VOID BSP_INTC_IntGetHandler (CPU_INT32U int_level)
 
CPU_INT32U BSP_INTC_IntReg (CPU_FNCT_VOID handler, CPU_INT32U irq, CPU_INT32U int_level)
 
static void BSP_INTC_IntUnhandled (void)
 
CPU_INT32U BSP_PBA_ClkFreq (void)
 
CPU_INT32U BSP_PBB_ClkFreq (void)
 
static void BSP_PM_ClkSelect (CPU_BOOLEAN cpudiv, CPU_INT08U cpusel, CPU_BOOLEAN pbadiv, CPU_INT08U pbasel, CPU_BOOLEAN pbbdiv, CPU_INT08U pbbsel)
 
static void BSP_PM_ClkSwitch (CPU_INT08U clk)
 
static void BSP_PM_GClkSetup (CPU_INT08U pll)
 
static void BSP_PM_GClkSetup (CPU_BOOLEAN pll)
 
static void BSP_PM_OSC0Setup (void)
 
static void BSP_PM_PLL0Setup (CPU_INT08U mul, CPU_INT08U div, CPU_BOOLEAN div2)
 
static void BSP_TmrInit (void)
 
static void BSP_TmrReload (void)
 
static void BSP_TmrTickISR (void)
 
CPU_INT08U BSP_USART_ByteRd (CPU_INT08U com)
 
void BSP_USART_ByteWr (CPU_INT08U com, CPU_INT08U b)
 
void BSP_USART_Init (CPU_INT08U com, CPU_INT32U baud_rate)
 
void BSP_USART_IntDis (CPU_INT08U com, CPU_INT32U mask)
 
void BSP_USART_IntEn (CPU_INT08U com, CPU_INT32U mask)
 
void BSP_USART_PrintDec (CPU_INT08U com, CPU_INT32U value, CPU_INT08U digits)
 
void BSP_USART_printf (CPU_INT08U com, CPU_CHAR *format,...)
 
void BSP_USART_PrintHex (CPU_INT08U com, CPU_INT32U value, CPU_INT08U digits)
 
void BSP_USART_StrWr (CPU_INT08U com, CPU_INT08U *s)
 
static void LED_Init (void)
 

Variables

const BSP_INTC_HANDLER BSP_INTC_Handlers [AVR32_INTC_NUM_INT_GRPS]
 
static volatile CPU_FNCT_VOID Int_Handler_Tbl_0 [AVR32_INTC_NUM_IRQS_PER_GRP0]
 
static volatile CPU_FNCT_VOID Int_Handler_Tbl_1 [AVR32_INTC_NUM_IRQS_PER_GRP1]
 
static volatile CPU_FNCT_VOID Int_Handler_Tbl_10 [AVR32_INTC_NUM_IRQS_PER_GRP10]
 
static volatile CPU_FNCT_VOID Int_Handler_Tbl_11 [AVR32_INTC_NUM_IRQS_PER_GRP11]
 
static volatile CPU_FNCT_VOID Int_Handler_Tbl_12 [AVR32_INTC_NUM_IRQS_PER_GRP12]
 
static volatile CPU_FNCT_VOID Int_Handler_Tbl_13 [AVR32_INTC_NUM_IRQS_PER_GRP13]
 
static volatile CPU_FNCT_VOID Int_Handler_Tbl_14 [AVR32_INTC_NUM_IRQS_PER_GRP14]
 
static volatile CPU_FNCT_VOID Int_Handler_Tbl_15 [AVR32_INTC_NUM_IRQS_PER_GRP15]
 
static volatile CPU_FNCT_VOID Int_Handler_Tbl_16 [AVR32_INTC_NUM_IRQS_PER_GRP16]
 
static volatile CPU_FNCT_VOID Int_Handler_Tbl_17 [AVR32_INTC_NUM_IRQS_PER_GRP17]
 
static volatile CPU_FNCT_VOID Int_Handler_Tbl_18 [AVR32_INTC_NUM_IRQS_PER_GRP18]
 
static volatile CPU_FNCT_VOID Int_Handler_Tbl_2 [AVR32_INTC_NUM_IRQS_PER_GRP2]
 
static volatile CPU_FNCT_VOID Int_Handler_Tbl_3 [AVR32_INTC_NUM_IRQS_PER_GRP3]
 
static volatile CPU_FNCT_VOID Int_Handler_Tbl_4 [AVR32_INTC_NUM_IRQS_PER_GRP4]
 
static volatile CPU_FNCT_VOID Int_Handler_Tbl_5 [AVR32_INTC_NUM_IRQS_PER_GRP5]
 
static volatile CPU_FNCT_VOID Int_Handler_Tbl_6 [AVR32_INTC_NUM_IRQS_PER_GRP6]
 
static volatile CPU_FNCT_VOID Int_Handler_Tbl_7 [AVR32_INTC_NUM_IRQS_PER_GRP7]
 
static volatile CPU_FNCT_VOID Int_Handler_Tbl_8 [AVR32_INTC_NUM_IRQS_PER_GRP8]
 
static volatile CPU_FNCT_VOID Int_Handler_Tbl_9 [AVR32_INTC_NUM_IRQS_PER_GRP9]
 

#define AVR32_INTC_ICR_reg   ((volatile CPU_INT32U *)(AVR32_INTC_ADDRESS + 0x200))

Referenced by BSP_INTC_IntGetHandler().

#define BSP_INTC_INT0   0 /* lowest interrupt priority level */

Referenced by BSP_INTC_Init().

#define BSP_INTC_INT1   1
#define BSP_INTC_INT2   2
#define BSP_INTC_INT3   3 /* highest interrupt priority level */

Referenced by BSP_INTC_IntGetHandler().

#define BSP_INTC_IPR_INTLEVEL_OFFSET   30 /* Interrupt level offset in Interrupt Priority Register */
#define BSP_INTC_IRQS_PER_GRP   32 /* Maximum number of interrupt request lines per group */
#define BSP_IRQ_COMPARE   AVR32_CORE_COMPARE_IRQ

Referenced by BSP_Init().

#define BSP_USART0_RXD_FUNCTION   AVR32_USART0_RXD_0_0_FUNCTION

Referenced by BSP_USART_Init().

#define BSP_USART0_RXD_PIN   AVR32_USART0_RXD_0_0_PIN

Referenced by BSP_USART_Init().

#define BSP_USART0_TXD_FUNCTION   AVR32_USART0_TXD_0_0_FUNCTION

Referenced by BSP_USART_Init().

#define BSP_USART0_TXD_PIN   AVR32_USART0_TXD_0_0_PIN

Referenced by BSP_USART_Init().

#define BSP_USART1_RXD_FUNCTION   AVR32_USART1_RXD_0_0_FUNCTION

Referenced by BSP_USART_Init().

#define BSP_USART1_RXD_PIN   AVR32_USART1_RXD_0_0_PIN

Referenced by BSP_USART_Init().

#define BSP_USART1_TXD_FUNCTION   AVR32_USART1_TXD_0_0_FUNCTION

Referenced by BSP_USART_Init().

#define BSP_USART1_TXD_PIN   AVR32_USART1_TXD_0_0_PIN

Referenced by BSP_USART_Init().

#define BSP_USART2_RXD_FUNCTION   AVR32_USART2_RXD_0_0_FUNCTION

Referenced by BSP_USART_Init().

#define BSP_USART2_RXD_PIN   AVR32_USART2_RXD_0_0_PIN

Referenced by BSP_USART_Init().

#define BSP_USART2_TXD_FUNCTION   AVR32_USART2_TXD_0_0_FUNCTION

Referenced by BSP_USART_Init().

#define BSP_USART2_TXD_PIN   AVR32_USART2_TXD_0_0_PIN

Referenced by BSP_USART_Init().

#define BSP_USART3_RXD_FUNCTION   AVR32_USART3_RXD_0_0_FUNCTION

Referenced by BSP_USART_Init().

#define BSP_USART3_RXD_PIN   AVR32_USART3_RXD_0_0_PIN

Referenced by BSP_USART_Init().

#define BSP_USART3_TXD_FUNCTION   AVR32_USART3_TXD_0_0_FUNCTION

Referenced by BSP_USART_Init().

#define BSP_USART3_TXD_PIN   AVR32_USART3_TXD_0_0_PIN

Referenced by BSP_USART_Init().

#define RCOSC   AVR32_PM_RCOSC_FREQUENCY /* Internal RC oscillator frequency */

CPU_INT32U BSP_CPU_ClkFreq ( void  )
static void BSP_FLASHC_SetWaitState ( CPU_INT16U  ws)
static
void BSP_GPIO_IntFlagClr ( CPU_INT16U  pin)
CPU_BOOLEAN BSP_GPIO_IntFlagRd ( CPU_INT16U  pin)
void BSP_GPIO_PinClr ( CPU_INT16U  pin)
CPU_BOOLEAN BSP_GPIO_PinGet ( CPU_INT16U  pin)
void BSP_GPIO_PinSet ( CPU_INT16U  pin)
void BSP_GPIO_PinTgl ( CPU_INT16U  pin)
void BSP_GPIO_SetFnct ( CPU_INT16U  pin,
CPU_INT08U  fnct 
)

Referenced by BSP_PM_GClkSetup(), and BSP_USART_Init().

void BSP_GPIO_SetIntMode ( CPU_INT16U  pin,
CPU_INT08U  mode 
)
void BSP_Init ( void  )
CPU_INT32U BSP_INTC_FastIntReg ( CPU_FNCT_VOID  handler,
CPU_INT32U  irq,
CPU_INT32U  int_level 
)
CPU_FNCT_VOID BSP_INTC_IntGetHandler ( CPU_INT32U  int_level)
CPU_INT32U BSP_INTC_IntReg ( CPU_FNCT_VOID  handler,
CPU_INT32U  irq,
CPU_INT32U  int_level 
)
static void BSP_INTC_IntUnhandled ( void  )
static

Referenced by BSP_INTC_Init().

CPU_INT32U BSP_PBA_ClkFreq ( void  )

Referenced by BSP_USART_Init().

CPU_INT32U BSP_PBB_ClkFreq ( void  )
static void BSP_PM_ClkSelect ( CPU_BOOLEAN  cpudiv,
CPU_INT08U  cpusel,
CPU_BOOLEAN  pbadiv,
CPU_INT08U  pbasel,
CPU_BOOLEAN  pbbdiv,
CPU_INT08U  pbbsel 
)
static
static void BSP_PM_ClkSwitch ( CPU_INT08U  clk)
static
static void BSP_PM_GClkSetup ( CPU_INT08U  pll)
static
static void BSP_PM_GClkSetup ( CPU_BOOLEAN  pll)
static

References BSP_GPIO_SetFnct().

static void BSP_PM_OSC0Setup ( void  )
static

References FOSC0.

static void BSP_PM_PLL0Setup ( CPU_INT08U  mul,
CPU_INT08U  div,
CPU_BOOLEAN  div2 
)
static

References FOSC0, and opt.

static void BSP_TmrInit ( void  )
static

References CPU_CLK_FREQ, and OS_TICKS_PER_SEC.

Referenced by BSP_Init().

static void BSP_TmrReload ( void  )
static

References CPU_CLK_FREQ, and OS_TICKS_PER_SEC.

Referenced by BSP_TmrTickISR().

void BSP_TmrTickISR ( void  )
static

References BSP_TmrReload(), and OSTimeTick().

Referenced by BSP_Init().

CPU_INT08U BSP_USART_ByteRd ( CPU_INT08U  com)

References b, and OSTimeDly().

void BSP_USART_ByteWr ( CPU_INT08U  com,
CPU_INT08U  b 
)
void BSP_USART_IntDis ( CPU_INT08U  com,
CPU_INT32U  mask 
)
void BSP_USART_IntEn ( CPU_INT08U  com,
CPU_INT32U  mask 
)
void BSP_USART_PrintDec ( CPU_INT08U  com,
CPU_INT32U  value,
CPU_INT08U  digits 
)

References BSP_USART_ByteWr(), and i.

void BSP_USART_printf ( CPU_INT08U  com,
CPU_CHAR *  format,
  ... 
)

References BSP_USART_StrWr(), and buffer.

void BSP_USART_PrintHex ( CPU_INT08U  com,
CPU_INT32U  value,
CPU_INT08U  digits 
)

References BSP_USART_ByteWr(), i, and temp.

void BSP_USART_StrWr ( CPU_INT08U  com,
CPU_INT08U *  s 
)

References BSP_USART_ByteWr().

Referenced by BSP_USART_printf().

static void LED_Init ( void  )
static

Referenced by BSP_Init().

const BSP_INTC_HANDLER BSP_INTC_Handlers[AVR32_INTC_NUM_INT_GRPS]
Initial value:
= {
{AVR32_INTC_NUM_IRQS_PER_GRP0, Int_Handler_Tbl_0},
{AVR32_INTC_NUM_IRQS_PER_GRP1, Int_Handler_Tbl_1},
{AVR32_INTC_NUM_IRQS_PER_GRP2, Int_Handler_Tbl_2},
{AVR32_INTC_NUM_IRQS_PER_GRP3, Int_Handler_Tbl_3},
{AVR32_INTC_NUM_IRQS_PER_GRP4, Int_Handler_Tbl_4},
{AVR32_INTC_NUM_IRQS_PER_GRP5, Int_Handler_Tbl_5},
{AVR32_INTC_NUM_IRQS_PER_GRP6, Int_Handler_Tbl_6},
{AVR32_INTC_NUM_IRQS_PER_GRP7, Int_Handler_Tbl_7},
{AVR32_INTC_NUM_IRQS_PER_GRP8, Int_Handler_Tbl_8},
{AVR32_INTC_NUM_IRQS_PER_GRP9, Int_Handler_Tbl_9},
{AVR32_INTC_NUM_IRQS_PER_GRP10, Int_Handler_Tbl_10},
{AVR32_INTC_NUM_IRQS_PER_GRP11, Int_Handler_Tbl_11},
{AVR32_INTC_NUM_IRQS_PER_GRP12, Int_Handler_Tbl_12},
{AVR32_INTC_NUM_IRQS_PER_GRP13, Int_Handler_Tbl_13},
{AVR32_INTC_NUM_IRQS_PER_GRP14, Int_Handler_Tbl_14},
{AVR32_INTC_NUM_IRQS_PER_GRP15, Int_Handler_Tbl_15},
{AVR32_INTC_NUM_IRQS_PER_GRP16, Int_Handler_Tbl_16},
{AVR32_INTC_NUM_IRQS_PER_GRP17, Int_Handler_Tbl_17},
{AVR32_INTC_NUM_IRQS_PER_GRP18, Int_Handler_Tbl_18},
}
static volatile CPU_FNCT_VOID Int_Handler_Tbl_4[AVR32_INTC_NUM_IRQS_PER_GRP4]
Definition: bsp-evk1105.c:164
static volatile CPU_FNCT_VOID Int_Handler_Tbl_7[AVR32_INTC_NUM_IRQS_PER_GRP7]
Definition: bsp-evk1105.c:167
static volatile CPU_FNCT_VOID Int_Handler_Tbl_18[AVR32_INTC_NUM_IRQS_PER_GRP18]
Definition: bsp-evk1105.c:178
static volatile CPU_FNCT_VOID Int_Handler_Tbl_1[AVR32_INTC_NUM_IRQS_PER_GRP1]
Definition: bsp-evk1105.c:161
static volatile CPU_FNCT_VOID Int_Handler_Tbl_3[AVR32_INTC_NUM_IRQS_PER_GRP3]
Definition: bsp-evk1105.c:163
static volatile CPU_FNCT_VOID Int_Handler_Tbl_11[AVR32_INTC_NUM_IRQS_PER_GRP11]
Definition: bsp-evk1105.c:171
static volatile CPU_FNCT_VOID Int_Handler_Tbl_10[AVR32_INTC_NUM_IRQS_PER_GRP10]
Definition: bsp-evk1105.c:170
static volatile CPU_FNCT_VOID Int_Handler_Tbl_8[AVR32_INTC_NUM_IRQS_PER_GRP8]
Definition: bsp-evk1105.c:168
static volatile CPU_FNCT_VOID Int_Handler_Tbl_5[AVR32_INTC_NUM_IRQS_PER_GRP5]
Definition: bsp-evk1105.c:165
static volatile CPU_FNCT_VOID Int_Handler_Tbl_13[AVR32_INTC_NUM_IRQS_PER_GRP13]
Definition: bsp-evk1105.c:173
static volatile CPU_FNCT_VOID Int_Handler_Tbl_0[AVR32_INTC_NUM_IRQS_PER_GRP0]
Definition: bsp-evk1105.c:160
static volatile CPU_FNCT_VOID Int_Handler_Tbl_14[AVR32_INTC_NUM_IRQS_PER_GRP14]
Definition: bsp-evk1105.c:174
static volatile CPU_FNCT_VOID Int_Handler_Tbl_2[AVR32_INTC_NUM_IRQS_PER_GRP2]
Definition: bsp-evk1105.c:162
static volatile CPU_FNCT_VOID Int_Handler_Tbl_9[AVR32_INTC_NUM_IRQS_PER_GRP9]
Definition: bsp-evk1105.c:169
static volatile CPU_FNCT_VOID Int_Handler_Tbl_12[AVR32_INTC_NUM_IRQS_PER_GRP12]
Definition: bsp-evk1105.c:172
static volatile CPU_FNCT_VOID Int_Handler_Tbl_17[AVR32_INTC_NUM_IRQS_PER_GRP17]
Definition: bsp-evk1105.c:177
static volatile CPU_FNCT_VOID Int_Handler_Tbl_6[AVR32_INTC_NUM_IRQS_PER_GRP6]
Definition: bsp-evk1105.c:166
static volatile CPU_FNCT_VOID Int_Handler_Tbl_15[AVR32_INTC_NUM_IRQS_PER_GRP15]
Definition: bsp-evk1105.c:175
static volatile CPU_FNCT_VOID Int_Handler_Tbl_16[AVR32_INTC_NUM_IRQS_PER_GRP16]
Definition: bsp-evk1105.c:176
volatile CPU_FNCT_VOID Int_Handler_Tbl_0[AVR32_INTC_NUM_IRQS_PER_GRP0]
static
volatile CPU_FNCT_VOID Int_Handler_Tbl_1[AVR32_INTC_NUM_IRQS_PER_GRP1]
static
volatile CPU_FNCT_VOID Int_Handler_Tbl_10[AVR32_INTC_NUM_IRQS_PER_GRP10]
static
volatile CPU_FNCT_VOID Int_Handler_Tbl_11[AVR32_INTC_NUM_IRQS_PER_GRP11]
static
volatile CPU_FNCT_VOID Int_Handler_Tbl_12[AVR32_INTC_NUM_IRQS_PER_GRP12]
static
volatile CPU_FNCT_VOID Int_Handler_Tbl_13[AVR32_INTC_NUM_IRQS_PER_GRP13]
static
volatile CPU_FNCT_VOID Int_Handler_Tbl_14[AVR32_INTC_NUM_IRQS_PER_GRP14]
static
volatile CPU_FNCT_VOID Int_Handler_Tbl_15[AVR32_INTC_NUM_IRQS_PER_GRP15]
static
volatile CPU_FNCT_VOID Int_Handler_Tbl_16[AVR32_INTC_NUM_IRQS_PER_GRP16]
static
volatile CPU_FNCT_VOID Int_Handler_Tbl_17[AVR32_INTC_NUM_IRQS_PER_GRP17]
static
volatile CPU_FNCT_VOID Int_Handler_Tbl_18[AVR32_INTC_NUM_IRQS_PER_GRP18]
static
volatile CPU_FNCT_VOID Int_Handler_Tbl_2[AVR32_INTC_NUM_IRQS_PER_GRP2]
static
volatile CPU_FNCT_VOID Int_Handler_Tbl_3[AVR32_INTC_NUM_IRQS_PER_GRP3]
static
volatile CPU_FNCT_VOID Int_Handler_Tbl_4[AVR32_INTC_NUM_IRQS_PER_GRP4]
static
volatile CPU_FNCT_VOID Int_Handler_Tbl_5[AVR32_INTC_NUM_IRQS_PER_GRP5]
static
volatile CPU_FNCT_VOID Int_Handler_Tbl_6[AVR32_INTC_NUM_IRQS_PER_GRP6]
static
volatile CPU_FNCT_VOID Int_Handler_Tbl_7[AVR32_INTC_NUM_IRQS_PER_GRP7]
static
volatile CPU_FNCT_VOID Int_Handler_Tbl_8[AVR32_INTC_NUM_IRQS_PER_GRP8]
static
volatile CPU_FNCT_VOID Int_Handler_Tbl_9[AVR32_INTC_NUM_IRQS_PER_GRP9]
static