121 lines
3.0 KiB
C
121 lines
3.0 KiB
C
/****************************************************************/
|
|
/* TMS320C32 */
|
|
/* ====== BIOS, ÊËÀÈÍ, ÊËÂÑÏ ====== */
|
|
/* ÖÍÈÈ ÑÝÒ (ñ) 1998-2000 ã. */
|
|
/****************************************************************/
|
|
/* Bios_dsp.h */
|
|
/****************************************************************/
|
|
/* Îñíîâíûå êîììàíäû BIOS */
|
|
/****************************************************************/
|
|
#ifndef _BIOS_DSP
|
|
#define _BIOS_DSP
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#define BM_PACKED 1
|
|
#define BM_CHAR32 0
|
|
|
|
#define CHIEF 1
|
|
#define SLAVE 0
|
|
|
|
#define ADR_FOR_SPECIAL 0x100
|
|
#define CMD_MODBUS_3 3
|
|
#define ANS_MODBUS_3 4
|
|
#define CMD_MODBUS_15 5
|
|
#define CMD_MODBUS_6 6
|
|
#define ANS_MODBUS_6 7
|
|
#define CMD_MODBUS_16 16
|
|
/*
|
|
|
|
CMD_MODBUS_3 = 3,
|
|
ANS_MODBUS_3 = 4,
|
|
CMD_MODBUS_15 = 5,
|
|
CMD_MODBUS_6 = 6,
|
|
ANS_MODBUS_6 = 7,
|
|
CMD_MODBUS_16 = 16,
|
|
*/
|
|
enum {
|
|
CMD_LOAD=51, CMD_UPLOAD, CMD_RUN, CMD_XFLASH, CMD_TFLASH,
|
|
CMD_PEEK, CMD_POKE, CMD_INITLOAD, CMD_INIT,CMD_EXTEND,
|
|
|
|
CMD_VECTOR=61,
|
|
CMD_IMPULSE,
|
|
/* ñòàíäàðòíûå êîìàíäû */
|
|
CMD_STD=65, CMD_STD_ANS
|
|
};
|
|
|
|
enum {false=0, true};
|
|
|
|
|
|
/** Âîçâðàùàåò íîìåð êîììàíäû, åñëè åñòü èëè -1 åñëè òðàíçàêöèé íå áûëî */
|
|
int get_command(RS_DATA *rs_arr);
|
|
|
|
/** Ñòàíäàðòíûé îòâåò, áåç ïàðàìåòðîâ */
|
|
void Answer(RS_DATA *rs_arr,int n);
|
|
|
|
/* íà÷àëüíûå óñòàíîâêè (íå ðàáîòàåò)*/
|
|
void init(RS_DATA *rs_arr);
|
|
|
|
/**@name Êîììàíäû
|
|
* Êîììàíäû, âûçûâàåìûå ÷åðåç ïîñëåäîâàòåëüíûé êàíàë*/
|
|
//@{
|
|
|
|
/** Èíèöèèðîâàòü çàãðóçêó áëîêà.
|
|
Íàñòðàèâàåò ïðèåì áëîêà äàííûõ */
|
|
void initload(RS_DATA *rs_arr);
|
|
|
|
/** Çàãðóçêà áëîêà.
|
|
Âûçûâàåòñà ïîñëå çàãðóçêè áëîêà ÷åðåç RS */
|
|
void load(RS_DATA *rs_arr);
|
|
|
|
/** Âûïîëíèòü ïðîãðàììó â ôîðìàòå Serial Boot.
|
|
@precondition Äîëæíà áûòü ïðîèçâåäåíà çàãðóçêà áëîêà
|
|
Àäðåñ ïðîãðàììû áåðåòñà èç çàãîëîâêà è
|
|
ñðàâíèâàåòñà ñ ïåðåìåííîé RecvPtr, çàïîëíàåìîé â ô-öèè load
|
|
@see load */
|
|
void run (RS_DATA *rs_arr);
|
|
|
|
/** Ïðî÷èòàòü à÷åéêó ïàìàòè */
|
|
void peek(RS_DATA *rs_arr);
|
|
|
|
/** Çàïèñàòü â à÷åéêó ïàìàòè */
|
|
void poke(RS_DATA *rs_arr);
|
|
|
|
/** Ïåðåäàòü áëîê ïàìàòè */
|
|
void upload(RS_DATA *rs_arr);
|
|
|
|
/** Ïðîøèòü XILINX.
|
|
@precondition Äîëæíà áûòü ïðîèçâåäåíà çàãðóçêà áëîêà
|
|
Àäðåñ è äëèíà ïðîøèâêè áåðåòñà èç çàãîëîâêà è
|
|
ñðàâíèâàåòñà ñ ïåðåìåííûìè RecvPtr è Length, çàïîëíàåìûìè â ô-öèè load,
|
|
òàê æå ñìîòðèò ìàãè÷åñêîå ñëîâî â íà÷àëå ïðîøèâêè
|
|
@see load */
|
|
void xflash(RS_DATA *rs_arr);
|
|
|
|
/** Ïðîøèòü TMS.
|
|
@precondition Äîëæíà áûòü ïðîèçâåäåíà çàãðóçêà áëîêà
|
|
Àäðåñ è äëèíà ïðîøèâêè áåðåòñà èç çàãîëîâêà è
|
|
ñðàâíèâàåòñà ñ ïåðåìåííûìè RecvPtr è Length, çàïîëíàåìûìè â ô-öèè load
|
|
@see load */
|
|
void tflash(RS_DATA *rs_arr);
|
|
|
|
|
|
/* ðàñøèðåííûå êîìàíäû äëà áèîñà */
|
|
void extendbios(RS_DATA *rs_arr);
|
|
|
|
|
|
void write_memory(unsigned long addr, unsigned int data);
|
|
unsigned int read_memory(unsigned long addr);
|
|
|
|
|
|
//@}
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif/* _BIOS_DSP */
|