blob: e7c52bfbfcc55ff1c11b18dcd71a2dc545f73985 [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 ],
Austin Schuhed5b26d2019-12-05 20:51:59 -080011 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -080012 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman100534c2015-09-07 15:51:23 -040013)
14
15cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -070016 name = "encoder_and_potentiometer",
17 srcs = [
18 "encoder_and_potentiometer.cc",
19 ],
20 hdrs = [
21 "encoder_and_potentiometer.h",
22 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080023 target_compatible_with = ["//tools/platforms/hardware:roborio"],
Brian Silverman003a4732018-03-11 14:02:15 -070024 deps = [
25 ":dma",
26 ":dma_edge_counting",
John Park398c74a2018-10-20 21:17:39 -070027 "//aos:init",
Austin Schuh45a549f2019-02-02 15:43:56 -080028 "//aos/logging",
Brian Silverman003a4732018-03-11 14:02:15 -070029 "//third_party:wpilib",
30 ],
Brian Silverman100534c2015-09-07 15:51:23 -040031)
32
33cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -070034 name = "dma_edge_counting",
35 srcs = [
36 "dma_edge_counting.cc",
37 ],
38 hdrs = [
39 "dma_edge_counting.h",
40 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080041 target_compatible_with = ["//tools/platforms/hardware:roborio"],
Brian Silverman003a4732018-03-11 14:02:15 -070042 deps = [
43 ":dma",
John Park33858a32018-09-28 23:05:48 -070044 "//aos/logging",
Brian Silverman003a4732018-03-11 14:02:15 -070045 "//third_party:wpilib",
46 ],
Brian Silverman100534c2015-09-07 15:51:23 -040047)
48
49cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -070050 name = "interrupt_edge_counting",
51 srcs = [
52 "interrupt_edge_counting.cc",
53 ],
54 hdrs = [
55 "interrupt_edge_counting.h",
56 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080057 target_compatible_with = ["//tools/platforms/hardware:roborio"],
Brian Silverman003a4732018-03-11 14:02:15 -070058 deps = [
John Park398c74a2018-10-20 21:17:39 -070059 "//aos:init",
Austin Schuh45a549f2019-02-02 15:43:56 -080060 "//aos/logging",
61 "//aos/stl_mutex",
62 "//aos/time",
Brian Silverman003a4732018-03-11 14:02:15 -070063 "//third_party:wpilib",
64 ],
Brian Silverman100534c2015-09-07 15:51:23 -040065)
66
67cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -070068 name = "buffered_pcm",
69 srcs = [
70 "buffered_pcm.cc",
71 "buffered_solenoid.cc",
72 ],
73 hdrs = [
74 "buffered_pcm.h",
75 "buffered_solenoid.h",
76 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080077 target_compatible_with = ["//tools/platforms/hardware:roborio"],
Brian Silverman003a4732018-03-11 14:02:15 -070078 deps = [
John Park33858a32018-09-28 23:05:48 -070079 "//aos/logging",
Brian Silverman003a4732018-03-11 14:02:15 -070080 "//third_party:wpilib",
81 ],
Brian Silverman100534c2015-09-07 15:51:23 -040082)
83
84cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -070085 name = "gyro_interface",
86 srcs = [
87 "gyro_interface.cc",
88 ],
89 hdrs = [
90 "gyro_interface.h",
91 ],
Brian Silverman7be68ba2020-01-08 22:08:40 -080092 # This library uses some deprecated parts of the SPI API.
93 copts = ["-Wno-deprecated-declarations"],
Philipp Schraderdada1072020-11-24 11:34:46 -080094 target_compatible_with = ["//tools/platforms/hardware:roborio"],
Brian Silverman003a4732018-03-11 14:02:15 -070095 deps = [
John Park33858a32018-09-28 23:05:48 -070096 "//aos/logging",
Austin Schuh45a549f2019-02-02 15:43:56 -080097 "//aos/time",
Brian Silverman003a4732018-03-11 14:02:15 -070098 "//third_party:wpilib",
99 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400100)
101
102cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700103 name = "gyro_sender",
104 srcs = [
105 "gyro_sender.cc",
106 ],
107 hdrs = [
108 "gyro_sender.h",
109 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800110 target_compatible_with = ["//tools/platforms/hardware:roborio"],
Brian Silverman003a4732018-03-11 14:02:15 -0700111 deps = [
112 ":gyro_interface",
Austin Schuh45a549f2019-02-02 15:43:56 -0800113 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700114 "//aos/events:event_loop",
Austin Schuh217a9782019-12-21 23:02:50 -0800115 "//aos/events:shm_event_loop",
John Park33858a32018-09-28 23:05:48 -0700116 "//aos/logging",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700117 "//aos/robot_state:robot_state_fbs",
Austin Schuh45a549f2019-02-02 15:43:56 -0800118 "//aos/time",
John Park33858a32018-09-28 23:05:48 -0700119 "//aos/util:phased_loop",
Tyler Chatow24b5db12020-01-06 21:16:56 -0800120 "//frc971/queues:gyro_fbs",
121 "//frc971/queues:gyro_uid_fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700122 "//frc971/zeroing:averager",
123 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400124)
125
Alex Perrycb7da4b2019-08-28 19:35:56 -0700126flatbuffer_cc_library(
127 name = "loop_output_handler_test_fbs",
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700128 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700129 "loop_output_handler_test.fbs",
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700130 ],
Austin Schuh00be38c2019-12-01 18:08:25 -0800131 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -0800132 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh00be38c2019-12-01 18:08:25 -0800133)
134
135aos_config(
Austin Schuhed5b26d2019-12-05 20:51:59 -0800136 name = "config",
137 src = "wpilib_config.json",
138 flatbuffers = [
139 ":pdp_values_fbs",
140 ":logging_fbs",
141 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800142 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhed5b26d2019-12-05 20:51:59 -0800143)
144
145aos_config(
Austin Schuh00be38c2019-12-01 18:08:25 -0800146 name = "loop_output_handler_test_config",
147 src = "loop_output_handler_test_config_source.json",
148 flatbuffers = [
149 ":loop_output_handler_test_fbs",
150 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800151 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh39788ff2019-12-01 18:22:57 -0800152 deps = [
153 "//aos/events:config",
154 ],
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700155)
156
Brian Silverman100534c2015-09-07 15:51:23 -0400157cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700158 name = "loop_output_handler",
159 srcs = [
160 "loop_output_handler.cc",
161 ],
162 hdrs = [
163 "loop_output_handler.h",
164 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800165 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman003a4732018-03-11 14:02:15 -0700166 deps = [
John Park398c74a2018-10-20 21:17:39 -0700167 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700168 "//aos/events:event_loop",
169 "//aos/robot_state:robot_state_fbs",
Austin Schuh45a549f2019-02-02 15:43:56 -0800170 "//aos/scoped:scoped_fd",
171 "//aos/time",
172 "//aos/util:log_interval",
Brian Silverman003a4732018-03-11 14:02:15 -0700173 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400174)
175
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700176cc_test(
177 name = "loop_output_handler_test",
178 srcs = [
179 "loop_output_handler_test.cc",
180 ],
Austin Schuh00be38c2019-12-01 18:08:25 -0800181 data = [
Austin Schuh14d7d3d2020-09-10 18:14:36 -0700182 ":loop_output_handler_test_config",
Austin Schuh00be38c2019-12-01 18:08:25 -0800183 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800184 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700185 deps = [
186 ":loop_output_handler",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700187 ":loop_output_handler_test_fbs",
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700188 "//aos/events:simulated_event_loop",
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700189 "//aos/testing:googletest",
190 "//aos/testing:test_logging",
191 ],
192)
193
Brian Silverman100534c2015-09-07 15:51:23 -0400194cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700195 name = "joystick_sender",
196 srcs = [
197 "joystick_sender.cc",
198 ],
199 hdrs = [
200 "joystick_sender.h",
201 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800202 target_compatible_with = ["//tools/platforms/hardware:roborio"],
Brian Silverman003a4732018-03-11 14:02:15 -0700203 deps = [
John Park398c74a2018-10-20 21:17:39 -0700204 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700205 "//aos/events:shm_event_loop",
206 "//aos/input:driver_station_data",
Austin Schuh45a549f2019-02-02 15:43:56 -0800207 "//aos/network:team_number",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700208 "//aos/robot_state:joystick_state_fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700209 "//third_party:wpilib",
210 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400211)
Brian Silverman811f8ec2015-12-06 01:29:42 -0500212
213cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700214 name = "wpilib_interface",
215 srcs = [
216 "wpilib_interface.cc",
217 ],
218 hdrs = [
219 "wpilib_interface.h",
220 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800221 target_compatible_with = ["//tools/platforms/hardware:roborio"],
Brian Silverman003a4732018-03-11 14:02:15 -0700222 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700223 "//aos/events:event_loop",
224 "//aos/robot_state:robot_state_fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700225 "//third_party:wpilib",
226 ],
Brian Silverman39b339e2016-01-03 13:24:22 -0800227)
228
Alex Perrycb7da4b2019-08-28 19:35:56 -0700229flatbuffer_cc_library(
Austin Schuhed5b26d2019-12-05 20:51:59 -0800230 name = "pdp_values_fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700231 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700232 "pdp_values.fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700233 ],
Austin Schuhed5b26d2019-12-05 20:51:59 -0800234 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -0800235 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman425492b2015-12-30 15:23:55 -0800236)
237
238cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700239 name = "pdp_fetcher",
240 srcs = [
241 "pdp_fetcher.cc",
242 ],
243 hdrs = [
244 "pdp_fetcher.h",
245 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800246 target_compatible_with = ["//tools/platforms/hardware:roborio"],
Brian Silverman003a4732018-03-11 14:02:15 -0700247 deps = [
Austin Schuhed5b26d2019-12-05 20:51:59 -0800248 ":pdp_values_fbs",
Austin Schuh45a549f2019-02-02 15:43:56 -0800249 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700250 "//aos/events:event_loop",
Austin Schuh217a9782019-12-21 23:02:50 -0800251 "//aos/events:shm_event_loop",
John Park33858a32018-09-28 23:05:48 -0700252 "//aos/util:phased_loop",
Brian Silverman003a4732018-03-11 14:02:15 -0700253 "//third_party:wpilib",
254 ],
Brian Silverman811f8ec2015-12-06 01:29:42 -0500255)
Campbell Crowleyc0cfb132015-12-30 20:58:02 -0800256
257cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700258 name = "wpilib_robot_base",
259 hdrs = [
260 "wpilib_robot_base.h",
261 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800262 target_compatible_with = ["//tools/platforms/hardware:roborio"],
Brian Silverman003a4732018-03-11 14:02:15 -0700263 deps = [
264 "//third_party:wpilib",
265 ],
Campbell Crowleyc0cfb132015-12-30 20:58:02 -0800266)
Brian Silverman5f17a972016-02-28 01:49:32 -0500267
Alex Perrycb7da4b2019-08-28 19:35:56 -0700268flatbuffer_cc_library(
269 name = "imu_fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700270 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700271 "imu.fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700272 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700273 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -0800274 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman5f17a972016-02-28 01:49:32 -0500275)
276
Austin Schuhac17fba2020-03-28 15:55:33 -0700277flatbuffer_cc_library(
278 name = "imu_batch_fbs",
279 srcs = [
280 "imu_batch.fbs",
281 ],
282 gen_reflections = 1,
283 includes = [
284 ":imu_fbs_includes",
285 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800286 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhac17fba2020-03-28 15:55:33 -0700287)
288
Brian Silverman5f17a972016-02-28 01:49:32 -0500289cc_library(
Brian Silverman7be68ba2020-01-08 22:08:40 -0800290 name = "ADIS16470",
291 srcs = [
292 "ADIS16470.cc",
293 ],
294 hdrs = [
295 "ADIS16470.h",
296 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800297 target_compatible_with = ["//tools/platforms/hardware:roborio"],
Brian Silverman7be68ba2020-01-08 22:08:40 -0800298 deps = [
299 ":fpga_time_conversion",
Austin Schuhac17fba2020-03-28 15:55:33 -0700300 ":imu_batch_fbs",
Brian Silverman7be68ba2020-01-08 22:08:40 -0800301 ":imu_fbs",
Austin Schuhac17fba2020-03-28 15:55:33 -0700302 "//aos/containers:sized_array",
Brian Silverman7be68ba2020-01-08 22:08:40 -0800303 "//aos/events:event_loop",
304 "//aos/time",
305 "//third_party:wpilib",
306 "@com_github_google_glog//:glog",
307 "@com_google_absl//absl/types:span",
308 ],
309)
310
311cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700312 name = "ADIS16448",
313 srcs = [
314 "ADIS16448.cc",
315 ],
316 hdrs = [
317 "ADIS16448.h",
318 ],
Brian Silverman7be68ba2020-01-08 22:08:40 -0800319 # This library uses some deprecated parts of the SPI API.
320 copts = ["-Wno-deprecated-declarations"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800321 target_compatible_with = ["//tools/platforms/hardware:roborio"],
Brian Silverman003a4732018-03-11 14:02:15 -0700322 deps = [
Brian Silverman7be68ba2020-01-08 22:08:40 -0800323 ":fpga_time_conversion",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700324 ":imu_fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700325 ":spi_rx_clearer",
Austin Schuh45a549f2019-02-02 15:43:56 -0800326 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700327 "//aos/events:event_loop",
Austin Schuh217a9782019-12-21 23:02:50 -0800328 "//aos/events:shm_event_loop",
John Park33858a32018-09-28 23:05:48 -0700329 "//aos/logging",
Austin Schuh45a549f2019-02-02 15:43:56 -0800330 "//aos/time",
Brian Silverman003a4732018-03-11 14:02:15 -0700331 "//frc971/zeroing:averager",
332 "//third_party:wpilib",
333 ],
Brian Silverman5f17a972016-02-28 01:49:32 -0500334)
Brian Silvermanb5b46ca2016-03-13 01:14:17 -0500335
336cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700337 name = "dma",
338 srcs = [
339 "dma.cc",
340 ],
341 hdrs = [
342 "dma.h",
343 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800344 target_compatible_with = ["//tools/platforms/hardware:roborio"],
Brian Silverman003a4732018-03-11 14:02:15 -0700345 deps = [
346 "//third_party:wpilib",
347 ],
348)
349
350cc_library(
351 name = "spi_rx_clearer",
352 srcs = [
353 "spi_rx_clearer.cc",
354 ],
355 hdrs = [
356 "spi_rx_clearer.h",
357 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800358 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman003a4732018-03-11 14:02:15 -0700359 deps = [
John Park33858a32018-09-28 23:05:48 -0700360 "//aos/logging",
Brian Silverman003a4732018-03-11 14:02:15 -0700361 ],
Brian Silvermanb5b46ca2016-03-13 01:14:17 -0500362)
Sabina Davisadc58542019-02-01 22:23:00 -0800363
364cc_library(
365 name = "sensor_reader",
366 srcs = [
367 "sensor_reader.cc",
368 ],
369 hdrs = [
Austin Schuh45a549f2019-02-02 15:43:56 -0800370 "sensor_reader.h",
Sabina Davisadc58542019-02-01 22:23:00 -0800371 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800372 target_compatible_with = ["//tools/platforms/hardware:roborio"],
Sabina Davisadc58542019-02-01 22:23:00 -0800373 deps = [
Sabina Davis1ffa4172019-02-01 22:38:33 -0800374 ":dma",
375 ":dma_edge_counting",
Austin Schuh54667ac2019-02-02 16:44:49 -0800376 ":encoder_and_potentiometer",
Brian Silverman7be68ba2020-01-08 22:08:40 -0800377 ":fpga_time_conversion",
Austin Schuh45a549f2019-02-02 15:43:56 -0800378 ":wpilib_interface",
379 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700380 "//aos/events:event_loop",
Austin Schuh217a9782019-12-21 23:02:50 -0800381 "//aos/events:shm_event_loop",
Austin Schuha0c41ba2020-09-10 22:59:14 -0700382 "//aos/logging",
Austin Schuh45a549f2019-02-02 15:43:56 -0800383 "//aos/stl_mutex",
384 "//aos/time",
385 "//aos/util:phased_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700386 "//frc971/control_loops:control_loops_fbs",
Austin Schuh45a549f2019-02-02 15:43:56 -0800387 "//third_party:wpilib",
Sabina Davisadc58542019-02-01 22:23:00 -0800388 ],
389)
Sabina Davisd004fd62019-02-02 23:51:46 -0800390
391cc_library(
392 name = "drivetrain_writer",
393 srcs = [
394 "drivetrain_writer.cc",
395 ],
396 hdrs = [
397 "drivetrain_writer.h",
398 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800399 target_compatible_with = ["//tools/platforms/hardware:roborio"],
Sabina Davisd004fd62019-02-02 23:51:46 -0800400 deps = [
401 ":loop_output_handler",
402 "//aos:math",
403 "//aos/logging",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700404 "//frc971/control_loops/drivetrain:drivetrain_output_fbs",
Sabina Davisd004fd62019-02-02 23:51:46 -0800405 "//third_party:wpilib",
406 ],
407)
Brian Silverman7be68ba2020-01-08 22:08:40 -0800408
409cc_library(
410 name = "fpga_time_conversion",
411 srcs = [
412 "fpga_time_conversion.cc",
413 ],
414 hdrs = [
415 "fpga_time_conversion.h",
416 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800417 target_compatible_with = ["//tools/platforms/hardware:roborio"],
Brian Silverman7be68ba2020-01-08 22:08:40 -0800418 deps = [
419 "//aos/time",
420 "//aos/util:compiler_memory_barrier",
421 "//third_party:wpilib",
422 "@com_github_google_glog//:glog",
423 ],
424)