API for DK's
[BSP]

Collaboration diagram for API for DK's:

Data Structures

struct  BC_TypeDef
 Board Controller Register definiton. More...

Defines

#define BC_FLASH_BASE   0x80000000
 Defines FPGA register bank for Energy Micro Development Kit (DK) board, i.e.
#define BC_SRAM_BASE   0x84000000
 SRAM base address.
#define BC_SSD2119_BASE   0x88000000
 TFT Controller base address.
#define BC_REGISTER_BASE   0x8c000000
 Board Controller registers base address.
#define BC_CFG   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x00))
 CFG.
#define BC_EM   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x01))
 EM.
#define BC_MAGIC   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x02))
 MAGIC.
#define BC_LED   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x03))
 LEDs.
#define BC_PUSHBUTTON   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x04))
 Push Buttons.
#define BC_DIPSWITCH   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x05))
 Dip switches.
#define BC_JOYSTICK   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x06))
 Joystick.
#define BC_AEM   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x07))
 AEM push button status.
#define BC_DISPLAY_CTRL   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x08))
 Display Control.
#define BC_EBI_CFG   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x09))
 EBI config.
#define BC_BUS_CFG   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x0a))
 BUS config.
#define BC_PERCTRL   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x0c))
 Peripheral Control.
#define BC_AEMSTATE   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x0d))
 AEM state of push button switch.
#define BC_SPI_CFG   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x0e))
 SPI config.
#define BC_RESET   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x0f))
 Reset.
#define BC_ADC_START   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x10))
 ADC start.
#define BC_ADC_STATUS   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x11))
 ADC status.
#define BC_ADC_DATA   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x12))
 ADC data.
#define BC_HW_VERSION   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x14))
 HW version.
#define BC_FW_BUILDNO   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x15))
 FW build number.
#define BC_FW_VERSION   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x16))
 FW version.
#define BC_SCRATCH_COMMON   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x17))
 Scratch common.
#define BC_SCRATCH_EFM0   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x18))
 Scratch EFM0.
#define BC_SCRATCH_EFM1   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x19))
 Scratch EFM1.
#define BC_SCRATCH_EFM2   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x1A))
 Scratch EFM2.
#define BC_SCRATCH_EFM3   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x1B))
 Scratch EFM3.
#define BC_SCRATCH_BC0   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x1C))
 Scratch BC0.
#define BC_SCRATCH_BC1   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x1D))
 Scratch BC1.
#define BC_SCRATCH_BC2   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x1E))
 Scratch BC2.
#define BC_SCRATCH_BC3   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x1f))
 Scratch BC3.
#define BC_INTFLAG   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x20))
 Interrupt flag.
#define BC_INTEN   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x21))
 Interrupt enable.
#define BC_CFG_SPI   (0)
 Defines bit fields for board control registers.
#define BC_CFG_EBI   (1)
 EBI mode.
#define BC_EM_EM0   (0)
 Indicate EM0.
#define BC_EM_EM1   (1)
 Indicate EM1.
#define BC_EM_EM2   (2)
 Indicate EM2.
#define BC_EM_EM3   (3)
 Indicate EM3.
#define BC_EM_EM4   (4)
 Indicate EM4.
#define BC_MAGIC_VALUE   (0xef32)
 Magic.
#define BC_PUSHBUTTON_MASK   (0x000f)
 Push button mask.
#define BC_PUSHBUTTON_SW1   (1 << 0)
 Push button SW1.
#define BC_PUSHBUTTON_SW2   (1 << 1)
 Push button SW2.
#define BC_PUSHBUTTON_SW3   (1 << 2)
 Push button SW3.
#define BC_PUSHBUTTON_SW4   (1 << 3)
 Push button SW4.
#define BC_DIPSWITCH_MASK   (0x00ff)
 Dip switch mask.
#define BC_JOYSTICK_MASK   (0x001f)
 Joystick mask.
#define BC_JOYSTICK_DOWN   (1 << 0)
 Joystick down.
#define BC_JOYSTICK_RIGHT   (1 << 1)
 Joystick right.
#define BC_JOYSTICK_UP   (1 << 2)
 Joystick up.
#define BC_JOYSTICK_LEFT   (1 << 3)
 Joystick left.
#define BC_JOYSTICK_CENTER   (1 << 4)
 Joystick center button.
#define BC_DISPCTRL_RESET   (1 << 0)
 Reset.
#define BC_DISPCTRL_POWER_ENABLE   (1 << 1)
 Display Control Power Enable.
#define BC_EBI_CFG_MASK   (0x0003)
 EBI Config.
#define BC_EBI_CFG_16X16   (0)
 16x16 address/data mode
#define BC_EBI_CFG_8X8   (1)
 8x8 address/data mode
#define BC_EBI_CFG_24X8   (2)
 24x8 address/data mode
#define BC_BUS_CFG_MASK   (0x0003)
 Bus config.
#define BC_BUS_CFG_FSMC   (0)
 Kit Board Controller owns bus.
#define BC_BUS_CFG_EBI   (1)
 EBI drives bus.
#define BC_BUS_CFG_SPI   (2)
 SPI drives bus.
#define BC_PERCTRL_ACCEL   (1 << 0)
 Accelerometer enable.
#define BC_PERCTRL_AMBIENT   (1 << 1)
 Ambient light sensor enable.
#define BC_PERCTRL_POTMETER   (1 << 2)
 Potentiometer enable.
#define BC_PERCTRL_RS232A   (1 << 3)
 RS232A enable.
#define BC_PERCTRL_RS232B   (1 << 4)
 RS232B enable.
#define BC_PERCTRL_SPI   (1 << 5)
 SPI enable.
#define BC_PERCTRL_I2C   (1 << 6)
 I2C enable.
#define BC_PERCTRL_IRDA   (1 << 7)
 IRDA enable.
#define BC_PERCTRL_ANALOG_SE   (1 << 8)
 Analog SE enable.
#define BC_PERCTRL_ANALOG_DIFF   (1 << 9)
 Analog Diff enable.
#define BC_PERCTRL_AUDIO_OUT   (1 << 10)
 Audio Out enable.
#define BC_PERCTRL_AUDIO_IN   (1 << 11)
 Audio In enable.
#define BC_PERCTRL_ACCEL_GSEL   (1 << 12)
 Accel Gsel enable.
#define BC_PERCTRL_ACCEL_SELFTEST   (1 << 13)
 Accel Self test enable.
#define BC_PERCTRL_RS232_SHUTDOWN   (1 << 14)
 RS232 shutdown.
#define BC_PERCTRL_IRDA_SHUTDOWN   (1 << 15)
 IRDA shutdown.
#define BC_AEMSTATE_BC   (0)
 AEM button state, BC controls buttons.
#define BC_AEMSTATE_EFM   (1)
 AEM button state, EFM32 controls buttons.
#define BC_SPI_CFG_FLASH   (0)
 SPI Flash config.
#define BC_SPI_CFG_MICROSD   (1)
 SPI MicroSD config.
#define BC_RESET_FLASH   (1 << 0)
 Reset Flash.
#define BC_RESET_EFM   (1 << 1)
 Reset EFM.
#define BC_ADC_START_MASK   (0x00ff)
 ADC Start mask.
#define BC_ADC_STATUS_DONE   (0)
 ADC Status Done.
#define BC_ADC_STATUS_BUSY   (1)
 ADC Status Busy.
#define BC_HW_VERSION_PCB_MASK   (0x07f0)
 PCB Version mask.
#define BC_HW_VERSION_PCB_SHIFT   (4)
 PCB Version shift.
#define BC_HW_VERSION_BOARD_MASK   (0x000f)
 Board version mask.
#define BC_HW_VERSION_BOARD_SHIFT   (0)
 Board version shift.
#define BC_HW_FW_VERSION_MAJOR_MASK   (0xf000)
 FW Version major mask.
#define BC_HW_FW_VERSION_MAJOR_SHIFT   (12)
 FW version major shift.
#define BC_HW_FW_VERSION_MINOR_MASK   (0x0f00)
 FW version minor mask.
#define BC_HW_FW_VERSION_MINOR_SHIFT   (8)
 FW version minor shift.
#define BC_HW_FW_VERSION_PATCHLEVEL_MASK   (0x00ff)
 FW Patchlevel mask.
#define BC_HW_FW_VERSION_PATCHLEVEL_SHIFT   (0)
 FW Patchlevel shift.
#define BC_INTEN_MASK   (0x000f)
 Interrupt enable mask.
#define BC_INTEN_PB   (1 << 0)
 Push Button Interrupt enable.
#define BC_INTEN_DIP   (1 << 1)
 DIP Switch Interrupt enable.
#define BC_INTEN_JOYSTICK   (1 << 2)
 Joystick Interrupt enable.
#define BC_INTEN_AEM   (1 << 3)
 AEM Interrupt enable.
#define BC_INTFLAG_MASK   (0x000f)
 Interrupt flag mask.
#define BC_INTFLAG_PB   (1 << 0)
 Push Button interrupt triggered.
#define BC_INTFLAG_DIP   (1 << 1)
 DIP interrupt triggered.
#define BC_INTFLAG_JOYSTICK   (1 << 2)
 Joystick interrupt triggered.
#define BC_INTFLAG_AEM   (1 << 3)
 AEM interrupt triggered.
#define BC_REGISTER_BASE   0x80000000
 Defines FPGA register bank for Energy Micro Development Kit board, i.e.
#define BC_SSD2119_BASE   0x84000000
 TFT-LCD controller.
#define BC_PSRAM_BASE   0x88000000
 PSRAM base address.
#define BC_FLASH_BASE   0x8C000000
 External Flash base address.
#define __IO   volatile
 Defines bit fields for board control registers.
#define BC_REGISTER   ((BC_TypeDef *) BC_REGISTER_BASE)
 Register block base.
#define BC_EM_EM0   (0)
 Indicate EM0.
#define BC_EM_EM1   (1)
 Indicate EM1.
#define BC_EM_EM2   (2)
 Indicate EM2.
#define BC_EM_EM3   (3)
 Indicate EM3.
#define BC_EM_EM4   (4)
 Indicate EM4.
#define BC_MAGIC_VALUE   (0xef32)
 Magic.
#define BC_UIF_PB_MASK   (0x000f)
 Push button mask.
#define BC_UIF_PB1   (1 << 0)
 Push button PB1.
#define BC_UIF_PB2   (1 << 1)
 Push button PB2.
#define BC_UIF_PB3   (1 << 2)
 Push button PB3.
#define BC_UIF_PB4   (1 << 3)
 Push button PB4.
#define BC_DIPSWITCH_MASK   (0x000f)
 Dip switch mask.
#define BC_UIF_JOYSTICK_MASK   (0x001f)
 Joystick mask.
#define BC_UIF_JOYSTICK_DOWN   (1 << 0)
 Joystick down.
#define BC_UIF_JOYSTICK_RIGHT   (1 << 1)
 Joystick right.
#define BC_UIF_JOYSTICK_UP   (1 << 2)
 Joystick up.
#define BC_UIF_JOYSTICK_LEFT   (1 << 3)
 Joystick left.
#define BC_UIF_JOYSTICK_CENTER   (1 << 4)
 Joystick center button.
#define BC_UIF_AEM_BC   (0)
 AEM button state, BC controls buttons.
#define BC_UIF_AEM_EFM   (1)
 AEM button state, EFM32 controls buttons.
#define BC_DISPLAY_CTRL_RESET   (1 << 1)
 Reset.
#define BC_DISPLAY_CTRL_POWER_ENABLE   (1 << 0)
 Display Control Power and Backlight Enable.
#define BC_DISPLAY_CTRL_MODE_SHIFT   2
 Bit offset value for Display_Mode setting.
#define BC_DISPLAY_CTRL_MODE_8080   (0 << BC_DISPLAY_CTRL_MODE_SHIFT)
 Address mapped mode.
#define BC_DISPLAY_CTRL_MODE_GENERIC   (1 << BC_DISPLAY_CTRL_MODE_SHIFT)
 Direct Drive + SPI mode.
#define BC_EBI_CTRL_EXTADDR_MASK   (0x0001)
 Enable extended addressing support.
#define BC_ARB_CTRL_SHIFT   0
 Bit offset value for ARB_CTRL setting.
#define BC_ARB_CTRL_BC   (0 << BC_ARB_CTRL_SHIFT)
 BC drives display.
#define BC_ARB_CTRL_EBI   (1 << BC_ARB_CTRL_SHIFT)
 EFM32GG EBI drives display, memory mapped or direct drive.
#define BC_ARB_CTRL_SPI   (2 << BC_ARB_CTRL_SHIFT)
 EFM32GG SPI drives display.
#define BC_INTEN_MASK   (0x000f)
 Interrupt enable mask.
#define BC_INTEN_PB   (1 << 0)
 Push Button Interrupt enable.
#define BC_INTEN_DIP   (1 << 1)
 DIP Switch Interrupt enable.
#define BC_INTEN_JOYSTICK   (1 << 2)
 Joystick Interrupt enable.
#define BC_INTEN_AEM   (1 << 3)
 AEM Interrupt enable.
#define BC_INTEN_ETH   (1 << 4)
 Ethernet Interrupt enable.
#define BC_INTFLAG_MASK   (0x000f)
 Interrupt flag mask.
#define BC_INTFLAG_PB   (1 << 0)
 Push Button interrupt triggered.
#define BC_INTFLAG_DIP   (1 << 1)
 DIP interrupt triggered.
#define BC_INTFLAG_JOYSTICK   (1 << 2)
 Joystick interrupt triggered.
#define BC_INTFLAG_AEM   (1 << 3)
 AEM Interrupt triggered.
#define BC_INTFLAG_ETH   (1 << 4)
 Ethernet Interrupt triggered.
#define BC_PERICON_RS232_SHUTDOWN_SHIFT   13
 RS232 enable MUX bit.
#define BC_PERICON_RS232_UART_SHIFT   12
 UART enable.
#define BC_PERICON_RS232_LEUART_SHIFT   11
 LEUART enable.
#define BC_PERICON_I2C_SHIFT   10
 I2C enable.
#define BC_PERICON_I2S_ETH_SEL_SHIFT   9
 I2S/ETH/TFT SPI enable.
#define BC_PERICON_I2S_ETH_SHIFT   8
 I2S/ETH mux select.
#define BC_PERICON_TRACE_SHIFT   7
 ETM Trace enable.
#define BC_PERICON_TOUCH_SHIFT   6
 Touch enable.
#define BC_PERICON_AUDIO_IN_SHIFT   5
 Audio In enable.
#define BC_PERICON_AUDIO_OUT_SEL_SHIFT   4
 Audio Out I2S/DAC select.
#define BC_PERICON_AUDIO_OUT_SHIFT   3
 Audio Out enable.
#define BC_PERICON_ANALOG_DIFF_SHIFT   2
 Analog Diff enable.
#define BC_PERICON_ANALOG_SE_SHIFT   1
 Anallog SE enable.
#define BC_PERICON_SPI_SHIFT   0
 Micro-SD SPI enable.
#define BC_SPI_DEMUX_SLAVE_MASK   (0x0003)
 Mask for SPI MUX bits.
#define BC_SPI_DEMUX_SLAVE_AUDIO   (0)
 SPI interface to I2S Audio.
#define BC_SPI_DEMUX_SLAVE_ETHERNET   (1)
 SPI interface to Ethernet controller.
#define BC_SPI_DEMUX_SLAVE_DISPLAY   (2)
 SPI interface to TFT-LCD-SSD2119 controller.
#define BC_ADC_STATUS_DONE   (0)
 ADC Status Done.
#define BC_ADC_STATUS_BUSY   (1)
 ADC Status Busy.
#define BC_CLKRST_FLASH_SHIFT   (1 << 1)
 Flash Reset Control.
#define BC_CLKRST_ETH_SHIFT   (1 << 2)
 Ethernet Reset Control.
#define BC_HW_VERSION_PCB_MASK   (0x07f0)
 PCB Version mask.
#define BC_HW_VERSION_PCB_SHIFT   (4)
 PCB Version shift.
#define BC_HW_VERSION_BOARD_MASK   (0x000f)
 Board version mask.
#define BC_HW_VERSION_BOARD_SHIFT   (0)
 Board version shift.
#define BC_FW_VERSION_MAJOR_MASK   (0xf000)
 FW Version major mask.
#define BC_FW_VERSION_MAJOR_SHIFT   (12)
 FW version major shift.
#define BC_FW_VERSION_MINOR_MASK   (0x0f00)
 FW version minor mask.
#define BC_FW_VERSION_MINOR_SHIFT   (8)
 FW version minor shift.
#define BC_FW_VERSION_PATCHLEVEL_MASK   (0x00ff)
 FW Patchlevel mask.
#define BC_FW_VERSION_PATCHLEVEL_SHIFT   (0)
 FW Patchlevel shift.
#define BC_MBOX_TXSTATUS0_FIFOEMPTY   (1 << 0)
 BC/EFM32 communication register.
#define BC_MBOX_TXSTATUS0_FIFOFULL   (1 << 1)
 BC/EFM32 communication register.
#define BC_MBOX_TXSTATUS0_FIFOUNDERFLOW   (1 << 4)
 BC/EFM32 communication register.
#define BC_MBOX_TXSTATUS0_FIFOOVERFLOW   (1 << 5)
 BC/EFM32 communication register.
#define BC_MBOX_TXSTATUS1_WORDCOUNT_MASK   (0x07FF)
 BC/EFM32 communication register.
#define BC_BUF_CTRL_CS_ENABLE   (1 << 0)
 BC/EFM32 communication register.

Enumerations

enum  BSP_Display_TypeDef {
  BSP_Display_EBI,
  BSP_Display_SPI,
  BSP_Display_BC,
  BSP_Display_PowerEnable,
  BSP_Display_PowerDisable,
  BSP_Display_ResetAssert,
  BSP_Display_ResetRelease,
  BSP_Display_Mode8080,
  BSP_Display_ModeGeneric
}
 

Display Control.

More...
enum  BSP_BusControl_TypeDef {
  BSP_BusControl_Undefined = 0,
  BSP_BusControl_OFF,
  BSP_BusControl_DIRECT,
  BSP_BusControl_SPI,
  BSP_BusControl_EBI
}
 

Bus control access mode.

More...
enum  BSP_Peripheral_Typedef {
  BSP_ACCEL = BC_PERCTRL_ACCEL,
  BSP_AMBIENT = BC_PERCTRL_AMBIENT,
  BSP_POTMETER = BC_PERCTRL_POTMETER,
  BSP_RS232A = BC_PERCTRL_RS232A,
  BSP_RS232B = BC_PERCTRL_RS232B,
  BSP_SPI = BC_PERCTRL_SPI,
  BSP_I2C = BC_PERCTRL_I2C,
  BSP_IRDA = BC_PERCTRL_IRDA,
  BSP_ANALOG_SE = BC_PERCTRL_ANALOG_SE,
  BSP_ANALOG_DIFF = BC_PERCTRL_ANALOG_DIFF,
  BSP_AUDIO_OUT = BC_PERCTRL_AUDIO_OUT,
  BSP_AUDIO_IN = BC_PERCTRL_AUDIO_IN,
  BSP_ACCEL_GSEL = BC_PERCTRL_ACCEL_GSEL,
  BSP_ACCEL_SELFTEST = BC_PERCTRL_ACCEL_SELFTEST,
  BSP_RS232_SHUTDOWN = BC_PERCTRL_RS232_SHUTDOWN,
  BSP_IRDA_SHUTDOWN = BC_PERCTRL_IRDA_SHUTDOWN
}
 

Peripherals control structure for Gxxx_DK's.

More...
enum  BSP_Peripheral_TypeDef {
  BSP_RS232_SHUTDOWN = BC_PERCTRL_RS232_SHUTDOWN,
  BSP_RS232_UART,
  BSP_RS232_LEUART,
  BSP_I2C = BC_PERCTRL_I2C,
  BSP_ETH,
  BSP_I2S,
  BSP_TRACE,
  BSP_TOUCH,
  BSP_AUDIO_IN = BC_PERCTRL_AUDIO_IN,
  BSP_AUDIO_OUT = BC_PERCTRL_AUDIO_OUT,
  BSP_ANALOG_DIFF = BC_PERCTRL_ANALOG_DIFF,
  BSP_ANALOG_SE = BC_PERCTRL_ANALOG_SE,
  BSP_MICROSD,
  BSP_TFT
}
 

Peripherals control structure for DK3x50 DK's.

More...

Functions

BSP_BusControl_TypeDef BSP_BusControlModeGet (void)
 Get current board controller bus decode logic configuration.
int BSP_BusControlModeSet (BSP_BusControl_TypeDef mode)
 Configure Board Controller bus decode logic.
uint32_t BSP_DipSwitchGet (void)
 Get status of the DIP switches on the DK.
int BSP_DisplayControl (BSP_Display_TypeDef option)
 Configure display control.
int BSP_EbiExtendedAddressRange (bool enable)
 Extended the EBI addressing range by enabling address lines A16-A22.
int BSP_EnergyModeSet (uint16_t energyMode)
 Inform board controller about current energy mode.
int BSP_InterruptDisable (uint16_t flags)
 Disable interrupts from board controller.
int BSP_InterruptEnable (uint16_t flags)
 Enable interrupts from board controller.
int BSP_InterruptFlagsClear (uint16_t flags)
 Clear board controller interrupt flags.
uint16_t BSP_InterruptFlagsGet (void)
 Get board controller interrupt flags.
uint16_t BSP_JoystickGet (void)
 Get status of joystick on the DK.
int BSP_PeripheralAccess (BSP_Peripheral_TypeDef perf, bool enable)
 DK Peripheral Access Control Enable or disable access to on-board peripherals through switches and SPI switch where applicable.
uint16_t BSP_PushButtonsGet (void)
 Get status of the pushbutton switches on the DK.
uint16_t BSP_RegisterRead (volatile uint16_t *addr)
 Read from a board controller register.
int BSP_RegisterWrite (volatile uint16_t *addr, uint16_t data)
 Write to a board controller register.
int BSP_McuBoard_DeInit (void)
 Disable MCU plugin board peripherals.
int BSP_McuBoard_Init (void)
 Enable MCU plugin board peripherals.
int BSP_McuBoard_UsbStatusLedEnable (bool enable)
 Set state of MCU plugin board USB status LED.
bool BSP_McuBoard_UsbVbusOcFlagGet (void)
 Get state MCU plugin board VBUS overcurrent flag.
int BSP_McuBoard_UsbVbusPowerEnable (bool enable)
 Enable MCU plugin board VBUS power switch.

Define Documentation

#define __IO   volatile

Defines bit fields for board control registers.

Read/Write board controller register

Definition at line 70 of file bsp_dk_bcreg_3201.h.

#define BC_ADC_DATA   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x12))

ADC data.

Definition at line 80 of file bsp_dk_bcreg_3200.h.

#define BC_ADC_START   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x10))

ADC start.

Definition at line 78 of file bsp_dk_bcreg_3200.h.

#define BC_ADC_START_MASK   (0x00ff)

ADC Start mask.

Definition at line 165 of file bsp_dk_bcreg_3200.h.

#define BC_ADC_STATUS   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x11))

ADC status.

Definition at line 79 of file bsp_dk_bcreg_3200.h.

#define BC_ADC_STATUS_BUSY   (1)

ADC Status Busy.

Definition at line 226 of file bsp_dk_bcreg_3201.h.

#define BC_ADC_STATUS_BUSY   (1)

ADC Status Busy.

Definition at line 168 of file bsp_dk_bcreg_3200.h.

#define BC_ADC_STATUS_DONE   (0)

ADC Status Done.

Definition at line 225 of file bsp_dk_bcreg_3201.h.

#define BC_ADC_STATUS_DONE   (0)

ADC Status Done.

Definition at line 167 of file bsp_dk_bcreg_3200.h.

#define BC_AEM   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x07))

AEM push button status.

Definition at line 70 of file bsp_dk_bcreg_3200.h.

#define BC_AEMSTATE   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x0d))

AEM state of push button switch.

Definition at line 75 of file bsp_dk_bcreg_3200.h.

#define BC_AEMSTATE_BC   (0)

AEM button state, BC controls buttons.

Definition at line 156 of file bsp_dk_bcreg_3200.h.

#define BC_AEMSTATE_EFM   (1)

AEM button state, EFM32 controls buttons.

Definition at line 157 of file bsp_dk_bcreg_3200.h.

#define BC_ARB_CTRL_BC   (0 << BC_ARB_CTRL_SHIFT)

BC drives display.

Definition at line 183 of file bsp_dk_bcreg_3201.h.

Referenced by BSP_DisplayControl().

#define BC_ARB_CTRL_EBI   (1 << BC_ARB_CTRL_SHIFT)

EFM32GG EBI drives display, memory mapped or direct drive.

Definition at line 184 of file bsp_dk_bcreg_3201.h.

Referenced by BSP_DisplayControl(), RETARGET_WriteChar(), TFT_AddressMappedInit(), and TFT_DirectInit().

#define BC_ARB_CTRL_SHIFT   0

Bit offset value for ARB_CTRL setting.

Definition at line 182 of file bsp_dk_bcreg_3201.h.

#define BC_ARB_CTRL_SPI   (2 << BC_ARB_CTRL_SHIFT)

EFM32GG SPI drives display.

Definition at line 185 of file bsp_dk_bcreg_3201.h.

Referenced by BSP_DisplayControl().

#define BC_BUF_CTRL_CS_ENABLE   (1 << 0)

BC/EFM32 communication register.

Definition at line 255 of file bsp_dk_bcreg_3201.h.

#define BC_BUS_CFG   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x0a))

BUS config.

Definition at line 73 of file bsp_dk_bcreg_3200.h.

#define BC_BUS_CFG_EBI   (1)

EBI drives bus.

Definition at line 136 of file bsp_dk_bcreg_3200.h.

#define BC_BUS_CFG_FSMC   (0)

Kit Board Controller owns bus.

Definition at line 135 of file bsp_dk_bcreg_3200.h.

#define BC_BUS_CFG_MASK   (0x0003)

Bus config.

Definition at line 134 of file bsp_dk_bcreg_3200.h.

#define BC_BUS_CFG_SPI   (2)

SPI drives bus.

Definition at line 137 of file bsp_dk_bcreg_3200.h.

#define BC_CFG   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x00))

CFG.

Definition at line 63 of file bsp_dk_bcreg_3200.h.

#define BC_CFG_EBI   (1)

EBI mode.

Definition at line 101 of file bsp_dk_bcreg_3200.h.

#define BC_CFG_SPI   (0)

Defines bit fields for board control registers.

SPI mode

Definition at line 100 of file bsp_dk_bcreg_3200.h.

#define BC_CLKRST_ETH_SHIFT   (1 << 2)

Ethernet Reset Control.

Definition at line 230 of file bsp_dk_bcreg_3201.h.

#define BC_CLKRST_FLASH_SHIFT   (1 << 1)

Flash Reset Control.

Definition at line 229 of file bsp_dk_bcreg_3201.h.

#define BC_DIPSWITCH   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x05))

Dip switches.

Definition at line 68 of file bsp_dk_bcreg_3200.h.

#define BC_DIPSWITCH_MASK   (0x000f)

Dip switch mask.

Definition at line 157 of file bsp_dk_bcreg_3201.h.

#define BC_DIPSWITCH_MASK   (0x00ff)

Dip switch mask.

Definition at line 117 of file bsp_dk_bcreg_3200.h.

#define BC_DISPCTRL_POWER_ENABLE   (1 << 1)

Display Control Power Enable.

Definition at line 127 of file bsp_dk_bcreg_3200.h.

#define BC_DISPCTRL_RESET   (1 << 0)

Reset.

Definition at line 126 of file bsp_dk_bcreg_3200.h.

#define BC_DISPLAY_CTRL   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x08))

Display Control.

Definition at line 71 of file bsp_dk_bcreg_3200.h.

#define BC_DISPLAY_CTRL_MODE_8080   (0 << BC_DISPLAY_CTRL_MODE_SHIFT)

Address mapped mode.

Definition at line 175 of file bsp_dk_bcreg_3201.h.

#define BC_DISPLAY_CTRL_MODE_GENERIC   (1 << BC_DISPLAY_CTRL_MODE_SHIFT)

Direct Drive + SPI mode.

Definition at line 176 of file bsp_dk_bcreg_3201.h.

Referenced by BSP_DisplayControl().

#define BC_DISPLAY_CTRL_MODE_SHIFT   2

Bit offset value for Display_Mode setting.

Definition at line 174 of file bsp_dk_bcreg_3201.h.

#define BC_DISPLAY_CTRL_POWER_ENABLE   (1 << 0)

Display Control Power and Backlight Enable.

Definition at line 173 of file bsp_dk_bcreg_3201.h.

Referenced by BSP_DisplayControl().

#define BC_DISPLAY_CTRL_RESET   (1 << 1)

Reset.

Definition at line 172 of file bsp_dk_bcreg_3201.h.

Referenced by BSP_DisplayControl().

#define BC_EBI_CFG   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x09))

EBI config.

Definition at line 72 of file bsp_dk_bcreg_3200.h.

#define BC_EBI_CFG_16X16   (0)

16x16 address/data mode

Definition at line 130 of file bsp_dk_bcreg_3200.h.

#define BC_EBI_CFG_24X8   (2)

24x8 address/data mode

Definition at line 132 of file bsp_dk_bcreg_3200.h.

#define BC_EBI_CFG_8X8   (1)

8x8 address/data mode

Definition at line 131 of file bsp_dk_bcreg_3200.h.

#define BC_EBI_CFG_MASK   (0x0003)

EBI Config.

Definition at line 129 of file bsp_dk_bcreg_3200.h.

#define BC_EBI_CTRL_EXTADDR_MASK   (0x0001)

Enable extended addressing support.

Definition at line 179 of file bsp_dk_bcreg_3201.h.

Referenced by BSP_EbiExtendedAddressRange().

#define BC_EM   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x01))

EM.

Definition at line 64 of file bsp_dk_bcreg_3200.h.

#define BC_EM_EM0   (0)

Indicate EM0.

Definition at line 140 of file bsp_dk_bcreg_3201.h.

#define BC_EM_EM0   (0)

Indicate EM0.

Definition at line 103 of file bsp_dk_bcreg_3200.h.

#define BC_EM_EM1   (1)

Indicate EM1.

Definition at line 141 of file bsp_dk_bcreg_3201.h.

#define BC_EM_EM1   (1)

Indicate EM1.

Definition at line 104 of file bsp_dk_bcreg_3200.h.

#define BC_EM_EM2   (2)

Indicate EM2.

Definition at line 142 of file bsp_dk_bcreg_3201.h.

#define BC_EM_EM2   (2)

Indicate EM2.

Definition at line 105 of file bsp_dk_bcreg_3200.h.

#define BC_EM_EM3   (3)

Indicate EM3.

Definition at line 143 of file bsp_dk_bcreg_3201.h.

#define BC_EM_EM3   (3)

Indicate EM3.

Definition at line 106 of file bsp_dk_bcreg_3200.h.

#define BC_EM_EM4   (4)

Indicate EM4.

Definition at line 144 of file bsp_dk_bcreg_3201.h.

#define BC_EM_EM4   (4)

Indicate EM4.

Definition at line 107 of file bsp_dk_bcreg_3200.h.

#define BC_FLASH_BASE   0x8C000000

External Flash base address.

Definition at line 61 of file bsp_dk_bcreg_3201.h.

#define BC_FLASH_BASE   0x80000000

Defines FPGA register bank for Energy Micro Development Kit (DK) board, i.e.

board control registers FLASH memory base address

Definition at line 58 of file bsp_dk_bcreg_3200.h.

#define BC_FW_BUILDNO   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x15))

FW build number.

Definition at line 82 of file bsp_dk_bcreg_3200.h.

#define BC_FW_VERSION   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x16))

FW version.

Definition at line 83 of file bsp_dk_bcreg_3200.h.

#define BC_FW_VERSION_MAJOR_MASK   (0xf000)

FW Version major mask.

Definition at line 239 of file bsp_dk_bcreg_3201.h.

#define BC_FW_VERSION_MAJOR_SHIFT   (12)

FW version major shift.

Definition at line 240 of file bsp_dk_bcreg_3201.h.

#define BC_FW_VERSION_MINOR_MASK   (0x0f00)

FW version minor mask.

Definition at line 241 of file bsp_dk_bcreg_3201.h.

#define BC_FW_VERSION_MINOR_SHIFT   (8)

FW version minor shift.

Definition at line 242 of file bsp_dk_bcreg_3201.h.

#define BC_FW_VERSION_PATCHLEVEL_MASK   (0x00ff)

FW Patchlevel mask.

Definition at line 243 of file bsp_dk_bcreg_3201.h.

#define BC_FW_VERSION_PATCHLEVEL_SHIFT   (0)

FW Patchlevel shift.

Definition at line 244 of file bsp_dk_bcreg_3201.h.

#define BC_HW_FW_VERSION_MAJOR_MASK   (0xf000)

FW Version major mask.

Definition at line 175 of file bsp_dk_bcreg_3200.h.

#define BC_HW_FW_VERSION_MAJOR_SHIFT   (12)

FW version major shift.

Definition at line 176 of file bsp_dk_bcreg_3200.h.

#define BC_HW_FW_VERSION_MINOR_MASK   (0x0f00)

FW version minor mask.

Definition at line 177 of file bsp_dk_bcreg_3200.h.

#define BC_HW_FW_VERSION_MINOR_SHIFT   (8)

FW version minor shift.

Definition at line 178 of file bsp_dk_bcreg_3200.h.

#define BC_HW_FW_VERSION_PATCHLEVEL_MASK   (0x00ff)

FW Patchlevel mask.

Definition at line 179 of file bsp_dk_bcreg_3200.h.

#define BC_HW_FW_VERSION_PATCHLEVEL_SHIFT   (0)

FW Patchlevel shift.

Definition at line 180 of file bsp_dk_bcreg_3200.h.

#define BC_HW_VERSION   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x14))

HW version.

Definition at line 81 of file bsp_dk_bcreg_3200.h.

#define BC_HW_VERSION_BOARD_MASK   (0x000f)

Board version mask.

Definition at line 235 of file bsp_dk_bcreg_3201.h.

#define BC_HW_VERSION_BOARD_MASK   (0x000f)

Board version mask.

Definition at line 172 of file bsp_dk_bcreg_3200.h.

#define BC_HW_VERSION_BOARD_SHIFT   (0)

Board version shift.

Definition at line 236 of file bsp_dk_bcreg_3201.h.

#define BC_HW_VERSION_BOARD_SHIFT   (0)

Board version shift.

Definition at line 173 of file bsp_dk_bcreg_3200.h.

#define BC_HW_VERSION_PCB_MASK   (0x07f0)

PCB Version mask.

Definition at line 233 of file bsp_dk_bcreg_3201.h.

#define BC_HW_VERSION_PCB_MASK   (0x07f0)

PCB Version mask.

Definition at line 170 of file bsp_dk_bcreg_3200.h.

#define BC_HW_VERSION_PCB_SHIFT   (4)

PCB Version shift.

Definition at line 234 of file bsp_dk_bcreg_3201.h.

#define BC_HW_VERSION_PCB_SHIFT   (4)

PCB Version shift.

Definition at line 171 of file bsp_dk_bcreg_3200.h.

#define BC_INTEN   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x21))

Interrupt enable.

Definition at line 94 of file bsp_dk_bcreg_3200.h.

#define BC_INTEN_AEM   (1 << 3)

AEM Interrupt enable.

Definition at line 192 of file bsp_dk_bcreg_3201.h.

#define BC_INTEN_AEM   (1 << 3)

AEM Interrupt enable.

Definition at line 186 of file bsp_dk_bcreg_3200.h.

#define BC_INTEN_DIP   (1 << 1)

DIP Switch Interrupt enable.

Definition at line 190 of file bsp_dk_bcreg_3201.h.

#define BC_INTEN_DIP   (1 << 1)

DIP Switch Interrupt enable.

Definition at line 184 of file bsp_dk_bcreg_3200.h.

#define BC_INTEN_ETH   (1 << 4)

Ethernet Interrupt enable.

Definition at line 193 of file bsp_dk_bcreg_3201.h.

#define BC_INTEN_JOYSTICK   (1 << 2)

Joystick Interrupt enable.

Definition at line 191 of file bsp_dk_bcreg_3201.h.

#define BC_INTEN_JOYSTICK   (1 << 2)

Joystick Interrupt enable.

Definition at line 185 of file bsp_dk_bcreg_3200.h.

#define BC_INTEN_MASK   (0x000f)

Interrupt enable mask.

Definition at line 188 of file bsp_dk_bcreg_3201.h.

#define BC_INTEN_MASK   (0x000f)

Interrupt enable mask.

Definition at line 182 of file bsp_dk_bcreg_3200.h.

#define BC_INTEN_PB   (1 << 0)

Push Button Interrupt enable.

Definition at line 189 of file bsp_dk_bcreg_3201.h.

#define BC_INTEN_PB   (1 << 0)

Push Button Interrupt enable.

Definition at line 183 of file bsp_dk_bcreg_3200.h.

#define BC_INTFLAG   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x20))

Interrupt flag.

Definition at line 93 of file bsp_dk_bcreg_3200.h.

#define BC_INTFLAG_AEM   (1 << 3)

AEM Interrupt triggered.

Definition at line 199 of file bsp_dk_bcreg_3201.h.

#define BC_INTFLAG_AEM   (1 << 3)

AEM interrupt triggered.

Definition at line 192 of file bsp_dk_bcreg_3200.h.

#define BC_INTFLAG_DIP   (1 << 1)

DIP interrupt triggered.

Definition at line 197 of file bsp_dk_bcreg_3201.h.

#define BC_INTFLAG_DIP   (1 << 1)

DIP interrupt triggered.

Definition at line 190 of file bsp_dk_bcreg_3200.h.

#define BC_INTFLAG_ETH   (1 << 4)

Ethernet Interrupt triggered.

Definition at line 200 of file bsp_dk_bcreg_3201.h.

#define BC_INTFLAG_JOYSTICK   (1 << 2)

Joystick interrupt triggered.

Definition at line 198 of file bsp_dk_bcreg_3201.h.

#define BC_INTFLAG_JOYSTICK   (1 << 2)

Joystick interrupt triggered.

Definition at line 191 of file bsp_dk_bcreg_3200.h.

#define BC_INTFLAG_MASK   (0x000f)

Interrupt flag mask.

Definition at line 195 of file bsp_dk_bcreg_3201.h.

#define BC_INTFLAG_MASK   (0x000f)

Interrupt flag mask.

Definition at line 188 of file bsp_dk_bcreg_3200.h.

#define BC_INTFLAG_PB   (1 << 0)

Push Button interrupt triggered.

Definition at line 196 of file bsp_dk_bcreg_3201.h.

#define BC_INTFLAG_PB   (1 << 0)

Push Button interrupt triggered.

Definition at line 189 of file bsp_dk_bcreg_3200.h.

#define BC_JOYSTICK   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x06))

Joystick.

Definition at line 69 of file bsp_dk_bcreg_3200.h.

#define BC_JOYSTICK_CENTER   (1 << 4)

Joystick center button.

Definition at line 124 of file bsp_dk_bcreg_3200.h.

#define BC_JOYSTICK_DOWN   (1 << 0)

Joystick down.

Definition at line 120 of file bsp_dk_bcreg_3200.h.

#define BC_JOYSTICK_LEFT   (1 << 3)

Joystick left.

Definition at line 123 of file bsp_dk_bcreg_3200.h.

#define BC_JOYSTICK_MASK   (0x001f)

Joystick mask.

Definition at line 119 of file bsp_dk_bcreg_3200.h.

#define BC_JOYSTICK_RIGHT   (1 << 1)

Joystick right.

Definition at line 121 of file bsp_dk_bcreg_3200.h.

#define BC_JOYSTICK_UP   (1 << 2)

Joystick up.

Definition at line 122 of file bsp_dk_bcreg_3200.h.

#define BC_LED   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x03))

LEDs.

Definition at line 66 of file bsp_dk_bcreg_3200.h.

#define BC_MAGIC   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x02))

MAGIC.

Definition at line 65 of file bsp_dk_bcreg_3200.h.

#define BC_MAGIC_VALUE   (0xef32)

Magic.

Definition at line 147 of file bsp_dk_bcreg_3201.h.

#define BC_MAGIC_VALUE   (0xef32)

Magic.

Definition at line 109 of file bsp_dk_bcreg_3200.h.

#define BC_MBOX_TXSTATUS0_FIFOEMPTY   (1 << 0)

BC/EFM32 communication register.

Definition at line 247 of file bsp_dk_bcreg_3201.h.

#define BC_MBOX_TXSTATUS0_FIFOFULL   (1 << 1)

BC/EFM32 communication register.

Definition at line 248 of file bsp_dk_bcreg_3201.h.

#define BC_MBOX_TXSTATUS0_FIFOOVERFLOW   (1 << 5)

BC/EFM32 communication register.

Definition at line 250 of file bsp_dk_bcreg_3201.h.

#define BC_MBOX_TXSTATUS0_FIFOUNDERFLOW   (1 << 4)

BC/EFM32 communication register.

Definition at line 249 of file bsp_dk_bcreg_3201.h.

#define BC_MBOX_TXSTATUS1_WORDCOUNT_MASK   (0x07FF)

BC/EFM32 communication register.

Definition at line 252 of file bsp_dk_bcreg_3201.h.

#define BC_PERCTRL   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x0c))

Peripheral Control.

Definition at line 74 of file bsp_dk_bcreg_3200.h.

#define BC_PERCTRL_ACCEL   (1 << 0)

Accelerometer enable.

Definition at line 139 of file bsp_dk_bcreg_3200.h.

#define BC_PERCTRL_ACCEL_GSEL   (1 << 12)

Accel Gsel enable.

Definition at line 151 of file bsp_dk_bcreg_3200.h.

#define BC_PERCTRL_ACCEL_SELFTEST   (1 << 13)

Accel Self test enable.

Definition at line 152 of file bsp_dk_bcreg_3200.h.

#define BC_PERCTRL_AMBIENT   (1 << 1)

Ambient light sensor enable.

Definition at line 140 of file bsp_dk_bcreg_3200.h.

#define BC_PERCTRL_ANALOG_DIFF   (1 << 9)

Analog Diff enable.

Definition at line 148 of file bsp_dk_bcreg_3200.h.

#define BC_PERCTRL_ANALOG_SE   (1 << 8)

Analog SE enable.

Definition at line 147 of file bsp_dk_bcreg_3200.h.

#define BC_PERCTRL_AUDIO_IN   (1 << 11)

Audio In enable.

Definition at line 150 of file bsp_dk_bcreg_3200.h.

#define BC_PERCTRL_AUDIO_OUT   (1 << 10)

Audio Out enable.

Definition at line 149 of file bsp_dk_bcreg_3200.h.

#define BC_PERCTRL_I2C   (1 << 6)

I2C enable.

Definition at line 145 of file bsp_dk_bcreg_3200.h.

#define BC_PERCTRL_IRDA   (1 << 7)

IRDA enable.

Definition at line 146 of file bsp_dk_bcreg_3200.h.

#define BC_PERCTRL_IRDA_SHUTDOWN   (1 << 15)

IRDA shutdown.

Definition at line 154 of file bsp_dk_bcreg_3200.h.

#define BC_PERCTRL_POTMETER   (1 << 2)

Potentiometer enable.

Definition at line 141 of file bsp_dk_bcreg_3200.h.

#define BC_PERCTRL_RS232_SHUTDOWN   (1 << 14)

RS232 shutdown.

Definition at line 153 of file bsp_dk_bcreg_3200.h.

#define BC_PERCTRL_RS232A   (1 << 3)

RS232A enable.

Definition at line 142 of file bsp_dk_bcreg_3200.h.

#define BC_PERCTRL_RS232B   (1 << 4)

RS232B enable.

Definition at line 143 of file bsp_dk_bcreg_3200.h.

#define BC_PERCTRL_SPI   (1 << 5)

SPI enable.

Definition at line 144 of file bsp_dk_bcreg_3200.h.

#define BC_PERICON_ANALOG_DIFF_SHIFT   2

Analog Diff enable.

Definition at line 214 of file bsp_dk_bcreg_3201.h.

Referenced by BSP_PeripheralAccess().

#define BC_PERICON_ANALOG_SE_SHIFT   1

Anallog SE enable.

Definition at line 215 of file bsp_dk_bcreg_3201.h.

Referenced by BSP_PeripheralAccess().

#define BC_PERICON_AUDIO_IN_SHIFT   5

Audio In enable.

Definition at line 211 of file bsp_dk_bcreg_3201.h.

Referenced by BSP_PeripheralAccess().

#define BC_PERICON_AUDIO_OUT_SEL_SHIFT   4

Audio Out I2S/DAC select.

Definition at line 212 of file bsp_dk_bcreg_3201.h.

Referenced by BSP_PeripheralAccess().

#define BC_PERICON_AUDIO_OUT_SHIFT   3

Audio Out enable.

Definition at line 213 of file bsp_dk_bcreg_3201.h.

Referenced by BSP_PeripheralAccess().

#define BC_PERICON_I2C_SHIFT   10

I2C enable.

Definition at line 206 of file bsp_dk_bcreg_3201.h.

Referenced by BSP_PeripheralAccess().

#define BC_PERICON_I2S_ETH_SEL_SHIFT   9

I2S/ETH/TFT SPI enable.

Definition at line 207 of file bsp_dk_bcreg_3201.h.

Referenced by BSP_PeripheralAccess().

#define BC_PERICON_I2S_ETH_SHIFT   8

I2S/ETH mux select.

Definition at line 208 of file bsp_dk_bcreg_3201.h.

Referenced by BSP_PeripheralAccess().

#define BC_PERICON_RS232_LEUART_SHIFT   11

LEUART enable.

Definition at line 205 of file bsp_dk_bcreg_3201.h.

Referenced by BSP_PeripheralAccess().

#define BC_PERICON_RS232_SHUTDOWN_SHIFT   13

RS232 enable MUX bit.

Definition at line 203 of file bsp_dk_bcreg_3201.h.

Referenced by BSP_PeripheralAccess().

#define BC_PERICON_RS232_UART_SHIFT   12

UART enable.

Definition at line 204 of file bsp_dk_bcreg_3201.h.

Referenced by BSP_PeripheralAccess().

#define BC_PERICON_SPI_SHIFT   0

Micro-SD SPI enable.

Definition at line 216 of file bsp_dk_bcreg_3201.h.

Referenced by BSP_PeripheralAccess().

#define BC_PERICON_TOUCH_SHIFT   6

Touch enable.

Definition at line 210 of file bsp_dk_bcreg_3201.h.

Referenced by BSP_PeripheralAccess().

#define BC_PERICON_TRACE_SHIFT   7

ETM Trace enable.

Definition at line 209 of file bsp_dk_bcreg_3201.h.

Referenced by BSP_PeripheralAccess().

#define BC_PSRAM_BASE   0x88000000

PSRAM base address.

Definition at line 60 of file bsp_dk_bcreg_3201.h.

#define BC_PUSHBUTTON   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x04))

Push Buttons.

Definition at line 67 of file bsp_dk_bcreg_3200.h.

#define BC_PUSHBUTTON_MASK   (0x000f)

Push button mask.

Definition at line 111 of file bsp_dk_bcreg_3200.h.

#define BC_PUSHBUTTON_SW1   (1 << 0)

Push button SW1.

Definition at line 112 of file bsp_dk_bcreg_3200.h.

#define BC_PUSHBUTTON_SW2   (1 << 1)

Push button SW2.

Definition at line 113 of file bsp_dk_bcreg_3200.h.

#define BC_PUSHBUTTON_SW3   (1 << 2)

Push button SW3.

Definition at line 114 of file bsp_dk_bcreg_3200.h.

#define BC_PUSHBUTTON_SW4   (1 << 3)

Push button SW4.

Definition at line 115 of file bsp_dk_bcreg_3200.h.

#define BC_REGISTER   ((BC_TypeDef *) BC_REGISTER_BASE)
#define BC_REGISTER_BASE   0x80000000

Defines FPGA register bank for Energy Micro Development Kit board, i.e.

board control registers Board Controller registers base address

Definition at line 58 of file bsp_dk_bcreg_3201.h.

#define BC_REGISTER_BASE   0x8c000000

Board Controller registers base address.

Definition at line 61 of file bsp_dk_bcreg_3200.h.

#define BC_RESET   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x0f))

Reset.

Definition at line 77 of file bsp_dk_bcreg_3200.h.

#define BC_RESET_EFM   (1 << 1)

Reset EFM.

Definition at line 163 of file bsp_dk_bcreg_3200.h.

#define BC_RESET_FLASH   (1 << 0)

Reset Flash.

Definition at line 162 of file bsp_dk_bcreg_3200.h.

#define BC_SCRATCH_BC0   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x1C))

Scratch BC0.

Definition at line 89 of file bsp_dk_bcreg_3200.h.

#define BC_SCRATCH_BC1   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x1D))

Scratch BC1.

Definition at line 90 of file bsp_dk_bcreg_3200.h.

#define BC_SCRATCH_BC2   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x1E))

Scratch BC2.

Definition at line 91 of file bsp_dk_bcreg_3200.h.

#define BC_SCRATCH_BC3   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x1f))

Scratch BC3.

Definition at line 92 of file bsp_dk_bcreg_3200.h.

#define BC_SCRATCH_COMMON   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x17))

Scratch common.

Definition at line 84 of file bsp_dk_bcreg_3200.h.

#define BC_SCRATCH_EFM0   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x18))

Scratch EFM0.

Definition at line 85 of file bsp_dk_bcreg_3200.h.

#define BC_SCRATCH_EFM1   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x19))

Scratch EFM1.

Definition at line 86 of file bsp_dk_bcreg_3200.h.

#define BC_SCRATCH_EFM2   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x1A))

Scratch EFM2.

Definition at line 87 of file bsp_dk_bcreg_3200.h.

#define BC_SCRATCH_EFM3   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x1B))

Scratch EFM3.

Definition at line 88 of file bsp_dk_bcreg_3200.h.

#define BC_SPI_CFG   ((volatile uint16_t *)(BC_REGISTER_BASE + sizeof(uint16_t) * 0x0e))

SPI config.

Definition at line 76 of file bsp_dk_bcreg_3200.h.

#define BC_SPI_CFG_FLASH   (0)

SPI Flash config.

Definition at line 159 of file bsp_dk_bcreg_3200.h.

#define BC_SPI_CFG_MICROSD   (1)

SPI MicroSD config.

Definition at line 160 of file bsp_dk_bcreg_3200.h.

#define BC_SPI_DEMUX_SLAVE_AUDIO   (0)

SPI interface to I2S Audio.

Definition at line 220 of file bsp_dk_bcreg_3201.h.

#define BC_SPI_DEMUX_SLAVE_DISPLAY   (2)

SPI interface to TFT-LCD-SSD2119 controller.

Definition at line 222 of file bsp_dk_bcreg_3201.h.

#define BC_SPI_DEMUX_SLAVE_ETHERNET   (1)

SPI interface to Ethernet controller.

Definition at line 221 of file bsp_dk_bcreg_3201.h.

#define BC_SPI_DEMUX_SLAVE_MASK   (0x0003)

Mask for SPI MUX bits.

Definition at line 219 of file bsp_dk_bcreg_3201.h.

#define BC_SRAM_BASE   0x84000000

SRAM base address.

Definition at line 59 of file bsp_dk_bcreg_3200.h.

#define BC_SSD2119_BASE   0x84000000

TFT-LCD controller.

Definition at line 59 of file bsp_dk_bcreg_3201.h.

#define BC_SSD2119_BASE   0x88000000

TFT Controller base address.

Definition at line 60 of file bsp_dk_bcreg_3200.h.

Referenced by RETARGET_SerialInit(), and TFT_AddressMappedInit().

#define BC_UIF_AEM_BC   (0)

AEM button state, BC controls buttons.

Definition at line 168 of file bsp_dk_bcreg_3201.h.

#define BC_UIF_AEM_EFM   (1)

AEM button state, EFM32 controls buttons.

Definition at line 169 of file bsp_dk_bcreg_3201.h.

Referenced by RETARGET_WriteChar(), TFT_AddressMappedInit(), and TFT_DirectInit().

#define BC_UIF_JOYSTICK_CENTER   (1 << 4)

Joystick center button.

Definition at line 165 of file bsp_dk_bcreg_3201.h.

#define BC_UIF_JOYSTICK_DOWN   (1 << 0)

Joystick down.

Definition at line 161 of file bsp_dk_bcreg_3201.h.

#define BC_UIF_JOYSTICK_LEFT   (1 << 3)

Joystick left.

Definition at line 164 of file bsp_dk_bcreg_3201.h.

#define BC_UIF_JOYSTICK_MASK   (0x001f)

Joystick mask.

Definition at line 160 of file bsp_dk_bcreg_3201.h.

#define BC_UIF_JOYSTICK_RIGHT   (1 << 1)

Joystick right.

Definition at line 162 of file bsp_dk_bcreg_3201.h.

#define BC_UIF_JOYSTICK_UP   (1 << 2)

Joystick up.

Definition at line 163 of file bsp_dk_bcreg_3201.h.

#define BC_UIF_PB1   (1 << 0)

Push button PB1.

Definition at line 151 of file bsp_dk_bcreg_3201.h.

#define BC_UIF_PB2   (1 << 1)

Push button PB2.

Definition at line 152 of file bsp_dk_bcreg_3201.h.

#define BC_UIF_PB3   (1 << 2)

Push button PB3.

Definition at line 153 of file bsp_dk_bcreg_3201.h.

#define BC_UIF_PB4   (1 << 3)

Push button PB4.

Definition at line 154 of file bsp_dk_bcreg_3201.h.

#define BC_UIF_PB_MASK   (0x000f)

Push button mask.

Definition at line 150 of file bsp_dk_bcreg_3201.h.


Enumeration Type Documentation

Bus control access mode.

Enumerator:
BSP_BusControl_Undefined 

Board control mode unknown (not set).

BSP_BusControl_OFF 

Board control disable.

BSP_BusControl_DIRECT 

GPIO direct drive (n/a).

BSP_BusControl_SPI 

Configure Board controller for SPI mode.

BSP_BusControl_EBI 

Configure Board controller for EBI mode.

Definition at line 80 of file bsp.h.

Display Control.

Enumerator:
BSP_Display_EBI 

SSD2119 TFT controller driven by EFM32 EBI interface.

BSP_Display_SPI 

SSD2119 TFT controller driven by EFM32 SPI interface.

BSP_Display_BC 

SSD2119 TFT controller driven by board controller (AEM).

BSP_Display_PowerEnable 

SSD2119 Enable power.

BSP_Display_PowerDisable 

SSD2119 Disable power.

BSP_Display_ResetAssert 

Hold SSD2119 in reset.

BSP_Display_ResetRelease 

Release SSD2119 in reset.

BSP_Display_Mode8080 

Configure SSD2119 for 8080 mode of operation.

BSP_Display_ModeGeneric 

Configure SSD2119 for Generic+SPI mode of operation.

Definition at line 66 of file bsp.h.

Peripherals control structure for DK3x50 DK's.

Enumerator:
BSP_RS232_SHUTDOWN 

Disable RS232.

BSP_RS232_UART 

UART control of RS232.

BSP_RS232_LEUART 

LEUART control of RS232.

BSP_I2C 

I2C interface.

BSP_ETH 

Ethernet.

BSP_I2S 

Audio I2S.

BSP_TRACE 

ETM Trace.

BSP_TOUCH 

Display touch interface.

BSP_AUDIO_IN 

Audio In.

BSP_AUDIO_OUT 

Audio Out.

BSP_ANALOG_DIFF 

Differential analog input.

BSP_ANALOG_SE 

Single ended analog input.

BSP_MICROSD 

MicroSD SPI interace.

BSP_TFT 

SSD2119 TFT controller.

Definition at line 120 of file bsp.h.

Peripherals control structure for Gxxx_DK's.

Enumerator:
BSP_ACCEL 

Accelerometer.

BSP_AMBIENT 

Light sensor.

BSP_POTMETER 

Potentiometer.

BSP_RS232A 

Serial port A.

BSP_RS232B 

Serial port B.

BSP_SPI 

SPI interface.

BSP_I2C 

I2C interface.

BSP_IRDA 

IrDA interface.

BSP_ANALOG_SE 

Single ended analog input.

BSP_ANALOG_DIFF 

Differential analog input.

BSP_AUDIO_OUT 

Audio Out.

BSP_AUDIO_IN 

Audio In.

BSP_ACCEL_GSEL 

Accelerometer range select.

BSP_ACCEL_SELFTEST 

Accelerometer selftest mode.

BSP_RS232_SHUTDOWN 

Disable RS232.

BSP_IRDA_SHUTDOWN 

Disable IrDA.

Definition at line 92 of file bsp.h.


Function Documentation

BSP_BusControl_TypeDef BSP_BusControlModeGet ( void   ) 

Get current board controller bus decode logic configuration.

Returns:
Bus decode logic configuration as enumerated in BSP_BusControl_TypeDef.

Definition at line 186 of file bsp_dk_3201.c.

int BSP_BusControlModeSet ( BSP_BusControl_TypeDef  mode  ) 

Configure Board Controller bus decode logic.

Parameters:
[in] mode Mode of operation, use enum BSP_BusControl_TypeDef mode. On Gxxx_DK's this functions is a dummy.
Returns:
BSP_STATUS_OK or BSP_STATUS_ILLEGAL_PARAM. BSP_STATUS_NOT_IMPLEMENTED on Gxxx_DK's.

Definition at line 200 of file bsp_dk_3201.c.

References BSP_BusControl_DIRECT, BSP_BusControl_EBI, BSP_BusControl_OFF, BSP_BusControl_SPI, BSP_STATUS_ILLEGAL_PARAM, and BSP_STATUS_OK.

Referenced by BSP_Disable(), and BSP_Init().

Here is the caller graph for this function:

uint32_t BSP_DipSwitchGet ( void   ) 

Get status of the DIP switches on the DK.

Returns:
Bitmask with a single bit for each DIP switch.

Definition at line 251 of file bsp_dk_3201.c.

References BC_REGISTER, and BSP_RegisterRead().

Here is the call graph for this function:

int BSP_DisplayControl ( BSP_Display_TypeDef  option  ) 

Configure display control.

Parameters:
[in] option Configure using enum BSP_Display_TypeDef. On Gxxx_DK's this functions is a dummy.
Returns:
BSP_STATUS_OK or BSP_STATUS_NOT_IMPLEMENTED on Gxxx_DK's.

Definition at line 264 of file bsp_dk_3201.c.

References BC_ARB_CTRL_BC, BC_ARB_CTRL_EBI, BC_ARB_CTRL_SPI, BC_DISPLAY_CTRL_MODE_GENERIC, BC_DISPLAY_CTRL_POWER_ENABLE, BC_DISPLAY_CTRL_RESET, BC_REGISTER, BSP_Display_BC, BSP_Display_EBI, BSP_Display_Mode8080, BSP_Display_ModeGeneric, BSP_Display_PowerDisable, BSP_Display_PowerEnable, BSP_Display_ResetAssert, BSP_Display_ResetRelease, BSP_Display_SPI, BSP_RegisterRead(), BSP_RegisterWrite(), and BSP_STATUS_OK.

Referenced by RETARGET_SerialInit(), TFT_AddressMappedInit(), and TFT_DirectInit().

Here is the call graph for this function:

Here is the caller graph for this function:

int BSP_EbiExtendedAddressRange ( bool  enable  ) 

Extended the EBI addressing range by enabling address lines A16-A22.

On Gxxx_DK's this functions is a dummy.

Parameters:
[in] enable If true, enable address lines A16-A22, if false disable.
Returns:
BSP_STATUS_OK on DK3x50, BSP_STATUS_NOT_IMPLEMENTED on Gxxx_DK's.

Definition at line 336 of file bsp_dk_3201.c.

References BC_EBI_CTRL_EXTADDR_MASK, BC_REGISTER, BSP_RegisterWrite(), and BSP_STATUS_OK.

Here is the call graph for this function:

int BSP_EnergyModeSet ( uint16_t  energyMode  ) 

Inform board controller about current energy mode.

Parameters:
[in] energyMode A number describing the energy mode.
Returns:
BSP_STATUS_OK

Definition at line 357 of file bsp_dk_3201.c.

References BC_REGISTER, BSP_RegisterWrite(), and BSP_STATUS_OK.

Here is the call graph for this function:

int BSP_InterruptDisable ( uint16_t  flags  ) 

Disable interrupts from board controller.

Parameters:
[in] flags A bitmask defining which interrupt sources to disable.
Returns:
BSP_STATUS_OK

Definition at line 370 of file bsp_dk_3201.c.

References BC_REGISTER, BSP_RegisterRead(), BSP_RegisterWrite(), and BSP_STATUS_OK.

Here is the call graph for this function:

int BSP_InterruptEnable ( uint16_t  flags  ) 

Enable interrupts from board controller.

Parameters:
[in] flags A bitmask defining which interrupt sources to enable.
Returns:
BSP_STATUS_OK

Definition at line 389 of file bsp_dk_3201.c.

References BC_REGISTER, BSP_RegisterRead(), BSP_RegisterWrite(), and BSP_STATUS_OK.

Here is the call graph for this function:

int BSP_InterruptFlagsClear ( uint16_t  flags  ) 

Clear board controller interrupt flags.

Parameters:
[in] flags A bitmask defining which interrupt sources to clear.
Returns:
BSP_STATUS_OK

Definition at line 407 of file bsp_dk_3201.c.

References BC_REGISTER, BSP_RegisterRead(), BSP_RegisterWrite(), and BSP_STATUS_OK.

Here is the call graph for this function:

uint16_t BSP_InterruptFlagsGet ( void   ) 

Get board controller interrupt flags.

Returns:
A bitmask defining which interrupt sources have their flaf set.

Definition at line 421 of file bsp_dk_3201.c.

References BC_REGISTER, and BSP_RegisterRead().

Here is the call graph for this function:

uint16_t BSP_JoystickGet ( void   ) 

Get status of joystick on the DK.

Returns:
The status of the 5 joystick switches. See BC_JOYSTICK_MASK or BC_UIF_JOYSTICK_MASK according to your kit.

Definition at line 431 of file bsp_dk_3201.c.

References BC_REGISTER, and BSP_RegisterRead().

Here is the call graph for this function:

int BSP_McuBoard_DeInit ( void   ) 

Disable MCU plugin board peripherals.

Returns:
BSP_STATUS_OK.

Definition at line 54 of file bsp_dk_mcuboard.c.

References BSP_STATUS_OK.

int BSP_McuBoard_Init ( void   ) 

Enable MCU plugin board peripherals.

Returns:
BSP_STATUS_OK.

Definition at line 70 of file bsp_dk_mcuboard.c.

References BSP_STATUS_OK.

int BSP_McuBoard_UsbStatusLedEnable ( bool  enable  ) 

Set state of MCU plugin board USB status LED.

Parameters:
[in] enable Set to true to turn on LED, false to turn off.
Returns:
BSP_STATUS_OK on plugin boards with USB capability, BSP_STATUS_NOT_IMPLEMENTED otherwise.

Definition at line 95 of file bsp_dk_mcuboard.c.

References BSP_STATUS_NOT_IMPLEMENTED, and BSP_STATUS_OK.

bool BSP_McuBoard_UsbVbusOcFlagGet ( void   ) 

Get state MCU plugin board VBUS overcurrent flag.

Returns:
True if overcurrent situation exist, false otherwise.

Definition at line 119 of file bsp_dk_mcuboard.c.

int BSP_McuBoard_UsbVbusPowerEnable ( bool  enable  ) 

Enable MCU plugin board VBUS power switch.

Parameters:
[in] enable Set to true to turn on VBUS power, false to turn off.
Returns:
BSP_STATUS_OK on plugin boards with USB capability, BSP_STATUS_NOT_IMPLEMENTED otherwise.

Definition at line 146 of file bsp_dk_mcuboard.c.

References BSP_STATUS_NOT_IMPLEMENTED, and BSP_STATUS_OK.

int BSP_PeripheralAccess ( BSP_Peripheral_TypeDef  perf,
bool  enable 
)

DK Peripheral Access Control Enable or disable access to on-board peripherals through switches and SPI switch where applicable.

Turn off conflicting peripherals when enabling another.

Parameters:
[in] perf Which peripheral to configure. Use enum BSP_Peripheral_TypeDef or BSP_Peripheral_Typedef according to DK type.
[in] enable If true, set up access to peripheral, if false disable access.
Returns:
BSP_STATUS_OK.

Definition at line 452 of file bsp_dk_3201.c.

References BC_PERICON_ANALOG_DIFF_SHIFT, BC_PERICON_ANALOG_SE_SHIFT, BC_PERICON_AUDIO_IN_SHIFT, BC_PERICON_AUDIO_OUT_SEL_SHIFT, BC_PERICON_AUDIO_OUT_SHIFT, BC_PERICON_I2C_SHIFT, BC_PERICON_I2S_ETH_SEL_SHIFT, BC_PERICON_I2S_ETH_SHIFT, BC_PERICON_RS232_LEUART_SHIFT, BC_PERICON_RS232_SHUTDOWN_SHIFT, BC_PERICON_RS232_UART_SHIFT, BC_PERICON_SPI_SHIFT, BC_PERICON_TOUCH_SHIFT, BC_PERICON_TRACE_SHIFT, BC_REGISTER, BSP_ANALOG_DIFF, BSP_ANALOG_SE, BSP_AUDIO_IN, BSP_AUDIO_OUT, BSP_ETH, BSP_I2C, BSP_I2S, BSP_MICROSD, BSP_RegisterRead(), BSP_RegisterWrite(), BSP_RS232_LEUART, BSP_RS232_SHUTDOWN, BSP_RS232_UART, BSP_STATUS_OK, BSP_TFT, BSP_TOUCH, and BSP_TRACE.

Referenced by I2CDRV_Init(), TFT_DirectInit(), and TOUCH_Init().

Here is the call graph for this function:

Here is the caller graph for this function:

uint16_t BSP_PushButtonsGet ( void   ) 

Get status of the pushbutton switches on the DK.

Returns:
The status of the switches. See BC_PUSHBUTTON_MASK or BC_UIF_PB_MASK according to your kit.

Definition at line 668 of file bsp_dk_3201.c.

References BC_REGISTER, and BSP_RegisterRead().

Here is the call graph for this function:

uint16_t BSP_RegisterRead ( volatile uint16_t *  addr  ) 

Read from a board controller register.

Parameters:
[in] addr The board controller register address.
Returns:
The value read.

Definition at line 678 of file bsp_dk_3201.c.

References BSP_INIT_DK_EBI.

Referenced by BSP_DipSwitchGet(), BSP_DisplayControl(), BSP_InterruptDisable(), BSP_InterruptEnable(), BSP_InterruptFlagsClear(), BSP_InterruptFlagsGet(), BSP_JoystickGet(), BSP_LedClear(), BSP_LedGet(), BSP_LedSet(), BSP_LedsGet(), BSP_LedToggle(), BSP_PeripheralAccess(), BSP_PushButtonsGet(), RETARGET_WriteChar(), TFT_AddressMappedInit(), and TFT_DirectInit().

Here is the caller graph for this function:

int BSP_RegisterWrite ( volatile uint16_t *  addr,
uint16_t  data 
)

Write to a board controller register.

Parameters:
[in] addr The Board controller register address.
[in] data The value to write.

Definition at line 695 of file bsp_dk_3201.c.

References BSP_INIT_DK_EBI, and BSP_STATUS_OK.

Referenced by BSP_DisplayControl(), BSP_EbiExtendedAddressRange(), BSP_EnergyModeSet(), BSP_Init(), BSP_InterruptDisable(), BSP_InterruptEnable(), BSP_InterruptFlagsClear(), BSP_LedClear(), BSP_LedSet(), BSP_LedsInit(), BSP_LedsSet(), BSP_LedToggle(), and BSP_PeripheralAccess().

Here is the caller graph for this function: