Project

General

Profile

Revision 1345

Added by Rich Hong almost 11 years ago

Final spline code for master/slave

updated outdated libdragonfly and libwireless

View differences:

dragonfly_lib.h
1
/**
2
 * @file dragonfly_lib.h
3
 * @brief Contains other include files
4
 * 
5
 * Include this file for all the functionality of libdragonfly.
6
 *
7
 * @author Colony Project, CMU Robotics Club
8
 **/
9

  
10
#ifndef _DRAGONFLY_LIB_H_
11
#define _DRAGONFLY_LIB_H_
12

  
13
/**
14
 * @addtogroup dragonfly
15
 * @{
16
 **/
17

  
18
// Configuration definitions
19
/** @brief Initialize analog **/
20
#define ANALOG 0x01
21
/** @brief Initialize serial communications **/
22
#define SERIAL 0x02
23
/** @brief Initialize USB communications **/
24
#define USB    0x02
25
/** @brief Initialize communications **/
26
#define COMM   0x02
27
/** @brief Initialize the orb **/
28
#define ORB    0x04
29
/** @brief Initialize the motors **/
30
#define MOTORS 0x08
31
/** @brief Initialize the servos **/
32
#define SERVOS 0x10
33
/** @brief Initialize I2C **/
34
#define I2C    0x20
35
/** @brief Initialize the buzzer **/
36
#define BUZZER 0x40
37
/** @brief Initialize the LCD screen **/
38
#define LCD    0x80
39
/** @brief Initialize everything **/
40
#define ALL_ON 0xFF
41

  
42

  
43
/** @brief Initialize the board **/
44
void dragonfly_init(int config);
45

  
46
/** @} **/ //end addtogroup
47

  
48
#include <inttypes.h>
49
#include <stdio.h>
50
#include <stdlib.h>
51
#include <avr/io.h>
52
#include <avr/interrupt.h>
53
#include <util/delay.h>
54
#include <util/twi.h>
55

  
56
#include <analog.h>
57
#include <dio.h>
58
#include <time.h>
59
#include <lcd.h>
60
#include <lights.h>
61
#include <motor.h>
62
#include <serial.h>
63
#include <buzzer.h>
64
#include <rangefinder.h>
65
#include <bom.h>
66
#include <move.h>
67
#include <reset.h>
68
#include <math.h>
69

  
70
#include <spi.h>
71
#include <encoders.h>
72

  
73
#endif
74

  
1
/**
2
 * Copyright (c) 2007 Colony Project
3
 * 
4
 * Permission is hereby granted, free of charge, to any person
5
 * obtaining a copy of this software and associated documentation
6
 * files (the "Software"), to deal in the Software without
7
 * restriction, including without limitation the rights to use,
8
 * copy, modify, merge, publish, distribute, sublicense, and/or sell
9
 * copies of the Software, and to permit persons to whom the
10
 * Software is furnished to do so, subject to the following
11
 * conditions:
12
 * 
13
 * The above copyright notice and this permission notice shall be
14
 * included in all copies or substantial portions of the Software.
15
 * 
16
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
18
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23
 * OTHER DEALINGS IN THE SOFTWARE.
24
 **/
25

  
26

  
27
/**
28
 * @file dragonfly_lib.h
29
 * @brief Contains other include files
30
 * 
31
 * Include this file for all the functionality of libdragonfly.
32
 *
33
 * @author Colony Project, CMU Robotics Club
34
 **/
35

  
36
#ifndef _DRAGONFLY_LIB_H_
37
#define _DRAGONFLY_LIB_H_
38

  
39
/**
40
 * @addtogroup dragonfly
41
 * @{
42
 **/
43

  
44
// Configuration definitions
45
/** @brief Initialize analog **/
46
#define ANALOG 0x01
47
/** @brief Initialize serial communications **/
48
#define SERIAL 0x02
49
/** @brief Initialize USB communications **/
50
#define USB    0x02
51
/** @brief Initialize communications **/
52
#define COMM   0x02
53
/** @brief Initialize the orb **/
54
#define ORB    0x04
55
/** @brief Initialize the motors **/
56
#define MOTORS 0x08
57
/** @brief Initialize I2C **/
58
#define I2C    0x20
59
/** @brief Initialize the buzzer **/
60
#define BUZZER 0x40
61
/** @brief Initialize the LCD screen **/
62
#define LCD    0x80
63
/** @brief Initialize the rangefinders **/
64
#define RANGE  0x0100
65
/** @brief Initialize the BOM **/
66
#define BOM  0x0200
67
/** @brief Initialize everything  **/
68
#define ALL_ON 0x03FF
69

  
70
/** @brief Initialize the board **/
71
void dragonfly_init(int config);
72

  
73
/** @} **/ //end addtogroup
74

  
75
#include <inttypes.h>
76
#include <stdio.h>
77
#include <stdlib.h>
78
#include <avr/io.h>
79
#include <avr/interrupt.h>
80
#include <util/delay.h>
81
#include <util/twi.h>
82

  
83
// This file is included from the libdragonfly directory because it seems to be
84
// missing from the AVR libc distribution.
85
#include "atomic.h"
86

  
87
#include <analog.h>
88
#include <dio.h>
89
#include <time.h>
90
#include <lcd.h>
91
#include <lights.h>
92
#include <motor.h>
93
#include <serial.h>
94
#include <buzzer.h>
95
#include <rangefinder.h>
96
#include <bom.h>
97
#include <move.h>
98
#include <reset.h>
99
#include <math.h>
100
#include <eeprom.h>
101
#include <stdbool.h>
102

  
103
/** @brief shortcut for ATOMIC_BLOCK(ATOMIC_RESTORESTATE) **/
104
#define SYNC ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
105

  
106
/** @brief atomically grab a lock if it is free, return otherwise **/
107
#define REQUIRE_LOCK_OR_RETURN(LOCK) do { SYNC { if (LOCK) return; LOCK=1; } } while (0)
108

  
109
/** @brief atomically release a lock **/
110
#define RELEASE_LOCK(LOCK) do { LOCK=0; } while (0)
111

  
112

  
113

  
114
#endif
115

  

Also available in: Unified diff