⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dev0455.h

📁 是zmac的协议的全部完整的解析.代码例子很全
💻 H
📖 第 1 页 / 共 2 页
字号:
 */#ifdef  PACKET_TRACE#define POWERUP_GPIO_CFG     0x1498            // DEFAULT + PacketTrace#else//!PACKET_TRACE#define POWERUP_GPIO_CFG     0x0498            // DEFAULT#endif//PACKET_TRACE/** * @description Powered setting of GPIO_DIRH GPIO16 output-enable register. */#define POWERUP_GPIO_DIRH    0                 // GPIO16 = Input/** * @description Powered setting of GPIO_DIRL GPIO15..0 output-enable register. */#define POWERUP_GPIO_DIRL   (BOARDLED_MASK|GPIO(7)|GPIO(5)|GPIO(4)|GPIO(3))                                               // LEDs & GPIO7,5,4,3 outputs/** * @description Powered setting of GPIO_CLRH clear GPIO16 output register. */#define POWERUP_GPIO_CLRH    0                 // No output state change/** * @description Powered setting of GPIO_CLRL clear GPIO15..0 outputs register. */#define POWERUP_GPIO_CLRL    GPIO(4)           // GPIO4 low/** * @description Powered setting of GPIO_SETH set GPIO16 output register. */#define POWERUP_GPIO_SETH    0                 // No output state change/** * @description Powered setting of GPIO_SETL set GPIO15..0 outputs register. */#define POWERUP_GPIO_SETL   (BOARDLED_MASK|GPIO(7)|GPIO(5))                                               // LEDs off (high), GPIO5 high/** * @description Powered setting of GPIO_PUH GPIO16 pullup resistor enable * register. */#define POWERUP_GPIO_PUH     0                 // No pullup on GPIO16/** * @description Powered setting of GPIO_PUL GPIO15..0 pullup resistors enable * register. */#define POWERUP_GPIO_PUL    (GPIO(BUTTON1)|GPIO(BUTTON0))                                               // Pullup Buttons/** * @description Powered setting of GPIO_PDH GPIO16 pulldown resistor enable * register. */#define POWERUP_GPIO_PDH     0                 // No pulldown on GPIO16/** * @description Powered setting of GPIO_PDL GPIO15..0 pulldown resistors enable * register. */#define POWERUP_GPIO_PDL     0x0000            // No pulldowns on GPIO15..0/** * @description Deep Sleep setting of GPIO_DBG debug configuration register. */#define POWERDN_GPIO_DBG     POWERUP_GPIO_DBG/** * @description Deep Sleep setting of GPIO_CFG configuration register. */#define POWERDN_GPIO_CFG    (POWERUP_GPIO_CFG & ~0x4F00)                                               // Disable analog I/O switches/** * @description Deep Sleep setting of GPIO_DIRH GPIO16 output-enable register. */#define POWERDN_GPIO_DIRH    POWERUP_GPIO_DIRH/** * @description Deep Sleep setting of GPIO_DIRL GPIO15..0 output-enable register. */#define POWERDN_GPIO_DIRL    POWERUP_GPIO_DIRL/** * @description Deep Sleep setting of GPIO_CLRH clear GPIO16 output register. */#define POWERDN_GPIO_CLRH    0                 // No output state change/** * @description Deep Sleep setting of GPIO_CLRL clear GPIO15..0 outputs register. */#define POWERDN_GPIO_CLRL    0x0000            // No output state change/** * @description Deep Sleep setting of GPIO_SETH set GPIO16 output register. */#define POWERDN_GPIO_SETH    0                 // No output state change/** * @description Deep Sleep setting of GPIO_SETL set GPIO15..0 outputs register. */#define POWERDN_GPIO_SETL    BOARDLED_MASK     // LEDs off (high)/** * @description Deep Sleep setting of GPIO_PUH GPIO16 pullup resistor * enable register. */#define POWERDN_GPIO_PUH     POWERUP_GPIO_PUH/** * @description Deep Sleep setting of GPIO_PUL GPIO15..0 pullup resistors * enable register. */#ifdef  PACKET_TRACE#define POWERDN_GPIO_PUL    (POWERUP_GPIO_PUL                             \                            |GPIO(0)            /* SC1  MOSI pull up   */ \                            |GPIO(1)            /* SC1  MISO pull up   */ \                            |GPIO(5)            /* PTI  DATA pull up   */ \                            |GPIO(9)            /* SC2   TXD pull up   */ \                            |GPIO(10)           /* SC2   RXD pull up   */ \                            )#else//!PACKET_TRACE#define POWERDN_GPIO_PUL    (POWERUP_GPIO_PUL                             \                            |GPIO(0)            /* SC1  MOSI pull up   */ \                            |GPIO(1)            /* SC1  MISO pull up   */ \                            |GPIO(9)            /* SC2   TXD pull up   */ \                            |GPIO(10)           /* SC2   RXD pull up   */ \                            )#endif//PACKET_TRACE/** * @description Deep Sleep setting of GPIO_PDH GPIO16 pulldown resistor * enable register. */#define POWERDN_GPIO_PDH     (POWERUP_GPIO_PDH|GPIO(16)) // TMR1 pull down/** * @description Deep Sleep setting of GPIO_PDL GPIO15..0 pulldown resistors * enable register. */#ifdef  PACKET_TRACE#define POWERDN_GPIO_PDL    (POWERUP_GPIO_PDL                             \                            |GPIO(2)            /* SC1 MSCLK pull down */ \                            |GPIO(4)            /* PTI    EN pull down */ \                            |GPIO(6)            /* GPIO6     pull down */ \                            )#else//!PACKET_TRACE#define POWERDN_GPIO_PDL    (POWERUP_GPIO_PDL                             \                            |GPIO(2)            /* SC1 MSCLK pull down */ \                            |GPIO(6)            /* GPIO6     pull down */ \                            )#endif//PACKET_TRACE//@{/** * @description A convenient define that chooses if this external signal can * be used as source to wake from deep sleep.  Any change in the state of the * signal will wake up the CPU. */#define WAKE_ON_GPIO0   FALSE#define WAKE_ON_GPIO1   FALSE#define WAKE_ON_GPIO2   FALSE#define WAKE_ON_GPIO3   FALSE#define WAKE_ON_GPIO4   FALSE#define WAKE_ON_GPIO5   FALSE#define WAKE_ON_GPIO6   FALSE#define WAKE_ON_GPIO7   FALSE#define WAKE_ON_GPIO8   TRUE   //BUTTON0#define WAKE_ON_GPIO9   FALSE#define WAKE_ON_GPIO10  FALSE#define WAKE_ON_GPIO11  FALSE#define WAKE_ON_GPIO12  FALSE#define WAKE_ON_GPIO13  FALSE#define WAKE_ON_GPIO14  FALSE#define WAKE_ON_GPIO15  TRUE   //BUTTON1#define WAKE_ON_GPIO16  FALSE//@}//@} //END OF GPIO Configuration Definitions/** @name Board Specific Functions * * The following macros exist to aid in the initialization, power up from sleep, * and power down to sleep operations.  These macros are responsible for * either initializing directly, or calling initialization functions for any * peripherals that are specific to this board implementation.  These * macros are called from halInit, halPowerDown, and halPowerUp respectively. */ //@{/** * @description Initialize the board.  This function is called from halInit(). */#define halInternalInitBoard()                                  \        do {                                                    \          halInternalPowerUpBoard();                            \          halInternalInitButton();                              \       } while(0)/** * @description Power down the board.  This function is called from * halPowerDown(). */#define halInternalPowerDownBoard()                             \        do {                                                    \          /* Board peripheral deactivation */                   \          halInternalSleepAdc();                                \          /* GPIO Output configuration */                       \          GPIO_CLRH  = POWERDN_GPIO_CLRH; /* output states  */  \          GPIO_CLRL  = POWERDN_GPIO_CLRL; /* output states  */  \          GPIO_SETH  = POWERDN_GPIO_SETH; /* output states  */  \          GPIO_SETL  = POWERDN_GPIO_SETL; /* output states  */  \          GPIO_DIRH  = POWERDN_GPIO_DIRH; /* output enables */  \          GPIO_DIRL  = POWERDN_GPIO_DIRL; /* output enables */  \          /* GPIO Mode Config (see above) */                    \          GPIO_DBG   = POWERDN_GPIO_DBG;                        \          GPIO_CFG   = POWERDN_GPIO_CFG;                        \          /* GPIO Pullup/Pulldown Config */                     \          GPIO_PDH   = POWERDN_GPIO_PDH;                        \          GPIO_PDL   = POWERDN_GPIO_PDL;                        \          GPIO_PUH   = POWERDN_GPIO_PUH;                        \          GPIO_PUL   = POWERDN_GPIO_PUL;                        \        } while(0)/** * @description Power up the board.  This function is called from * halPowerUp(). */#define halInternalPowerUpBoard()                               \        do {                                                    \          /* GPIO Pullup/Pulldown Config */                     \          GPIO_PUH   = POWERUP_GPIO_PUH;                        \          GPIO_PUL   = POWERUP_GPIO_PUL;                        \          GPIO_PDH   = POWERUP_GPIO_PDH;                        \          GPIO_PDL   = POWERUP_GPIO_PDL;                        \          /* GPIO Mode Config (see above) */                    \          GPIO_DBG   = POWERUP_GPIO_DBG;                        \          GPIO_CFG   = POWERUP_GPIO_CFG;                        \          /* GPIO Output configuration */                       \          GPIO_CLRH  = POWERUP_GPIO_CLRH; /* output states  */  \          GPIO_CLRL  = POWERUP_GPIO_CLRL; /* output states  */  \          GPIO_SETH  = POWERUP_GPIO_SETH; /* output states  */  \          GPIO_SETL  = POWERUP_GPIO_SETL; /* output states  */  \          GPIO_DIRH  = POWERUP_GPIO_DIRH; /* output enables */  \          GPIO_DIRL  = POWERUP_GPIO_DIRL; /* output enables */  \          /* Board peripheral activation */                     \          halInternalInitAdc();                                 \          halInternalRestartUart();                             \        } while(0)//@} //END OF BOARD SPECIFIC FUNCTIONS#endif //__BOARD_H__

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -