pros_sys/
adi.rs

1use core::ffi::*;
2
3use crate::error::PROS_ERR;
4
5pub const INTERNAL_ADI_PORT: c_int = 22;
6pub const NUM_ADI_PORTS: c_int = 8;
7pub const HIGH: c_int = 1;
8pub const LOW: c_int = 0;
9pub const INPUT: c_int = 0x00;
10pub const OUTPUT: c_int = 0x01;
11pub const INPUT_ANALOG: c_int = 0x02;
12pub const OUTPUT_ANALOG: c_int = 0x03;
13/** Reference type for an initialized encoder.
14
15This merely contains the port number for the encoder, unlike its use as an
16object to store encoder data in PROS 2.*/
17pub type adi_encoder_t = i32;
18/** Reference type for an initialized ultrasonic.
19
20This merely contains the port number for the ultrasonic, unlike its use as an
21object to store ultrasonic data in PROS 2.*/
22pub type adi_ultrasonic_t = i32;
23/** Reference type for an initialized gyroscope.
24
25This merely contains the port number for the gyroscope, unlike its use as an
26object to store gyro data in PROS 2.*/
27pub type adi_gyro_t = i32;
28/** Reference type for an initialized potentiometer.
29
30This merely contains the port number for the potentiometer, unlike its use as an
31object to store potentiometer data in PROS 2.*/
32pub type adi_potentiometer_t = i32;
33/** Reference type for an initialized addressable led.
34
35This merely contains the port number for the led, unlike its use as an
36object to store led data in PROS 2.*/
37pub type adi_led_t = i32;
38pub const E_ADI_ANALOG_IN: c_int = 0;
39pub const E_ADI_ANALOG_OUT: c_int = 1;
40pub const E_ADI_DIGITAL_IN: c_int = 2;
41pub const E_ADI_DIGITAL_OUT: c_int = 3;
42pub const E_ADI_LEGACY_GYRO: c_int = 10;
43pub const E_ADI_LEGACY_SERVO: c_int = 12;
44pub const E_ADI_LEGACY_PWM: c_int = 13;
45pub const E_ADI_LEGACY_ENCODER: c_int = 14;
46pub const E_ADI_LEGACY_ULTRASONIC: c_int = 15;
47pub const E_ADI_TYPE_UNDEFINED: c_int = 255;
48pub const E_ADI_ERR: c_int = PROS_ERR;
49/// Represents the port type for an ADI port.
50pub type adi_port_config_e_t = c_int;
51pub const E_ADI_POT_EDR: c_int = 0;
52pub const E_ADI_POT_V2: c_int = 1;
53/// Represents the potentiometer version type.
54pub type adi_potentiometer_type_e_t = c_int;
55extern "C" {
56    /** Gets the configuration for the given ADI port.
57
58    This function uses the following values of errno when an error state is
59    reached:
60    ENXIO - The given value is not within the range of ADI Ports.
61
62    \param port
63           The ADI port number (from 1-8, 'a'-'h', 'A'-'H') for which to return
64           the configuration
65
66    \return The ADI configuration for the given port*/
67    pub fn adi_port_get_config(port: u8) -> adi_port_config_e_t;
68    /** Gets the value for the given ADI port.
69
70    This function uses the following values of errno when an error state is
71    reached:
72    ENXIO - The given value is not within the range of ADI Ports.
73
74    \param port
75           The ADI port number (from 1-8, 'a'-'h', 'A'-'H') for which the value
76           will be returned
77
78    \return The value stored for the given port*/
79    pub fn adi_port_get_value(port: u8) -> i32;
80    /** Configures an ADI port to act as a given sensor type.
81
82    This function uses the following values of errno when an error state is
83    reached:
84    ENXIO - The given value is not within the range of ADI Ports.
85
86    \param port
87           The ADI port number (from 1-8, 'a'-'h', 'A'-'H') to configure
88    \param type
89           The configuration type for the port
90
91    \return 1 if the operation was successful or PROS_ERR if the operation
92    failed, setting errno.*/
93    pub fn adi_port_set_config(port: u8, config: adi_port_config_e_t) -> i32;
94    /** Sets the value for the given ADI port.
95
96    This only works on ports configured as outputs, and the behavior will change
97    depending on the configuration of the port.
98
99    This function uses the following values of errno when an error state is
100    reached:
101    ENXIO  - The given value is not within the range of ADI Ports.
102
103    \param port
104           The ADI port number (from 1-8, 'a'-'h', 'A'-'H') for which the value
105           will be set
106    \param value
107           The value to set the ADI port to
108
109    \return 1 if the operation was successful or PROS_ERR if the operation
110    failed, setting errno.*/
111    pub fn adi_port_set_value(port: u8, value: i32) -> i32;
112    /** Calibrates the analog sensor on the specified port and returns the new
113    calibration value.
114
115    This method assumes that the true sensor value is not actively changing at
116    this time and computes an average from approximately 500 samples, 1 ms apart,
117    for a 0.5 s period of calibration. The average value thus calculated is
118    returned and stored for later calls to the adi_analog_read_calibrated() and
119    adi_analog_read_calibrated_HR() functions. These functions will return
120    the difference between this value and the current sensor value when called.
121
122    Do not use this function when the sensor value might be unstable
123    (gyro rotation, accelerometer movement).
124
125    This function uses the following values of errno when an error state is
126    reached:
127    ENXIO - The given value is not within the range of ADI Ports
128
129    \param port
130           The ADI port to calibrate (from 1-8, 'a'-'h', 'A'-'H')
131
132    \return The average sensor value computed by this function*/
133    pub fn adi_analog_calibrate(port: u8) -> i32;
134    /** Gets the 12-bit value of the specified port.
135
136    The value returned is undefined if the analog pin has been switched to a
137    different mode.
138
139    This function uses the following values of errno when an error state is
140    reached:
141    ENXIO - The given value is not within the range of ADI Ports
142    EADDRINUSE - The port is not configured as an analog input
143
144    \param port
145           The ADI port (from 1-8, 'a'-'h', 'A'-'H') for which the value will be
146           returned
147
148    \return The analog sensor value, where a value of 0 reflects an input voltage
149    of nearly 0 V and a value of 4095 reflects an input voltage of nearly 5 V*/
150    pub fn adi_analog_read(port: u8) -> i32;
151    /** Gets the 12 bit calibrated value of an analog input port.
152
153    The adi_analog_calibrate() function must be run first. This function is
154    inappropriate for sensor values intended for integration, as round-off error
155    can accumulate causing drift over time. Use adi_analog_read_calibrated_HR()
156    instead.
157
158    This function uses the following values of errno when an error state is
159    reached:
160    ENXIO - The given value is not within the range of ADI Ports
161    EADDRINUSE - The port is not configured as an analog input
162
163    \param port
164           The ADI port (from 1-8, 'a'-'h', 'A'-'H') for which the value will be
165           returned
166
167    \return The difference of the sensor value from its calibrated default from
168    -4095 to 4095*/
169    pub fn adi_analog_read_calibrated(port: u8) -> i32;
170    /** Gets the 16 bit calibrated value of an analog input port.
171
172    The adi_analog_calibrate() function must be run first. This is intended for
173    integrated sensor values such as gyros and accelerometers to reduce drift due
174    to round-off, and should not be used on a sensor such as a line tracker
175    or potentiometer.
176
177    The value returned actually has 16 bits of "precision", even though the ADC
178    only reads 12 bits, so that error induced by the average value being between
179    two values when integrated over time is trivial. Think of the value as the
180    true value times 16.
181
182    This function uses the following values of errno when an error state is
183    reached:
184    ENXIO - The given value is not within the range of ADI Ports
185    EADDRINUSE - The port is not configured as an analog input
186
187    \param port
188           The ADI port (from 1-8, 'a'-'h', 'A'-'H') for which the value will be
189           returned
190
191    \return The difference of the sensor value from its calibrated default from
192    -16384 to 16384*/
193    pub fn adi_analog_read_calibrated_HR(port: u8) -> i32;
194    /** Gets the digital value (1 or 0) of a port configured as a digital input.
195
196    If the port is configured as some other mode, the digital value which
197    reflects the current state of the port is returned, which may or may not
198    differ from the currently set value. The return value is undefined for ports
199    configured as any mode other than a Digital Input.
200
201    This function uses the following values of errno when an error state is
202    reached:
203    ENXIO - The given value is not within the range of ADI Ports
204    EADDRINUSE - The port is not configured as a digital input
205
206    \param port
207           The ADI port to read (from 1-8, 'a'-'h', 'A'-'H')
208
209    \return True if the pin is HIGH, or false if it is LOW*/
210    pub fn adi_digital_read(port: u8) -> i32;
211    /** Gets a rising-edge case for a digital button press.
212
213    This function is not thread-safe.
214    Multiple tasks polling a single button may return different results under the
215    same circumstances, so only one task should call this function for any given
216    button. E.g., Task A calls this function for buttons 1 and 2. Task B may call
217    this function for button 3, but should not for buttons 1 or 2. A typical
218    use-case for this function is to call inside opcontrol to detect new button
219    presses, and not in any other tasks.
220
221    This function uses the following values of errno when an error state is
222    reached:
223    ENXIO - The given value is not within the range of ADI Ports
224    EADDRINUSE - The port is not configured as a digital input
225
226    \param port
227           The ADI port to read (from 1-8, 'a'-'h', 'A'-'H')
228
229    \return 1 if the button is pressed and had not been pressed
230    the last time this function was called, 0 otherwise.*/
231    pub fn adi_digital_get_new_press(port: u8) -> i32;
232    /** Sets the digital value (1 or 0) of a port configured as a digital output.
233
234    If the port is configured as some other mode, behavior is undefined.
235
236    This function uses the following values of errno when an error state is
237    reached:
238    ENXIO - The given value is not within the range of ADI Ports
239    EADDRINUSE - The port is not configured as a digital output
240
241    \param port
242           The ADI port to read (from 1-8, 'a'-'h', 'A'-'H')
243    \param value
244           An expression evaluating to "true" or "false" to set the output to
245           HIGH or LOW respectively, or the constants HIGH or LOW themselves
246
247    \return 1 if the operation was successful or PROS_ERR if the operation
248    failed, setting errno.*/
249    pub fn adi_digital_write(port: u8, value: bool) -> i32;
250    /** Configures the port as an input or output with a variety of settings.
251
252    This function uses the following values of errno when an error state is
253    reached:
254    ENXIO - The given value is not within the range of ADI Ports
255
256    \param port
257           The ADI port to read (from 1-8, 'a'-'h', 'A'-'H')
258    \param mode
259           One of INPUT, INPUT_ANALOG, INPUT_FLOATING, OUTPUT, or OUTPUT_OD
260
261    \return 1 if the operation was successful or PROS_ERR if the operation
262    failed, setting errno.*/
263    pub fn adi_pin_mode(port: u8, mode: u8) -> i32;
264    /** Sets the speed of the motor on the given port.
265
266    This function uses the following values of errno when an error state is
267    reached:
268    ENXIO - The given value is not within the range of ADI Ports
269    EADDRINUSE - The port is not configured as an motor
270
271    \param port
272           The ADI port to set (from 1-8, 'a'-'h', 'A'-'H')
273    \param speed
274           The new signed speed; -127 is full reverse and 127 is full forward,
275           with 0 being off
276
277    \return 1 if the operation was successful or PROS_ERR if the operation
278    failed, setting errno.*/
279    pub fn adi_motor_set(port: u8, speed: i8) -> i32;
280    /** Gets the last set speed of the motor on the given port.
281
282    This function uses the following values of errno when an error state is
283    reached:
284    ENXIO - The given value is not within the range of ADI Ports
285    EADDRINUSE - The port is not configured as an motor
286
287    \param port
288           The ADI port to get (from 1-8, 'a'-'h', 'A'-'H')
289
290    \return The last set speed of the motor on the given port*/
291    pub fn adi_motor_get(port: u8) -> i32;
292    /** Stops the motor on the given port.
293
294    This function uses the following values of errno when an error state is
295    reached:
296    ENXIO - The given value is not within the range of ADI Ports
297    EADDRINUSE - The port is not configured as an motor
298
299    \param port
300           The ADI port to set (from 1-8, 'a'-'h', 'A'-'H')
301
302    \return 1 if the operation was successful or PROS_ERR if the operation
303    failed, setting errno.*/
304    pub fn adi_motor_stop(port: u8) -> i32;
305    /** Gets the number of ticks recorded by the encoder.
306
307    There are 360 ticks in one revolution.
308
309    This function uses the following values of errno when an error state is
310    reached:
311    ENXIO - The given value is not within the range of ADI Ports
312    EADDRINUSE - The port is not configured as an encoder
313
314
315    \param enc
316           The adi_encoder_t object from adi_encoder_init() to read
317
318    \return The signed and cumulative number of counts since the last start or
319    reset*/
320    pub fn adi_encoder_get(enc: adi_encoder_t) -> i32;
321    /** Creates an encoder object and configures the specified ports accordingly.
322
323    This function uses the following values of errno when an error state is
324    reached:
325    ENXIO - The given value is not within the range of ADI Ports
326    EADDRINUSE - The port is not configured as an encoder
327
328
329    \param port_top
330           The "top" wire from the encoder sensor with the removable cover side
331           up. This should be in port 1, 3, 5, or 7 ('A', 'C', 'E', or 'G').
332    \param port_bottom
333           The "bottom" wire from the encoder sensor
334    \param reverse
335           If "true", the sensor will count in the opposite direction
336
337    \return An adi_encoder_t object to be stored and used for later calls to
338    encoder functions*/
339    pub fn adi_encoder_init(port_top: u8, port_bottom: u8, reverse: bool) -> i32;
340    /** Sets the encoder value to zero.
341
342    It is safe to use this method while an encoder is enabled. It is not
343    necessary to call this method before stopping or starting an encoder.
344
345    This function uses the following values of errno when an error state is
346    reached:
347    ENXIO - The given value is not within the range of ADI Ports
348    EADDRINUSE - The port is not configured as an encoder
349
350
351    \param enc
352           The adi_encoder_t object from adi_encoder_init() to reset
353
354    \return 1 if the operation was successful or PROS_ERR if the operation
355    failed, setting errno.*/
356    pub fn adi_encoder_reset(enc: adi_encoder_t) -> i32;
357    /** Disables the encoder and voids the configuration on its ports.
358
359    This function uses the following values of errno when an error state is
360    reached:
361    ENXIO - The given value is not within the range of ADI Ports
362    EADDRINUSE - The port is not configured as an encoder
363
364    \param enc
365           The adi_encoder_t object from adi_encoder_init() to stop
366
367    \return 1 if the operation was successful or PROS_ERR if the operation
368    failed, setting errno.*/
369    pub fn adi_encoder_shutdown(enc: adi_encoder_t) -> i32;
370    /** Gets the current ultrasonic sensor value in centimeters.
371
372    If no object was found, zero is returned. If the ultrasonic sensor was never
373    started, the return value is undefined. Round and fluffy objects can cause
374    inaccurate values to be returned.
375
376    This function uses the following values of errno when an error state is
377    reached:
378    ENXIO - The given value is not within the range of ADI Ports
379    EADDRINUSE - The port is not configured as an ultrasonic
380
381    \param ult
382           The adi_ultrasonic_t object from adi_ultrasonic_init() to read
383
384    \return The distance to the nearest object in m^-4 (10000 indicates 1 meter),
385    measured from the sensor's mounting points.*/
386    pub fn adi_ultrasonic_get(ult: adi_ultrasonic_t) -> i32;
387    /** Creates an ultrasonic object and configures the specified ports accordingly.
388
389    This function uses the following values of errno when an error state is
390    reached:
391    ENXIO - The given value is not within the range of ADI Ports
392    EADDRINUSE - The port is not configured as an ultrasonic
393
394    \param port_ping
395           The port connected to the orange OUTPUT cable. This should be in port
396           1, 3, 5, or 7 ('A', 'C', 'E', 'G').
397    \param port_echo
398           The port connected to the yellow INPUT cable. This should be in the
399           next highest port following port_ping.
400
401    \return An adi_ultrasonic_t object to be stored and used for later calls to
402    ultrasonic functions*/
403    pub fn adi_ultrasonic_init(port_ping: u8, port_echo: u8) -> adi_ultrasonic_t;
404    /** Disables the ultrasonic sensor and voids the configuration on its ports.
405
406    This function uses the following values of errno when an error state is
407    reached:
408    ENXIO - The given value is not within the range of ADI Ports
409    EADDRINUSE - The port is not configured as an ultrasonic
410
411    \param ult
412           The adi_ultrasonic_t object from adi_ultrasonic_init() to stop
413
414    \return 1 if the operation was successful or PROS_ERR if the operation
415    failed, setting errno.*/
416    pub fn adi_ultrasonic_shutdown(ult: adi_ultrasonic_t) -> i32;
417    /** Gets the current gyro angle in tenths of a degree. Unless a multiplier is
418    applied to the gyro, the return value will be a whole number representing
419    the number of degrees of rotation times 10.
420
421    There are 360 degrees in a circle, thus the gyro will return 3600 for one
422    whole rotation.
423
424    This function uses the following values of errno when an error state is
425    reached:
426    ENXIO - The given value is not within the range of ADI Ports
427    EADDRINUSE - The port is not configured as a gyro
428
429    \param gyro
430           The adi_gyro_t object for which the angle will be returned
431
432    \return The gyro angle in degrees.*/
433    pub fn adi_gyro_get(gyro: adi_gyro_t) -> c_double;
434    /** Initializes a gyroscope on the given port. If the given port has not
435    previously been configured as a gyro, then this function starts a 1300 ms
436    calibration period.
437
438    It is highly recommended that this function be called from initialize() when
439    the robot is stationary to ensure proper calibration.
440
441    This function uses the following values of errno when an error state is
442    reached:
443    ENXIO - The given value is not within the range of ADI Ports
444    EADDRINUSE - The port is not configured as a gyro
445
446    \param port
447           The ADI port to initialize as a gyro (from 1-8, 'a'-'h', 'A'-'H')
448    \param multiplier
449           A scalar value that will be multiplied by the gyro heading value
450           supplied by the ADI
451
452    \return An adi_gyro_t object containing the given port, or PROS_ERR if the
453    initialization failed.*/
454    pub fn adi_gyro_init(port: u8, multiplier: c_double) -> adi_gyro_t;
455    /** Resets the gyroscope value to zero.
456
457    This function uses the following values of errno when an error state is
458    reached:
459    ENXIO - The given value is not within the range of ADI Ports
460    EADDRINUSE - The port is not configured as a gyro
461
462    \param gyro
463           The adi_gyro_t object for which the angle will be returned
464
465    \return 1 if the operation was successful or PROS_ERR if the operation
466    failed, setting errno.*/
467    pub fn adi_gyro_reset(gyro: adi_gyro_t) -> i32;
468    /** Disables the gyro and voids the configuration on its port.
469
470    This function uses the following values of errno when an error state is
471    reached:
472    ENXIO - The given value is not within the range of ADI Ports
473    EADDRINUSE - The port is not configured as a gyro
474
475    \param gyro
476           The adi_gyro_t object to be shut down
477
478    \return 1 if the operation was successful or PROS_ERR if the operation
479    failed, setting errno.*/
480    pub fn adi_gyro_shutdown(gyro: adi_gyro_t) -> i32;
481    /** Initializes a potentiometer on the given port of the original potentiometer.
482
483    This function uses the following values of errno when an error state is
484    reached:
485    ENXIO - The given value is not within the range of ADI Ports
486    EADDRINUSE - The port is not configured as a potentiometer
487
488    \param port
489           The ADI port to initialize as a gyro (from 1-8, 'a'-'h', 'A'-'H')
490
491    \return An adi_potentiometer_t object containing the given port, or PROS_ERR if the
492    initialization failed.*/
493    pub fn adi_potentiometer_init(port: u8) -> adi_potentiometer_t;
494    /** Initializes a potentiometer on the given port.
495
496    This function uses the following values of errno when an error state is
497    reached:
498    ENXIO - The given value is not within the range of ADI Ports
499    EADDRINUSE - The port is not configured as a potentiometer
500
501    \param port
502           The ADI port to initialize as a gyro (from 1-8, 'a'-'h', 'A'-'H')
503    \param potentiometer_type
504           An adi_potentiometer_type_e_t enum value specifying the potentiometer version type
505
506    \return An adi_potentiometer_t object containing the given port, or PROS_ERR if the
507    initialization failed.*/
508    pub fn adi_potentiometer_type_init(
509        port: u8,
510        pot_type: adi_potentiometer_type_e_t,
511    ) -> adi_potentiometer_t;
512    /** Gets the current potentiometer angle in tenths of a degree.
513
514    The original potentiometer rotates 250 degrees thus returning an angle between 0-250 degrees.
515    Potentiometer V2 rotates 330 degrees thus returning an angle between 0-330 degrees.
516
517    This function uses the following values of errno when an error state is
518    reached:
519    ENXIO - The given value is not within the range of ADI Ports
520    EADDRINUSE - The port is not configured as a potentiometer
521
522    \param potentiometer
523           The adi_potentiometer_t object for which the angle will be returned
524
525    \return The potentiometer angle in degrees.*/
526    pub fn adi_potentiometer_get_angle(potentiometer: adi_potentiometer_t) -> c_double;
527    /** Initializes a led on the given port of the original led.
528
529    This function uses the following values of errno when an error state is
530    reached:
531    ENXIO - The given value is not within the range of ADI Ports
532    EINVAL - The ADI port given is not a valid port as defined below
533    EADDRINUSE - The port is not configured for ADI output
534
535    \param port
536           The ADI port to initialize as a led (from 1-8, 'a'-'h', 'A'-'H')
537
538    \return An adi_led_t object containing the given port, or PROS_ERR if the
539    initialization failed, setting errno*/
540    pub fn adi_led_init(port: u8) -> adi_led_t;
541    /** @brief Clear the entire led strip of color
542
543    This function uses the following values of errno when an error state is
544    reached:
545    ENXIO - The given value is not within the range of ADI Ports
546    EINVAL - A given value is not correct, or the buffer is null
547    EADDRINUSE - The port is not configured for ADI output
548
549    @param led port of type adi_led_t
550    @param buffer array of colors in format 0xRRGGBB, recommended that individual RGB value not to exceed 0x80 due to current draw
551    @param buffer_length length of buffer to clear
552    @return PROS_SUCCESS if successful, PROS_ERR if not*/
553    pub fn adi_led_clear_all(led: adi_led_t, buffer: *const u32, buffer_length: u32) -> i32;
554    /** @brief Set the entire led strip using the colors contained in the buffer
555
556    This function uses the following values of errno when an error state is
557    reached:
558    ENXIO - The given value is not within the range of ADI Ports
559    EINVAL - A given value is not correct, or the buffer is null
560    EADDRINUSE - The port is not configured for ADI output
561
562    @param led port of type adi_led_t
563    @param buffer array of colors in format 0xRRGGBB, recommended that individual RGB value not to exceed 0x80 due to current draw
564    @param buffer_length length of buffer to clear
565    @return PROS_SUCCESS if successful, PROS_ERR if not*/
566    pub fn adi_led_set(led: adi_led_t, buffer: *const u32, buffer_length: u32) -> i32;
567    /** @brief Set the entire led strip to one color
568
569    This function uses the following values of errno when an error state is
570    reached:
571    ENXIO - The given value is not within the range of ADI Ports
572    EINVAL - A given value is not correct, or the buffer is null
573    EADDRINUSE - The port is not configured for ADI output
574
575    @param led port of type adi_led_t
576    @param buffer array of colors in format 0xRRGGBB, recommended that individual RGB value not to exceed 0x80 due to current draw
577    @param buffer_length length of buffer to clear
578    @param color color to set all the led strip value to
579    @return PROS_SUCCESS if successful, PROS_ERR if not*/
580    pub fn adi_led_set_all(
581        led: adi_led_t,
582        buffer: *const u32,
583        buffer_length: u32,
584        color: u32,
585    ) -> i32;
586    /** @brief Set one pixel on the led strip
587
588    This function uses the following values of errno when an error state is
589    reached:
590    ENXIO - The given value is not within the range of ADI Ports
591    EINVAL - A given value is not correct, or the buffer is null
592    EADDRINUSE - The port is not configured for ADI output
593
594    @param led port of type adi_led_t
595    @param buffer array of colors in format 0xRRGGBB, recommended that individual RGB value not to exceed 0x80 due to current draw
596    @param buffer_length length of the input buffer
597    @param color color to clear all the led strip to
598    @param pixel_position position of the pixel to clear
599    @return PROS_SUCCESS if successful, PROS_ERR if not*/
600    pub fn adi_led_set_pixel(
601        led: adi_led_t,
602        buffer: *const u32,
603        buffer_length: u32,
604        color: u32,
605        pixel_position: u32,
606    ) -> i32;
607    /** @brief Clear the entire led strip of color
608
609    This function uses the following values of errno when an error state is
610    reached:
611    ENXIO - The given value is not within the range of ADI Ports
612    EINVAL - A given value is not correct, or the buffer is null
613    EADDRINUSE - The port is not configured for ADI output
614
615    @param led port of type adi_led_t
616    @param buffer array of colors in format 0xRRGGBB, recommended that individual RGB value not to exceed 0x80 due to current draw
617    @param buffer_length length of buffer to clear
618    @return PROS_SUCCESS if successful, PROS_ERR if not*/
619    pub fn adi_led_clear_pixel(
620        led: adi_led_t,
621        buffer: *const u32,
622        buffer_length: u32,
623        pixel_position: u32,
624    ) -> i32;
625}