Line No. | Rev | Author | Line |
---|---|---|---|
1 | 6 | kaklik | /*! \file avrcore.h \brief AVR-Core Board Driver Functions. */ |
2 | //***************************************************************************** |
||
3 | // |
||
4 | // File Name : 'avrcore.h' |
||
5 | // Title : AVR-Core Board Driver Functions |
||
6 | // Author : Pascal Stang - Copyright (C) 2004 |
||
7 | // Created : 2004.10.01 |
||
8 | // Revised : 2005.10.24 |
||
9 | // Version : 0.1 |
||
10 | // Target MCU : Atmel AVR series |
||
11 | // Editor Tabs : 4 |
||
12 | // |
||
13 | // This code is distributed under the GNU Public License |
||
14 | // which can be found at http://www.gnu.org/licenses/gpl.txt |
||
15 | // |
||
16 | //***************************************************************************** |
||
17 | |||
18 | #ifndef AVRCORE_H |
||
19 | #define AVRCORE_H |
||
20 | |||
21 | // defines and typedefs |
||
22 | #define AVRCORELATCH (*((unsigned char*)0x4000)) |
||
23 | #define AVRCORELATCH_ADDRMASK 0x0F |
||
24 | #define AVRCORELATCH_LEDMASK 0xF0 |
||
25 | |||
26 | // SAT-MB serial port control |
||
27 | // CTS is an output signal |
||
28 | #define AVRCORE_SER_CTS_PORT PORTB |
||
29 | #define AVRCORE_SER_CTS_DDR DDRB |
||
30 | #define AVRCORE_SER_CTS_PORTIN PINB |
||
31 | #define AVRCORE_SER_CTS_PIN PB5 |
||
32 | // RTS is an input signal |
||
33 | #define AVRCORE_SER_RTS_PORT PORTB |
||
34 | #define AVRCORE_SER_RTS_DDR DDRB |
||
35 | #define AVRCORE_SER_RTS_PORTIN PINB |
||
36 | #define AVRCORE_SER_RTS_PIN PB6 |
||
37 | |||
38 | // functions |
||
39 | |||
40 | //! Initialize AVRCore hardware |
||
41 | void avrcoreInit(void); |
||
42 | |||
43 | //! Set the current external RAM page |
||
44 | // The AVRCore on-board external RAM is typically 512KBytes. |
||
45 | // The RAM is memory-mapped into the 32KByte address space from |
||
46 | // 0x8000-0xFFFF, and must therefore be accessed in pages (32KB chunks). |
||
47 | // Use this function to select which of the 16 (0-15) 32KByte pages |
||
48 | // you wish to access. |
||
49 | void avrcoreSetRamPage(u08 page); |
||
50 | |||
51 | //! Set the state of the four LEDs on AVRCore |
||
52 | // leds bit0 => LED1 (0=off, 1=on) |
||
53 | // leds bit1 => LED2 (0=off, 1=on) |
||
54 | // leds bit2 => LED3 (0=off, 1=on) |
||
55 | // leds bit3 => LED4 (0=off, 1=on) |
||
56 | void avrcoreSetLeds(u08 leds); |
||
57 | |||
58 | //! Turn on selected LEDs |
||
59 | // '0' bit = no change |
||
60 | // '1' bit = turn on |
||
61 | void avrcoreSetLedsOn(u08 leds); |
||
62 | |||
63 | //! Turn off selected LEDs |
||
64 | // '0' bit = no change |
||
65 | // '1' bit = turn off |
||
66 | void avrcoreSetLedsOff(u08 leds); |
||
67 | |||
68 | //! Set on/off power setting of AVRCore serial port |
||
69 | // (0=off, 1=on) |
||
70 | void avrcoreSetSerialPortPower(u08 on); |
||
71 | |||
72 | #endif |
Powered by WebSVN v2.8.3