aboutsummaryrefslogtreecommitdiffstats
path: root/src/lpc176x/i2c.c
Commit message (Collapse)AuthorAgeFilesLines
* i2c: handle errors at i2ccmdsTimofey Titovets2024-10-261-2/+7
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* lpc176x: Add i2c_read functionalityMichael Kurz2021-04-251-1/+34
| | | | | | This adds the i2c_read command to the lp176x MCU. Signed-off-by: Michael Kurz <michi.kurz@gmail.com>
* lpc176x: Introduce get_pclock_frequency()Kevin O'Connor2021-03-251-2/+3
| | | | | | | Add get_pclock_frequency() - a standard way of obtaining the peripheral clock frequency. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Add support for additional i2c busesKevin O'Connor2020-04-211-46/+63
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Update code to use armcm_boot mechanismKevin O'Connor2019-08-221-1/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Use enumerations for buses and reserve pinsKevin O'Connor2019-04-041-1/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* i2ccmds: Pass the i2c address as a 7-bit number (0-127)Kevin O'Connor2019-01-071-1/+1
| | | | | | | | | | | | | | | | The sam3 i2c code and the linux code use a 7-bit i2c address, while the avr, lpc176x, and samd21 i2c code uses an 8-bit address with the least significant bit always zero. A similar issue occurred in the host code (sx1509.py and replicape.py use 7-bit addresses while uc1701.py and mcp4451.py use 8-bit addresses). Consistently use 7-bit addresses in all the code. This breaks compatibility between host and mcu software, so make a change to the config_i2c command to force users to synchronize software updates. This also breaks common Smoothieboard configs, so update the mcp4451 code to validate the i2c_address. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Pass gpio id to gpio_peripheral()Kevin O'Connor2019-01-041-2/+2
| | | | | | | Pass the gpio id instead of the bank/pin to gpio_peripheral(). This is in keeping with other ARM ports. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Move enable_peripheral_clock to main.cKevin O'Connor2019-01-041-1/+1
| | | | | | | Move and rename function to enable_pclock() - in keeping with other ARM ports. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Enable full speed peripheral clocks on SPI and I2CKevin O'Connor2018-11-211-1/+2
| | | | | | | | Scale the bus speed within the peripheral instead of on the system bus as scaling on the system bus slows down general register access to the peripheral. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Convert i2c code to use standard i2ccmds.cKevin O'Connor2018-11-141-10/+18
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcp4451: Add initial support for programming the mcp4451 on lpc176xKevin O'Connor2018-06-291-0/+100
Add support for programming smoothieboard current. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>