init_port.s

来自「dsPIC单片机的应用例程」· S 代码 · 共 67 行

S
67
字号
;START_HEADER
;
; dsPIC30F6014 Demo Source File
; (c) Copyright 2005 Microchip Technology, All rights reserved
;
; --------------------------------------------------------------------------
; File Revision History:
; --------------------------------------------------------------------------
;
; $Log: init_port.s,v $
; Revision 1.1  2006/07/07 15:32:03  c13075
; initial rev
;
; Revision 1.3  2005/04/04 23:44:26  VasukiH
; Updates to comments in file header
;
; Revision 1.2  2005/04/04 23:15:59  VasukiH
; Updates for MPLAB C30 v1.30 compatiblity
;
; Revision 1.1.1.1  2003/08/23 00:38:32  VasukiH
; First import of demo source into CVS Repository
;
;
;
; --------------------------------------------------------------------------
;
; Software and Development Tools Info:
; --------------------------------------------------------------------------
; Tool                          Version
; --------------------------------------------------------------------------
; MPLAB IDE                     7.0
; MPLAB C30 Toolsuite           1.30
; dsPICDEM(TM) Processor Board  1.10
; --------------------------------------------------------------------------
;
; File Notes:
; 1. This routine configures all PortD pins for outputs and turns off
;    all four LEDs connected to RD1-RD4 on power up
;       RD0 = LED1
;       RD1 = LED2
;       RD2 = LED3
;       RD3 = LED4
;END_HEADER


.include "p30fxxxx.inc"

.global _init_port

.section .text                          ;Code section in Program FLASH memory

_init_port:

        clr     TRISD                   ;Set all Port D pins as output pins
        setm    LATD                    ;Set all Port D latches to 1
        bclr    LATD, #LATD4            ;Clear selected latches 4-7 to 0
        bclr    LATD, #LATD5
        bclr    LATD, #LATD6
        bclr    LATD, #LATD7


        return                          ;Return to calling routine

.end                                    ;EOF


⌨️ 快捷键说明

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