blob: c2cdb51b9c83cb390bdb0316c39bbc7dada32f71 [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",
John Park33858a32018-09-28 23:05:48 -0700113 "//aos/logging",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700114 "//aos/robot_state:robot_state_fbs",
Austin Schuh45a549f2019-02-02 15:43:56 -0800115 "//aos/time",
John Park33858a32018-09-28 23:05:48 -0700116 "//aos/util:phased_loop",
Brian Silverman003a4732018-03-11 14:02:15 -0700117 "//frc971/queues:gyro",
118 "//frc971/zeroing:averager",
119 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400120)
121
Alex Perrycb7da4b2019-08-28 19:35:56 -0700122flatbuffer_cc_library(
123 name = "loop_output_handler_test_fbs",
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700124 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700125 "loop_output_handler_test.fbs",
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700126 ],
Austin Schuh00be38c2019-12-01 18:08:25 -0800127 gen_reflections = 1,
128)
129
130aos_config(
Austin Schuhed5b26d2019-12-05 20:51:59 -0800131 name = "config",
132 src = "wpilib_config.json",
133 flatbuffers = [
134 ":pdp_values_fbs",
135 ":logging_fbs",
136 ],
137)
138
139aos_config(
Austin Schuh00be38c2019-12-01 18:08:25 -0800140 name = "loop_output_handler_test_config",
141 src = "loop_output_handler_test_config_source.json",
142 flatbuffers = [
143 ":loop_output_handler_test_fbs",
144 ],
Austin Schuh39788ff2019-12-01 18:22:57 -0800145 deps = [
146 "//aos/events:config",
147 ],
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700148)
149
Brian Silverman100534c2015-09-07 15:51:23 -0400150cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700151 name = "loop_output_handler",
152 srcs = [
153 "loop_output_handler.cc",
154 ],
155 hdrs = [
156 "loop_output_handler.h",
157 ],
158 deps = [
John Park398c74a2018-10-20 21:17:39 -0700159 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700160 "//aos/events:event_loop",
161 "//aos/robot_state:robot_state_fbs",
Austin Schuh45a549f2019-02-02 15:43:56 -0800162 "//aos/scoped:scoped_fd",
163 "//aos/time",
164 "//aos/util:log_interval",
Brian Silverman003a4732018-03-11 14:02:15 -0700165 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400166)
167
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700168cc_test(
169 name = "loop_output_handler_test",
170 srcs = [
171 "loop_output_handler_test.cc",
172 ],
Austin Schuh00be38c2019-12-01 18:08:25 -0800173 data = [
174 "loop_output_handler_test_config.json",
175 ],
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700176 deps = [
177 ":loop_output_handler",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700178 ":loop_output_handler_test_fbs",
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700179 "//aos/events:simulated_event_loop",
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700180 "//aos/testing:googletest",
181 "//aos/testing:test_logging",
182 ],
183)
184
Brian Silverman100534c2015-09-07 15:51:23 -0400185cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700186 name = "joystick_sender",
187 srcs = [
188 "joystick_sender.cc",
189 ],
190 hdrs = [
191 "joystick_sender.h",
192 ],
193 restricted_to = ["//tools:roborio"],
194 deps = [
John Park398c74a2018-10-20 21:17:39 -0700195 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700196 "//aos/events:shm_event_loop",
197 "//aos/input:driver_station_data",
Austin Schuh45a549f2019-02-02 15:43:56 -0800198 "//aos/network:team_number",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700199 "//aos/robot_state:joystick_state_fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700200 "//third_party:wpilib",
201 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400202)
Brian Silverman811f8ec2015-12-06 01:29:42 -0500203
204cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700205 name = "wpilib_interface",
206 srcs = [
207 "wpilib_interface.cc",
208 ],
209 hdrs = [
210 "wpilib_interface.h",
211 ],
212 restricted_to = ["//tools:roborio"],
213 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700214 "//aos/events:event_loop",
215 "//aos/robot_state:robot_state_fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700216 "//third_party:wpilib",
217 ],
Brian Silverman39b339e2016-01-03 13:24:22 -0800218)
219
Alex Perrycb7da4b2019-08-28 19:35:56 -0700220flatbuffer_cc_library(
Austin Schuhed5b26d2019-12-05 20:51:59 -0800221 name = "pdp_values_fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700222 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700223 "pdp_values.fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700224 ],
Austin Schuhed5b26d2019-12-05 20:51:59 -0800225 gen_reflections = 1,
Brian Silverman425492b2015-12-30 15:23:55 -0800226)
227
228cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700229 name = "pdp_fetcher",
230 srcs = [
231 "pdp_fetcher.cc",
232 ],
233 hdrs = [
234 "pdp_fetcher.h",
235 ],
236 restricted_to = ["//tools:roborio"],
237 deps = [
Austin Schuhed5b26d2019-12-05 20:51:59 -0800238 ":pdp_values_fbs",
Austin Schuh45a549f2019-02-02 15:43:56 -0800239 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700240 "//aos/events:event_loop",
John Park33858a32018-09-28 23:05:48 -0700241 "//aos/util:phased_loop",
Brian Silverman003a4732018-03-11 14:02:15 -0700242 "//third_party:wpilib",
243 ],
Brian Silverman811f8ec2015-12-06 01:29:42 -0500244)
Campbell Crowleyc0cfb132015-12-30 20:58:02 -0800245
246cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700247 name = "wpilib_robot_base",
248 hdrs = [
249 "wpilib_robot_base.h",
250 ],
251 restricted_to = ["//tools:roborio"],
252 deps = [
253 "//third_party:wpilib",
254 ],
Campbell Crowleyc0cfb132015-12-30 20:58:02 -0800255)
Brian Silverman5f17a972016-02-28 01:49:32 -0500256
Alex Perrycb7da4b2019-08-28 19:35:56 -0700257flatbuffer_cc_library(
258 name = "imu_fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700259 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700260 "imu.fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700261 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700262 gen_reflections = 1,
Brian Silverman5f17a972016-02-28 01:49:32 -0500263)
264
265cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700266 name = "ADIS16448",
267 srcs = [
268 "ADIS16448.cc",
269 ],
270 hdrs = [
271 "ADIS16448.h",
272 ],
273 restricted_to = ["//tools:roborio"],
274 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700275 ":imu_fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700276 ":spi_rx_clearer",
Austin Schuh45a549f2019-02-02 15:43:56 -0800277 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700278 "//aos/events:event_loop",
John Park33858a32018-09-28 23:05:48 -0700279 "//aos/logging",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700280 "//aos/robot_state:robot_state_fbs",
Austin Schuh45a549f2019-02-02 15:43:56 -0800281 "//aos/time",
Brian Silverman003a4732018-03-11 14:02:15 -0700282 "//frc971/zeroing:averager",
283 "//third_party:wpilib",
284 ],
Brian Silverman5f17a972016-02-28 01:49:32 -0500285)
Brian Silvermanb5b46ca2016-03-13 01:14:17 -0500286
287cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700288 name = "dma",
289 srcs = [
290 "dma.cc",
291 ],
292 hdrs = [
293 "dma.h",
294 ],
295 restricted_to = ["//tools:roborio"],
296 deps = [
297 "//third_party:wpilib",
298 ],
299)
300
301cc_library(
302 name = "spi_rx_clearer",
303 srcs = [
304 "spi_rx_clearer.cc",
305 ],
306 hdrs = [
307 "spi_rx_clearer.h",
308 ],
309 deps = [
John Park33858a32018-09-28 23:05:48 -0700310 "//aos/logging",
Brian Silverman003a4732018-03-11 14:02:15 -0700311 ],
Brian Silvermanb5b46ca2016-03-13 01:14:17 -0500312)
Sabina Davisadc58542019-02-01 22:23:00 -0800313
314cc_library(
315 name = "sensor_reader",
316 srcs = [
317 "sensor_reader.cc",
318 ],
319 hdrs = [
Austin Schuh45a549f2019-02-02 15:43:56 -0800320 "sensor_reader.h",
Sabina Davisadc58542019-02-01 22:23:00 -0800321 ],
322 restricted_to = ["//tools:roborio"],
323 deps = [
Sabina Davis1ffa4172019-02-01 22:38:33 -0800324 ":dma",
325 ":dma_edge_counting",
Austin Schuh54667ac2019-02-02 16:44:49 -0800326 ":encoder_and_potentiometer",
Austin Schuh45a549f2019-02-02 15:43:56 -0800327 ":wpilib_interface",
328 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700329 "//aos/events:event_loop",
Austin Schuh45a549f2019-02-02 15:43:56 -0800330 "//aos/stl_mutex",
331 "//aos/time",
332 "//aos/util:phased_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700333 "//frc971/control_loops:control_loops_fbs",
Austin Schuh45a549f2019-02-02 15:43:56 -0800334 "//third_party:wpilib",
Sabina Davisadc58542019-02-01 22:23:00 -0800335 ],
336)
Sabina Davisd004fd62019-02-02 23:51:46 -0800337
338cc_library(
339 name = "drivetrain_writer",
340 srcs = [
341 "drivetrain_writer.cc",
342 ],
343 hdrs = [
344 "drivetrain_writer.h",
345 ],
346 restricted_to = ["//tools:roborio"],
347 deps = [
348 ":loop_output_handler",
349 "//aos:math",
350 "//aos/logging",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700351 "//frc971/control_loops/drivetrain:drivetrain_output_fbs",
Sabina Davisd004fd62019-02-02 23:51:46 -0800352 "//third_party:wpilib",
353 ],
354)