btashton opened a new pull request #2637:
URL: https://github.com/apache/incubator-nuttx/pull/2637


   ## Summary
   This adds primitive I2C master support to the BL602.  Note this is still a 
**DRAFT**.
   
   TODO prior to merge:
   - [ ] Properly handle `I2C_M_NOSTART` and `I2C_M_NOSTOP`.  This IP block 
does not allow direct control over these bits but the sub-address feature 
should make this possible for most real cases.
   - [ ] Add interrupt support
   - [ ] Clean up the transaction start and end logic (right now 
handling/clearing status bits is kind of a mess).
   
   ## Impact
   Add I2C support to BL602
   
   ## Testing
   
   Using I2C tool with some devices on the bus we can see basic functionality
   ```
   nsh> i2c dev -b 0 0x00 0x7f
        0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
   00: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
   10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
   20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
   30: -- -- -- -- -- -- -- -- -- -- -- -- -- 3d -- -- 
   40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
   50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
   60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- -- 
   70: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
   nsh> i2c get -b 0 -a 0x68 -r 0x75
   READ Bus: 0 Addr: 68 Subaddr: 75 Value: 68
   ```
   From the logic analyser for a register read:
   
![image](https://user-images.githubusercontent.com/173245/103448235-696de500-4c4b-11eb-8e2c-33185ef3410a.png)
    


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to