blob: b7fe837e2d027f2158279e86e4431a1af2323e59 [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")
Brian Silverman100534c2015-09-07 15:51:23 -04004
Alex Perrycb7da4b2019-08-28 19:35:56 -07005flatbuffer_cc_library(
6 name = "logging_fbs",
Brian Silverman003a4732018-03-11 14:02:15 -07007 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -07008 "logging.fbs",
Brian Silverman003a4732018-03-11 14:02:15 -07009 ],
Brian Silverman100534c2015-09-07 15:51:23 -040010)
11
12cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -070013 name = "encoder_and_potentiometer",
14 srcs = [
15 "encoder_and_potentiometer.cc",
16 ],
17 hdrs = [
18 "encoder_and_potentiometer.h",
19 ],
20 restricted_to = ["//tools:roborio"],
21 deps = [
22 ":dma",
23 ":dma_edge_counting",
John Park398c74a2018-10-20 21:17:39 -070024 "//aos:init",
Austin Schuh45a549f2019-02-02 15:43:56 -080025 "//aos/logging",
26 "//aos/mutex",
Brian Silverman003a4732018-03-11 14:02:15 -070027 "//third_party:wpilib",
28 ],
Brian Silverman100534c2015-09-07 15:51:23 -040029)
30
31cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -070032 name = "dma_edge_counting",
33 srcs = [
34 "dma_edge_counting.cc",
35 ],
36 hdrs = [
37 "dma_edge_counting.h",
38 ],
39 restricted_to = ["//tools:roborio"],
40 deps = [
41 ":dma",
John Park33858a32018-09-28 23:05:48 -070042 "//aos/logging",
Brian Silverman003a4732018-03-11 14:02:15 -070043 "//third_party:wpilib",
44 ],
Brian Silverman100534c2015-09-07 15:51:23 -040045)
46
47cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -070048 name = "interrupt_edge_counting",
49 srcs = [
50 "interrupt_edge_counting.cc",
51 ],
52 hdrs = [
53 "interrupt_edge_counting.h",
54 ],
55 restricted_to = ["//tools:roborio"],
56 deps = [
John Park398c74a2018-10-20 21:17:39 -070057 "//aos:init",
Austin Schuh45a549f2019-02-02 15:43:56 -080058 "//aos/logging",
59 "//aos/stl_mutex",
60 "//aos/time",
Brian Silverman003a4732018-03-11 14:02:15 -070061 "//third_party:wpilib",
62 ],
Brian Silverman100534c2015-09-07 15:51:23 -040063)
64
65cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -070066 name = "buffered_pcm",
67 srcs = [
68 "buffered_pcm.cc",
69 "buffered_solenoid.cc",
70 ],
71 hdrs = [
72 "buffered_pcm.h",
73 "buffered_solenoid.h",
74 ],
75 restricted_to = ["//tools:roborio"],
76 deps = [
John Park33858a32018-09-28 23:05:48 -070077 "//aos/logging",
Brian Silverman003a4732018-03-11 14:02:15 -070078 "//third_party:wpilib",
79 ],
Brian Silverman100534c2015-09-07 15:51:23 -040080)
81
82cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -070083 name = "gyro_interface",
84 srcs = [
85 "gyro_interface.cc",
86 ],
87 hdrs = [
88 "gyro_interface.h",
89 ],
90 restricted_to = ["//tools:roborio"],
91 deps = [
John Park33858a32018-09-28 23:05:48 -070092 "//aos/logging",
Austin Schuh45a549f2019-02-02 15:43:56 -080093 "//aos/time",
Brian Silverman003a4732018-03-11 14:02:15 -070094 "//third_party:wpilib",
95 ],
Brian Silverman100534c2015-09-07 15:51:23 -040096)
97
98cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -070099 name = "gyro_sender",
100 srcs = [
101 "gyro_sender.cc",
102 ],
103 hdrs = [
104 "gyro_sender.h",
105 ],
106 restricted_to = ["//tools:roborio"],
107 deps = [
108 ":gyro_interface",
Austin Schuh45a549f2019-02-02 15:43:56 -0800109 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700110 "//aos/events:event_loop",
John Park33858a32018-09-28 23:05:48 -0700111 "//aos/logging",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700112 "//aos/robot_state:robot_state_fbs",
Austin Schuh45a549f2019-02-02 15:43:56 -0800113 "//aos/time",
John Park33858a32018-09-28 23:05:48 -0700114 "//aos/util:phased_loop",
Brian Silverman003a4732018-03-11 14:02:15 -0700115 "//frc971/queues:gyro",
116 "//frc971/zeroing:averager",
117 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400118)
119
Alex Perrycb7da4b2019-08-28 19:35:56 -0700120flatbuffer_cc_library(
121 name = "loop_output_handler_test_fbs",
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700122 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700123 "loop_output_handler_test.fbs",
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700124 ],
125)
126
Brian Silverman100534c2015-09-07 15:51:23 -0400127cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700128 name = "loop_output_handler",
129 srcs = [
130 "loop_output_handler.cc",
131 ],
132 hdrs = [
133 "loop_output_handler.h",
134 ],
135 deps = [
John Park398c74a2018-10-20 21:17:39 -0700136 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700137 "//aos/events:event_loop",
138 "//aos/robot_state:robot_state_fbs",
Austin Schuh45a549f2019-02-02 15:43:56 -0800139 "//aos/scoped:scoped_fd",
140 "//aos/time",
141 "//aos/util:log_interval",
Brian Silverman003a4732018-03-11 14:02:15 -0700142 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400143)
144
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700145cc_test(
146 name = "loop_output_handler_test",
147 srcs = [
148 "loop_output_handler_test.cc",
149 ],
150 deps = [
151 ":loop_output_handler",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700152 ":loop_output_handler_test_fbs",
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700153 "//aos/events:simulated_event_loop",
Austin Schuhbd1fe9c2019-06-29 16:35:48 -0700154 "//aos/testing:googletest",
155 "//aos/testing:test_logging",
156 ],
157)
158
Brian Silverman100534c2015-09-07 15:51:23 -0400159cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700160 name = "joystick_sender",
161 srcs = [
162 "joystick_sender.cc",
163 ],
164 hdrs = [
165 "joystick_sender.h",
166 ],
167 restricted_to = ["//tools:roborio"],
168 deps = [
John Park398c74a2018-10-20 21:17:39 -0700169 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700170 "//aos/events:shm_event_loop",
171 "//aos/input:driver_station_data",
Austin Schuh45a549f2019-02-02 15:43:56 -0800172 "//aos/network:team_number",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700173 "//aos/robot_state:joystick_state_fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700174 "//third_party:wpilib",
175 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400176)
Brian Silverman811f8ec2015-12-06 01:29:42 -0500177
178cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700179 name = "wpilib_interface",
180 srcs = [
181 "wpilib_interface.cc",
182 ],
183 hdrs = [
184 "wpilib_interface.h",
185 ],
186 restricted_to = ["//tools:roborio"],
187 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700188 "//aos/events:event_loop",
189 "//aos/robot_state:robot_state_fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700190 "//third_party:wpilib",
191 ],
Brian Silverman39b339e2016-01-03 13:24:22 -0800192)
193
Alex Perrycb7da4b2019-08-28 19:35:56 -0700194flatbuffer_cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700195 name = "pdp_values",
196 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700197 "pdp_values.fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700198 ],
Brian Silverman425492b2015-12-30 15:23:55 -0800199)
200
201cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700202 name = "pdp_fetcher",
203 srcs = [
204 "pdp_fetcher.cc",
205 ],
206 hdrs = [
207 "pdp_fetcher.h",
208 ],
209 restricted_to = ["//tools:roborio"],
210 deps = [
211 ":pdp_values",
Austin Schuh45a549f2019-02-02 15:43:56 -0800212 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700213 "//aos/events:event_loop",
John Park33858a32018-09-28 23:05:48 -0700214 "//aos/util:phased_loop",
Brian Silverman003a4732018-03-11 14:02:15 -0700215 "//third_party:wpilib",
216 ],
Brian Silverman811f8ec2015-12-06 01:29:42 -0500217)
Campbell Crowleyc0cfb132015-12-30 20:58:02 -0800218
219cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700220 name = "wpilib_robot_base",
221 hdrs = [
222 "wpilib_robot_base.h",
223 ],
224 restricted_to = ["//tools:roborio"],
225 deps = [
226 "//third_party:wpilib",
227 ],
Campbell Crowleyc0cfb132015-12-30 20:58:02 -0800228)
Brian Silverman5f17a972016-02-28 01:49:32 -0500229
Alex Perrycb7da4b2019-08-28 19:35:56 -0700230flatbuffer_cc_library(
231 name = "imu_fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700232 srcs = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700233 "imu.fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700234 ],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700235 gen_reflections = 1,
Brian Silverman5f17a972016-02-28 01:49:32 -0500236)
237
238cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700239 name = "ADIS16448",
240 srcs = [
241 "ADIS16448.cc",
242 ],
243 hdrs = [
244 "ADIS16448.h",
245 ],
246 restricted_to = ["//tools:roborio"],
247 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700248 ":imu_fbs",
Brian Silverman003a4732018-03-11 14:02:15 -0700249 ":spi_rx_clearer",
Austin Schuh45a549f2019-02-02 15:43:56 -0800250 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700251 "//aos/events:event_loop",
John Park33858a32018-09-28 23:05:48 -0700252 "//aos/logging",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700253 "//aos/robot_state:robot_state_fbs",
Austin Schuh45a549f2019-02-02 15:43:56 -0800254 "//aos/time",
Brian Silverman003a4732018-03-11 14:02:15 -0700255 "//frc971/zeroing:averager",
256 "//third_party:wpilib",
257 ],
Brian Silverman5f17a972016-02-28 01:49:32 -0500258)
Brian Silvermanb5b46ca2016-03-13 01:14:17 -0500259
260cc_library(
Brian Silverman003a4732018-03-11 14:02:15 -0700261 name = "dma",
262 srcs = [
263 "dma.cc",
264 ],
265 hdrs = [
266 "dma.h",
267 ],
268 restricted_to = ["//tools:roborio"],
269 deps = [
270 "//third_party:wpilib",
271 ],
272)
273
274cc_library(
275 name = "spi_rx_clearer",
276 srcs = [
277 "spi_rx_clearer.cc",
278 ],
279 hdrs = [
280 "spi_rx_clearer.h",
281 ],
282 deps = [
John Park33858a32018-09-28 23:05:48 -0700283 "//aos/logging",
Brian Silverman003a4732018-03-11 14:02:15 -0700284 ],
Brian Silvermanb5b46ca2016-03-13 01:14:17 -0500285)
Sabina Davisadc58542019-02-01 22:23:00 -0800286
287cc_library(
288 name = "sensor_reader",
289 srcs = [
290 "sensor_reader.cc",
291 ],
292 hdrs = [
Austin Schuh45a549f2019-02-02 15:43:56 -0800293 "sensor_reader.h",
Sabina Davisadc58542019-02-01 22:23:00 -0800294 ],
295 restricted_to = ["//tools:roborio"],
296 deps = [
Sabina Davis1ffa4172019-02-01 22:38:33 -0800297 ":dma",
298 ":dma_edge_counting",
Austin Schuh54667ac2019-02-02 16:44:49 -0800299 ":encoder_and_potentiometer",
Austin Schuh45a549f2019-02-02 15:43:56 -0800300 ":wpilib_interface",
301 "//aos:init",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700302 "//aos/events:event_loop",
Austin Schuh45a549f2019-02-02 15:43:56 -0800303 "//aos/stl_mutex",
304 "//aos/time",
305 "//aos/util:phased_loop",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700306 "//frc971/control_loops:control_loops_fbs",
Austin Schuh45a549f2019-02-02 15:43:56 -0800307 "//third_party:wpilib",
Sabina Davisadc58542019-02-01 22:23:00 -0800308 ],
309)
Sabina Davisd004fd62019-02-02 23:51:46 -0800310
311cc_library(
312 name = "drivetrain_writer",
313 srcs = [
314 "drivetrain_writer.cc",
315 ],
316 hdrs = [
317 "drivetrain_writer.h",
318 ],
319 restricted_to = ["//tools:roborio"],
320 deps = [
321 ":loop_output_handler",
322 "//aos:math",
323 "//aos/logging",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700324 "//frc971/control_loops/drivetrain:drivetrain_output_fbs",
Sabina Davisd004fd62019-02-02 23:51:46 -0800325 "//third_party:wpilib",
326 ],
327)