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

📄 bl78k0_kx2_control.h

📁 NEC upd78f0300的自编程序样例
💻 H
字号:
//==============================================================================
// PROJECT      = Bootloader
// MODULE       = bl78k0_kx2_control.h
// SHORT DESC.  = Defines for the control module
// DEVICE       = 78K0/Kx2
// VERSION      = 1.0
// DATE         = 05.12.2006
// LAST CHANGE  =
// =============================================================================
// By:          NEC Electronics (Europe) GmbH
//              Arcadiastrasse 10
//              D-40472 Duesseldorf
// =============================================================================



#ifndef __BL78k0_KX2_CONTROL_H
#define __BL78k0_KX2_CONTROL_H

//*****************************************************************************
// function prototypes
//*****************************************************************************
void init_micro(void);
u08 bootloader_start(void);
__callt void sendString (u08 *ucpStr);
__callt u08 wait_for_rx(u08 timeout_factor);
__callt u08 readyToRxWithTimeout(void);
__callt u08 stopRxWithTimeout(void);
u08 executeUpdate(void);
void afterFirstSwap(void);
__callt u08 rom_Read(u16 ROM_addr);
__callt u08 eraseAppArea(void);
u08 copyBootCluster(void);
__callt void calcBootlSec1CRC(void);
__callt u08 verifyAppArea(void);
__callt u08 checkAppCRC(void);
__callt void resetAll(void);
__callt void exceptionHandler(void);
u08 writeIntoFlash(void);
void messageTimeoutHandler(void);



//*****************************************************************************
// return values from bootloader control and states for main modul
//*****************************************************************************

#define     UPDATE                    0   // start update
#define     ERROR_OCCURS              2   // error occurs
#define     APP_START                 3   // start application
#define     BOOTLOADER_START          4   // bootloader start in MAIN MODULE


//*****************************************************************************
// generically variables
//*****************************************************************************

#define     ERROR                     0   // error const.
#define     OK                        1   // ok const.



//*****************************************************************************
// bootloader start state defines
//*****************************************************************************

#define BOOTL_SET_RX_READY        0       // set up interface ready for rx
#define BOOTL_ILLEGAL_CHARACTERS  1       // receive illegal characters
#define BOOTL_START_MESSAGES      2       // send start messages
#define BOOTL_RX_Y_OR_N           3       // user prompt


//*****************************************************************************
// update states
//*****************************************************************************
#define START_UPDATE              0       // update start
#define RECEIVE_BYTES             1       // receive hex file
#define ANALYSE_BYTES             2       // analyse received bytes
#define AFTER_FLASH_WRITE         4       // do something after flash write



#define BOOTLOADER_UPDATE         0       // bootloader update const.
#define APPLICATION_UPDATE        1       // application update const.


#endif






⌨️ 快捷键说明

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