📄 amux8.lst
字号:
472 00EB ECO_TR: equ 0EBh ; External Oscillator Trim Register (W)
473
474 00FA FLS_PR1: equ 0FAh ; Flash Program Register 1 (RW)
475 0003 FLS_PR1_BANK: equ 03h ; MASK: Select Active Flash Bank
476
477 00FD DAC_CR: equ 0FDh ; Analog Mux DAC Control Register
478 0008 DAC_CR_IRANGE: equ 08h ; MASK: Sets the DAC Range low or high
479 0006 DAC_CR_OSCMODE: equ 06h ; MASK: Defines the reset mode for AMux
480 0001 DAC_CR_ENABLE: equ 01h ; MASK: Enable/Disable DAC function
481
482 ;;=============================================================================
483 ;; M8C System Macros
484 ;; These macros should be used when their functions are needed.
485 ;;=============================================================================
486
487 ;----------------------------------------------------
488 ; Swapping Register Banks
489 ;----------------------------------------------------
490 macro M8C_SetBank0
491 and F, ~FLAG_XIO_MASK
492 1C5C endm
493
494 macro M8C_SetBank1
495 or F, FLAG_XIO_MASK
496 1C5C endm
497
498 ;----------------------------------------------------
499 ; Global Interrupt Enable/Disable
500 ;----------------------------------------------------
501 macro M8C_EnableGInt
502 or F, FLAG_GLOBAL_IE
503 1C5C endm
504
505 macro M8C_DisableGInt
506 and F, ~FLAG_GLOBAL_IE
507 1C5C endm
508
509 ;----------------------------------------------------
510 ; Enable/Disable Interrupt Mask
511 ;
512 ; Use the following macros to enable/disable
513 ; bits in the Interrupt mask registers,
514 ; INT_MSK0, INT_MSK1 or INT_MSK3.
515 ;
516 ; Usage: M8C_DisableIntMask INT_MSKN, MASK
517 ; M8C_EnableIntMask INT_MSKN, MASK
518 ;
519 ; where INT_MSKN is INT_MSK0, INT_MSK1 or INT_MSK3
520 ; and MASK is the bit set to enable or disable
521 ;----------------------------------------------------
522 ; Disable Interrupt Bit Mask(s)
523 macro M8C_DisableIntMask
524 and reg[@0], ~@1 ; disable specified interrupt enable bit
525 1C5C endm
526
527 ; Enable Interrupt Bit Mask(s)
528 macro M8C_EnableIntMask
529 or reg[@0], @1 ; enable specified interrupt enable bit
530 1C5C endm
531
532 ;----------------------------------------------------
533 ; Clear Posted Interrupt Flag Mask
534 ;
535 ; Use the following macros to clear the
536 ; bits in the Interrupt Clear registers,
537 ; INT_CLR0, INT_CLR1 or INT_CLR3.
538 ; Usage: M8C_ClearIntFlag INT_CLRN, MASK
539 ;
540 ; where INT_MSKN is INT_CLR0, INT_CLR1 or INT_CLR3
541 ; and MASK is the bit set to enable or disable
542 ;----------------------------------------------------
543 macro M8C_ClearIntFlag
544 mov reg[@0], ~@1 ; clear specified interrupt enable bit
545 1C5C endm
546
547 ;----------------------------------------------------
548 ; Power-On Reset & WatchDog Timer Functions
549 ;----------------------------------------------------
550 macro M8C_EnableWatchDog
551 and reg[CPU_SCR0], ~CPU_SCR0_PORS_MASK
552 1C5C endm
553
554 macro M8C_ClearWDT
555 mov reg[RES_WDT], 00h
556 1C5C endm
557
558 macro M8C_ClearWDTAndSleep
559 mov reg[RES_WDT], 38h
560 1C5C endm
561
562 ;----------------------------------------------------
563 ; Sleep, CPU Stop & Software Reset
564 ;----------------------------------------------------
565 macro M8C_Sleep
566 or reg[CPU_SCR0], CPU_SCR0_SLEEP_MASK
567 ; The next instruction to be executed depends on the state of the
568 ; various interrupt enable bits. If some interrupts are enabled
569 ; and the global interrupts are disabled, the next instruction will
570 ; be the one that follows the invocation of this macro. If global
571 ; interrupts are also enabled then the next instruction will be
572 ; from the interrupt vector table. If no interrupts are enabled
573 ; then the CPU sleeps forever.
574 1C5C endm
575
576 macro M8C_Stop
577 ; In general, you probably don't want to do this, but here's how:
578 or reg[CPU_SCR0], CPU_SCR0_STOP_MASK
579 ; Next instruction to be executed is located in the interrupt
580 ; vector table entry for Power-On Reset.
581 1C5C endm
582
583 macro M8C_Reset
584 ; Restore CPU to the power-on reset state.
585 mov A, 0
586 SSC
587 ; Next non-supervisor instruction will be at interrupt vector 0.
588 1C5C endm
589
590 ;----------------------------------------------------
591 ; ImageCraft Code Compressor Actions
592 ;----------------------------------------------------
593 ; Suspend Code Compressor
594 ; Must not span a RET or RETI instruction
595 ; without resuming code compression
596 macro Suspend_CodeCompressor
597 or F, 0
598 1C5C endm
599
600 ; Resume Code Compression
601 macro Resume_CodeCompressor
602 add SP, 0
603 1C5C endm
1 ;;*****************************************************************************
2 ;;*****************************************************************************
3 ;;
4 ;; FILENAME: Memory.inc
5 ;;
6 ;; DESCRIPTION: Memory Model and Stack Parameter Definitions for
7 ;; 21x3x PSoC devices.
8 ;;
9 ;; LAST MODIFIED: August 17, 2004
10 ;;
11 ;;-----------------------------------------------------------------------------
12 ;; Copyright (c) Cypress MicroSystems 2004. All Rights Reserved.
13 ;;*****************************************************************************
14 ;;*****************************************************************************
15 ;
16 ;
17 ; ******** Define Memory Model and Stack parameters ********
18 ;
19 0001 IMAGECRAFT: equ 1
20 0002 HITECH: equ 2
21 0002 TOOLCHAIN: equ HITECH
22 0001 SYSTEM_LARGE_MEMORY_MODEL: equ 1
23 0000 SYSTEM_SMALL_MEMORY_MODEL: equ 0
24 0001 SYSTEM_STACK_PAGE: equ 1
25 0000 SYSTEM_STACK_PAGE_OFFSET: equ 0
26 0002 SYSTEM_TOOLS: equ 2
27 0000 SYSTEM_IDXPG_TRACKS_STK_PP: equ 0
28 0001 SYSTEM_IDXPG_TRACKS_IDX_PP: equ 1
29 0000 SYSTEM_MULTIPAGE_STACK: equ 0
30
31
32 ; ******* Function Class Definitions *******
33 ;
34 ; These definitions are used to describe RAM access patterns. They provide
35 ; documentation and they control prologue and epilogue macros that perform
36 ; the necessary housekeeping functions for large memory model devices like
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -