Line No. | Rev | Author | Line |
---|---|---|---|
1 | 6 | kaklik | /*! \file megaio.h \brief MegaIO Control/Access function library. */ |
2 | //***************************************************************************** |
||
3 | // |
||
4 | // File Name : 'megaio.h' |
||
5 | // Title : MegaIO Control/Access function library |
||
6 | // Author : Pascal Stang - Copyright (C) 2004 |
||
7 | // Created : 5/18/2004 |
||
8 | // Revised : 5/18/2004 |
||
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 MEGAIO_H |
||
19 | #define MEGAIO_H |
||
20 | |||
21 | #include "megaio/megaioreg.h" // include MegaIO register definitions |
||
22 | |||
23 | // defines |
||
24 | |||
25 | // function prototypes |
||
26 | |||
27 | //! initialize the MegaIO interface |
||
28 | u08 megaioInit(void); |
||
29 | //! write an 8-32 bit number to a MegaIO register |
||
30 | void megaioWriteReg(unsigned char regnum, unsigned char nbytes, unsigned long data); |
||
31 | //! read an 8-32 bit number from a MegaIO register |
||
32 | unsigned long megaioReadReg(unsigned char regnum, unsigned char nbytes); |
||
33 | |||
34 | //! set the baudrate of the MegaIO serial port |
||
35 | void megaioSetBaudRate(u32 baudrate); |
||
36 | //! send a byte out the MegaIO serial port |
||
37 | void megaioSendByte(u08 data); |
||
38 | //! get a byte from the MegaIO serial port |
||
39 | int megaioGetByte(void); |
||
40 | //! get a complete receive buffer with data from MegaIO serial port |
||
41 | cBuffer* megaioGetRxBuffer(void); |
||
42 | |||
43 | //! turn on MegaIO PWM and set for bitRes resolution |
||
44 | void megaioPWMInit(u08 bitRes); |
||
45 | //! turn off MegaIO PWM |
||
46 | void megaioPWMOff(void); |
||
47 | //! set MegaIO PWM1A duty cycle |
||
48 | void megaioPWMASet(u16 pwmDuty); |
||
49 | //! set MegaIO PWM1B duty cycle |
||
50 | void megaioPWMBSet(u16 pwmDuty); |
||
51 | //! set MegaIO prescaler division rate |
||
52 | void megaioSetPrescaler(u08 prescaleDiv); |
||
53 | |||
54 | //! do A/D conversion on channel [ch] and return result |
||
55 | u16 megaioA2DConvert(u08 ch); |
||
56 | |||
57 | #endif |
Powered by WebSVN v2.8.3