Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add Support for the ADI Expander #245

Merged
merged 70 commits into from Sep 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
1fd691c
Create ext_adi.h
kunwarsahni01 Aug 14, 2020
d57786a
Created vdml_ext_adi.c and ext_adi.hpp
kunwarsahni01 Aug 14, 2020
1fd125a
Create vdml_ext_adi.cpp
kunwarsahni01 Aug 14, 2020
fd578fe
Add smart_port struct
kunwarsahni01 Aug 15, 2020
b8ef153
Remove Port Config Typedef
kunwarsahni01 Aug 15, 2020
cdd6483
Change smart_port variable
kunwarsahni01 Aug 15, 2020
9457cc7
Fixed adi_encoder_t ext_adi_encoder_init
kunwarsahni01 Aug 15, 2020
ae99033
Remove smart_port struct and add get_ports function
kunwarsahni01 Aug 16, 2020
bcf17fb
Implemented get_ports
kunwarsahni01 Aug 16, 2020
a461ede
Removing pointer
kunwarsahni01 Aug 16, 2020
5b9dae2
Working on implementation for get_ports()
kunwarsahni01 Aug 18, 2020
78bbc85
May have found proper solution to the issues with get_ports issue.
WillXuCodes Aug 26, 2020
7e23948
Changed params of gyro to directly reference smart points.
WillXuCodes Aug 26, 2020
6c89e26
(Unfinished) changed a few more params to be include both smart port and
WillXuCodes Aug 27, 2020
65043e1
Fixed get_ports macro scoping issue
WillXuCodes Aug 27, 2020
793157d
Fixed C api compiling errors, current state of cpp file is commented
WillXuCodes Aug 27, 2020
8dcc8d2
Merge pull request #243 from purduesigbots/develop
kunwarsahni01 Aug 29, 2020
b0b1a6a
Fixed warning with unused adi port var, and fixed the smart_ports to be
WillXuCodes Aug 29, 2020
cc06e2e
Revert "Fixed warning with unused adi port var, and fixed the smart_p…
WillXuCodes Aug 29, 2020
fcfc966
Made smart ports be - 1
kunwarsahni01 Aug 30, 2020
877df53
ext gyro fix (we were passing in the adi port instead of the gyro
WillXuCodes Aug 30, 2020
320f2fe
moved ext-adi #define functions into ext_adi.h, the c++ api is good for
mooreBrendan Aug 30, 2020
853428c
Change _port to uint32_t
kunwarsahni01 Aug 30, 2020
c265df5
Fix ultrasonic calls
kunwarsahni01 Aug 30, 2020
1f57bcb
fixed return_ports on ultrasonic_get, needs testing
mooreBrendan Aug 31, 2020
1b0cb14
Update Comments
kunwarsahni01 Sep 3, 2020
df7981b
made adi into wrapper for ext_adi
mooreBrendan Sep 4, 2020
bc9d9d2
Fix Ultrasonic C++ api
kunwarsahni01 Sep 4, 2020
4f59b3b
Combined external adi and internal adi, so it's all one api under the
WillXuCodes Sep 4, 2020
9fa3d95
Deleted old unused hpp/cpp files for the seperate cpp files.
WillXuCodes Sep 4, 2020
5286d03
merged c++ api works with encoders, sonars, buttons, motors, gyros
mooreBrendan Sep 5, 2020
414ca7e
code clean up
mooreBrendan Sep 5, 2020
7df1ce8
documentation clean up
mooreBrendan Sep 6, 2020
919f4ce
made ports in vdml_adi.c from int32_t to uint8_t
mooreBrendan Sep 6, 2020
2366756
removed unnecessary parenthesis
mooreBrendan Sep 6, 2020
6053a6b
fixed docs to accurately reflect function and not just "configure"
mooreBrendan Sep 6, 2020
3646819
reverted version
mooreBrendan Sep 6, 2020
0f68e42
Deleted redundant (For external adi port) comments in adi expander
WillXuCodes Sep 7, 2020
8d80a18
Update include/pros/adi.hpp
mooreBrendan Sep 7, 2020
12f0172
Update include/pros/adi.hpp
mooreBrendan Sep 7, 2020
93ca9ff
Alphabetized api header file, also deleted unnecessary empty lines on
WillXuCodes Sep 7, 2020
aedc307
Added spaces back to multiplyer = 1 to adi gyro default param.
WillXuCodes Sep 7, 2020
6487dc1
fixed ambiguous initializations
mooreBrendan Sep 8, 2020
1e83096
fixed typos in the documentation
mooreBrendan Sep 8, 2020
82af00d
Update src/devices/vdml_adi.cpp
mooreBrendan Sep 9, 2020
0c815d5
Formatting Fix
WillXuCodes Sep 10, 2020
c65d583
Comment Formatting Fix
WillXuCodes Sep 10, 2020
e8bf9d6
Param Formatting Fix
WillXuCodes Sep 10, 2020
4bf8135
Fix Param Formatting
WillXuCodes Sep 10, 2020
b30c154
Comment Fix
WillXuCodes Sep 10, 2020
6e27dda
Changed comment spelling error
WillXuCodes Sep 10, 2020
660e5cd
Update include/pros/adi.hpp
mooreBrendan Sep 11, 2020
b4db9e2
Update include/pros/ext_adi.h
mooreBrendan Sep 11, 2020
f89fdf1
Update src/devices/vdml_adi.cpp
mooreBrendan Sep 11, 2020
8d6ddbe
fixed documentation and formatting
mooreBrendan Sep 11, 2020
11668a1
Fixed formatting
WillXuCodes Sep 11, 2020
f2e2439
Fix Formatting
WillXuCodes Sep 11, 2020
997f116
revert version
WillXuCodes Sep 11, 2020
2ad6900
formatting fixes, documentation cleanup, fixed typos
mooreBrendan Sep 12, 2020
a39bfe4
removed constant function parameters, reset version string
mooreBrendan Sep 12, 2020
bc1695f
reversed the smart port and adi port
mooreBrendan Sep 12, 2020
8267034
removed empty ADIPort constructor
mooreBrendan Sep 12, 2020
066e1df
removed unnecessary type values
mooreBrendan Sep 12, 2020
5a38a5a
moved macros out of public, updated ENXIO warning
mooreBrendan Sep 12, 2020
766ad6b
added explicit to port_pair constructors
mooreBrendan Sep 12, 2020
0ac5b5a
Update include/pros/adi.hpp
mooreBrendan Sep 12, 2020
e980360
corrected encoder to gyro in comments
mooreBrendan Sep 12, 2020
ac9d6b4
fixed collum formating, reverted explicit
mooreBrendan Sep 12, 2020
8442742
Add External ADI Test
kunwarsahni01 Sep 13, 2020
8119101
Format Ext ADI Test
kunwarsahni01 Sep 13, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions include/api.h
Expand Up @@ -49,6 +49,7 @@

#include "pros/adi.h"
#include "pros/colors.h"
#include "pros/ext_adi.h"
#include "pros/imu.h"
#include "pros/llemu.h"
#include "pros/misc.h"
Expand Down
9 changes: 5 additions & 4 deletions include/pros/adi.h
Expand Up @@ -111,6 +111,7 @@ typedef enum adi_port_config_e {
#endif
#endif

#define INTERNAL_ADI_PORT 22
#define NUM_ADI_PORTS 8

#ifdef __cplusplus
Expand Down Expand Up @@ -327,7 +328,7 @@ int32_t adi_analog_read_calibrated_HR(uint8_t port);
* Gets the digital value (1 or 0) of a port configured as a digital input.
*
* If the port is configured as some other mode, the digital value which
* reflects the current state of the poprt is returned, which may or may not
* reflects the current state of the port is returned, which may or may not
* differ from the currently set value. The return value is undefined for ports
* configured as any mode other than a Digital Input.
*
Expand Down Expand Up @@ -386,7 +387,7 @@ int32_t adi_digital_get_new_press(uint8_t port);
* \return 1 if the operation was successful or PROS_ERR if the operation
* failed, setting errno.
*/
int32_t adi_digital_write(uint8_t port, const bool value);
int32_t adi_digital_write(uint8_t port, bool value);

/**
* Configures the port as an input or output with a variety of settings.
Expand Down Expand Up @@ -493,7 +494,7 @@ int32_t adi_encoder_get(adi_encoder_t enc);
*
* \param port_top
* The "top" wire from the encoder sensor with the removable cover side
* UP
* up
* \param port_bottom
* The "bottom" wire from the encoder sensor
* \param reverse
Expand All @@ -502,7 +503,7 @@ int32_t adi_encoder_get(adi_encoder_t enc);
* \return An adi_encoder_t object to be stored and used for later calls to
* encoder functions
*/
adi_encoder_t adi_encoder_init(uint8_t port_top, uint8_t port_bottom, const bool reverse);
adi_encoder_t adi_encoder_init(uint8_t port_top, uint8_t port_bottom, bool reverse);

/**
* Sets the encoder value to zero.
Expand Down