blob: 8d0982a1ba906bf33a2c2fd9606b312303afa186 [file] [log] [blame]
Brian Silverman003a4732018-03-11 14:02:15 -07001package(default_visibility = ["//visibility:public"])
Brian Silverman100534c2015-09-07 15:51:23 -04002
Alex Perrycb7da4b2019-08-28 19:35:56 -07003load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
Austin Schuh00be38c2019-12-01 18:08:25 -08004load("//aos:config.bzl", "aos_config")
Brian Silverman100534c2015-09-07 15:51:23 -04005
Alex Perrycb7da4b2019-08-28 19:35:56 -07006flatbuffer_cc_library(
7 name = "logging_fbs",
Brian Silverman003a4732018-03-11 14:02:15 -07008 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -07009 "logging.fbs",
Brian Silverman003a4732018-03-11 14:02:15 -070010 ],
Brian Silverman100534c2015-09-07 15:51:23 -040011)
12
13cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -070014 name = "encoder_and_potentiometer",
15 srcs = [
16 "encoder_and_potentiometer.cc",
17 ],
18 hdrs = [
19 "encoder_and_potentiometer.h",
20 ],
21 restricted_to = ["//tools:roborio"],
22 deps = [
23 ":dma",
24 ":dma_edge_counting",
John Park398c74a2018-10-20 21:17:39 -070025 "//aos:init",
Austin Schuh45a549f2019-02-02 15:43:56 -080026 "//aos/logging",
27 "//aos/mutex",
Brian Silverman003a4732018-03-11 14:02:15 -070028 "//third_party:wpilib",
29 ],
Brian Silverman100534c2015-09-07 15:51:23 -040030)
31
32cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -070033 name = "dma_edge_counting",
34 srcs = [
35 "dma_edge_counting.cc",
36 ],
37 hdrs = [
38 "dma_edge_counting.h",
39 ],
40 restricted_to = ["//tools:roborio"],
41 deps = [
42 ":dma",
John Park33858a32018-09-28 23:05:48 -070043 "//aos/logging",
Brian Silverman003a4732018-03-11 14:02:15 -070044 "//third_party:wpilib",
45 ],
Brian Silverman100534c2015-09-07 15:51:23 -040046)
47
48cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -070049 name = "interrupt_edge_counting",
50 srcs = [
51 "interrupt_edge_counting.cc",
52 ],
53 hdrs = [
54 "interrupt_edge_counting.h",
55 ],
56 restricted_to = ["//tools:roborio"],
57 deps = [
John Park398c74a2018-10-20 21:17:39 -070058 "//aos:init",
Austin Schuh45a549f2019-02-02 15:43:56 -080059 "//aos/logging",
60 "//aos/stl_mutex",
61 "//aos/time",
Brian Silverman003a4732018-03-11 14:02:15 -070062 "//third_party:wpilib",
63 ],
Brian Silverman100534c2015-09-07 15:51:23 -040064)
65
66cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -070067 name = "buffered_pcm",
68 srcs = [
69 "buffered_pcm.cc",
70 "buffered_solenoid.cc",
71 ],
72 hdrs = [
73 "buffered_pcm.h",
74 "buffered_solenoid.h",
75 ],
76 restricted_to = ["//tools:roborio"],
77 deps = [
John Park33858a32018-09-28 23:05:48 -070078 "//aos/logging",
Brian Silverman003a4732018-03-11 14:02:15 -070079 "//third_party:wpilib",
80 ],
Brian Silverman100534c2015-09-07 15:51:23 -040081)
82
83cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -070084 name = "gyro_interface",
85 srcs = [
86 "gyro_interface.cc",
87 ],
88 hdrs = [
89 "gyro_interface.h",
90 ],
91 restricted_to = ["//tools:roborio"],
92 deps = [
John Park33858a32018-09-28 23:05:48 -070093 "//aos/logging",
Austin Schuh45a549f2019-02-02 15:43:56 -080094 "//aos/time",
Brian Silverman003a4732018-03-11 14:02:15 -070095 "//third_party:wpilib",
96 ],
Brian Silverman100534c2015-09-07 15:51:23 -040097)
98
99cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700100 name = "gyro_sender",
101 srcs = [
102 "gyro_sender.cc",
103 ],
104 hdrs = [
105 "gyro_sender.h",
106 ],
107 restricted_to = ["//tools:roborio"],
108 deps = [
109 ":gyro_interface",
Austin Schuh45a549f2019-02-02 15:43:56 -0800110 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700111 "//aos/events:event_loop",
John Park33858a32018-09-28 23:05:48 -0700112 "//aos/logging",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700113 "//aos/robot_state:robot_state_fbs",
Austin Schuh45a549f2019-02-02 15:43:56 -0800114 "//aos/time",
John Park33858a32018-09-28 23:05:48 -0700115 "//aos/util:phased_loop",
Brian Silverman003a4732018-03-11 14:02:15 -0700116 "//frc971/queues:gyro",
117 "//frc971/zeroing:averager",
118 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400119)
120
Alex Perrycb7da4b2019-08-28 19:35:56 -0700121flatbuffer_cc_library(
122 name = "loop_output_handler_test_fbs",
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700123 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700124 "loop_output_handler_test.fbs",
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700125 ],
Austin Schuh00be38c2019-12-01 18:08:25 -0800126 gen_reflections = 1,
127)
128
129aos_config(
130 name = "loop_output_handler_test_config",
131 src = "loop_output_handler_test_config_source.json",
132 flatbuffers = [
133 ":loop_output_handler_test_fbs",
134 ],
Austin Schuh39788ff2019-12-01 18:22:57 -0800135 deps = [
136 "//aos/events:config",
137 ],
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700138)
139
Brian Silverman100534c2015-09-07 15:51:23 -0400140cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700141 name = "loop_output_handler",
142 srcs = [
143 "loop_output_handler.cc",
144 ],
145 hdrs = [
146 "loop_output_handler.h",
147 ],
148 deps = [
John Park398c74a2018-10-20 21:17:39 -0700149 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700150 "//aos/events:event_loop",
151 "//aos/robot_state:robot_state_fbs",
Austin Schuh45a549f2019-02-02 15:43:56 -0800152 "//aos/scoped:scoped_fd",
153 "//aos/time",
154 "//aos/util:log_interval",
Brian Silverman003a4732018-03-11 14:02:15 -0700155 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400156)
157
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700158cc_test(
159 name = "loop_output_handler_test",
160 srcs = [
161 "loop_output_handler_test.cc",
162 ],
Austin Schuh00be38c2019-12-01 18:08:25 -0800163 data = [
164 "loop_output_handler_test_config.json",
165 ],
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700166 deps = [
167 ":loop_output_handler",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700168 ":loop_output_handler_test_fbs",
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700169 "//aos/events:simulated_event_loop",
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700170 "//aos/testing:googletest",
171 "//aos/testing:test_logging",
172 ],
173)
174
Brian Silverman100534c2015-09-07 15:51:23 -0400175cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700176 name = "joystick_sender",
177 srcs = [
178 "joystick_sender.cc",
179 ],
180 hdrs = [
181 "joystick_sender.h",
182 ],
183 restricted_to = ["//tools:roborio"],
184 deps = [
John Park398c74a2018-10-20 21:17:39 -0700185 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700186 "//aos/events:shm_event_loop",
187 "//aos/input:driver_station_data",
Austin Schuh45a549f2019-02-02 15:43:56 -0800188 "//aos/network:team_number",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700189 "//aos/robot_state:joystick_state_fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700190 "//third_party:wpilib",
191 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400192)
Brian Silverman811f8ec2015-12-06 01:29:42 -0500193
194cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700195 name = "wpilib_interface",
196 srcs = [
197 "wpilib_interface.cc",
198 ],
199 hdrs = [
200 "wpilib_interface.h",
201 ],
202 restricted_to = ["//tools:roborio"],
203 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700204 "//aos/events:event_loop",
205 "//aos/robot_state:robot_state_fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700206 "//third_party:wpilib",
207 ],
Brian Silverman39b339e2016-01-03 13:24:22 -0800208)
209
Alex Perrycb7da4b2019-08-28 19:35:56 -0700210flatbuffer_cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700211 name = "pdp_values",
212 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700213 "pdp_values.fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700214 ],
Brian Silverman425492b2015-12-30 15:23:55 -0800215)
216
217cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700218 name = "pdp_fetcher",
219 srcs = [
220 "pdp_fetcher.cc",
221 ],
222 hdrs = [
223 "pdp_fetcher.h",
224 ],
225 restricted_to = ["//tools:roborio"],
226 deps = [
227 ":pdp_values",
Austin Schuh45a549f2019-02-02 15:43:56 -0800228 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700229 "//aos/events:event_loop",
John Park33858a32018-09-28 23:05:48 -0700230 "//aos/util:phased_loop",
Brian Silverman003a4732018-03-11 14:02:15 -0700231 "//third_party:wpilib",
232 ],
Brian Silverman811f8ec2015-12-06 01:29:42 -0500233)
Campbell Crowleyc0cfb132015-12-30 20:58:02 -0800234
235cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700236 name = "wpilib_robot_base",
237 hdrs = [
238 "wpilib_robot_base.h",
239 ],
240 restricted_to = ["//tools:roborio"],
241 deps = [
242 "//third_party:wpilib",
243 ],
Campbell Crowleyc0cfb132015-12-30 20:58:02 -0800244)
Brian Silverman5f17a972016-02-28 01:49:32 -0500245
Alex Perrycb7da4b2019-08-28 19:35:56 -0700246flatbuffer_cc_library(
247 name = "imu_fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700248 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700249 "imu.fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700250 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700251 gen_reflections = 1,
Brian Silverman5f17a972016-02-28 01:49:32 -0500252)
253
254cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700255 name = "ADIS16448",
256 srcs = [
257 "ADIS16448.cc",
258 ],
259 hdrs = [
260 "ADIS16448.h",
261 ],
262 restricted_to = ["//tools:roborio"],
263 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700264 ":imu_fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700265 ":spi_rx_clearer",
Austin Schuh45a549f2019-02-02 15:43:56 -0800266 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700267 "//aos/events:event_loop",
John Park33858a32018-09-28 23:05:48 -0700268 "//aos/logging",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700269 "//aos/robot_state:robot_state_fbs",
Austin Schuh45a549f2019-02-02 15:43:56 -0800270 "//aos/time",
Brian Silverman003a4732018-03-11 14:02:15 -0700271 "//frc971/zeroing:averager",
272 "//third_party:wpilib",
273 ],
Brian Silverman5f17a972016-02-28 01:49:32 -0500274)
Brian Silvermanb5b46ca2016-03-13 01:14:17 -0500275
276cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700277 name = "dma",
278 srcs = [
279 "dma.cc",
280 ],
281 hdrs = [
282 "dma.h",
283 ],
284 restricted_to = ["//tools:roborio"],
285 deps = [
286 "//third_party:wpilib",
287 ],
288)
289
290cc_library(
291 name = "spi_rx_clearer",
292 srcs = [
293 "spi_rx_clearer.cc",
294 ],
295 hdrs = [
296 "spi_rx_clearer.h",
297 ],
298 deps = [
John Park33858a32018-09-28 23:05:48 -0700299 "//aos/logging",
Brian Silverman003a4732018-03-11 14:02:15 -0700300 ],
Brian Silvermanb5b46ca2016-03-13 01:14:17 -0500301)
Sabina Davisadc58542019-02-01 22:23:00 -0800302
303cc_library(
304 name = "sensor_reader",
305 srcs = [
306 "sensor_reader.cc",
307 ],
308 hdrs = [
Austin Schuh45a549f2019-02-02 15:43:56 -0800309 "sensor_reader.h",
Sabina Davisadc58542019-02-01 22:23:00 -0800310 ],
311 restricted_to = ["//tools:roborio"],
312 deps = [
Sabina Davis1ffa4172019-02-01 22:38:33 -0800313 ":dma",
314 ":dma_edge_counting",
Austin Schuh54667ac2019-02-02 16:44:49 -0800315 ":encoder_and_potentiometer",
Austin Schuh45a549f2019-02-02 15:43:56 -0800316 ":wpilib_interface",
317 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700318 "//aos/events:event_loop",
Austin Schuh45a549f2019-02-02 15:43:56 -0800319 "//aos/stl_mutex",
320 "//aos/time",
321 "//aos/util:phased_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700322 "//frc971/control_loops:control_loops_fbs",
Austin Schuh45a549f2019-02-02 15:43:56 -0800323 "//third_party:wpilib",
Sabina Davisadc58542019-02-01 22:23:00 -0800324 ],
325)
Sabina Davisd004fd62019-02-02 23:51:46 -0800326
327cc_library(
328 name = "drivetrain_writer",
329 srcs = [
330 "drivetrain_writer.cc",
331 ],
332 hdrs = [
333 "drivetrain_writer.h",
334 ],
335 restricted_to = ["//tools:roborio"],
336 deps = [
337 ":loop_output_handler",
338 "//aos:math",
339 "//aos/logging",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700340 "//frc971/control_loops/drivetrain:drivetrain_output_fbs",
Sabina Davisd004fd62019-02-02 23:51:46 -0800341 "//third_party:wpilib",
342 ],
343)