aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-08-28Use c++ style castHEADmastermainBin Chen
Change-Id: I6394978e2cbc1a6efa9912a876f652d3d455d98b Signed-off-by: Bin Chen <pierr.chen@gmail.com>
2016-08-23Disable implicit conversionBin Chen
According to Google coding style, need to add explicit keyword for single-argument constructors. Change-Id: I2673b5367e01b8cca9d908cf5fca96f4877e83d3 Signed-off-by: Bin Chen <pierr.chen@gmail.com>
2016-08-19Remove redundant virtual keywordsBin Chen
According to google coding style, should not use both virtual and override. Change-Id: Ic0074184542d8604c6645f0e8567bd44804ab795 Signed-off-by: Bin Chen <pierr.chen@gmail.com>
2016-08-01Remove Brillo-specific LOCAL_MODULE_TAGSDan Willemsen
Replaced with PRODUCT_PACKAGES_DEBUG in brillo_base.mk Change-Id: I38c4ddd6433d3d6f4c270de29d410087585b0c67
2016-05-25Remove unused imports.Bertrand SIMONNET
This is not used and breaks a downstream branch. Lets fix it here to not deviate. Change-Id: If607f3dcbb19f719bd5ff59ca1218a9d4b5b0733
2016-05-24Implement the client side UART interface.Bertrand SIMONNET
This CL adds the C APIs to act on UART devices as well as unit tests and an example. Bug: 27898961 Change-Id: I23f627d69fb3440fec53bded20bd3b408c9ed591
2016-05-24Export the UART functionality via binder.Bertrand SIMONNET
Allows the binder clients to access UART devices. Bug: 27898961 Change-Id: Ifa94a2864c0bad8a3fb38948b4dac57c876d5290
2016-05-24Implement the backend for UART support.Bertrand SIMONNET
This includes: * the hal hooks to register UART devices. * the UART sysfs driver. * the UART manager. Bug: 27898961 Change-Id: I48488b2684c9198c70a908cef3ef6c2032eb4bfe
2016-05-24Document the HAL.Bertrand SIMONNET
Documents and explain the HAL to facilitate its implementation. Bug: 28522721 Change-Id: Ie65610b5f6f0e61a92ea6558deb2f54eb93f3e90
2016-05-23Change peripheralman tests to run on the device.Bertrand SIMONNET
The daemon tests were created as host tests. We actually don't run host tests in the builder so convert them to native tests to be able to run it. Bug: 28909367 Change-Id: I24ffdf1363fc202a661b417debaac594784a0fcd
2016-05-18Make sure BGpio_setValue fails on input.Bertrand SIMONNET
Setting the value of an input GPIO will fail in the daemon. We need to make sure the error is propagated to the user and an message is logged. This is probably a common error. Giving feedback to the developer will be helpful. Bug: 28765716 Change-Id: I5e9b20e317d73875431e0e09b4589fc61781a1af
2016-04-26Replace ScopedFd with unique_fdChristopher Wiley
aidl-cpp will generate code using unique_fd in the near future. While here, also make the binder intermediates library depend on libbinder in order to obtain proper header include paths. Bug: 27804373 Change-Id: Ia36dba111f3ff824d34612dedcb202612ed4ba35 Test: Compiles with accompanying changes.
2016-04-25Use int32_t instead of ssize_tBertrand SIMONNET
AIDL uses int32_t for ints on all platform but the size of ssize_t depends on the architecture. Use int32_t everywhere instead. Bug: 27831222 Test: Compiles on arm64. Change-Id: I14062b2efae9aa396254c82410c68d478a2e85cd
2016-04-25Implement the client API for all I2C functions.Bertrand SIMONNET
This CL exposes the following functions in the C API: * write * writeRegBuffer * read * readRegByte * readRegWord * readRegBuffer Bug: 27831222 Change-Id: I8bcdc1cc949e5b13d490ce37eb29b6e706df72b4
2016-04-25Implement the backend for more I2C functions.Bertrand SIMONNET
Implements the driver and AIDL interface for: * Read * ReadRegBuffer * Write * WriteRegByte * WriteRegWord * WriteRegBuffer Bug: 27831222 Change-Id: I792661a47330ea3c7d864b6373440e6369a58d77
2016-04-19libperipheralman_binder needs libbinder include pathsChristopher Wiley
Bug: 27804373 Change-Id: I7c22373834ce6333c46a79d635409cbf9b069bcb Test: Compiles
2016-04-18Revert "Replace ScopedFd with unique_fd"Christopher Wiley
This reverts commit 734847ed5fb389ceaec6034d89f81bffe051337d. Change-Id: Idfcb62cc8b7563bccb060dc3ca79a684707b3b6e
2016-04-13Replace ScopedFd with unique_fdChristopher Wiley
aidl-cpp will generate code using unique_fd in the near future. While here, also make the binder intermediates library depend on libbinder in order to obtain proper header include paths. Bug: 27804373 Test: Compiles with accompanying changes. Change-Id: I6098e63f179ac81096fa4775cc11e59e87a962c9
2016-04-13Remove unused fieldsChristopher Wiley
A recent update to libchrome reveals that we were previously suppressing warnings about unused private fields. Bug: 28117776 Change-Id: Ibcbfce0e5129cb55f3aff0127f79fc24e534241d Test: This now compiles.
2016-03-30Remove listAvailableGpios.Bertrand SIMONNET
This is not useful as we don't expect users to take runtime decisions based on this. Bug: 27836221 Bug: 27836293 Change-Id: Ieef02af25b222ec52cfe7f35d91f31707d438267
2016-03-30Fix binder mocking in unit tests.Bertrand SIMONNET
This CL mocks binder correctly in the unit tests, avoiding calling service manager. Bug: 27901103 Test: Unit tests pass. Service manager is not called. Change-Id: Ic4d8d80e47768dcabb69ae970b66bab2e3b1ee8d
2016-03-30Allow setting the SPI message delay.Bertrand SIMONNET
This CL adds an interface to set the delay to wait between two SPI messages. Bug: 27923916 Change-Id: Idb1fa208b974d489414d63d67ad5fa702e8b03e4
2016-03-23Add tests for the I2c developer C API.Bertrand SIMONNET
Bug: 27675223 Change-Id: I751083324c09aff20a93290897fc4676ce247722
2016-03-23Add unit tests for the Spi developer interfaces.Bertrand SIMONNET
Bug: 27675223 Change-Id: I34289c5caa7ba7d5d1a1f419829830d3a221ead0
2016-03-21Add unittests for the LEDs client interface.Bertrand SIMONNET
Bug: 27675223 Change-Id: Id3a4739c111c8c8e6ebb828687a2c72527499ed7
2016-03-21Add a test for the C only compatibility.Bertrand SIMONNET
This will be done with a no-op static library, including all the C headers and compiling with strict C only compiler flags. Change-Id: I6fe4aaf0f3014b4325ec5fe052d09afc170ee972
2016-03-21Fix the headers to be C89 compatible.Bertrand SIMONNET
Fixes two things: * Trailing commas in enums are not supported in C89. * We must type define the pin_mux_callbacks structs in order to mention it without the struct keyword. Bug: 27601668 Change-Id: Ie55e5e9ded69900a0848d192936ab1bb75c34c70
2016-03-16Add unit tests for the Gpio C API.Bertrand SIMONNET
This tests that: * the C API is correctly implemented. * the C/C++ to AIDL conversion is done properly. * the peripheral manager client tracks ownership correctly. Bug: 27675223 Change-Id: Ie7ce869b381fcf544af967826c62f283b7ddb61c
2016-03-15Add I2C managerLee Campbell
Add basic support for I2C. Only Read Register command supported so far. BUG: 26776321 TEST: Testing I2C temp sensor Change-Id: Id4a2e96df489c64b2724ac3995557459f285667c
2016-03-15Implement the LED driver and HALLee Campbell
Hooked up the LED driver and wired up the HAL calls. Still missing Pin muxing for LEDs BUG: 27556738 Change-Id: Ief334b3e66e7357cb2de8a2b6ccf553394bf2b77 TEST: Toggled LEDs on dragonboard
2016-03-15Expose the Led interface to the user.Bertrand SIMONNET
This CL adds: * LED support in the AIDL interface. * LED support and implementation in the C API. * an example blinking an LED. Bug: 27580067 Change-Id: Ia8334006626c2683aa8ce40b0b90efc32585a29c
2016-03-15Implement LED managerLee Campbell
Add a manager for LEDs BUG: 27556738 Change-Id: Id0a0e08d14005f37f8dfa2496dc07bdcdf6c1899
2016-03-14Cleanup Peripheral IO's examples.Bertrand SIMONNET
Removes unused library, unnecessary calls and headers. Change-Id: I2c7a0f2b2ed627c0b0f4d41418f446b5593b054e Test: examples work.
2016-03-10Cleanup error descriptions.Bertrand SIMONNET
We no longer have peripheral manager specific error code. The documentation should be more precise on what the error code is. Bug: 27477643 Change-Id: Ib685aa11f3b6f18d1a4611410f91571230c795c3
2016-03-10Add a helper to acknowledge a GPIO interrupt.Bertrand SIMONNET
When an interrupt triggers on a GPIO, we must lseek and read the value in order to be able to poll again. As we don't guarantee that the file descriptor we use to poll will be the value file, add a convenience function to reset the file descriptor's state. To illustrate how to use it, we provide an example that will watch a GPIO for interrupt and print a message when the GPIO's value changes. This is implemented with both select and poll. Bug: 26778811 Change-Id: Ib25338599a8e08d7734839171da6204bb64a2ded
2016-03-10Fix SPI Transfer rx codeLee Campbell
TEST: Read SPI data from a sensor Change-Id: I4a853d89f177fd281c0cb29d64bc57d82d7a0478
2016-03-10Use errno instead of a custom error code.Bertrand SIMONNET
Errno is expressive enough to cover all error cases we can encounter. It is also standard and more convinient to use. All errors will be reported across the AIDL interface via service specific error codes with values from errno. On success, we allow reporting Status::ok() for convenience which translates to a service specific error code 0. Bug: 27477643 Change-Id: Ifa453d9f350cc2e06aea0f6d5c64eb5928404d88
2016-03-09Wire up GPIO and SPI list commandsLee Campbell
Fixed bug in SPI transfer Change-Id: I384a94e330a9962902044652a1d3cd5ae016ce0d
2016-03-08Fix 64bit build due to type mismatchLee Campbell
Change-Id: Ic1eb37f67872a5684be5567bc6cf9f75fecffc99
2016-03-08Hook up the SPI HAL to the SPI managerLee Campbell
Implement the backend IOCTLS for SPI BUG: 27555414 Change-Id: I4be6b9e33dd7b6d2483a04f368289a3229df0439 TEST: Tested with an RGB led
2016-03-08Add doxygen docs for public headersLee Campbell
Added docs for errors, gpio and the client BUG: 27482120 TEST: Generated a devsite. Change-Id: I514c75f6c7e8024996025cb10e0ae0860fc456f5
2016-03-08Expose SPI in the developer interface.Bertrand SIMONNET
This CL defines and implements the C API used by the developer to access the SPI interface. Bug: 27530022 Change-Id: Id3380191fa8d81ff749e3db9d208dff25deed3fb
2016-03-07Add support for SPI in peripheral manager.Bertrand SIMONNET
This CL adds the AIDL interface and support for SPI in peripheral manager. This functionality is not yet exposed to the developer and will be done in another CL. Bug: 27529524 Change-Id: I376f0e10febde61258048e04a1e5fc56f0b7b25f
2016-03-07Add support for edge, active low and polling fd for GPIO.Bertrand SIMONNET
This CL adds support to GPIO for: * setting the edge interrupt trigger. * setting the active low type. * passing a file descriptor to the client that can be used to poll on interrupts. Bug: 26778811 Change-Id: I6c25eef5d6d02343316d55b2280398a1df59c091
2016-03-03Fix crash loop when HAL can't be foundLee Campbell
When there is no HAL provided PIO will just run with no registered devices Change-Id: Id8f3a7a69b18d5460996d7528d5cc99d1323821e
2016-03-03Add SPI ManagerLee Campbell
Add SPI backend and fake device stubs for unit testing. BUG: 26779252 Change-Id: I33607d7a266f53a63452bd7a1757a22d9f21e97a
2016-03-03Add --pin arg to exampleLee Campbell
Now example can be ran as follows: peripheralmanager_example --pin=IO18 This allows for easier testing of GPIO pins BUG: 26778811 Change-Id: I713630ad14fd575bd28d880c94cb1a8ea5152361 TEST: All the gpio pins on edison work.
2016-03-03Fix typo.Bertrand SIMONNET
Bug: None Change-Id: I1cba67057b96ec4d123c31d4a52e80f7e29ae207
2016-03-03Adding bare bones SPI driverLee Campbell
Add support for a spidev driver. Ioctls are not wired up yet. BUG: 26779252 Change-Id: I8d81d685077798ae96e73d0061b8f44c94d30310
2016-03-03Consolidate constants for client and daemon.Bertrand SIMONNET
Instead of defining the enum constants twice, consolidate them into a header only library. Bug: 27435044 Change-Id: I768375aabb53caa1baa5f3973c39ae0ec4fee43f