Size: 18489
Comment:
|
Size: 22107
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 747: | Line 747: |
---------------------------- #include <ipOS.h> #include <ipUART.h> /* * IP2022 configuration block */ CONFIG_BLOCK ( FUSE0(FUSE0_XTAL | FUSE0_PIN_DIV1 | FUSE0_POUT_DIV2 | FUSE0_WUDP_128us | FUSE0_WUDX_1ms), FUSE1(0), OSC1_FREQ, "UBICOM", "starter", CONFIG_VER(0, 0, 0, 0), CONFIG_DATE(0, 0, 0), CONFIG_DATE(0, 0, 0) ); #if defined(DEBUG) #define RUNTIME_DEBUG 1 #else #define RUNTIME_DEBUG 0 #endif THIS_FILE("main"); #define K_1 0x11 #define K_2 0x12 #define K_3 0x14 #define K_A 0x18 #define K_4 0x21 #define K_5 0x22 #define K_6 0x24 #define K_B 0x28 #define K_7 0x41 #define K_8 0x42 #define K_9 0x44 #define K_C 0x48 #define K_STAR 0x81 #define K_0 0x82 #define K_HASH 0x84 #define K_D 0x88 #define VID_X 40 #define VID_Y 30 u8_t vidmem[VID_X*VID_Y]; #define HSYNC 0x80 #define VSYNC 0x40 #define TCTRL 0x01b void zpoz(u16_t t) { u16_t i, j; for (i = 0; i < t; i++) for (j = 0; j < t; j++) {} } void wait(u32_t t) { u32_t i = 0; for (i = 0; i < t; i++) {} } void init(void) { debug_init(); heap_add((addr_t)(&_bss_end), (addr_t)(RAMEND - (DEFAULT_STACK_SIZE - 1)) - (addr_t)(&_bss_end)); *(u8_t *)RBDIR = 0x00; *(u8_t *)RBOUT = 0x00; *(u8_t *)RCOUT = 0xff; memset(vidmem, 0, VID_X*VID_Y); *(u8_t *)T1CFG1H = 0x00; *(u8_t *)T1CFG2H = 0x04; *(u8_t *)T1CFG1L = 0x01; *(u8_t *)T1CFG2L = 0x00; *(u8_t *)T2CFG1H = 0x00; *(u8_t *)T2CFG2H = 0x09; *(u8_t *)T2CFG1L = 0x01; *(u8_t *)T2CFG2L = 0x00; *(u8_t *)T1CMP1L = 0xff; *(u8_t *)T1CMP1H = 0xff; *(u8_t *)T1CAP1L = 0xff; *(u8_t *)T1CAP1H = 0xff; *(u8_t *)TCTRL = 0x01; } u8_t getkey() { u8_t k = 0; *(u8_t *)RCDIR = 0x0f; zpoz(10); k |= *(u8_t *)RCIN & 0x0f; *(u8_t *)RCDIR = 0xf0; zpoz(10); k |= *(u8_t *)RCIN & 0xf0; return k; } u8_t pressed(u8_t k) { if ((getkey() & k) == k) return 1; return 0; } void drawline(u8_t y) { u8_t x = 0; for (x = 0; x < VID_X; x++) { *(u8_t *)RBOUT = vidmem[y*VID_Y+x]; } } void draw() { u8_t y = 0; for (y = 0; y < VID_Y; y++) drawline(y); } void start(void) { init(); u16_t i = 0; u8_t t = 0; u8_t col = 3; *(u8_t *)RBOUT = VSYNC | HSYNC; *(u8_t *)RBOUT += col; for (;;) { *(u8_t *)RBOUT &= ~VSYNC; //*(u8_t *)TCTRL = 0x01; while (*(u8_t *)T1CNTL < 40) {}; wait(136); *(u8_t *)RBOUT |= VSYNC; //*(u8_t *)TCTRL = 0x02; while (*(u8_t *)T2CNTL < 240) {}; wait(2350); //*(u8_t *)TCTRL = 0x01; for (i = 0; i < 480; i++) { // if (pressed(K_1)) col |= 1; else col &= ~1; // if (pressed(K_2)) col |= 2; else col &= ~2; // if (pressed(K_3)) col |= 4; else col &= ~4; /* t = *(u8_t *)T1CNTL; if (t < 27) *(u8_t *)RBOUT = 0x80; else if (t < 43) *(u8_t *)RBOUT = 0xc0; else if (t < 226) *(u8_t *)RBOUT = 0xc0 + col; else if (t < 230) *(u8_t *)RBOUT = 0xc0; else { *(u8_t *)TCTRL = 0x01; i++; }*/ *(u8_t *)RBOUT &= ~HSYNC; //*(u8_t *)TCTRL = 0x01; while (*(u8_t *)T1CNTL < 27) {}; // 25 je lepsi, ale nedela vlajku wait(7); *(u8_t *)RBOUT |= HSYNC; //*(u8_t *)TCTRL = 0x01; while (*(u8_t *)T1CNTL < 12) {}; wait(2); //*(u8_t *)RBOUT += col; //*(u8_t *)TCTRL = 0x01; while (*(u8_t *)T1CNTL < 186) {}; wait(56); //*(u8_t *)RBOUT -= col; //*(u8_t *)TCTRL = 0x01; while (*(u8_t *)T1CNTL < 2) {}; wait(1); } //*(u8_t *)TCTRL = 0x02; while (*(u8_t *)T2CNTL < 82) {}; wait(800); } } |
Pujcit:
CRT: [1] Lojík, V.: Číslicová technika v telekomunikacích II. Skripta.Praha: ČVUT, 1995. n/a [2] Chod, J.: Číslicová a impulsová technika II. Skripta.Praha: ČVUT, 1989. S 2012 / kat
M5B: [1] J. Hamhalter, J. Tišer: Funkce komplexní proměnné. ČVUT Praha, 2001. S 2645
TKV: [1] Schlitter, M. Telekomunikační vedení. Skripta. Praha: ČVUT, 1995. kat / S 1816 / S 2054
TS: [1] Škop, M. at all. Telekomunikační přenosová technika. Skripta. Praha: ČVUT, 1991. S 2273 / kat [2] Lojík, V. Spojovací systémy II. Skripta. Praha: ČVUT, 1991. S 2034 / kat [3] Lojík, V. Digitální spojovací systémy. Skripta. Praha: ČVUT, 1998. S 2303 / kat
ZDK: [1] Prchal, J. Systémy přenosu dat. Skripta. Praha: ČVUT-FEL, 1989. S 2064 / kat [2] Vondrák, M., Svoboda, J. Přenos dat - cvičení. Skripta. Praha: ČVUT-FEL, 1990. S 2075 / kat
P2: [1] Novotný, K.: Teorie elektromagnetického pole II. Skripta ČVUT, Praha 1997 S 2649 / S 2473 [2] Coufalová, B., Novotný, K.: Teorie elektromagnetického pole II - příklady. Skripta ČVUT, Praha 1996, 1998 S 1852 [3] Vokurka, J.: Teorie elektromagnetického pole II. Skripta ČVUT, Praha 1985 S 1836
http://www.onlamp.com/pub/a/onlamp/2004/11/04/which_wiki.html
http://serversideguy.blogspot.com/2004/12/google-suggest-dissected.html
I kdyz mam tucnaka rad, tohle se mi libi...
http://homepage.tinet.ie/~cullenm/2dart/regi.jpg
#include <ipOS.h> #include <ipUART.h>
CONFIG_BLOCK (
- FUSE0(FUSE0_XTAL | FUSE0_PIN_DIV1 | FUSE0_POUT_DIV2 | FUSE0_WUDP_128us | FUSE0_WUDX_1ms), FUSE1(0), OSC1_FREQ, "UBICOM", "starter", CONFIG_VER(0, 0, 0, 0), CONFIG_DATE(0, 0, 0), CONFIG_DATE(0, 0, 0) );
#if defined(DEBUG) #define RUNTIME_DEBUG 1 #else #define RUNTIME_DEBUG 0 #endif
THIS_FILE("main");
#define K_1 0x11 #define K_2 0x12 #define K_3 0x14 #define K_A 0x18 #define K_4 0x21 #define K_5 0x22 #define K_6 0x24 #define K_B 0x28 #define K_7 0x41 #define K_8 0x42 #define K_9 0x44 #define K_C 0x48 #define K_STAR 0x81 #define K_0 0x82 #define K_HASH 0x84 #define K_D 0x88
#define VID_X 40 #define VID_Y 30 u8_t vidmem[VID_X*VID_Y];
void zpoz(u16_t t) {
- u16_t i, j;
for (i = 0; i < t; i++)
for (j = 0; j < t; j++) {}
}
void init(void) {
- debug_init();
heap_add((addr_t)(&_bss_end), (addr_t)(RAMEND - (DEFAULT_STACK_SIZE - 1)) - (addr_t)(&_bss_end)); timer_init();
- (u8_t *)RBDIR = 0x00;
- (u8_t *)RCOUT = 0xff; memset(vidmem, 0, VID_X*VID_Y);
}
u8_t getkey() {
- u8_t k = 0;
- (u8_t *)RCDIR = 0x0f; zpoz(10);
k |= *(u8_t *)RCIN & 0x0f;
- (u8_t *)RCDIR = 0xf0; zpoz(10);
k |= *(u8_t *)RCIN & 0xf0; return k;
}
u8_t pressed(u8_t k) {
if ((getkey() & k) == k) return 1; return 0;
}
void drawline(u8_t y) {
- u8_t x = 0;
for (x = 0; x < VID_X; x++) {
- (u8_t *)RBOUT = vidmem[y*VID_Y+x];
}
void draw() {
- u8_t y = 0;
for (y = 0; y < VID_Y; y++)
- drawline(y);
}
void start(void) {
- init(); u8_t i = 0x01; for (;;) {
if (pressed(K_1) && !(i & 0x80)) i *= 2; else if (pressed(K_2) && !(i & 0x01)) i /= 2;
- (u8_t *)RBOUT = i; zpoz(100);
}
#include <ipOS.h> #include <ipUART.h>
CONFIG_BLOCK (
- FUSE0(FUSE0_XTAL | FUSE0_PIN_DIV1 | FUSE0_POUT_DIV2 | FUSE0_WUDP_128us | FUSE0_WUDX_1ms), FUSE1(0), OSC1_FREQ, "UBICOM", "starter", CONFIG_VER(0, 0, 0, 0), CONFIG_DATE(0, 0, 0), CONFIG_DATE(0, 0, 0) );
#if defined(DEBUG) #define RUNTIME_DEBUG 1 #else #define RUNTIME_DEBUG 0 #endif
THIS_FILE("main");
#define K_1 0x11 #define K_2 0x12 #define K_3 0x14 #define K_A 0x18 #define K_4 0x21 #define K_5 0x22 #define K_6 0x24 #define K_B 0x28 #define K_7 0x41 #define K_8 0x42 #define K_9 0x44 #define K_C 0x48 #define K_STAR 0x81 #define K_0 0x82 #define K_HASH 0x84 #define K_D 0x88
#define VID_X 40 #define VID_Y 30 u8_t vidmem[VID_X*VID_Y]; struct oneshot led_timer;
void zpoz(u16_t t) {
- u16_t i, j;
for (i = 0; i < t; i++)
for (j = 0; j < t; j++) {}
}
void init(void) {
- debug_init();
heap_add((addr_t)(&_bss_end), (addr_t)(RAMEND - (DEFAULT_STACK_SIZE - 1)) - (addr_t)(&_bss_end)); timer_init();
CONFIG_BLOCK (
- FUSE0(FUSE0_XTAL | FUSE0_PIN_DIV1 | FUSE0_POUT_DIV2 | FUSE0_WUDP_128us | FUSE0_WUDX_1ms), FUSE1(0), OSC1_FREQ, "UBICOM", "starter", CONFIG_VER(0, 0, 0, 0), CONFIG_DATE(0, 0, 0), CONFIG_DATE(0, 0, 0) );
#if defined(DEBUG) #define RUNTIME_DEBUG 1 #else #define RUNTIME_DEBUG 0 #endif
THIS_FILE("main");
#define K_1 0x11 #define K_2 0x12 #define K_3 0x14 #define K_A 0x18 #define K_4 0x21 #define K_5 0x22 #define K_6 0x24 #define K_B 0x28 #define K_7 0x41 #define K_8 0x42 #define K_9 0x44 #define K_C 0x48 #define K_STAR 0x81 #define K_0 0x82 #define K_HASH 0x84 #define K_D 0x88
#define VID_X 40 #define VID_Y 30 u8_t vidmem[VID_X*VID_Y];
#define TCTRL 0x01b
void zpoz(u16_t t) {
- u16_t i, j;
for (i = 0; i < t; i++)
for (j = 0; j < t; j++) {}
}
void wait(u32_t t) {
- u32_t i = 0;
for (i = 0; i < t; i++) {}
}
void init(void) {
- debug_init();
heap_add((addr_t)(&_bss_end), (addr_t)(RAMEND - (DEFAULT_STACK_SIZE - 1)) - (addr_t)(&_bss_end));
- (u8_t *)RBDIR = 0x00;
- (u8_t *)RBOUT = 0x00;
- (u8_t *)RCOUT = 0xff; memset(vidmem, 0, VID_X*VID_Y);
- (u8_t *)T1CFG1H = 0x00;
- (u8_t *)T1CFG2H = 0x04;
- (u8_t *)T1CFG1L = 0x01;
- (u8_t *)T1CFG2L = 0x00;
- (u8_t *)T2CFG1H = 0x00;
- (u8_t *)T2CFG2H = 0x09;
- (u8_t *)T2CFG1L = 0x01;
- (u8_t *)T2CFG2L = 0x00;
- (u8_t *)T1CMP1L = 0xff;
- (u8_t *)T1CMP1H = 0xff;
- (u8_t *)T1CAP1L = 0xff;
- (u8_t *)T1CAP1H = 0xff;
- (u8_t *)TCTRL = 0x01;
}
u8_t getkey() {
- u8_t k = 0;
- (u8_t *)RCDIR = 0x0f; zpoz(10);
k |= *(u8_t *)RCIN & 0x0f;
- (u8_t *)RCDIR = 0xf0; zpoz(10);
k |= *(u8_t *)RCIN & 0xf0; return k;
}
u8_t pressed(u8_t k) {
if ((getkey() & k) == k) return 1; return 0;
}
void drawline(u8_t y) {
- u8_t x = 0;
for (x = 0; x < VID_X; x++) {
- (u8_t *)RBOUT = vidmem[y*VID_Y+x];
}
void draw() {
- u8_t y = 0;
for (y = 0; y < VID_Y; y++)
- drawline(y);
}
void start(void) {
- init(); u16_t i = 0; u8_t t = 0; u8_t col = 7; for (;;) {
- (u8_t *)RBOUT = 0x00;
//*(u8_t *)TCTRL = 0x01; while (*(u8_t *)T1CNTL < 40) {}; wait(12);
- (u8_t *)RBOUT = 0x80;
//*(u8_t *)TCTRL = 0x02; while (*(u8_t *)T2CNTL < 240) {}; wait(100); //*(u8_t *)TCTRL = 0x01;
for (i = 0; i < 480;) {
- (u8_t *)RBOUT = 0x00;
// if (pressed(K_1)) col |= 1; else col &= ~1; // if (pressed(K_2)) col |= 2; else col &= ~2; // if (pressed(K_3)) col |= 4; else col &= ~4;
CONFIG_BLOCK (
- FUSE0(FUSE0_XTAL | FUSE0_PIN_DIV1 | FUSE0_POUT_DIV2 | FUSE0_WUDP_128us | FUSE0_WUDX_1ms), FUSE1(0), OSC1_FREQ, "UBICOM", "starter", CONFIG_VER(0, 0, 0, 0), CONFIG_DATE(0, 0, 0), CONFIG_DATE(0, 0, 0) );
#if defined(DEBUG) #define RUNTIME_DEBUG 1 #else #define RUNTIME_DEBUG 0 #endif
THIS_FILE("main");
#define K_1 0x11 #define K_2 0x12 #define K_3 0x14 #define K_A 0x18 #define K_4 0x21 #define K_5 0x22 #define K_6 0x24 #define K_B 0x28 #define K_7 0x41 #define K_8 0x42 #define K_9 0x44 #define K_C 0x48 #define K_STAR 0x81 #define K_0 0x82 #define K_HASH 0x84 #define K_D 0x88
#define VID_X 40 #define VID_Y 30 u8_t vidmem[VID_X*VID_Y];
#define HSYNC 0x80 #define VSYNC 0x40
#define TCTRL 0x01b
void zpoz(u16_t t) {
- u16_t i, j;
for (i = 0; i < t; i++)
for (j = 0; j < t; j++) {}
}
void wait(u32_t t) {
- u32_t i = 0;
for (i = 0; i < t; i++) {}
}
void init(void) {
- debug_init();
heap_add((addr_t)(&_bss_end), (addr_t)(RAMEND - (DEFAULT_STACK_SIZE - 1)) - (addr_t)(&_bss_end));
- (u8_t *)RBDIR = 0x00;
- (u8_t *)RBOUT = 0x00;
- (u8_t *)RCOUT = 0xff; memset(vidmem, 0, VID_X*VID_Y);
- (u8_t *)T1CFG1H = 0x00;
- (u8_t *)T1CFG2H = 0x04;
- (u8_t *)T1CFG1L = 0x01;
- (u8_t *)T1CFG2L = 0x00;
- (u8_t *)T2CFG1H = 0x00;
- (u8_t *)T2CFG2H = 0x09;
- (u8_t *)T2CFG1L = 0x01;
- (u8_t *)T2CFG2L = 0x00;
- (u8_t *)T1CMP1L = 0xff;
- (u8_t *)T1CMP1H = 0xff;
- (u8_t *)T1CAP1L = 0xff;
- (u8_t *)T1CAP1H = 0xff;
- (u8_t *)TCTRL = 0x01;
}
u8_t getkey() {
- u8_t k = 0;
- (u8_t *)RCDIR = 0x0f; zpoz(10);
k |= *(u8_t *)RCIN & 0x0f;
- (u8_t *)RCDIR = 0xf0; zpoz(10);
k |= *(u8_t *)RCIN & 0xf0; return k;
}
u8_t pressed(u8_t k) {
if ((getkey() & k) == k) return 1; return 0;
}
void drawline(u8_t y) {
- u8_t x = 0;
for (x = 0; x < VID_X; x++) {
- (u8_t *)RBOUT = vidmem[y*VID_Y+x];
}
void draw() {
- u8_t y = 0;
for (y = 0; y < VID_Y; y++)
- drawline(y);
}
void start(void) {
- init(); u16_t i = 0; u8_t t = 0; u8_t col = 3;
- (u8_t *)RBOUT = VSYNC | HSYNC;
- (u8_t *)RBOUT += col; for (;;) {
(u8_t *)RBOUT &= ~VSYNC; //*(u8_t *)TCTRL = 0x01; while (*(u8_t *)T1CNTL < 40) {}; wait(136);
- (u8_t *)RBOUT |= VSYNC;
//*(u8_t *)TCTRL = 0x02; while (*(u8_t *)T2CNTL < 240) {}; wait(2350); //*(u8_t *)TCTRL = 0x01;
for (i = 0; i < 480; i++) {
// if (pressed(K_1)) col |= 1; else col &= ~1; // if (pressed(K_2)) col |= 2; else col &= ~2; // if (pressed(K_3)) col |= 4; else col &= ~4;