blob: ac9bc876dc0f39e615e82898654678cd692a5f90 [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 Schuhbd1fe9c2019-06-29 16:35:48 -0700135)
136
Brian Silverman100534c2015-09-07 15:51:23 -0400137cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700138 name = "loop_output_handler",
139 srcs = [
140 "loop_output_handler.cc",
141 ],
142 hdrs = [
143 "loop_output_handler.h",
144 ],
145 deps = [
John Park398c74a2018-10-20 21:17:39 -0700146 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700147 "//aos/events:event_loop",
148 "//aos/robot_state:robot_state_fbs",
Austin Schuh45a549f2019-02-02 15:43:56 -0800149 "//aos/scoped:scoped_fd",
150 "//aos/time",
151 "//aos/util:log_interval",
Brian Silverman003a4732018-03-11 14:02:15 -0700152 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400153)
154
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700155cc_test(
156 name = "loop_output_handler_test",
157 srcs = [
158 "loop_output_handler_test.cc",
159 ],
Austin Schuh00be38c2019-12-01 18:08:25 -0800160 data = [
161 "loop_output_handler_test_config.json",
162 ],
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700163 deps = [
164 ":loop_output_handler",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700165 ":loop_output_handler_test_fbs",
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700166 "//aos/events:simulated_event_loop",
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700167 "//aos/testing:googletest",
168 "//aos/testing:test_logging",
169 ],
170)
171
Brian Silverman100534c2015-09-07 15:51:23 -0400172cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700173 name = "joystick_sender",
174 srcs = [
175 "joystick_sender.cc",
176 ],
177 hdrs = [
178 "joystick_sender.h",
179 ],
180 restricted_to = ["//tools:roborio"],
181 deps = [
John Park398c74a2018-10-20 21:17:39 -0700182 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700183 "//aos/events:shm_event_loop",
184 "//aos/input:driver_station_data",
Austin Schuh45a549f2019-02-02 15:43:56 -0800185 "//aos/network:team_number",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700186 "//aos/robot_state:joystick_state_fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700187 "//third_party:wpilib",
188 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400189)
Brian Silverman811f8ec2015-12-06 01:29:42 -0500190
191cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700192 name = "wpilib_interface",
193 srcs = [
194 "wpilib_interface.cc",
195 ],
196 hdrs = [
197 "wpilib_interface.h",
198 ],
199 restricted_to = ["//tools:roborio"],
200 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700201 "//aos/events:event_loop",
202 "//aos/robot_state:robot_state_fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700203 "//third_party:wpilib",
204 ],
Brian Silverman39b339e2016-01-03 13:24:22 -0800205)
206
Alex Perrycb7da4b2019-08-28 19:35:56 -0700207flatbuffer_cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700208 name = "pdp_values",
209 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700210 "pdp_values.fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700211 ],
Brian Silverman425492b2015-12-30 15:23:55 -0800212)
213
214cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700215 name = "pdp_fetcher",
216 srcs = [
217 "pdp_fetcher.cc",
218 ],
219 hdrs = [
220 "pdp_fetcher.h",
221 ],
222 restricted_to = ["//tools:roborio"],
223 deps = [
224 ":pdp_values",
Austin Schuh45a549f2019-02-02 15:43:56 -0800225 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700226 "//aos/events:event_loop",
John Park33858a32018-09-28 23:05:48 -0700227 "//aos/util:phased_loop",
Brian Silverman003a4732018-03-11 14:02:15 -0700228 "//third_party:wpilib",
229 ],
Brian Silverman811f8ec2015-12-06 01:29:42 -0500230)
Campbell Crowleyc0cfb132015-12-30 20:58:02 -0800231
232cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700233 name = "wpilib_robot_base",
234 hdrs = [
235 "wpilib_robot_base.h",
236 ],
237 restricted_to = ["//tools:roborio"],
238 deps = [
239 "//third_party:wpilib",
240 ],
Campbell Crowleyc0cfb132015-12-30 20:58:02 -0800241)
Brian Silverman5f17a972016-02-28 01:49:32 -0500242
Alex Perrycb7da4b2019-08-28 19:35:56 -0700243flatbuffer_cc_library(
244 name = "imu_fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700245 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700246 "imu.fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700247 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700248 gen_reflections = 1,
Brian Silverman5f17a972016-02-28 01:49:32 -0500249)
250
251cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700252 name = "ADIS16448",
253 srcs = [
254 "ADIS16448.cc",
255 ],
256 hdrs = [
257 "ADIS16448.h",
258 ],
259 restricted_to = ["//tools:roborio"],
260 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700261 ":imu_fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700262 ":spi_rx_clearer",
Austin Schuh45a549f2019-02-02 15:43:56 -0800263 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700264 "//aos/events:event_loop",
John Park33858a32018-09-28 23:05:48 -0700265 "//aos/logging",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700266 "//aos/robot_state:robot_state_fbs",
Austin Schuh45a549f2019-02-02 15:43:56 -0800267 "//aos/time",
Brian Silverman003a4732018-03-11 14:02:15 -0700268 "//frc971/zeroing:averager",
269 "//third_party:wpilib",
270 ],
Brian Silverman5f17a972016-02-28 01:49:32 -0500271)
Brian Silvermanb5b46ca2016-03-13 01:14:17 -0500272
273cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700274 name = "dma",
275 srcs = [
276 "dma.cc",
277 ],
278 hdrs = [
279 "dma.h",
280 ],
281 restricted_to = ["//tools:roborio"],
282 deps = [
283 "//third_party:wpilib",
284 ],
285)
286
287cc_library(
288 name = "spi_rx_clearer",
289 srcs = [
290 "spi_rx_clearer.cc",
291 ],
292 hdrs = [
293 "spi_rx_clearer.h",
294 ],
295 deps = [
John Park33858a32018-09-28 23:05:48 -0700296 "//aos/logging",
Brian Silverman003a4732018-03-11 14:02:15 -0700297 ],
Brian Silvermanb5b46ca2016-03-13 01:14:17 -0500298)
Sabina Davisadc58542019-02-01 22:23:00 -0800299
300cc_library(
301 name = "sensor_reader",
302 srcs = [
303 "sensor_reader.cc",
304 ],
305 hdrs = [
Austin Schuh45a549f2019-02-02 15:43:56 -0800306 "sensor_reader.h",
Sabina Davisadc58542019-02-01 22:23:00 -0800307 ],
308 restricted_to = ["//tools:roborio"],
309 deps = [
Sabina Davis1ffa4172019-02-01 22:38:33 -0800310 ":dma",
311 ":dma_edge_counting",
Austin Schuh54667ac2019-02-02 16:44:49 -0800312 ":encoder_and_potentiometer",
Austin Schuh45a549f2019-02-02 15:43:56 -0800313 ":wpilib_interface",
314 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700315 "//aos/events:event_loop",
Austin Schuh45a549f2019-02-02 15:43:56 -0800316 "//aos/stl_mutex",
317 "//aos/time",
318 "//aos/util:phased_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700319 "//frc971/control_loops:control_loops_fbs",
Austin Schuh45a549f2019-02-02 15:43:56 -0800320 "//third_party:wpilib",
Sabina Davisadc58542019-02-01 22:23:00 -0800321 ],
322)
Sabina Davisd004fd62019-02-02 23:51:46 -0800323
324cc_library(
325 name = "drivetrain_writer",
326 srcs = [
327 "drivetrain_writer.cc",
328 ],
329 hdrs = [
330 "drivetrain_writer.h",
331 ],
332 restricted_to = ["//tools:roborio"],
333 deps = [
334 ":loop_output_handler",
335 "//aos:math",
336 "//aos/logging",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700337 "//frc971/control_loops/drivetrain:drivetrain_output_fbs",
Sabina Davisd004fd62019-02-02 23:51:46 -0800338 "//third_party:wpilib",
339 ],
340)