#ifndef __global_h_ #define __global_h_ /*256 kb flash rom*/ #define ADDRSEGMENT0 0x00000 #define ADDRSEGMENT1 0x10000 #define ADDRSEGMENT2 0x20000 #define ADDRSEGMENT3 0x30000 /*256 kb battery-buffered ram*/ #define ADDRSEGMENT4 0x40000 #define ADDRSEGMENT5 0x50000 #define ADDRSEGMENT6 0x60000 #define ADDRSEGMENT7 0x70000 /* 2 kb iram */ #define _ADDRIRAMSTART 0xf600 #define _ADDRIRAMEND 0xfdff /*512 bytes used by systemstack*/ #define _ADDRSYSSTACKSTART 0xfa00 #define _ADDRSYSSTACKEND 0xfbff /*and 256 bitaddressable bytes*/ #define ADDRBITSTART 0xfd00 #define ADDRBITEND 0xfdff /*this is useable for bios, and others*/ #define ADDRIRAMSTART _ADDRIRAMSTART #define ADDRIRAMEND 0xf800 /*2 kb xram*/ #define ADDRXRAMSTART 0xe000 #define ADDRXRAMEND 0xe7ff /* these are the segment numbers */ #define ADDR_SEG0 0x00 #define ADDR_SEG1 0x01 #define ADDR_SEG2 0x02 #define ADDR_SEG3 0x03 #define ADDR_SEG4 0x04 #define ADDR_SEG5 0x05 #define ADDR_SEG6 0x06 #define ADDR_SEG7 0x07 /* the page numbers */ #define ADDR_SEG0_P0 0x00 #define ADDR_SEG0_P1 0x01 #define ADDR_SEG0_P2 0x02 #define ADDR_SEG0_P3 0x03 #define ADDR_SEG1_P0 0x04 #define ADDR_SEG1_P1 0x05 #define ADDR_SEG1_P2 0x06 #define ADDR_SEG1_P3 0x07 #define ADDR_SEG2_P0 0x08 #define ADDR_SEG2_P1 0x09 #define ADDR_SEG2_P2 0x0a #define ADDR_SEG2_P3 0x0b #define ADDR_SEG3_P0 0x0c #define ADDR_SEG3_P1 0x0d #define ADDR_SEG3_P2 0x0e #define ADDR_SEG3_P3 0x0f #define ADDR_SEG4_P0 0x10 #define ADDR_SEG4_P1 0x11 #define ADDR_SEG4_P2 0x12 #define ADDR_SEG4_P3 0x13 #define ADDR_SEG5_P0 0x14 #define ADDR_SEG5_P1 0x15 #define ADDR_SEG5_P2 0x16 #define ADDR_SEG5_P3 0x17 #define ADDR_SEG6_P0 0x18 #define ADDR_SEG6_P1 0x19 #define ADDR_SEG6_P2 0x1a #define ADDR_SEG6_P3 0x1b #define ADDR_SEG7_P0 0x1c #define ADDR_SEG7_P1 0x1d #define ADDR_SEG7_P2 0x1e #define ADDR_SEG7_P3 0x1f /* the io-addresses */ /*CS2 0x80000-0xdffff (256kb)*/ #define ADDRLCDSEG 0x08 #define ADDRLCDPAGE 0x20 /*CS3 0xc0000-0xfffff (256kb), free, or second flash rom*/ #define ADDRFREEIOSEG 0x0c #define ADDRFREEIOPAGE 0x30 /*CS4 0x10000-0x100fff (4kb), uart*/ #define ADDRUARTSEG 0x10 #define ADDRUARTPAGE 0x40 #define RTCDEVICEID 0xA2 #define LONGITUDE (*(double volatile sdata *)0x0e000) #define LATITUDE (*(double volatile sdata *)0x0e008) #define LAST (*(double volatile sdata *)0x0e010) #define GAST (*(double volatile sdata *)0x0e018) #define KOOR_RA (*(double volatile sdata *)0x0e020) #define KOOR_DEC (*(double volatile sdata *)0x0e028) #define KOOR_AZ (*(double volatile sdata *)0x0e030) #define KOOR_ALT (*(double volatile sdata *)0x0e038) #define OBJ_ARC10_HO (*(long volatile sdata *)0x0e040) #define OBJ_ARC10_VE (*(long volatile sdata *)0x0e044) #define OBJ_DEG_AZ (*(double volatile sdata *)0x0e048) #define OBJ_DEG_ALT (*(double volatile sdata *)0x0e050) #define OBJ_DEG_RA (*(double volatile sdata *)0x0e058) #define OBJ_DEG_DEC (*(double volatile sdata *)0x0e060) /////////////////////////////////////////////////////////////// //speeds * 1/10000 correctur speed 1 #define CFG_SP1_HO (*(int volatile sdata *)0x0e068) #define CFG_SP1_VE (*(int volatile sdata *)0x0e06a) //speeds * 1/10000 correctur speed 2 #define CFG_SP2_HO (*(int volatile sdata *)0x0e06c) #define CFG_SP2_VE (*(int volatile sdata *)0x0e06e) //speeds * 1/10000 guiding/goto #define CFG_SP3_HO (*(int volatile sdata *)0x0e070) #define CFG_SP3_VE (*(int volatile sdata *)0x0e072) #define CFG_SP_FR (*(int volatile sdata *)0x0e074) /////////////////////////////////////////////////////////////// /*next 0x0e076*/ sbit DP2_8 = DP2^8; sbit DP2_9 = DP2^9; sbit DP2_10 = DP2^10; sbit DP2_11 = DP2^11; sbit DP7_0 = DP7^0; sbit DP7_1 = DP7^1; sbit DP7_2 = DP7^2; sbit DP7_3 = DP7^3; sbit DP7_4 = DP7^4; sbit DP7_5 = DP7^5; sbit DP7_6 = DP7^6; sbit DP7_7 = DP7^7; sbit DP8_0 = DP8^0; sbit DP8_1 = DP8^1; sbit DP8_2 = DP8^2; sbit DP8_3 = DP8^3; sbit DP8_4 = DP8^4; sbit P2_8 = P2^8; sbit P2_9 = P2^9; sbit P2_10 = P2^10; sbit P2_11 = P2^11; sbit MOTORSWITCH = P8^4; #define INPUT 0 #define OUTPUT 1 #define RIGHT 0 #define LEFT 1 #define UP 0 #define DOWN 1 #define OFF 0 #define ON 1 #define LOW 0 #define HIGH 1 #endif //__global_h_