{"action":"created","comment":{"url":"https://api.github.com/repos/ARMmbed/mbed-drivers/pulls/comments/53327840","id":53327840,"diff_hunk":"@@ -0,0 +1,562 @@\n+/* mbed Microcontroller Library\n+ * Copyright (c) 2006-2016 ARM Limited\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+#ifndef MBED_DRIVERS_V1_I2C_HPP\n+#define MBED_DRIVERS_V1_I2C_HPP\n+\n+#include \"mbed-drivers/platform.h\"\n+\n+#if DEVICE_I2C && DEVICE_I2C_ASYNCH\n+\n+\n+#include \"mbed-hal/i2c_api.h\"\n+#include \"mbed-hal/dma_api.h\"\n+\n+#include \"mbed-drivers/CThunk.h\"\n+#include \"core-util/FunctionPointer.h\"\n+#include \"core-util/PoolAllocator.h\"\n+\n+// Forward declarations\n+namespace mbed_drivers {\n+namespace v1 {\n+enum class I2CError;\n+}\n+}\n+\n+#include \"I2CDetail.hpp\"\n+#include \"EphemeralBuffer.hpp\"\n+\n+/**\n+ * \\file\n+ * \\brief A generic interface for I2C peripherals\n+ *\n+ * The I2C class interfaces with an I2C Resource manager in order to initiate Transactions and receive events. The\n+ * I2CTransaction class encapsulates all I2C transaction parameters. The I2CResourceManager class is a generic interface\n+ * for implementing I2C resource managers. This will allow for additional classes of I2C device, for example, a\n+ * bitbanged I2C master.\n+ *\n+ * # I2C\n+ * I2C encapsulates an I2C master. The physical I2C master to use is selected via the pins provided to the constructor.\n+ * The ```frequency()``` API sets the default frequency for transactions issued from the I2C object. This is used for\n+ * each transaction issued by I2C unless overridden when creating the transaction. Transactions are initiated by calling\n+ * ```transfer_to()``` or ```transfer_to_irqsafe()```. Both of these APIs create an instance of the ```TransferAdder```\n+ * helper class.\n+ *\n+ * # TransferAdder\n+ * The TransferAdder class allows convenient construction of complex transfers.\n+ *\n+ * The ```frequency()``` member overrides the default frequency set by the issuing I2C object.\n+ *\n+ * The ```on()``` member allows setting up to 4 event handlers, each with a corresponding event mask.\n+ *\n+ * The ```tx()``` members add a buffer to send to the transfer.\n+ *\n+ * The ```rx()``` members add a buffer to receive into to the transfer. There is a special case of ```rx()```, which\n+ * doesn't use a normal buffer. When ```rx(size_t)``` is called with a size of less than 8 bytes, the underlying\n+ * EphermeralBuffer is placed in ephemeral mode. This means that no preallocated receive buffer is needed, instead the\n+ * data is packed directly into the EphemeralBuffer. This has a side-effect that the data will be freed once the last\n+ * event handler has exited, so if the data must be retained, it should be copied out.\n+ *\n+ * The ```apply()``` method validates the transfer and adds it to the transaction queue of the I2CResourceManager. It\n+ * returns the result of validation.\n+ *\n+ * # I2C Resource Managers\n+ * I2C Resource managers are instantiated statically and initialized during global init. There is one Resource Manager\n+ * per logical I2C master. Logical I2C masters could consist of:\n+ *\n+ * * Onchip I2C masters\n+ * * I2C Bridges (SPI->I2C bridge, I2C->I2C bridge, etc.)\n+ * * Bit banged I2C\n+ * * Bit banged I2C over SPI GPIO expander\n+ * * More...\n+ *\n+ * Currently only onchip I2C masters are supported.\n+ *\n+ * # I2C transactions\n+ * An I2CTransaction contains a list of event handlers and their event masks, an I2C address, an operating frequency,\n+ * and zero or more I2CSegments. Zero-segment Transactions are explicitly supported since they are useful in connected\n+ * device discovery (pings).\n+ *\n+ * # I2C Segments\n+ * An I2CSegment is a wrapper around an EphemeralBuffer. It provides an I2C transfer direction (read or write) and an\n+ * optional callback to execute in IRQ context. I2CSegments also provide a chaining pointer so that they can perform\n+ * sequential or scatter/gather operations.\n+ *\n+ * # Constructing I2C transactions\n+ *\n+ * ```C++\n+ * void doneCB(bool dir, I2CTransaction *t, uint32_t event) {\n+ *     // Do something\n+ * }\n+ * I2C i2c0(sda, scl);\n+ * void app_start (int, char **) {\n+ *     uint8_t cmd[2] = {0xaa, 0x55};\n+ *     i2c0.transfer_to(addr).tx(cmd,2).rx(4).on(I2C_EVENT_ALL, doneCB);\n+ * }\n+ * ```\n+ */\n+namespace mbed_drivers {\n+using namespace mbed;\n+namespace v1 {\n+// Forward declaration of I2C\n+class I2C;\n+\n+/**\n+ * @brief List of error codes that can be produced by the I2C API\n+ */\n+enum class I2CError {\n+    None,\n+    InvalidMaster,\n+    PinMismatch,\n+    Busy,\n+    NullTransaction,\n+    NullSegment,\n+    MissingPoolAllocator,\n+    InvalidAddress,\n+    BufferSize,\n+    ScatterGatherNotSupported\n+};\n+\n+/**\n+ * A Transaction container for I2C\n+ */\n+class I2CTransaction {\n+public:\n+    /** I2C transfer callback\n+     *  @param The transaction that was running when the callback was triggered\n+     *  @param the event that triggered the calback\n+     */\n+    using event_callback_t = detail::I2C_event_callback_t;\n+\n+    /**\n+     * Construct an I2C transaction and set the destination address at the same time\n+     *\n+     * @param[in] address set the I2C destination address\n+     */\n+    I2CTransaction(uint16_t address, uint32_t hz, bool irqsafe, I2C *issuer);\n+    ~I2CTransaction();\n+\n+    /**\n+     * Get a new segment to be used by the transaction.\n+     * This API calls the associated I2C object's associated allocator.\n+     * @return a new I2CSegment\n+     */\n+    detail::I2CSegment * new_segment();\n+\n+    /**\n+     * Install a new event handler with the corresponding event mask\n+     * Once all available event slots are consumed, further calls to add_event are ignored.\n+     *\n+     * @param[in] event The event mask on which to trigger cb\n+     * @param[in] cb The event to trigger when one or more bits in the event mask is matched\n+     * @retval false There was no space for a new event handler\n+     * @retval true The new event handler was installed\n+     */\n+    bool add_event(uint32_t event, const event_callback_t & cb);\n+\n+    /**\n+     * The resource manager calls this API.\n+     * Calls the event handlers and\n+     */\n+    void process_event(uint32_t event);\n+\n+    /**\n+     * Set the next transaction in the queue\n+     * This is an atomic operation that will append to the queue.\n+     */\n+    void append(I2CTransaction *t);\n+\n+    /**\n+     * Forwards the irq-context callback to the segment\n+     * Also adds a pointer to this transaction to the callback\n+     * @param[in] the event that triggered this callback\n+     */\n+    void call_irq_cb(uint32_t event);\n+\n+    /**\n+     * If the current segment is valid advance the segment pointer\n+     *\n+     * @retval true if the current segment is valid after this operation\n+     * @retval false if the current segment is not valid after this operation\n+     */\n+    bool advance_segment();\n+\n+    /**\n+     * Reset the current segment to the root segment\n+     */\n+    void reset_current() {\n+        _current  = _root;\n+    }\n+\n+    /**\n+     * Accessor for the next pointer\n+     * @return the next transaction\n+     */\n+    I2CTransaction * get_next() {\n+        return _next;\n+    }\n+\n+    /**\n+     * Accessor for the Transactions's issuer\n+     * @return the I2C object that issued this transaction\n+     */\n+    I2C * get_issuer() {\n+        return _issuer;\n+    }\n+\n+    /**\n+     * Accessor for the current segment pointer\n+     * @return the current segment poitner\n+     */\n+    detail::I2CSegment * get_current() {\n+        return _current;\n+    }\n+\n+    /**\n+     * Accessor for the irqsafe flag\n+     * @retval true if the transaction was instantiated with irqsafe set and access to irq-safe allocators\n+     * @retval false if the transaction was not instantiated with irqsafe set and access to irq-safe allocators\n+     */\n+    bool is_irqsafe() const {\n+        return _irqsafe;\n+    }\n+\n+    /**\n+     * Accessor for the transaction frequency\n+     * @return the frequency of the transaction in Hz\n+     */\n+    uint32_t freq() const {\n+        return _hz;\n+    }\n+\n+    /**\n+     * Accessor for the transaction frequency\n+     * @param[in] hz the transaction frequency in Hz\n+     */\n+    void freq(uint32_t hz) {\n+        _hz = hz;\n+    }\n+\n+    /**\n+     * Accessor for the transaction target address\n+     * @return the transaction address\n+     */\n+    uint16_t address() const {\n+        return _address;\n+    }\n+\n+protected:\n+    /**\n+     * The next transaction in the queue\n+     * This field is used for chaining transactions together into a queue.\n+     *\n+     * This field is not volatile because it is only accessed from within a\n+     * critical section.\n+     */\n+    I2CTransaction * _next;\n+    /// The target I2C address to communicate with\n+    uint16_t _address;\n+    /**\n+     * The first I2CSegment in the transaction\n+     *\n+     * This field is not volatile because it is only accessed from within a\n+     * critical section. This will still be valid if the critical section is\n+     * replaced with an atomic operation.\n+     */\n+    detail::I2CSegment * _root;\n+    /**\n+     * The first I2CSegment in the transaction\n+     *\n+     * This is a helper field for building or processing I2C transactions.\n+     * It allows the Transaction to easily locate the end of the queue when\n+     * composing the transaction and, equally, the currently transferring segment\n+     * while processing the transaction.\n+     *\n+     * This field is not volatile because it is only accessed from within a\n+     * critical section.\n+     */\n+    detail::I2CSegment * _current;\n+    /// The I2C frequency to use for the transaction\n+    unsigned _hz;\n+    /// Flag to indicate that the Transaction and its Segments were allocated with an irqsafe allocator\n+    bool _irqsafe;\n+    /// The I2C Object that launched this transaction\n+    I2C * _issuer;\n+    /// An array of I2C Event Handlers\n+    detail::I2CEventHandler _handlers[I2C_TRANSACTION_NHANDLERS];\n+};\n+\n+/** An I2C Master, used for communicating with I2C slave devices\n+ *\n+ * Example:\n+ * @code\n+ * // Read from I2C slave at address 0x62\n+ *\n+ * #include \"mbed.h\"\n+ *\n+ * I2C i2c(p28, p27);\n+ *\n+ * void tx_done\n+ * void app_start(int, char **) {\n+ *     static char txdata[2] = {0xaa, 0x55};\n+ *     i2c.transfer_to(address).tx(data, 2).callback();\n+ * }\n+ * @endcode\n+ */\n+class I2C {\n+public:\n+    using event_callback_t = detail::I2C_event_callback_t;\n+\n+    /** Create an I2C Master interface, connected to the specified pins\n+     *\n+     *  @param sda I2C data line pin\n+     *  @param scl I2C clock line pin\n+     */\n+    I2C(PinName sda, PinName scl);\n+\n+    /** Create an I2C Master interface, connected to the specified pins and providing IRQ-safe allocators\n+     *\n+     *  @param sda I2C data line pin\n+     *  @param scl I2C clock line pin\n+     *  @param TransactionPool An IRQ-safe allocator for Transaction objects\n+     *  @param SegmentPool An IRQ-safe allocator for Segment objects\n+     */\n+    I2C(PinName sda, PinName scl, mbed::util::PoolAllocator *TransactionPool, mbed::util::PoolAllocator *SegmentPool);\n+\n+    /** Set the frequency of the I2C interface\n+     *\n+     *  @param hz The bus frequency in hertz\n+     */\n+    void frequency(int hz);\n+\n+    /**\n+     * @brief A helper class for constructing transactions\n+     */\n+    class TransferAdder {\n+        friend I2C;\n+    protected:\n+        /**\n+         * @brief Construct a new TransferAdder\n+         *\n+         * @param[in] i2c the issuing I2C object\n+         * @param[in] address the address that is the target of the transfer\n+         * @param[in] hz the frequency to use for the transfer\n+         * @param[in] irqsafe indicates whether the TransferAdder should use the I2C Object's IRQ-safe allocators\n+         */\n+        TransferAdder(I2C *i2c, int address, uint32_t hz, bool irqsafe);\n+\n+        /**\n+         * @brief Allocates and constructs a new I2C Segment\n+         * @return A new I2C Segment\n+         */\n+        detail::I2CSegment * new_segment(detail::I2CDirection d);\n+\n+    public:\n+        /**\n+         * @brief Set the frequency for this transaction\n+         *\n+         * By default, the transaction will use the default frequency for the I2C object. This overrides that frequency.\n+         * The frequency used will be applied to the whole transaction, not just a single segment.\n+         *\n+         * @param[in] hz the frequency to set\n+         */\n+        TransferAdder & frequency(uint32_t hz);\n+\n+        /**\n+         * @brief set an event handler\n+         *\n+         * An event is triggered when any of the bits in the event mask match the event.\n+         * Four event slots are provided, additional event\n+         *\n+         * @param[in] event the event mask\n+         * @param[in] cb the callback to trigger on an event mask match\n+         */\n+        TransferAdder & on(uint32_t event, const event_callback_t & cb);\n+\n+        /**\n+         * @brief set an event handler\n+         *\n+         * An event is triggered when any of the bits in the event mask match the event.\n+         * Four event slots are provided, additional event\n+         *\n+         * @param[in] event the event mask\n+         * @param[in] cb the callback to trigger on an event mask match\n+         */\n+        TransferAdder & on(uint32_t event, event_callback_t && cb);\n+\n+        /**\n+         * @brief Queue the transfer\n+         *\n+         * Hands the transfer over to the resource manager and returns the resource manager's status. No further\n+         * configuration of the transfer is possible after apply() has been called.\n+         *\n+         * @return the error status of submitting the transfer to the resource manager\n+         */\n+        I2CError apply();\n+\n+        /**\n+         * @brief Add a transmit buffer to the transaction\n+         *\n+         * @param[in] buf a pointer to the buffer to send\n+         * @param[in] len the number of bytes to send\n+         */\n+        TransferAdder & tx(void *buf, size_t len);\n+\n+        /**\n+         * @brief Add a transmit buffer to the transaction\n+         *\n+         * @param[in] buf a pointer to and length of the buffer to send\n+         */\n+        TransferAdder & tx(const Buffer & buf);\n+\n+        /**\n+         * @brief Add an ephermeral transmit buffer to the transaction\n+         *\n+         * If the buffer is 7 or fewer bytes, it will be managed internally, so the original can be freed.\n+         *\n+         * @param[in] buf a pointer to the buffer to send\n+         * @param[in] len the number of bytes to send\n+         */\n+        TransferAdder & tx_eph(void *buf, size_t len);\n+\n+        /**\n+         * @brief Add a receive buffer to the transaction\n+         *\n+         * @param[in] buf a pointer to the buffer to receive into\n+         * @param[in] len the number of bytes to receive\n+         */\n+        TransferAdder & rx(void *buf, size_t len);\n+\n+        /**\n+         * @brief Add a receive buffer to the transaction\n+         *\n+         * @param[in] buf a pointer to and length of the buffer to receive into\n+         */\n+        TransferAdder & rx(const Buffer & buf);\n+\n+        /**\n+         * @brief Add an ephermeral receive buffer to the transaction\n+         *\n+         * If the buffer is 7 or fewer bytes, it will be managed internally\n+         *\n+         * @param[in] len the number of bytes to receive\n+         */\n+        TransferAdder & rx(size_t len);\n+\n+        /**\n+         * @brief Applies an unapplied transaction or destroys a failed transaction\n+         *\n+         * If the transaction has not been applied when the TransferAdder goes out of scope, it is automatically\n+         * applied. If it has already been applied, the destructor exits. If an error condition has been detected, the\n+         * destructor destroys the transaction and any associated segments.\n+         */\n+        ~TransferAdder();\n+    protected:\n+        I2CTransaction * _xact;","path":"mbed-drivers/v1/I2C.hpp","position":467,"original_position":467,"commit_id":"a1bd9362319ec2c982d2aa16c557d8d0c52a1afe","original_commit_id":"a1bd9362319ec2c982d2aa16c557d8d0c52a1afe","user":{"login":"0xc0170","id":2963726,"avatar_url":"https://avatars.githubusercontent.com/u/2963726?v=3","gravatar_id":"","url":"https://api.github.com/users/0xc0170","html_url":"https://github.com/0xc0170","followers_url":"https://api.github.com/users/0xc0170/followers","following_url":"https://api.github.com/users/0xc0170/following{/other_user}","gists_url":"https://api.github.com/users/0xc0170/gists{/gist_id}","starred_url":"https://api.github.com/users/0xc0170/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0xc0170/subscriptions","organizations_url":"https://api.github.com/users/0xc0170/orgs","repos_url":"https://api.github.com/users/0xc0170/repos","events_url":"https://api.github.com/users/0xc0170/events{/privacy}","received_events_url":"https://api.github.com/users/0xc0170/received_events","type":"User","site_admin":false},"body":"what does _xact stand for?","created_at":"2016-02-18T15:22:36Z","updated_at":"2016-02-18T15:22:36Z","html_url":"https://github.com/ARMmbed/mbed-drivers/pull/102#discussion_r53327840","pull_request_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/pulls/102","_links":{"self":{"href":"https://api.github.com/repos/ARMmbed/mbed-drivers/pulls/comments/53327840"},"html":{"href":"https://github.com/ARMmbed/mbed-drivers/pull/102#discussion_r53327840"},"pull_request":{"href":"https://api.github.com/repos/ARMmbed/mbed-drivers/pulls/102"}}},"pull_request":{"url":"https://api.github.com/repos/ARMmbed/mbed-drivers/pulls/102","id":47501715,"html_url":"https://github.com/ARMmbed/mbed-drivers/pull/102","diff_url":"https://github.com/ARMmbed/mbed-drivers/pull/102.diff","patch_url":"https://github.com/ARMmbed/mbed-drivers/pull/102.patch","issue_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/issues/102","number":102,"state":"open","locked":false,"title":"Add a prototype fluent API for I2C","user":{"login":"bremoran","id":2636227,"avatar_url":"https://avatars.githubusercontent.com/u/2636227?v=3","gravatar_id":"","url":"https://api.github.com/users/bremoran","html_url":"https://github.com/bremoran","followers_url":"https://api.github.com/users/bremoran/followers","following_url":"https://api.github.com/users/bremoran/following{/other_user}","gists_url":"https://api.github.com/users/bremoran/gists{/gist_id}","starred_url":"https://api.github.com/users/bremoran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bremoran/subscriptions","organizations_url":"https://api.github.com/users/bremoran/orgs","repos_url":"https://api.github.com/users/bremoran/repos","events_url":"https://api.github.com/users/bremoran/events{/privacy}","received_events_url":"https://api.github.com/users/bremoran/received_events","type":"User","site_admin":false},"body":"Much in the same vein as https://github.com/ARMmbed/mbed-drivers/pull/93, add a fluent API to I2C\r\n\r\ncc @0xc0170 @bogdanm @salkinium @hugovincent @autopulated ","created_at":"2015-10-13T08:02:46Z","updated_at":"2016-02-18T15:22:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7482189ef76a4c8002f12479094f3e1b4ffd7405","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/pulls/102/commits","review_comments_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/pulls/102/comments","review_comment_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/issues/102/comments","statuses_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/statuses/a1bd9362319ec2c982d2aa16c557d8d0c52a1afe","head":{"label":"bremoran:i2c-fluent","ref":"i2c-fluent","sha":"a1bd9362319ec2c982d2aa16c557d8d0c52a1afe","user":{"login":"bremoran","id":2636227,"avatar_url":"https://avatars.githubusercontent.com/u/2636227?v=3","gravatar_id":"","url":"https://api.github.com/users/bremoran","html_url":"https://github.com/bremoran","followers_url":"https://api.github.com/users/bremoran/followers","following_url":"https://api.github.com/users/bremoran/following{/other_user}","gists_url":"https://api.github.com/users/bremoran/gists{/gist_id}","starred_url":"https://api.github.com/users/bremoran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bremoran/subscriptions","organizations_url":"https://api.github.com/users/bremoran/orgs","repos_url":"https://api.github.com/users/bremoran/repos","events_url":"https://api.github.com/users/bremoran/events{/privacy}","received_events_url":"https://api.github.com/users/bremoran/received_events","type":"User","site_admin":false},"repo":{"id":42716978,"name":"mbed-drivers","full_name":"bremoran/mbed-drivers","owner":{"login":"bremoran","id":2636227,"avatar_url":"https://avatars.githubusercontent.com/u/2636227?v=3","gravatar_id":"","url":"https://api.github.com/users/bremoran","html_url":"https://github.com/bremoran","followers_url":"https://api.github.com/users/bremoran/followers","following_url":"https://api.github.com/users/bremoran/following{/other_user}","gists_url":"https://api.github.com/users/bremoran/gists{/gist_id}","starred_url":"https://api.github.com/users/bremoran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bremoran/subscriptions","organizations_url":"https://api.github.com/users/bremoran/orgs","repos_url":"https://api.github.com/users/bremoran/repos","events_url":"https://api.github.com/users/bremoran/events{/privacy}","received_events_url":"https://api.github.com/users/bremoran/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bremoran/mbed-drivers","description":"Drivers for common MCU peripherals in mbed OS.","fork":true,"url":"https://api.github.com/repos/bremoran/mbed-drivers","forks_url":"https://api.github.com/repos/bremoran/mbed-drivers/forks","keys_url":"https://api.github.com/repos/bremoran/mbed-drivers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bremoran/mbed-drivers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bremoran/mbed-drivers/teams","hooks_url":"https://api.github.com/repos/bremoran/mbed-drivers/hooks","issue_events_url":"https://api.github.com/repos/bremoran/mbed-drivers/issues/events{/number}","events_url":"https://api.github.com/repos/bremoran/mbed-drivers/events","assignees_url":"https://api.github.com/repos/bremoran/mbed-drivers/assignees{/user}","branches_url":"https://api.github.com/repos/bremoran/mbed-drivers/branches{/branch}","tags_url":"https://api.github.com/repos/bremoran/mbed-drivers/tags","blobs_url":"https://api.github.com/repos/bremoran/mbed-drivers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bremoran/mbed-drivers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bremoran/mbed-drivers/git/refs{/sha}","trees_url":"https://api.github.com/repos/bremoran/mbed-drivers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bremoran/mbed-drivers/statuses/{sha}","languages_url":"https://api.github.com/repos/bremoran/mbed-drivers/languages","stargazers_url":"https://api.github.com/repos/bremoran/mbed-drivers/stargazers","contributors_url":"https://api.github.com/repos/bremoran/mbed-drivers/contributors","subscribers_url":"https://api.github.com/repos/bremoran/mbed-drivers/subscribers","subscription_url":"https://api.github.com/repos/bremoran/mbed-drivers/subscription","commits_url":"https://api.github.com/repos/bremoran/mbed-drivers/commits{/sha}","git_commits_url":"https://api.github.com/repos/bremoran/mbed-drivers/git/commits{/sha}","comments_url":"https://api.github.com/repos/bremoran/mbed-drivers/comments{/number}","issue_comment_url":"https://api.github.com/repos/bremoran/mbed-drivers/issues/comments{/number}","contents_url":"https://api.github.com/repos/bremoran/mbed-drivers/contents/{+path}","compare_url":"https://api.github.com/repos/bremoran/mbed-drivers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bremoran/mbed-drivers/merges","archive_url":"https://api.github.com/repos/bremoran/mbed-drivers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bremoran/mbed-drivers/downloads","issues_url":"https://api.github.com/repos/bremoran/mbed-drivers/issues{/number}","pulls_url":"https://api.github.com/repos/bremoran/mbed-drivers/pulls{/number}","milestones_url":"https://api.github.com/repos/bremoran/mbed-drivers/milestones{/number}","notifications_url":"https://api.github.com/repos/bremoran/mbed-drivers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bremoran/mbed-drivers/labels{/name}","releases_url":"https://api.github.com/repos/bremoran/mbed-drivers/releases{/id}","deployments_url":"https://api.github.com/repos/bremoran/mbed-drivers/deployments","created_at":"2015-09-18T11:13:18Z","updated_at":"2015-09-18T11:13:20Z","pushed_at":"2016-02-12T14:09:35Z","git_url":"git://github.com/bremoran/mbed-drivers.git","ssh_url":"git@github.com:bremoran/mbed-drivers.git","clone_url":"https://github.com/bremoran/mbed-drivers.git","svn_url":"https://github.com/bremoran/mbed-drivers","homepage":"","size":18333,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ARMmbed:master","ref":"master","sha":"3f6fb0d30fa9ee7816b93dbbb73990df0223a46c","user":{"login":"ARMmbed","id":8916057,"avatar_url":"https://avatars.githubusercontent.com/u/8916057?v=3","gravatar_id":"","url":"https://api.github.com/users/ARMmbed","html_url":"https://github.com/ARMmbed","followers_url":"https://api.github.com/users/ARMmbed/followers","following_url":"https://api.github.com/users/ARMmbed/following{/other_user}","gists_url":"https://api.github.com/users/ARMmbed/gists{/gist_id}","starred_url":"https://api.github.com/users/ARMmbed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARMmbed/subscriptions","organizations_url":"https://api.github.com/users/ARMmbed/orgs","repos_url":"https://api.github.com/users/ARMmbed/repos","events_url":"https://api.github.com/users/ARMmbed/events{/privacy}","received_events_url":"https://api.github.com/users/ARMmbed/received_events","type":"Organization","site_admin":false},"repo":{"id":27869497,"name":"mbed-drivers","full_name":"ARMmbed/mbed-drivers","owner":{"login":"ARMmbed","id":8916057,"avatar_url":"https://avatars.githubusercontent.com/u/8916057?v=3","gravatar_id":"","url":"https://api.github.com/users/ARMmbed","html_url":"https://github.com/ARMmbed","followers_url":"https://api.github.com/users/ARMmbed/followers","following_url":"https://api.github.com/users/ARMmbed/following{/other_user}","gists_url":"https://api.github.com/users/ARMmbed/gists{/gist_id}","starred_url":"https://api.github.com/users/ARMmbed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARMmbed/subscriptions","organizations_url":"https://api.github.com/users/ARMmbed/orgs","repos_url":"https://api.github.com/users/ARMmbed/repos","events_url":"https://api.github.com/users/ARMmbed/events{/privacy}","received_events_url":"https://api.github.com/users/ARMmbed/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ARMmbed/mbed-drivers","description":"Drivers for common MCU peripherals in mbed OS.","fork":false,"url":"https://api.github.com/repos/ARMmbed/mbed-drivers","forks_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/forks","keys_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/teams","hooks_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/hooks","issue_events_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/issues/events{/number}","events_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/events","assignees_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/assignees{/user}","branches_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/branches{/branch}","tags_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/tags","blobs_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/git/refs{/sha}","trees_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/statuses/{sha}","languages_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/languages","stargazers_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/stargazers","contributors_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/contributors","subscribers_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/subscribers","subscription_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/subscription","commits_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/commits{/sha}","git_commits_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/git/commits{/sha}","comments_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/comments{/number}","issue_comment_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/issues/comments{/number}","contents_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/contents/{+path}","compare_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/merges","archive_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/downloads","issues_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/issues{/number}","pulls_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/pulls{/number}","milestones_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/milestones{/number}","notifications_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/labels{/name}","releases_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/releases{/id}","deployments_url":"https://api.github.com/repos/ARMmbed/mbed-drivers/deployments","created_at":"2014-12-11T11:59:33Z","updated_at":"2016-01-21T15:45:24Z","pushed_at":"2016-02-12T14:09:35Z","git_url":"git://github.com/ARMmbed/mbed-drivers.git","ssh_url":"git@github.com:ARMmbed/mbed-drivers.git","clone_url":"https://github.com/ARMmbed/mbed-drivers.git","svn_url":"https://github.com/ARMmbed/mbed-drivers","homepage":"","size":19750,"stargazers_count":22,"watchers_count":22,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":27,"mirror_url":null,"open_issues_count":24,"forks":27,"open_issues":24,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ARMmbed/mbed-drivers/pulls/102"},"html":{"href":"https://github.com/ARMmbed/mbed-drivers/pull/102"},"issue":{"href":"https://api.github.com/repos/ARMmbed/mbed-drivers/issues/102"},"comments":{"href":"https://api.github.com/repos/ARMmbed/mbed-drivers/issues/102/comments"},"review_comments":{"href":"https://api.github.com/repos/ARMmbed/mbed-drivers/pulls/102/comments"},"review_comment":{"href":"https://api.github.com/repos/ARMmbed/mbed-drivers/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ARMmbed/mbed-drivers/pulls/102/commits"},"statuses":{"href":"https://api.github.com/repos/ARMmbed/mbed-drivers/statuses/a1bd9362319ec2c982d2aa16c557d8d0c52a1afe"}}}}