Skip to content

[LPC4088] Bugfixes related to I2C and Port implementations #83

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

Merged
merged 2 commits into from
Oct 11, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,15 @@ void i2c_init(i2c_t *obj, PinName sda, PinName scl) {

pinmap_pinout(sda, PinMap_I2C_SDA);
pinmap_pinout(scl, PinMap_I2C_SCL);

// OpenDrain must explicitly be enabled for p0.0 and p0.1
if (sda == P0_0) {
pin_mode(sda, OpenDrain);
}
if (scl == P0_1) {
pin_mode(scl, OpenDrain);
}

}

inline int i2c_start(i2c_t *obj) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
#include "pinmap.h"
#include "gpio_api.h"


PinName port_pin(PortName port, int pin_n) {
return (PinName)(LPC_GPIO0_BASE + ((port << PORT_SHIFT) | pin_n));
return (PinName)(((port << PORT_SHIFT) | pin_n));
}

void port_init(port_t *obj, PortName port, int mask, PinDirection dir) {
Expand Down