RTEMS  5.1
Data Structures | Macros | Variables
leon.h File Reference
#include <rtems/score/sparc.h>

Go to the source code of this file.

Data Structures

struct  LEON_Register_Map
 

Macros

#define LEON_INTERRUPT_CORRECTABLE_MEMORY_ERROR   1
 
#define LEON_INTERRUPT_UART_2_RX_TX   2
 
#define LEON_INTERRUPT_UART_1_RX_TX   3
 
#define LEON_INTERRUPT_EXTERNAL_0   4
 
#define LEON_INTERRUPT_EXTERNAL_1   5
 
#define LEON_INTERRUPT_EXTERNAL_2   6
 
#define LEON_INTERRUPT_EXTERNAL_3   7
 
#define LEON_INTERRUPT_TIMER1   8
 
#define LEON_INTERRUPT_TIMER2   9
 
#define LEON_INTERRUPT_EMPTY1   10
 
#define LEON_INTERRUPT_EMPTY2   11
 
#define LEON_INTERRUPT_EMPTY3   12
 
#define LEON_INTERRUPT_EMPTY4   13
 
#define LEON_INTERRUPT_EMPTY5   14
 
#define LEON_INTERRUPT_EMPTY6   15
 
#define LEON_TRAP_TYPE(_source)   SPARC_ASYNCHRONOUS_TRAP((_source) + 0x10)
 
#define LEON_TRAP_SOURCE(_trap)   ((_trap) - 0x10)
 
#define LEON_INT_TRAP(_trap)
 
#define LEON_MEMORY_CONFIGURATION_PROM_SIZE_MASK   0x0003C000
 
#define LEON_MEMORY_CONFIGURATION_RAM_SIZE_MASK   0x00001E00
 
#define LEON_REG_TIMER_CONTROL_EN   0x00000001 /* 1 = enable counting */
 
#define LEON_REG_TIMER_CONTROL_RL   0x00000002 /* 1 = reload at 0 */
 
#define LEON_REG_TIMER_CONTROL_LD   0x00000004 /* 1 = load counter */
 
#define LEON_REG_UART_CONTROL_RTD   0x000000FF /* RX/TX data */
 
#define LEON_REG_UART_STATUS_CLR   0x00000000 /* Clear all status bits */
 
#define LEON_REG_UART_STATUS_DR   0x00000001 /* Data Ready */
 
#define LEON_REG_UART_STATUS_TSE   0x00000002 /* TX Send Register Empty */
 
#define LEON_REG_UART_STATUS_THE   0x00000004 /* TX Hold Register Empty */
 
#define LEON_REG_UART_STATUS_BR   0x00000008 /* Break Error */
 
#define LEON_REG_UART_STATUS_OE   0x00000010 /* RX Overrun Error */
 
#define LEON_REG_UART_STATUS_PE   0x00000020 /* RX Parity Error */
 
#define LEON_REG_UART_STATUS_FE   0x00000040 /* RX Framing Error */
 
#define LEON_REG_UART_STATUS_ERR   0x00000078 /* Error Mask */
 
#define LEON_REG_UART_CTRL_RE   0x00000001 /* Receiver enable */
 
#define LEON_REG_UART_CTRL_TE   0x00000002 /* Transmitter enable */
 
#define LEON_REG_UART_CTRL_RI   0x00000004 /* Receiver interrupt enable */
 
#define LEON_REG_UART_CTRL_TI   0x00000008 /* Transmitter interrupt enable */
 
#define LEON_REG_UART_CTRL_PS   0x00000010 /* Parity select */
 
#define LEON_REG_UART_CTRL_PE   0x00000020 /* Parity enable */
 
#define LEON_REG_UART_CTRL_FL   0x00000040 /* Flow control enable */
 
#define LEON_REG_UART_CTRL_LB   0x00000080 /* Loop Back enable */
 
#define LEON_Clear_interrupt(_source)
 
#define LEON_Force_interrupt(_source)
 
#define LEON_Is_interrupt_pending(_source)   (LEON_REG.Interrupt_Pending & (1 << (_source)))
 
#define LEON_Is_interrupt_masked(_source)   (!(LEON_REG.Interrupt_Mask & (1 << (_source))))
 
#define LEON_Mask_interrupt(_source)
 
#define LEON_Unmask_interrupt(_source)
 
#define LEON_Disable_interrupt(_source, _previous)
 
#define LEON_Restore_interrupt(_source, _previous)
 
#define BSP_Clear_interrupt(_source)   LEON_Clear_interrupt(_source)
 
#define BSP_Force_interrupt(_source)   LEON_Force_interrupt(_source)
 
#define BSP_Is_interrupt_pending(_source)   LEON_Is_interrupt_pending(_source)
 
#define BSP_Is_interrupt_masked(_source)   LEON_Is_interrupt_masked(_source)
 
#define BSP_Unmask_interrupt(_source)   LEON_Unmask_interrupt(_source)
 
#define BSP_Mask_interrupt(_source)   LEON_Mask_interrupt(_source)
 
#define BSP_Disable_interrupt(_source, _previous)   LEON_Disable_interrupt(_source, _prev)
 
#define BSP_Restore_interrupt(_source, _previous)   LEON_Restore_interrupt(_source, _previous)
 
#define BSP_Cpu_Is_interrupt_masked(_source, _cpu)   BSP_Is_interrupt_masked(_source)
 
#define BSP_Cpu_Unmask_interrupt(_source, _cpu)   BSP_Unmask_interrupt(_source)
 
#define BSP_Cpu_Mask_interrupt(_source, _cpu)   BSP_Mask_interrupt(_source)
 
#define BSP_Cpu_Disable_interrupt(_source, _previous, _cpu)   BSP_Disable_interrupt(_source, _prev)
 
#define BSP_Cpu_Restore_interrupt(_source, _previous, _cpu)   BSP_Cpu_Restore_interrupt(_source, _previous)
 
#define LEON_REG_TIMER_COUNTER_RELOAD_AT_ZERO   0x00000002
 
#define LEON_REG_TIMER_COUNTER_STOP_AT_ZERO   0x00000000
 
#define LEON_REG_TIMER_COUNTER_LOAD_COUNTER   0x00000004
 
#define LEON_REG_TIMER_COUNTER_ENABLE_COUNTING   0x00000001
 
#define LEON_REG_TIMER_COUNTER_DISABLE_COUNTING   0x00000000
 
#define LEON_REG_TIMER_COUNTER_RELOAD_MASK   0x00000002
 
#define LEON_REG_TIMER_COUNTER_ENABLE_MASK   0x00000001
 
#define LEON_REG_TIMER_COUNTER_DEFINED_MASK   0x00000003
 
#define LEON_REG_TIMER_COUNTER_CURRENT_MODE_MASK   0x00000003
 

Variables

LEON_Register_Map LEON_REG
 

Detailed Description

This include file contains information pertaining to the LEON-1. The LEON-1 is a custom SPARC V7 implementation. This CPU has a number of on-board peripherals and was developed by the European Space Agency to target space applications.

NOTE: Other than where absolutely required, this version currently supports only the peripherals and bits used by the basic board support package. This includes at least significant pieces of the following items:

Macro Definition Documentation

◆ LEON_Clear_interrupt

#define LEON_Clear_interrupt (   _source)
Value:
do { \
LEON_REG.Interrupt_Clear = (1 << (_source)); \
} while (0)

◆ LEON_Disable_interrupt

#define LEON_Disable_interrupt (   _source,
  _previous 
)
Value:
do { \
uint32_t _level; \
uint32_t _mask = 1 << (_source); \
\
_level = sparc_disable_interrupts(); \
(_previous) = LEON_REG.Interrupt_Mask; \
LEON_REG.Interrupt_Mask = _previous & ~_mask; \
sparc_enable_interrupts( _level ); \
(_previous) &= _mask; \
} while (0)

◆ LEON_Force_interrupt

#define LEON_Force_interrupt (   _source)
Value:
do { \
LEON_REG.Interrupt_Force = (1 << (_source)); \
} while (0)

◆ LEON_INT_TRAP

#define LEON_INT_TRAP (   _trap)
Value:
( (_trap) >= LEON_TRAP_TYPE( LEON_INTERRUPT_CORRECTABLE_MEMORY_ERROR ) && \
(_trap) <= LEON_TRAP_TYPE( LEON_INTERRUPT_EMPTY6 ) )

◆ LEON_Mask_interrupt

#define LEON_Mask_interrupt (   _source)
Value:
do { \
uint32_t _level; \
\
_level = sparc_disable_interrupts(); \
LEON_REG.Interrupt_Mask &= ~(1 << (_source)); \
sparc_enable_interrupts( _level ); \
} while (0)

◆ LEON_Restore_interrupt

#define LEON_Restore_interrupt (   _source,
  _previous 
)
Value:
do { \
uint32_t _level; \
uint32_t _mask = 1 << (_source); \
\
_level = sparc_disable_interrupts(); \
LEON_REG.Interrupt_Mask = \
(LEON_REG.Interrupt_Mask & ~_mask) | (_previous); \
sparc_enable_interrupts( _level ); \
} while (0)

◆ LEON_Unmask_interrupt

#define LEON_Unmask_interrupt (   _source)
Value:
do { \
uint32_t _level; \
\
_level = sparc_disable_interrupts(); \
LEON_REG.Interrupt_Mask |= (1 << (_source)); \
sparc_enable_interrupts( _level ); \
} while (0)