pros/ext_adi.h file

Contents

Contains prototypes for interfacing with the 3-Wire Expander.

This file should not be modified by users, since it gets replaced whenever a kernel upgrade occurs.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Namespaces

namespace pros
LLEMU Conditional Include
namespace pros::c

Functions

adi_port_config_e_t ext_adi_port_get_config(uint8_t smart_port, uint8_t adi_port)
General ADI Use Functions
int32_t ext_adi_port_get_value(uint8_t smart_port, uint8_t adi_port)
Gets the value for the given ADI port.
int32_t ext_adi_port_set_config(uint8_t smart_port, uint8_t adi_port, adi_port_config_e_t type)
Configures an ADI port to act as a given sensor type.
int32_t ext_adi_port_set_value(uint8_t smart_port, uint8_t adi_port, int32_t value)
Sets the value for the given ADI port.
int32_t ext_adi_analog_calibrate(uint8_t smart_port, uint8_t adi_port)
Calibrates the analog sensor on the specified port and returns the new calibration value.
int32_t ext_adi_analog_read(uint8_t smart_port, uint8_t adi_port)
Gets the 12-bit value of the specified port.
int32_t ext_adi_analog_read_calibrated(uint8_t smart_port, uint8_t adi_port)
Gets the 12 bit calibrated value of an analog input port.
int32_t ext_adi_analog_read_calibrated_HR(uint8_t smart_port, uint8_t adi_port)
Gets the 16 bit calibrated value of an analog input port.
int32_t ext_adi_digital_read(uint8_t smart_port, uint8_t adi_port)
Gets the digital value (1 or 0) of a port configured as a digital input.
int32_t ext_adi_digital_get_new_press(uint8_t smart_port, uint8_t adi_port)
Gets a rising-edge case for a digital button press.
int32_t ext_adi_digital_write(uint8_t smart_port, uint8_t adi_port, bool value)
Sets the digital value (1 or 0) of a port configured as a digital output.
int32_t ext_adi_pin_mode(uint8_t smart_port, uint8_t adi_port, uint8_t mode)
Configures the port as an input or output with a variety of settings.
int32_t ext_adi_motor_set(uint8_t smart_port, uint8_t adi_port, int8_t speed)
Sets the speed of the motor on the given port.
int32_t ext_adi_motor_get(uint8_t smart_port, uint8_t adi_port)
Gets the last set speed of the motor on the given port.
int32_t ext_adi_motor_stop(uint8_t smart_port, uint8_t adi_port)
Stops the motor on the given port.
int32_t ext_adi_encoder_get(ext_adi_encoder_t enc)
Gets the number of ticks recorded by the encoder.
ext_adi_encoder_t ext_adi_encoder_init(uint8_t smart_port, uint8_t adi_port_top, uint8_t adi_port_bottom, bool reverse)
Creates an encoder object and configures the specified ports accordingly.
int32_t ext_adi_encoder_reset(ext_adi_encoder_t enc)
Sets the encoder value to zero.
int32_t ext_adi_encoder_shutdown(ext_adi_encoder_t enc)
Disables the encoder and voids the configuration on its ports.
int32_t ext_adi_ultrasonic_get(ext_adi_ultrasonic_t ult)
Gets the current ultrasonic sensor value in centimeters.
ext_adi_ultrasonic_t ext_adi_ultrasonic_init(uint8_t smart_port, uint8_t adi_port_ping, uint8_t adi_port_echo)
Creates an ultrasonic object and configures the specified ports accordingly.
int32_t ext_adi_ultrasonic_shutdown(ext_adi_ultrasonic_t ult)
Disables the ultrasonic sensor and voids the configuration on its ports.
double ext_adi_gyro_get(ext_adi_gyro_t gyro)
Gets the current gyro angle in tenths of a degree.
ext_adi_gyro_t ext_adi_gyro_init(uint8_t smart_port, uint8_t adi_port, double multiplier)
Initializes a gyroscope on the given port.
int32_t ext_adi_gyro_reset(ext_adi_gyro_t gyro)
Resets the gyroscope value to zero.
int32_t ext_adi_gyro_shutdown(ext_adi_gyro_t gyro)
Disables the gyro and voids the configuration on its port.
ext_adi_potentiometer_t ext_adi_potentiometer_init(uint8_t smart_port, uint8_t adi_port, adi_potentiometer_type_e_t potentiometer_type)
Initializes a potentiometer on the given port.
double ext_adi_potentiometer_get_angle(ext_adi_potentiometer_t potentiometer)
Gets the current potentiometer angle in tenths of a degree.
ext_adi_led_t ext_adi_led_init(uint8_t smart_port, uint8_t adi_port)
Initializes a led on the given port.
int32_t ext_adi_led_clear_all(ext_adi_led_t led, uint32_t* buffer, uint32_t buffer_length)
Clear the entire led strip of color.
int32_t ext_adi_led_set(ext_adi_led_t led, uint32_t* buffer, uint32_t buffer_length)
Set the entire led strip using the colors contained in the buffer.
int32_t ext_adi_led_set_all(ext_adi_led_t led, uint32_t* buffer, uint32_t buffer_length, uint32_t color)
Set the entire led strip to one color.
int32_t ext_adi_led_set_pixel(ext_adi_led_t led, uint32_t* buffer, uint32_t buffer_length, uint32_t color, uint32_t pixel_position)
Set one pixel on the led strip.
int32_t ext_adi_led_clear_pixel(ext_adi_led_t led, uint32_t* buffer, uint32_t buffer_length, uint32_t pixel_position)
Clear one pixel on the led strip.

Typedefs

using ext_adi_encoder_t = int32_t
Reference type for an initialized encoder.
using ext_adi_ultrasonic_t = int32_t
Reference type for an initialized ultrasonic.
using ext_adi_gyro_t = int32_t
Reference type for an initialized gyroscope.
using ext_adi_potentiometer_t = int32_t
Reference type for an initialized potentiometer.
using ext_adi_led_t = int32_t
Reference type for an initialized addressable led.