Skip to content

Create pwmout_api.c #906

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 3 commits into from
Feb 24, 2015
Merged

Create pwmout_api.c #906

merged 3 commits into from
Feb 24, 2015

Conversation

Willem23
Copy link
Contributor

Added PWM support for the LPC812 using the SCT. Code was ported from LPC824 libs.
First needed to modify us_ticker() to free up the SCT and use the MRT instead.
PWM can support a maximum of 4 channels using any portpin. All channels will use the same period.

Added PWM support for the LPC812 using the SCT. Code was ported from LPC824 libs.
First needed to modify us_ticker() to free up the SCT and use the MRT instead.
PWM can support a maximum of 4 channels using any portpin. All channels will use the same period.
Activated the I2CSlave functions. Slave block read/write operations are fully supported. The slave byte read and writes need general modification to I2CSlave.cpp. See pending Issue.
Activated the PWM functions. They are supported now using the SCT after updating us_ticker() to use the MRT instead of the SCT.
Added PWM object.
@@ -29,7 +29,7 @@
#define DEVICE_SERIAL_FC 1

#define DEVICE_I2C 1
#define DEVICE_I2CSLAVE 0
#define DEVICE_I2CSLAVE 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this the target which will need modifications to have slave enabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Martin,

As explained in the comments for the pull request, the I2C slave can be
enabled and the slave block read/write operations are fine. The additional
work in I2CSlave.cpp is needed for a correct operation of the slave byte
read/write operations. This change includes platforms such as the LPC812 and
LPC824 because they have different I2C engines for master and slave.

Again, the currently accepted LPC824 I2C slave lib has that same problem and
doesn't work correctly for the slave byte read/writes.

Wim


From: Martin Kojtal [mailto:[email protected]]
Sent: donderdag 12 februari 2015 9:32
To: mbedmicro/mbed
Cc: Wim
Subject: Re: [mbed] Create pwmout_api.c (#906)

In libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC81X/device.h
#906 (comment) :

@@ -29,7 +29,7 @@
#define DEVICE_SERIAL_FC 1

#define DEVICE_I2C 1
-#define DEVICE_I2CSLAVE 0
+#define DEVICE_I2CSLAVE 1

Isn't this the target which will need modifications to have slave enabled?

Reply to this email directly or view it on
https://github.com/mbedmicro/mbed/pull/906/files#r24565131 GitHub.
<https://github.com/notifications/beacon/AKMUNJ5mrGex1x6ADfFng6gpyjnPdGHRks5
nrFyBgaJpZM4DfF7f.gif>

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 12, 2015

Ok, understand.

Why is I2C Slave enabled?

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 12, 2015

I don't want to enable slave for this platform if we know it's not fully functional, as users might struggle in case they use byte oriented approach. That's why I asked why slave is enabled. What do you think?

@Willem23
Copy link
Contributor Author

Then I propose you also disable the LPC824 I2C stuff since I know it is not
fully functional in several areas. The LPC812 I2C Slave lib as such is
correct. The fixes need to be made to I2CSlave.cpp by calling the correct
slave byte/read operations in LPC812. I proposed a temporary fix in I2CSlave
before by using a macro for the 812. This could be removed as soon as the
other libs are updated to the same level as the LPC812.

Regards

Wim


From: Martin Kojtal [mailto:[email protected]]
Sent: donderdag 12 februari 2015 14:22
To: mbedmicro/mbed
Cc: Wim
Subject: Re: [mbed] Create pwmout_api.c (#906)

I don't want to enable slave for this platform if we know it's not fully
functional, as users might struggle in case they use byte oriented approach.

Reply to this email directly or view it
#906 (comment) on
GitHub.
<https://github.com/notifications/beacon/AKMUNFct0M2JCbNf_4S5CVQstFX1qsjgks5
nrKCPgaJpZM4DfF7f.gif>

0xc0170 added a commit that referenced this pull request Feb 24, 2015
LPC812 - pwmout HAL implementation
@0xc0170 0xc0170 merged commit 7ae7daf into ARMmbed:master Feb 24, 2015
@Willem23 Willem23 deleted the patch-1 branch March 21, 2015 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants