📄 h8300h.h
字号:
<font color="#6920ac">/* Macro's to manipulate individual bits in I/O registers and * their shadow copies. */</font><b><font color='DarkGreen'>#define</font></b> <font color="maroon"><a name="h83h_RegClear">h83h_RegClear</a></font>(Reg, Mask) \ Reg##_r = (Reg##_s &= ~(Mask));<b><font color='DarkGreen'>#define</font></b> <font color="maroon"><a name="h83h_RegSet">h83h_RegSet</a></font>(Reg, Mask) \ Reg##_r = (Reg##_s |= (Mask));<font color="#6920ac">/* Macro's to manipulate I/O registers and * their shadow copies, but allow for manipulating * a collection of bits in one hit. */</font><b><font color='DarkGreen'>#define</font></b> <font color="maroon"><a name="h83h_RegPut">h83h_RegPut</a></font>(Reg, Mask, Val) \ Reg##_r = (Reg##_s = ((Reg##_s & ~(Mask)) | ((Val) & (Mask)) ));<font color="#6920ac">/* Macro's to retrieve the value of either the real register * or the shadow register. */</font> <b><font color='DarkGreen'>#define</font></b> <font color="maroon"><a name="h83h_RegGet">h83h_RegGet</a></font>(Reg, Mask) \ (Reg##_s & (Mask))<b><font color='DarkGreen'>#define</font></b> <font color="maroon"><a name="h83h_RegGetReal">h83h_RegGetReal</a></font>(Reg, Mask) \ (Reg##_r & (Mask))<font color="#6920ac">/* The macros above are repeated for stored addresses - i.e. if a program needs to store an address these macros will work for the stored values */</font><b><font color='DarkGreen'>#define</font></b> <font color="maroon"><a name="h83h_RegClear_A">h83h_RegClear_A</a></font>(RegAddr, ShadAddr, Mask) \ *(RegAddr) = (*(ShadAddr) &= ~(Mask));<b><font color='DarkGreen'>#define</font></b> <font color="maroon"><a name="h83h_RegSet_A">h83h_RegSet_A</a></font>(RegAddr, ShadAddr, Mask) \ *(RegAddr) = (*(ShadAddr) |= (Mask));<b><font color='DarkGreen'>#define</font></b> <font color="maroon"><a name="h83h_RegPut_A">h83h_RegPut_A</a></font>(RegAddr, ShadAddr, Mask, Val) \ *(RegAddr) = (*(ShadAddr) = ((*(ShadAddr) & ~(Mask)) | ((Val) & (Mask)) ));<b><font color='DarkGreen'>#define</font></b> <font color="maroon"><a name="h83h_RegGet_A">h83h_RegGet_A</a></font>(RegAddr, ShadAddr, Mask) \ (*(ShadAddr) & (Mask))<b><font color='DarkGreen'>#define</font></b> <font color="maroon"><a name="h83h_RegGetReal_A">h83h_RegGetReal_A</a></font>(RegAddr, ShadAddr, Mask) \ (*(RegAddr) & (Mask))<font color="#6920ac">/* * The following two macros return addresses (real and shadow) for * register names */</font><b><font color='DarkGreen'>#define</font></b> <font color="maroon"><a name="h83h_RegGetRealAddress_A">h83h_RegGetRealAddress_A</a></font>(Reg) \ (&(Reg##_r))<b><font color='DarkGreen'>#define</font></b> <font color="maroon"><a name="h83h_RegGetAddress_A">h83h_RegGetAddress_A</a></font>(Reg) \ (&(Reg##_s))<font color="#6920ac">/*********************** * GLOBAL DATA TYPES * ***********************/</font><font color="#6920ac">/* * ---<<< CORTEX SPECIFIC DEFINITIONS >>>--- */</font><font color="#6920ac">/* fast interrupt enable/diable cookie */</font><i><a name="hrdi_FastIntrCookie_t">typedef</a></i> <i>crtx_Byte_t</i> <i><font color='DarkBlue'>hrdi_FastIntrCookie_t</font></i>;<font color="#6920ac">/* global interrupt enable/diable cookie */</font><i><a name="hrdi_GlobalIntrCookie_t">typedef</a></i> <i>crtx_Byte_t</i> <i><font color='DarkBlue'>hrdi_GlobalIntrCookie_t</font></i>;<font color="#6920ac">/* timer initialisation block */</font><i>struct</i> tick_TimerSetupBlock_s { <i>crtx_Int_t</i> CrystalFreqDivider; <font color="#6920ac">/* crystal frequency divider */</font> <i>crtx_Int_t</i> CyclesPerClock; <font color="#6920ac">/* cycles per timer's clock */</font>};<font color="#6920ac">/* CPU registers as listed by GBM monitor */</font><i><a name="gdbm_Registers_t">typedef</a></i> <i>struct</i> <i><font color='DarkBlue'>gdbm_Registers_t</font></i> { <i>crtx_Uint32_t</i> R0; <font color="#6920ac">/* register R0 */</font> <i>crtx_Uint32_t</i> R1; <font color="#6920ac">/* register R1 */</font> <i>crtx_Uint32_t</i> R2; <font color="#6920ac">/* register R2 */</font> <i>crtx_Uint32_t</i> R3; <font color="#6920ac">/* register R3 */</font> <i>crtx_Uint32_t</i> R4; <font color="#6920ac">/* register R4 */</font> <i>crtx_Uint32_t</i> R5; <font color="#6920ac">/* register R5 */</font> <i>crtx_Uint32_t</i> R6; <font color="#6920ac">/* register R6 */</font> <i>crtx_Uint32_t</i> R7; <font color="#6920ac">/* register R7 */</font> <i>crtx_Uint32_t</i> CCR; <font color="#6920ac">/* CPU control register */</font> <i>crtx_Uint32_t</i> PC; <font color="#6920ac">/* program counter */</font>} <i>gdbm_Registers_t</i>;<font color="#6920ac">/* CPU registers saved on thread context switch */</font><i><a name="thrd_StackFrameRegs_t">typedef</a></i> <i>struct</i> thrd_StackFrameRegs_s { <i>crtx_Uint32_t</i> R3; <font color="#6920ac">/* register R3 */</font> <i>crtx_Uint32_t</i> R4; <font color="#6920ac">/* register R4 */</font> <i>crtx_Uint32_t</i> R5; <font color="#6920ac">/* register R5 */</font> <i>crtx_Uint32_t</i> R6; <font color="#6920ac">/* register R6 */</font> <i>crtx_Uint32_t</i> R7; <font color="#6920ac">/* register R7(SP) */</font> <i>crtx_Uint32_t</i> PC; <font color="#6920ac">/* program counter */</font>} <i><font color='DarkBlue'>thrd_StackFrameRegs_t</font></i>;<font color="#6920ac">/* hardware interrupts dispatcher */</font><font size="+1"><i>crtx_Void_t</i> <a href="hrdi_Dispatcher.FIND-FUNC">hrdi_Dispatcher</a>(<i>crtx_Void_t</i>);</font><font color="#6920ac">/* Set LISR interrupt mask. This service is only alowed from * hrdi_Shell to allow proper nested interrupt detection for * some ports. */</font><font size="+1"><i>crtx_Mask_t</i> <a href="hrdi_SetLisrIntrMask.FIND-FUNC">hrdi_SetLisrIntrMask</a>(<i>crtx_Mask_t</i> Mask_a);</font><font size="+1"><i>crtx_Void_t</i> <a href="hrdi_RestoreLisrIntrMask.FIND-FUNC">hrdi_RestoreLisrIntrMask</a>(<i>crtx_Mask_t</i> Mask_a);</font><font color="#6920ac">/* Hardware interrupt dispatcher */</font><i><a name="hrdi_Dispatcher_t">typedef</a></i> <i>crtx_Void_t</i> (*<i><font color='DarkBlue'>hrdi_Dispatcher_t</font></i>)(<i>crtx_Void_t</i>);<font size="+1"><i>crtx_Void_t</i> <a href="port_Init.FIND-FUNC">port_Init</a>(<i>crtx_Void_t</i>);</font><font size="+1"><i>crtx_Void_t</i> <a href="port_Fatal.FIND-FUNC">port_Fatal</a>(<i>crtx_Void_t</i>);</font><font size="+1"><i>crtx_Void_t</i> <a href="port_Abort.FIND-FUNC">port_Abort</a>(<i>crtx_Void_t</i>);</font><font size="+1"><i>crtx_Void_t</i> <a href="port_Exit.FIND-FUNC">port_Exit</a>(<i>crtx_Void_t</i>);</font><font size="+1"><i>crtx_Void_t</i> <a href="port_InitSerial.FIND-FUNC">port_InitSerial</a>(<i>crtx_Void_t</i>);</font><font size="+1"><i>crtx_Void_t</i> <a href="port_Putc.FIND-FUNC">port_Putc</a>(<i>crtx_Char_t</i> Char_a);</font><font size="+1"><i>crtx_Uint16_t</i> <a href="port_Ntohs.FIND-FUNC">port_Ntohs</a>(<i>crtx_Uint16_t</i> NetShort_a);</font><font size="+1"><i>crtx_Uint32_t</i> <a href="port_Ntohl.FIND-FUNC">port_Ntohl</a>(<i>crtx_Uint32_t</i> NetLong_a);</font><font size="+1"><i>crtx_Uint16_t</i> <a href="port_Htons.FIND-FUNC">port_Htons</a>(<i>crtx_Uint16_t</i> HostShort_a);</font><font size="+1"><i>crtx_Uint32_t</i> <a href="port_Htonl.FIND-FUNC">port_Htonl</a>(<i>crtx_Uint32_t</i> HostLong_a);</font><b><font color='DarkGreen'>#if</font></b><font color="maroon"> HRDI_USE_CORTEX_SCNDRY_INTR_TBL == 1</font><font color="#6920ac">/* secondary interrupt table */</font><i>extern</i> <i>crtx_Void_t</i> *hrdi_StartISRs_g; <font color="#6920ac">/* in RAM */</font><i>extern</i> <i>crtx_Void_t</i> *hrdi_EndISRs_g;<i>extern</i> <i>crtx_Void_t</i> *hrdi_StartISRsCode_g; <font color="#6920ac">/* in ROM */</font><i>extern</i> <i>crtx_Void_t</i> *hrdi_EndISRsCode_g;<i>extern</i> <i>crtx_Void_t</i> **hrdi_StartISRsPtr_g;<b><font color='DarkGreen'>#endif</font></b><font color="maroon"> <font color="#6920ac">/* HRDI_USE_CORTEX_SCNDRY_INTR_TBL == 1 */</font></font><font
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -