nico@207: nico@207: nico@207: CanFestival: /home/epimerde/documents/tc11/CanFestival-3/include/hcs12/asm-m68hc12/portsaccess.h Source File nico@207: nico@207: nico@207: nico@207: nico@207:
nico@207:
nico@207:
nico@207:
nico@207:

/home/epimerde/documents/tc11/CanFestival-3/include/hcs12/asm-m68hc12/portsaccess.h

Go to the documentation of this file.
00001 /*
nico@207: 00002 This file is part of CanFestival, a library implementing CanOpen Stack. 
nico@207: 00003 
nico@207: 00004 Copyright (C): Edouard TISSERANT and Francis DUPIN
nico@207: 00005 
nico@207: 00006 See COPYING file for copyrights details.
nico@207: 00007 
nico@207: 00008 This library is free software; you can redistribute it and/or
nico@207: 00009 modify it under the terms of the GNU Lesser General Public
nico@207: 00010 License as published by the Free Software Foundation; either
nico@207: 00011 version 2.1 of the License, or (at your option) any later version.
nico@207: 00012 
nico@207: 00013 This library is distributed in the hope that it will be useful,
nico@207: 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of
nico@207: 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
nico@207: 00016 Lesser General Public License for more details.
nico@207: 00017 
nico@207: 00018 You should have received a copy of the GNU Lesser General Public
nico@207: 00019 License along with this library; if not, write to the Free Software
nico@207: 00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
nico@207: 00021 */
nico@207: 00022 /*
nico@207: 00023 Variables to access to the io_ports
nico@207: 00024 */
nico@207: 00025 
nico@207: 00026 
nico@207: 00027 #ifndef __PORTS_ACCESS__
nico@207: 00028 #define __PORTS_ACCESS__
nico@207: 00029 
nico@207: 00030 /*
nico@207: 00031 By default the address is 0X0000 on HCS12.
nico@207: 00032 But the ports can be remaped. See the file ports.h
nico@207: 00033 */
nico@207: 00034 
nico@207: 00035 
nico@207: 00036 extern volatile unsigned char _io_ports[];
nico@207: 00037 
nico@207: 00038 /* To use for a 8 bits access */
nico@207: 00039 #define IO_PORTS_8(adr) \
nico@207: 00040 _io_ports[adr]
nico@207: 00041 
nico@207: 00042 /* To use for a 16 bits access */
nico@207: 00043 /* Example : IO_PORTS_16(CAN0IDAR1)= 0xABCD;
nico@207: 00044 will put AB at @CAN0IDAR1 and CD at  @CAN0IDAR1 + 1
nico@207: 00045 */
nico@207: 00046 #define IO_PORTS_16(adr) \
nico@207: 00047 *((unsigned volatile short*) (_io_ports + (adr)))
nico@207: 00048 
nico@207: 00049 #endif
nico@207: 

Generated on Mon Jun 4 16:29:06 2007 for CanFestival by  nico@207: nico@207: doxygen 1.5.1
nico@207: nico@207: