• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

xpal_board.h

Go to the documentation of this file.
00001 /* Board specific definitions for the HLog V1.1.0 platform - pin definitions */
00002 /* Copyright (C) 2009, 2010 ThomasKlosa
00003  *
00004  *   This program is free software; you can redistribute it and/or modify
00005  *   it under the terms of the GNU General Public License as published by
00006  *   the Free Software Foundation; either version 2 of the License, or
00007  *   (at your option) version 3.
00008  *
00009  *   This program is distributed in the hope that it will be useful,
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *   GNU General Public License for more details.
00013  *
00014  *   You should have received a copy of the GNU General Public License along
00015  *   with this program; if not, see <http://www.gnu.org/licenses/>.
00016  */
00017 
00030 #ifndef HLOG_BOARD_H
00031 #define HLOG_BOARD_H
00032 
00033 #include <avr/io.h>
00034 
00035 
00036 
00037 /*  ***********************************************************************
00038         microSD Card Interface
00039 */
00040 
00041 #define HL_SD_SS                PB0             //!< SD card SPI Select Port bit 
00042 #define HL_SD_SS_PORT   PORTB   //!< SD card SPI Select Port 
00043 #define HL_SD_SS_DDR    DDRB    //!< SD card SPI Select Data Direction 
00044 
00045 #define HL_SD_SCK               PB1             //!< SD card SPI Clock Port bit 
00046 #define HL_SD_SCK_PORT  PORTB   //!< SD card SPI Clock Port 
00047 #define HL_SD_SCK_DDR   DDRB    //!< SD card SPI Clock Data Direction 
00048  
00049 #define HL_SD_MOSI              PB2             //!< SD card SPI MOSI Port bit 
00050 #define HL_SD_MOSI_PORT PORTB   //!< SD card SPI MOSI Port 
00051 #define HL_SD_MOSI_DDR  DDRB    //!< SD card SPI MOSI Data Direction 
00052 
00053 #define HL_SD_MISO              PB3             //!< SD card SPI MISO Port bit 
00054 #define HL_SD_MISO_PIN  PINB    //!< SD card SPI MISO Port 
00055 #define HL_SD_MISO_DDR  DDRB    //!< SD card SPI MISO Data Direction 
00056 
00057 
00058 
00059 /*  ***********************************************************************
00060         external RS232 Interface
00061 */
00062 #define HL_EX232_UDR            UDR3    //!< External RJ11 serial port Data Register
00063 #define HL_EX232_UCSRA          UCSR3A  //!< External RJ11 serial port Control Status A
00064 #define HL_EX232_UCSRB          UCSR3B  //!< External RJ11 serial port Control Status B
00065 #define HL_EX232_UCSRC          UCSR3C  //!< External RJ11 serial port Control Status C
00066 #define HL_EX232_UBR            UBR3    //!< External RJ11 serial port Baud Rate Reg.
00067 
00068 #define HL_EX232_CTL_PORT       PORTL   //!< External RJ11 serial port Line Driver Control Port
00069 #define HL_EX232_CTL_DDR    DDRL        //!< External RJ11 serial port Line Driver Control Data Dir.
00070 #define HL_EX232_CTL_PIN    PINL        //!< External RJ11 serial port Line Driver Control Input
00071 
00072 #define HL_EX232_INVAL          (PL5)   //!< External RJ11 serial port Line Driver Invalid Signal bit
00073 #define HL_EX232_FRCON          (PL6)   //!< External RJ11 serial port Line Driver ForceOn Signal bit
00074 #define HL_EX232_EN                     (PL7)   //!< External RJ11 serial port Line Driver Enable bit
00075 
00076 /*  ***********************************************************************
00077         Module Interface
00078 */
00079 #define HL_MOD_UDR                      UDR2    //!< GPS Module USART Data Register
00080 #define HL_MOD_UCSRA            UCSR2A  //!< GPS Module USART Control Status A
00081 #define HL_MOD_UCSRB            UCSR2B  //!< GPS Module USART Control Status B
00082 #define HL_MOD_UCSRC            UCSR2C  //!< GPS Module USART Control Status C
00083 #define HL_MOD_UBR                      UBR2    //!< GPS Module USART Baud Rate Reg.
00084 
00085 
00086 /*  ***********************************************************************
00087         Power Supply Control    
00088 */
00089 #define HL_PWR_VLCD                     0               //!< LCD HV regulator enable bit
00090 #define HL_PWR_VLCD_PORT        PORTL   //!< LCD HV regulator enable Port
00091 #define HL_PWR_VLCD_DDR         DDRL    //!< LCD HV regulator enable data direction
00092 
00093 #define HL_PWR_VCC5                     1               //!< 5V regulator enable bit
00094 #define HL_PWR_VCC5_PORT        PORTL   //!< 5V regulator enable Port
00095 #define HL_PWR_VCC5_DDR         DDRL    //!< 5V regulator enable data dir.
00096 
00097 #define HL_PWR_VCC33            2               //!< 3.3V regulator enable bit
00098 #define HL_PWR_VCC33_PORT       PORTL   //!< 3.3V regulator enable port
00099 #define HL_PWR_VCC33_DDR        DDRL    //!< 3.3V regulator enable data dir.
00100 
00101 // ADC Settings for Vbat measurement at ADC0
00102 #define HL_PWR_ADMUX0           ( (_BV(REFS0)) | (_BV(REFS1)) ) //!< ADC0, Vref=2.56V
00103 #define HL_PWR_ADCSRB           0x00
00104 
00105 
00106 /*  ***********************************************************************
00107         Key Matrix Definitions, hardware lines only
00108 */
00109 #define HL_KEY_COL0                     0               //!< Key Matrix Column0 bit
00110 #define HL_KEY_COL1                     1               //!< Key Matrix Column1 bit
00111 #define HL_KEY_COL2                     2               //!< Key Matrix Column2 bit
00112 #define HL_KEY_COL3                     3               //!< Key Matrix Column3 bit
00113 #define HL_KEY_COL_PORT         PORTD   //!< Key Matrix Column Port
00114 #define HL_KEY_COL_PIN          PIND    //!< Key Matrix Column Input
00115 #define HL_KEY_COL_DDR          DDRD    //!< Key Matrix Column Data Dir.
00116 #define HL_KEY_COL_MASK         0x0F    //!< Key Matrix all Columns Bitmask
00117 
00118 #define HL_KEY_ROW_A_ID         4               //!< Key Matrix Row Section A ID
00119 #define HL_KEY_ROW_PORT_A       PORTD   //!< Key Matrix Row Section A Port
00120 #define HL_KEY_ROW_PIN_A        PIND    //!< Key Matrix Row Section A Input
00121 #define HL_KEY_ROW_DDR_A        DDRD    //!< Key Matrix Row Section A Data Dir.
00122 #define HL_KEY_ROW0                     4               //!< Key Matrix Row 0 bit
00123 #define HL_KEY_ROW1                     5               //!< Key Matrix Row 1 bit
00124 #define HL_KEY_ROW2                     6               //!< Key Matrix Row 2 bit
00125 #define HL_KEY_ROW3                     7               //!< Key Matrix Row 3 bit
00126 #define HL_KEY_MASK_ROW_A   0xF0        //!< Key Matrix Row1..3 Bitmask
00127 
00128 #define HL_KEY_ROW_B_ID         5               //!< Key Matrix Row Section B ID
00129 #define HL_KEY_ROW_PORT_B       PORTE   //!< Key Matrix Row Section B Port
00130 #define HL_KEY_ROW_PIN_B        PINE    //!< Key Matrix Row Section B Input
00131 #define HL_KEY_ROW_DDR_B        DDRE    //!< Key Matrix Row Section B Data Dir.
00132 #define HL_KEY_ROW4                     0               //!< Key Matrix Row 4 bit
00133 #define HL_KEY_ROW5                     1               //!< Key Matrix Row 5 bit
00134 #define HL_KEY_ROW6                     2               //!< Key Matrix Row 6 bit
00135 #define HL_KEY_ROW7                     3               //!< Key Matrix Row 7 bit
00136 #define HL_KEY_ROW8                     4               //!< Key Matrix Row 8 bit
00137 #define HL_KEY_ROW9                     5               //!< Key Matrix Row 9 bit
00138 #define HL_KEY_ROW10            6               //!< Key Matrix Row 10 bit
00139 #define HL_KEY_ROW11            7               //!< Key Matrix Row 11 bit
00140 #define HL_KEY_MASK_ROW_B   0xFF        //!< Key Matrix Row4..11 Bitmask
00141 
00142 #define HL_KEY_ROW_C_ID         6               //!< Key Matrix Row Section C ID
00143 #define HL_KEY_ROW_PORT_C       PORTH   //!< Key Matrix Row Section C Port
00144 #define HL_KEY_ROW_PIN_C        PINH    //!< Key Matrix Row Section C Input
00145 #define HL_KEY_ROW_DDR_C        DDRH    //!< Key Matrix Row Section C Data Dir.
00146 #define HL_KEY_ROW12            2               //!< Key Matrix Row 12 bit
00147 #define HL_KEY_ROW13            3               //!< Key Matrix Row 13 bit      
00148 #define HL_KEY_ROW14            4               //!< Key Matrix Row 14 bit
00149 #define HL_KEY_ROW15            5               //!< Key Matrix Row 15 bit
00150 #define HL_KEY_ROW16            6               //!< Key Matrix Row 16 bit
00151 #define HL_KEY_ROW17            7               //!< Key Matrix Row 17 bit
00152 #define HL_KEY_MASK_ROW_C   0xFC        //!< Key Matrix Row12..17 Bitmask
00153 
00154 /*  ***********************************************************************
00155         USB Interface
00156         RAM interface definitions to be done within the RAM section
00157 */
00158 #ifndef HL_USB_BASE_ADR
00159 #define HL_USB_BASE_ADR         0x4000  //!< Address range start in External Memory
00160 #endif
00161 #define HL_USB_ADR_LENGTH       0x3FFF  //!< Address range length in External Memory    
00162 
00163 #define HL_USB_TXE                      4               //!< bit to access FT245 TXE (Data can be writen to USB)
00164 #define HL_USB_TXE_PIN          PINB    //!< Input to access FT245 TXE
00165 #define HL_USB_TXE_DDR          DDRB    //!< Data Dir. to access FT245 TXE
00166 
00167 #define HL_USB_RXF                      5               //!< bit to access FT245 RXF (Data available from USB)
00168 #define HL_USB_RXF_PIN          PINB    //!< Input to access FT245 RXF
00169 #define HL_USB_RXF_DDR          DDRB    //!< Data Dir. to access FT245 RXF
00170 
00171 #define HL_USB_PWREN            6               //!< bit to access FT245 PwrEnable (USB is connected)
00172 #define HL_USB_PWREN_PIN        PINB    //!< Input to access FT245 PwrEnable
00173 #define HL_USB_PWREN_DDR        DDRB    //!< Data Dir. to access FT245 PwrEnable
00174 
00175 #define HL_USB_RESET            7               //!< bit to control FT245 RESET
00176 #define HL_USB_RESET_PORT       PORTB   //!< Port to control FT245 RESET
00177 #define HL_USB_RESET_DDR        DDRB    //!< Data Dir. to control FT245 RESET
00178 
00179 
00180 /*  ***********************************************************************
00181         LCD Interface
00182 */
00183 #define HL_LCD_DATA_PORT        PORTK   //!< LCD Data Port [out]
00184 #define HL_LCD_DATA_PIN         PINK    //!< LCD Data Input
00185 #define HL_LCD_DATA_DDR         DDRK    //!< LCD Data Direction
00186 
00187 #define HL_LCD_RESET            2               //!< bit to control LCD RESET
00188 #define HL_LCD_RESET_PORT       PORTJ   //!< Port to control LCD RESET
00189 #define HL_LCD_RESET_DDR        DDRJ    //!< Data Dir. to control LCD RESET
00190 
00191 #define HL_LCD_CS                       3               //!< bit to control LCD Select
00192 #define HL_LCD_CS_PORT          PORTJ   //!< Port to control LCD Select
00193 #define HL_LCD_CS_PIN           PINJ    //!< Input to control LCD Select (write = toggle)
00194 #define HL_LCD_CS_DDR           DDRJ    //!< Data Dir. to control LCD Select
00195 
00196 #define HL_LCD_D_R                      4               //!< bit to control LCD Data/Register access
00197 #define HL_LCD_D_R_PORT         PORTJ   //!< Port to control LCD Data/Register access
00198 #define HL_LCD_D_R_DDR          DDRJ    //!< Data Dir. to control LCD Data/Register access
00199 
00200 #define HL_LCD_WR                       5               //!< bit to control LCD Write
00201 #define HL_LCD_WR_PORT          PORTJ   //!< Port to control LCD Write
00202 #define HL_LCD_WR_PIN           PINJ    //!< Input to control LCD Write (write = toggle)
00203 #define HL_LCD_WR_DDR           DDRJ    //!< Data Dir. to control LCD Write
00204 
00205 #define HL_LCD_RD                       6               //!< bit to control LCD Read
00206 #define HL_LCD_RD_PORT          PORTJ   //!< Port to control LCD Read
00207 #define HL_LCD_RD_PIN           PINJ    //!< Input to control LCD Read (write = toggle)
00208 #define HL_LCD_RD_DDR           DDRJ    //!< Data Dir. to control LCD Read
00209 
00210 /*  ***********************************************************************
00211         External RAM
00212 */
00213 #ifndef HL_EXRAM_START
00214 #define HL_EXRAM_START  0x8000          //!< External RAM Start Address
00215 #endif
00216 #ifndef HL_EXRAM_END
00217 #define HL_EXRAM_END    0xFFFF          //!< External RAM End Address
00218 #endif
00219 #define HL_ADRH_PORT    PORTC           //!< External RAM Address Port
00220 #define HL_ADRH_DDR             DDRC            //!< External RAM Address Data Direction
00221 #define HL_XMCRA        (_BV(SRE)|_BV(SRL2))    //!< RAM interface configuration with no wait states
00222                         // upper/lower-range split at 0x8000
00223 #define HL_XMCRB        _BV(XMBK)       //!< RAM interface to support full addr. range (incl. USB), bus keeper on
00224 
00225 
00226 #endif
00227 

Generated by  doxygen 1.7.1