📄 dev0455.h
字号:
/** @file hal/micro/xap2b/em250/board/dev0455.h * @brief Functions and definitions specific to the breakout board. * * This is the default BOARD_HEADER file used with the breakout board * (development kit). * * <!-- Author(s): Lee Taylor, lee@ember.com --> * <!-- Copyright 2006 by Ember Corporation. All rights reserved.--> */#ifndef __BOARD_H__#define __BOARD_H__/** @name Custom Baud Rate Definitions * * The following define is used with defining a custom baud rate for the UART. * This define provides a simple hook into the definition of * the baud rates used with the UART. The baudSettings[] array in uart.c * links the BAUD_* defines with the actual register values needed for * operating the UART. The array baudSettings[] can be edited directly for a * custom baud rate or another entry (the register settings) can be provided * here with this define. *///@{/** * @description This define is the register setting for generating a baud of * 40000. Refer to the EM250 datasheet's discussion on UART buad rates for * the equation used to derive this value. */#define EMBER_SERIAL_BAUD_CUSTOM 300//@} //END OF CUSTOM BAUD DEFINITIONS/** @name LED Definitions * * The following are used to aid in the abstraction with the LED * connections. The microcontroller-specific sources use these * definitions so they are able to work across a variety of boards * which could have different connections. The names and ports/pins * used below are intended to match with a schematic of the system to * provide the abstraction. * * The BOARDLEDn enum values should always be used when manipulating the * state of LEDs, as they directly refer to the GPIOs to which the LEDs are * connected. * * \b Note: LEDs 0 and 1 are on the RCM. * * \b Note: LEDs 2 and 3 are on the breakout board (dev0455). *///@{/** * @description Assign each GPIO with an LED connected to a convenient name. * BOARD_ACTIVITY_LED and BOARD_HEARTBEAT_LED provide a further layer of * abstraction ontop of the 4 LEDs for verbose coding. */enum HalBoardLedPins { BOARDLED0 = 13, BOARDLED1 = 14, BOARDLED2 = 15, BOARD_ACTIVITY_LED = BOARDLED0, BOARD_HEARTBEAT_LED = BOARDLED1};/** * @description This mask indicates which GPIO the LEDs are connected to. * A bit is set for each GPIO to which an LED is connected. */#define BOARDLED_MASK 0xF800//#define BOARDLED_MASK 0x7800 // lvyong 2006-12-5//@} //END OF LED DEFINITIONS/** @name Button Definitions * * The following are used to aid in the abstraction with the Button * connections. The microcontroller-specific sources use these * definitions so they are able to work across a variety of boards * which could have different connections. The names and ports/pins * used below are intended to match with a schematic of the system to * provide the abstraction. * * The BUTTONn macros should always be used with manipulating the buttons * as they directly refer to the GPIOs to which the buttons are connected. * * \b Note: The GPIO number must match the IRQ letter *///@{/** * @description The actual GPIO BUTTON0 is connected to. This define should * be used whenever referencing BUTTON0. */#define BUTTON0 8 //the pin, also value used throughout HAL and app/** * @description The interrupt configuration register for BUTTON0. */#define BUTTON0_INTCFG GPIO_INTCFGA/** * @description The filter bit for BUTTON0. */#define BUTTON0_FLT_BIT GPIO_INTFILT_BIT/** * @description The interrupt trigger selection for BUTTON0. */#define BUTTON0_MOD_BITS GPIO_INTMOD_BIT/** * @description The interrupt bit for BUTTON0. */#define BUTTON0_INT_BIT INT_GPIOA/** * @description The actual GPIO BUTTON1 is connected to. This define should * be used whenever referencing BUTTON1. */#define BUTTON1 15 //the pin, also value used throughout HAL and app/** * @description The interrupt configuration register for BUTTON1. */#define BUTTON1_INTCFG GPIO_INTCFGC/** * @description The filter bit for BUTTON1. */#define BUTTON1_FLT_BIT GPIO_INTFILT_BIT/** * @description The interrupt trigger selection for BUTTON1. */#define BUTTON1_MOD_BITS GPIO_INTMOD_BIT/** * @description The interrupt bit for BUTTON1. */#define BUTTON1_INT_BIT INT_GPIOC//@} //END OF BUTTON DEFINITIONS/** @name Packet Trace * * When PACKET_TRACE is defined, GPIO_CFG will automatically be setup by * halInit() to enable Packet Trace support on GPIO Pins 4 and 5, * in addition to the configuration specified below. * * \b Note: This define will override any settings for GPIO 4 and 5. *///@{/** * @description This define does not equate to anything. It is used as a * trigger to enable Packet Trace support on the breakout board (dev0455). */#define PACKET_TRACE // We do have PACKET_TRACE support//@} //END OF PACKET TRACE DEFINITIONS/** @name ENABLE_OSC32K * * When ENABLE_OSC32K is defined, halInit() will configure system * timekeeping to utilize the external 32.768 kHz crystal oscillator * rather than the internal 1 kHz RC oscillator. *///@{/** * @description This define does not equate to anything. It is used as a * trigger to enable 32.768 kHz XTAL oscillator on the RCM (0452) plugged * into the Breakout board (dev0455). * Default is to disable 32.768 kHz XTAL and use 1 kHz RC oscillator instead. *///#define ENABLE_OSC32K // Enable 32.768 kHz osc instead of 1 kHz RC osc//@} //END OF ENABLE OSC32K DEFINITIONS/** @name DISABLE_OSC24M_BIAS_TRIM * * When DISABLE_OSC24M_BIAS_TRIM is defined, halInit() will disable adjusting * the 24 MHz oscillator's bias trim based on its corresponding Manufacturing * token, and instead utilize full bias at power up and deep sleep wakeups. * This should be utilized only if the Manufacturing token value proves to be * unreliable. *///@{/** * @description This define does not equate to anything. It is used as a * trigger to disable bias adjustment of the 24 MHz crystal oscillator on * the RCM (0452) plugged into the Breakout board (dev0455). * Default is to enable bias adjustment. *///#define DISABLE_OSC24M_BIAS_TRIM // Disable 24 MHz bias trim adjustment//@} //END OF DISABLE OSC24M BIAS TRIM DEFINITIONS //Since the two GPIO config registers affect multiple modules, it is not //possible for one or more of the modules to own the configuration //of the GPIO. This is the only place the registers should be touched. //The groups of comments below are setting for a couple common modes./* //GPIO[16,15,14,13] //+ SC1-2 + SC2-2 + CAP2-0 + CAP1-0 + GPIO[12,11,3,0] GPIO_DBG = 0x0000; GPIO_CFG = 0x0010;*//* // TMR1OB //+ GPIO[15,14,13] //+ SC1-2 + SC2-4S + CAP2-0 + CAP1-2h + GPIO[12,11] GPIO_DBG = 0x0000; GPIO_CFG = 0x0058;*//* //GPIO[16,15,14,13] //+ SC1-3M + SC2-4S + CAP2-2 + CAP1-2h + GPIO[12] GPIO_DBG = 0x0000; GPIO_CFG = 0x00F0;*//*** DEFAULT CONFIGURATION ** // TMR1OB //+ GPIO[15,14,13] //+ SC1-2 + SC2-3M + CAP2-0 + CAP1-2 + GPIO[12,11,3] //+ ADC2 GPIO_DBG = 0x0000; GPIO_CFG = 0x0498;*//** @name GPIO Configuration Definitions * * The following are used to specify the GPIO configuration to establish * when Powered (POWERUP_), and when Deep Sleeping (POWERDN_). The reason * for separate Deep Sleep settings is to allow for a slightly different * configuration that minimizes power consumption during Deep Sleep. For * example, inputs that might float could be pulled up or down, and output * states chosen with care, e.g. to turn off LEDs or other devices that might * consume power or be unnecessary when Deep Sleeping. *///@{/** * @description A convenience macro to convert GPIO# into bit mask for the * GPIO registers. */#define GPIO(n) (1u << ((n) & 0xF))/** * @description Powered setting of GPIO_DBG debug configuration register. */#define POWERUP_GPIO_DBG 0/** * @description Powered setting of GPIO_CFG configuration register.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -