blob: 48fda81b7d04d18c0e65b4c1ed0013f3a4cccdcf [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,
Brian Silverman100534c2015-09-07 15:51:23 -040012)
13
14cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -070015 name = "encoder_and_potentiometer",
16 srcs = [
17 "encoder_and_potentiometer.cc",
18 ],
19 hdrs = [
20 "encoder_and_potentiometer.h",
21 ],
22 restricted_to = ["//tools:roborio"],
23 deps = [
24 ":dma",
25 ":dma_edge_counting",
John Park398c74a2018-10-20 21:17:39 -070026 "//aos:init",
Austin Schuh45a549f2019-02-02 15:43:56 -080027 "//aos/logging",
28 "//aos/mutex",
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 ],
41 restricted_to = ["//tools:roborio"],
42 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 ],
57 restricted_to = ["//tools:roborio"],
58 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 ],
77 restricted_to = ["//tools:roborio"],
78 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 ],
92 restricted_to = ["//tools:roborio"],
93 deps = [
John Park33858a32018-09-28 23:05:48 -070094 "//aos/logging",
Austin Schuh45a549f2019-02-02 15:43:56 -080095 "//aos/time",
Brian Silverman003a4732018-03-11 14:02:15 -070096 "//third_party:wpilib",
97 ],
Brian Silverman100534c2015-09-07 15:51:23 -040098)
99
100cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700101 name = "gyro_sender",
102 srcs = [
103 "gyro_sender.cc",
104 ],
105 hdrs = [
106 "gyro_sender.h",
107 ],
108 restricted_to = ["//tools:roborio"],
109 deps = [
110 ":gyro_interface",
Austin Schuh45a549f2019-02-02 15:43:56 -0800111 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700112 "//aos/events:event_loop",
Austin Schuh217a9782019-12-21 23:02:50 -0800113 "//aos/events:shm_event_loop",
John Park33858a32018-09-28 23:05:48 -0700114 "//aos/logging",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700115 "//aos/robot_state:robot_state_fbs",
Austin Schuh45a549f2019-02-02 15:43:56 -0800116 "//aos/time",
John Park33858a32018-09-28 23:05:48 -0700117 "//aos/util:phased_loop",
Brian Silverman003a4732018-03-11 14:02:15 -0700118 "//frc971/queues:gyro",
119 "//frc971/zeroing:averager",
120 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400121)
122
Alex Perrycb7da4b2019-08-28 19:35:56 -0700123flatbuffer_cc_library(
124 name = "loop_output_handler_test_fbs",
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700125 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700126 "loop_output_handler_test.fbs",
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700127 ],
Austin Schuh00be38c2019-12-01 18:08:25 -0800128 gen_reflections = 1,
129)
130
131aos_config(
Austin Schuhed5b26d2019-12-05 20:51:59 -0800132 name = "config",
133 src = "wpilib_config.json",
134 flatbuffers = [
135 ":pdp_values_fbs",
136 ":logging_fbs",
137 ],
138)
139
140aos_config(
Austin Schuh00be38c2019-12-01 18:08:25 -0800141 name = "loop_output_handler_test_config",
142 src = "loop_output_handler_test_config_source.json",
143 flatbuffers = [
144 ":loop_output_handler_test_fbs",
145 ],
Austin Schuh39788ff2019-12-01 18:22:57 -0800146 deps = [
147 "//aos/events:config",
148 ],
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700149)
150
Brian Silverman100534c2015-09-07 15:51:23 -0400151cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700152 name = "loop_output_handler",
153 srcs = [
154 "loop_output_handler.cc",
155 ],
156 hdrs = [
157 "loop_output_handler.h",
158 ],
159 deps = [
John Park398c74a2018-10-20 21:17:39 -0700160 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700161 "//aos/events:event_loop",
162 "//aos/robot_state:robot_state_fbs",
Austin Schuh45a549f2019-02-02 15:43:56 -0800163 "//aos/scoped:scoped_fd",
164 "//aos/time",
165 "//aos/util:log_interval",
Brian Silverman003a4732018-03-11 14:02:15 -0700166 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400167)
168
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700169cc_test(
170 name = "loop_output_handler_test",
171 srcs = [
172 "loop_output_handler_test.cc",
173 ],
Austin Schuh00be38c2019-12-01 18:08:25 -0800174 data = [
175 "loop_output_handler_test_config.json",
176 ],
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700177 deps = [
178 ":loop_output_handler",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700179 ":loop_output_handler_test_fbs",
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700180 "//aos/events:simulated_event_loop",
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700181 "//aos/testing:googletest",
182 "//aos/testing:test_logging",
183 ],
184)
185
Brian Silverman100534c2015-09-07 15:51:23 -0400186cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700187 name = "joystick_sender",
188 srcs = [
189 "joystick_sender.cc",
190 ],
191 hdrs = [
192 "joystick_sender.h",
193 ],
194 restricted_to = ["//tools:roborio"],
195 deps = [
John Park398c74a2018-10-20 21:17:39 -0700196 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700197 "//aos/events:shm_event_loop",
198 "//aos/input:driver_station_data",
Austin Schuh45a549f2019-02-02 15:43:56 -0800199 "//aos/network:team_number",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700200 "//aos/robot_state:joystick_state_fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700201 "//third_party:wpilib",
202 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400203)
Brian Silverman811f8ec2015-12-06 01:29:42 -0500204
205cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700206 name = "wpilib_interface",
207 srcs = [
208 "wpilib_interface.cc",
209 ],
210 hdrs = [
211 "wpilib_interface.h",
212 ],
213 restricted_to = ["//tools:roborio"],
214 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700215 "//aos/events:event_loop",
216 "//aos/robot_state:robot_state_fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700217 "//third_party:wpilib",
218 ],
Brian Silverman39b339e2016-01-03 13:24:22 -0800219)
220
Alex Perrycb7da4b2019-08-28 19:35:56 -0700221flatbuffer_cc_library(
Austin Schuhed5b26d2019-12-05 20:51:59 -0800222 name = "pdp_values_fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700223 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700224 "pdp_values.fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700225 ],
Austin Schuhed5b26d2019-12-05 20:51:59 -0800226 gen_reflections = 1,
Brian Silverman425492b2015-12-30 15:23:55 -0800227)
228
229cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700230 name = "pdp_fetcher",
231 srcs = [
232 "pdp_fetcher.cc",
233 ],
234 hdrs = [
235 "pdp_fetcher.h",
236 ],
237 restricted_to = ["//tools:roborio"],
238 deps = [
Austin Schuhed5b26d2019-12-05 20:51:59 -0800239 ":pdp_values_fbs",
Austin Schuh45a549f2019-02-02 15:43:56 -0800240 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700241 "//aos/events:event_loop",
Austin Schuh217a9782019-12-21 23:02:50 -0800242 "//aos/events:shm_event_loop",
John Park33858a32018-09-28 23:05:48 -0700243 "//aos/util:phased_loop",
Brian Silverman003a4732018-03-11 14:02:15 -0700244 "//third_party:wpilib",
245 ],
Brian Silverman811f8ec2015-12-06 01:29:42 -0500246)
Campbell Crowleyc0cfb132015-12-30 20:58:02 -0800247
248cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700249 name = "wpilib_robot_base",
250 hdrs = [
251 "wpilib_robot_base.h",
252 ],
253 restricted_to = ["//tools:roborio"],
254 deps = [
255 "//third_party:wpilib",
256 ],
Campbell Crowleyc0cfb132015-12-30 20:58:02 -0800257)
Brian Silverman5f17a972016-02-28 01:49:32 -0500258
Alex Perrycb7da4b2019-08-28 19:35:56 -0700259flatbuffer_cc_library(
260 name = "imu_fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700261 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700262 "imu.fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700263 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700264 gen_reflections = 1,
Brian Silverman5f17a972016-02-28 01:49:32 -0500265)
266
267cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700268 name = "ADIS16448",
269 srcs = [
270 "ADIS16448.cc",
271 ],
272 hdrs = [
273 "ADIS16448.h",
274 ],
275 restricted_to = ["//tools:roborio"],
276 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700277 ":imu_fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700278 ":spi_rx_clearer",
Austin Schuh45a549f2019-02-02 15:43:56 -0800279 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700280 "//aos/events:event_loop",
Austin Schuh217a9782019-12-21 23:02:50 -0800281 "//aos/events:shm_event_loop",
John Park33858a32018-09-28 23:05:48 -0700282 "//aos/logging",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700283 "//aos/robot_state:robot_state_fbs",
Austin Schuh45a549f2019-02-02 15:43:56 -0800284 "//aos/time",
Brian Silverman003a4732018-03-11 14:02:15 -0700285 "//frc971/zeroing:averager",
286 "//third_party:wpilib",
287 ],
Brian Silverman5f17a972016-02-28 01:49:32 -0500288)
Brian Silvermanb5b46ca2016-03-13 01:14:17 -0500289
290cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700291 name = "dma",
292 srcs = [
293 "dma.cc",
294 ],
295 hdrs = [
296 "dma.h",
297 ],
298 restricted_to = ["//tools:roborio"],
299 deps = [
300 "//third_party:wpilib",
301 ],
302)
303
304cc_library(
305 name = "spi_rx_clearer",
306 srcs = [
307 "spi_rx_clearer.cc",
308 ],
309 hdrs = [
310 "spi_rx_clearer.h",
311 ],
312 deps = [
John Park33858a32018-09-28 23:05:48 -0700313 "//aos/logging",
Brian Silverman003a4732018-03-11 14:02:15 -0700314 ],
Brian Silvermanb5b46ca2016-03-13 01:14:17 -0500315)
Sabina Davisadc58542019-02-01 22:23:00 -0800316
317cc_library(
318 name = "sensor_reader",
319 srcs = [
320 "sensor_reader.cc",
321 ],
322 hdrs = [
Austin Schuh45a549f2019-02-02 15:43:56 -0800323 "sensor_reader.h",
Sabina Davisadc58542019-02-01 22:23:00 -0800324 ],
325 restricted_to = ["//tools:roborio"],
326 deps = [
Sabina Davis1ffa4172019-02-01 22:38:33 -0800327 ":dma",
328 ":dma_edge_counting",
Austin Schuh54667ac2019-02-02 16:44:49 -0800329 ":encoder_and_potentiometer",
Austin Schuh45a549f2019-02-02 15:43:56 -0800330 ":wpilib_interface",
331 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700332 "//aos/events:event_loop",
Austin Schuh217a9782019-12-21 23:02:50 -0800333 "//aos/events:shm_event_loop",
Austin Schuh45a549f2019-02-02 15:43:56 -0800334 "//aos/stl_mutex",
335 "//aos/time",
336 "//aos/util:phased_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700337 "//frc971/control_loops:control_loops_fbs",
Austin Schuh45a549f2019-02-02 15:43:56 -0800338 "//third_party:wpilib",
Sabina Davisadc58542019-02-01 22:23:00 -0800339 ],
340)
Sabina Davisd004fd62019-02-02 23:51:46 -0800341
342cc_library(
343 name = "drivetrain_writer",
344 srcs = [
345 "drivetrain_writer.cc",
346 ],
347 hdrs = [
348 "drivetrain_writer.h",
349 ],
350 restricted_to = ["//tools:roborio"],
351 deps = [
352 ":loop_output_handler",
353 "//aos:math",
354 "//aos/logging",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700355 "//frc971/control_loops/drivetrain:drivetrain_output_fbs",
Sabina Davisd004fd62019-02-02 23:51:46 -0800356 "//third_party:wpilib",
357 ],
358)