Commit Graph

1882 Commits (09970394da200ece1ed493685623435e6cd71639)

Author SHA1 Message Date
0xc0170 a6e45b7d38 spi - disable rx/tx fifo, write/readable flags change 2014-01-07 20:23:54 +01:00
Sissors e5f13c047c Added Sleep, LED3 and LED4 definitions, switches
Sleep = KL25Z sleep (verified to work correctly)
LED3 = LED1, LED4 = LED2 (for compatibility, similar to LED3 = LED4 in
KL25Z code)
SW1 and SW3 for the two switches (SW2 is reset switch)
2014-01-07 18:35:41 +01:00
0xc0170 5d95041620 PWM - legacy mode, LOAD use for updating 2014-01-06 18:43:17 +01:00
bcostm dace8653e6 [NUCLEO_F103RB] Remove HSE re-configuration in sleep code. 2014-01-06 15:07:49 +01:00
bcostm 989c66165c Merge branch 'master' of https://github.com/mbedmicro/mbed 2014-01-06 11:22:35 +01:00
Bogdan Marinescu b311c56b44 Merge pull request #138 from ytsuboi/master
[LPC812] Add SPISlave function
2013-12-31 07:25:41 -08:00
ytsuboi 4fbf286ee3 [LPC812] change ssp_busy() to check RXOV 2013-12-31 20:24:46 +09:00
0xc0170 aa501c003b Shared PORT interrupt - check improved
- clocks must be enabled and also interrupt detected, otherwise
	  interrupt handler is not invoked.
2013-12-31 08:34:12 +01:00
0xc0170 a384d1d875 pwm channel 7 correction, enhanced mode 2013-12-30 18:12:01 +01:00
0xc0170 dc19dcbb94 fix - KL46Z cmsis header (v2.2), shared interrupt PORTCD
- Ports C and D sharing same interrupt vectors
	- KL46Z CMSIS header update
	- InterruptIn methods irq_disable/enable comment update
2013-12-30 12:19:24 +01:00
0xc0170 8d7c3da179 i2c clock from global clock value, syntax corrections 2013-12-30 11:39:36 +01:00
ytsuboi 0a11767877 [LPC812] enable SPISlave 2013-12-29 19:18:50 +09:00
0xc0170 63526032d9 K20D5M flash algo for template 2013-12-26 09:03:19 +01:00
0xc0170 78140c4aa1 LPTMR timer - OSCEN set, GCC startup vectors add 2013-12-25 20:02:56 +01:00
0xc0170 b73b57db26 I2C, pullup 2013-12-23 20:56:48 +01:00
0xc0170 c9a029ce6f Merge branch 'master' into K20D50 2013-12-23 20:01:05 +01:00
0xc0170 366221524a SPI, RTC, Serial changes
- SPI - implementation
	- RTC - there's 32.768kHz crystal, use that as a source
	- Serial - 10bit transfer
2013-12-23 19:57:10 +01:00
tkuyucu eb5fd7d6e0 timer overflow sync issue fixed. 2013-12-20 16:37:28 +01:00
tkuyucu 4756fb3a51 timer interrupts implemented correctly. TimeOut and Ticker classes should work. 2013-12-19 15:53:11 +01:00
bcostm 28120ffb19 [NUCLEO_F103RB] Change license text in ALL target files 2013-12-19 11:44:15 +01:00
tkuyucu 76d25ffb25 16-bit timer with sw overflow is used instead of the 32-bit timer. 2013-12-19 10:41:16 +01:00
Bogdan Marinescu 34a43eaa41 Merge branch 'flow_control'
Conflicts:
	workspace_tools/tests.py
2013-12-19 11:36:45 +02:00
Bogdan Marinescu bb8ed20a47 LPC1768 flow control fixes
- Disable TX buffer, this isn't compatible with the software CTS implementation
- Properly set hardware RTS/CTS pins when possible
- Modified test to use hardware CTS and software RTS
2013-12-19 11:31:23 +02:00
Yihui Xiong 6501b16213 Merge remote-tracking branch 'upstream/master' 2013-12-19 12:38:04 +08:00
Yihui Xiong a3465b5eac fix 16bit timer pwm output 2013-12-19 12:31:31 +08:00
tkuyucu 3c2258956b AnalogIn, Interrupts, and I2C are added. 2013-12-18 15:04:16 +01:00
0xc0170 988894e837 Merge branch 'master' into K20D50 2013-12-17 16:13:27 +01:00
bcostm 9702a131d4 Merge branch 'master' of https://github.com/mbedmicro/mbed 2013-12-17 11:10:12 +01:00
Bogdan Marinescu c560db3233 Merge branch 'KL46_DEV' of git://github.com/sg-/mbed into sg--KL46_DEV
Conflicts:
	README.md
2013-12-17 12:06:12 +02:00
bcostm c84b8f9193 [NUCLEO_F103RB] Use HSI/LSI instead of HSE/LSE
Due to Nucleo board revision C requirements.
2013-12-17 11:04:28 +01:00
Bogdan Marinescu 572b22395f Merge pull request #129 from bcostm/master
[NUCLEO_F103RB] InterruptIn, Sleep, RTC added
2013-12-17 00:41:36 -08:00
Bogdan Marinescu 2fb9de927c Merge pull request #127 from 0xc0170/dev_KL05Z_exporters
Dev kl05 z exporters
2013-12-17 00:40:49 -08:00
sg- 33ae2fe364 Updates to comments and README.md to add new target links 2013-12-16 18:41:39 -06:00
sg- 4445a11673 Add pulldown support to PinMode enum and fix pullup value to match register definition 2013-12-16 13:05:13 -06:00
bcostm adce27f269 [NUCLEO_F103RB] Add RTC 2013-12-16 14:33:58 +01:00
bcostm f8ecc9be46 [NUCLEO_F103RB] Allow ACK polling with I2C (again)
Go back to the last modification made by Bogdan.
2013-12-16 10:13:31 +01:00
bcostm 967509de53 [NUCLEO_F103RB] Add sleep 2013-12-16 09:56:00 +01:00
0xc0170 f7cee14193 KL05Z GCC support, exporters for arm_gcc, uvision 2013-12-15 11:54:44 +01:00
bcostm 956064b4bc [NUCLEO_F103RB] Add InterruptIn 2013-12-14 18:53:57 +01:00
Bogdan Marinescu bb3d95e9e5 Merge branch 'master' of github.com:mbedmicro/mbed 2013-12-13 13:37:50 +02:00
Bogdan Marinescu 1ae5a1d340 Added pin definitions for LPC11U35 quick stard board 2013-12-13 13:35:19 +02:00
Bogdan Marinescu da605b82a5 Merge pull request #126 from bcostm/master
[NUCLEO_F103RB] Update PWM IOs used + I2C cleanup
2013-12-13 01:29:29 -08:00
Bogdan Marinescu a164c6f498 [NUCLEO_F103RB] Allow ACK polling with I2C 2013-12-12 20:00:02 +02:00
bcostm 18136e3f09 [NUCLEO_F103RB] Update PWM IOs used + I2C cleanup 2013-12-12 15:44:21 +01:00
bcostm 2310b4c031 [NUCLEO_F103RB] Code cleanup 2013-12-12 10:35:04 +01:00
bcostm a129b8f8fa [NUCLEO_F103RB] Add more generic signal names for the examples. 2013-12-11 18:38:35 +01:00
Bogdan Marinescu c3d4d3079f Added DEVICE_SERIAL_FC as an indicator for the flow control implementation 2013-12-11 10:26:18 +02:00
bcostm 37b8acad68 [NUCLEO_F103RB] Code cleanup 2013-12-10 16:46:15 +01:00
0xc0170 5e9e53f934 PWM - changes to start the channel 2013-12-10 15:57:43 +01:00
bcostm d44996c26c Merge branch 'master' of https://github.com/mbedmicro/mbed 2013-12-10 10:35:26 +01:00
Bogdan Marinescu faee2bf073 [NUCLEO_F103RB] Serial interrupt fixes
- use TC flag instead of TXE for TX interrupt
- clear interrupt flags to prevent possible interrupt storm
2013-12-09 13:01:39 +02:00
Bogdan Marinescu 2b8e05e002 [NUCLEO_F103RB] Timer fixes
- the timer data structures were not properly initialized
- changed slave timer mode to external clock 1 (section 15.3.15 of the manual)
- avoid a possible race condition when concatenating the values of the
  two 16-bit timers
2013-12-07 14:26:54 +02:00
tkuyucu 3faaff74ee PwmOut working. 2013-12-06 15:30:58 +01:00
tkuyucu 105c31bcb3 SPISlave works. 2013-12-06 10:01:28 +01:00
tkuyucu 4ba79b77b4 SPISlave works. pwm_out works but needs more work to properly implement 0 pulse and 100% pulse. 2013-12-06 09:59:40 +01:00
Bogdan Marinescu 53cd64775d Hardware flow control implementation for LPC81X 2013-12-05 17:33:16 +02:00
Bogdan Marinescu 2ac6c4c531 Fixed RTS/CTS bit-banging on LPC1768 2013-12-04 19:46:12 +02:00
Bogdan Marinescu fbeb52d613 Added RTS/CTS flow control
Currently implemented only for LPC1768. On this platform, when hardware
flow control is not directly supported, it will be emulated.
Also added "not_implemented.c" as a placeholder for various HAL functions
that might not be implemented on all platforms (in this particular case,
serial_set_flow_control). These are weak implementations that default to a
"not implemented" error message.
2013-12-04 19:42:11 +02:00
bcostm 0aa8b93e26 NUCLEO_F103RB: Add I2C master api 2013-12-04 11:17:10 +01:00
tkuyucu 685274563e Port, Buffer, DigitalInOut, and Spi (master) works. 2013-12-02 16:33:08 +01:00
Bogdan Marinescu 49df530ae7 Merge pull request #118 from bcostm/master
Add STMicroelectronics NUCLEO_F103RB target
2013-12-02 03:15:58 -08:00
Bogdan Marinescu 6aaa134516 Merge pull request #117 from Sissors/master
Added (deep)sleep to KL25Z
2013-12-02 01:55:33 -08:00
bcostm 3bcf77e4f7 NUCLEO_F103RB: minor changes 2013-12-02 09:22:28 +01:00
Sissors 9f89a4d218 Added (deep)sleep to KL25Z
Sleep is wait mode

Deepsleep is very low power stop mode

During the interrupt that removes it from deepsleep it will run at low
speed until the PLL is automatically re-enabled after the interrupt.
2013-11-30 19:28:00 +01:00
0xc0170 d8d526f656 Merge branch 'master' into K20D50 2013-11-28 17:24:57 +01:00
Michael Moon a249e39826 Improved baudrate calculation function.
Uses 100% integer math, delivers more accurate results with fewer iterations in less time.

Since it seems most of the NXP chips use identical math, I have also altered the other targets in this commit.

If there are non-NXP chips which use a similar serial block, consider porting to those as well

Comparison:

         BAUD   DL MUL DIV  CPU_CLOCK
      -------  --- --- --- ----------
new: {   9600, 625,  1,  0,  96000000},	// Actual baud:    9600, error =0.00%,    1 iterations
old: {   9600, 625,  1,  0,  96000000},	// Actual baud:    9600, error =0.00%,    0 iterations

new: {  38400, 125,  4,  1,  96000000},	// Actual baud:   38400, error =0.00%,    8 iterations
old: {  38400,  81, 14, 13,  96000000},	// Actual baud:   38409, error +0.02%,  420 iterations

new: {  57600,  81,  7,  2,  96000000},	// Actual baud:   57613, error +0.02%,  120 iterations
old: {  57600,  54, 14, 13,  96000000},	// Actual baud:   57613, error +0.02%,  315 iterations

new: { 115200,  27, 14, 13,  96000000},	// Actual baud:  115226, error +0.02%,  120 iterations
old: { 115200,  27, 14, 13,  96000000},	// Actual baud:  115226, error +0.02%,  210 iterations

new: { 230400,  23, 15,  2,  96000000},	// Actual baud:  230179, error -0.10%,  120 iterations
old: { 230400,  17, 15,  8,  96000000},	// Actual baud:  230179, error -0.10%,  525 iterations

new: { 250000,  24,  1,  0,  96000000},	// Actual baud:  250000, error =0.00%,    1 iterations
old: { 250000,  24,  1,  0,  96000000},	// Actual baud:  250000, error =0.00%,    0 iterations

new: {1000000,   6,  1,  0,  96000000},	// Actual baud: 1000000, error =0.00%,    1 iterations
old: {1000000,   6,  1,  0,  96000000},	// Actual baud: 1000000, error =0.00%,    0 iterations

new: {2000000,   3,  1,  0,  96000000},	// Actual baud: 2000000, error =0.00%,    1 iterations
old: {2000000,   3,  1,  0,  96000000},	// Actual baud: 2000000, error =0.00%,    0 iterations

new: {   9600, 514, 15,  4, 100000000},	// Actual baud:    9600, error =0.00%,  110 iterations
old: {   9600, 337, 15, 14, 100000000},	// Actual baud:    9593, error -0.07%, 1365 iterations

new: {  38400,  93,  4,  3, 100000000},	// Actual baud:   38402, error +0.01%,  120 iterations
old: {  38400,  85, 12, 11, 100000000},	// Actual baud:   38363, error -0.10%,  525 iterations

new: {  57600,  62,  4,  3, 100000000},	// Actual baud:   57604, error +0.01%,  120 iterations
old: {  57600,  61,  9,  7, 100000000},	// Actual baud:   57633, error +0.06%,  840 iterations

new: { 115200,  31,  4,  3, 100000000},	// Actual baud:  115207, error +0.01%,  120 iterations
old: { 115200,  31,  4,  3, 100000000},	// Actual baud:  115207, error +0.01%,  525 iterations

new: { 230400,  19,  7,  3, 100000000},	// Actual baud:  230263, error -0.06%,  120 iterations
old: { 230400,  19,  7,  3, 100000000},	// Actual baud:  230263, error -0.06%,  735 iterations

new: { 250000,  25,  1,  0, 100000000},	// Actual baud:  250000, error =0.00%,    1 iterations
old: { 250000,  25,  1,  0, 100000000},	// Actual baud:  250000, error =0.00%,    0 iterations

new: {1000000,   5,  4,  1, 100000000},	// Actual baud: 1000000, error =0.00%,    8 iterations
old: {1000000,   5,  4,  1, 100000000},	// Actual baud: 1000000, error =0.00%,  315 iterations

new: {2000000,   2,  9,  5, 100000000},	// Actual baud: 2008929, error +0.45%,  120 iterations
old: {2000000,   2,  9,  5, 100000000},	// Actual baud: 2008929, error +0.45%,  315 iterations

new: {   9600, 625,  4,  1, 120000000},	// Actual baud:    9600, error =0.00%,    8 iterations
old: {   9600, 404, 15, 14, 120000000},	// Actual baud:    9602, error +0.02%, 1575 iterations

new: {  38400, 179, 11,  1, 120000000},	// Actual baud:   38408, error +0.02%,  120 iterations
old: {  38400, 101, 15, 14, 120000000},	// Actual baud:   38409, error +0.02%,  525 iterations

new: {  57600,  93,  5,  2, 120000000},	// Actual baud:   57604, error +0.01%,  120 iterations
old: {  57600,  68, 12, 11, 120000000},	// Actual baud:   57545, error -0.10%,  420 iterations

new: { 115200,  47, 13,  5, 120000000},	// Actual baud:  115248, error +0.04%,  120 iterations
old: { 115200,  34, 12, 11, 120000000},	// Actual baud:  115090, error -0.10%,  315 iterations

new: { 230400,  19,  7,  5, 120000000},	// Actual baud:  230263, error -0.06%,  120 iterations
old: { 230400,  17, 12, 11, 120000000},	// Actual baud:  230179, error -0.10%,  210 iterations

new: { 250000,  30,  1,  0, 120000000},	// Actual baud:  250000, error =0.00%,    1 iterations
old: { 250000,  30,  1,  0, 120000000},	// Actual baud:  250000, error =0.00%,    0 iterations

new: {1000000,   5,  2,  1, 120000000},	// Actual baud: 1000000, error =0.00%,    3 iterations
old: {1000000,   4,  8,  7, 120000000},	// Actual baud: 1000000, error =0.00%,  210 iterations

new: {2000000,   3,  4,  1, 120000000},	// Actual baud: 2000000, error =0.00%,    8 iterations
old: {2000000,   2,  8,  7, 120000000},	// Actual baud: 2000000, error =0.00%,  210 iterations
2013-11-29 02:44:14 +11:00
0xc0170 c5a2e6ed0e pwm, spi - pin definition, dac removed 2013-11-27 18:46:30 +01:00
bcostm 1159845529 NUCLEO_F103RB: update channels management in analogin api 2013-11-27 15:39:57 +01:00
tkuyucu 511e24ecc9 nRF51822 mbed SDK with working GPIO, RawSerial, and timer 2013-11-27 13:16:11 +01:00
0xc0170 0e99a7c9bd Analog API - pins, analog pins (arduino) correction, irq
- ADC - pins, mux
	- analog pins - Ax
	- irq - port A - E
2013-11-26 20:08:13 +01:00
Bogdan Marinescu 256f70fffc Merge remote-tracking branch 'origin/master' 2013-11-26 17:14:46 +02:00
Bogdan Marinescu 3c0a8b633f Provide generic pinout defines
This commit adds generic peripheral names to various mbed enabled
boards, to make it easier to write portable code amongst various
mbed boards.
2013-11-26 17:12:36 +02:00
bcostm dd292a7e71 NUCLEO_F103RB: Add pwmout api + change timers for ticker 2013-11-26 09:26:08 +01:00
bcostm c33dbfd63d Enable STDIO messages used by the test firmwares 2013-11-25 10:20:39 +01:00
0xc0170 3dc97b20c0 startup ARM - stack pointer, serial functional
- stack pointer correction
	- startup for ARM - clean up
	- GCC ARM linker - RAM size correction
	- NVIC - RAM address
2013-11-22 21:21:01 +01:00
Sissors 585e05ca6a Added sleep to LPC81x
http://mbed.org/users/mbed_official/code/mbed-src/pull-request/6
2013-11-21 08:19:44 +01:00
0xc0170 4e09b52a71 K20 uVision files, ld NVIC offset
- K20 KEIL files
	- clock set to 1 (48MHz)
	- offset in GCC ld for vectors in RAM
	- us ticker - PIT timer interrupt implementation
2013-11-19 20:06:26 +01:00
bcostm 415ac34b56 Add analogin, serial and spi support for NUCLEO_F103RB 2013-11-19 09:11:31 +01:00
0xc0170 8ca8014c00 Merge branch 'master' into K20D50 2013-11-18 20:34:45 +01:00
bcostm 6d9b523185 Update workspace_tools files 2013-11-14 11:07:01 +01:00
bcostm beb779b3d6 Rename target 2013-11-13 09:29:29 +01:00
Bogdan Marinescu 5b6faea448 Removed redundant label TARGET_LPC81X_COMMON 2013-11-11 13:28:18 +02:00
Joris Aerts 76ffc4935e Fix bug in gpio_set not setting reserved pins correctly
Loop going over reserved pins was not going over all entries as result of incorrect sizeof
2013-11-08 13:39:00 -08:00
bcostm b8ddfce3d0 Change folder name to TARGET_NUCLEO-F103RB 2013-11-08 11:19:09 +01:00
bcostm c0d5675480 Add STM NUCLEO64 STM32F10X basic files 2013-11-07 11:32:01 +01:00
0xc0170 f4591dbbab Merge branch 'upstream_master' into dev_kl46z 2013-11-05 22:08:07 +01:00
Emilio Monti 317a1f66d2 Merge pull request #91 from jorisa/master
Add CAN api filter support and LPC11CXX CAN implementation
2013-10-25 06:58:05 -07:00
Adam Green 969733ae8f serial_putc() to make better use of Tx FIFO
If don't know if this is an issue that anyone cares about.  I am also
not sure what the best way to solve it is either.  I just thought I
would issue a pull request with this commit to bring the issue to light
and show a possible solution that I have tested on my mbed-1768 device.

Previously the serial_putc() API didn't make any use of the Tx FIFO
since the serial_writable() API it utilizes only returns true when the
FIFO is completely empty.  This is due to the fact that the THRE bit of
the UART's LSR (Line Status Register) only goes high when the whole
FIFO is empty.

I noticed this when doing some performance testing with the network
stack.  I went from calling printf() to output 3 bytes every 10 seconds
(with packet drop stats) to instead output 4 bytes every 10 seconds.
I thought these should easily fit in the 16 byte FIFO but outputting
one extra byte caused an additional three 550 byte UDP packets to be
dropped.  This should only happen if the additional character being
sent to the UART was taking away extra CPU cycles from the network
stack.

My solution is to keep track of the number of bytes that have been
placed in the Tx FIFO since it was last detected as being completely
empty (via the THRE bit).  Only once this count hits 16 does the code
then block, waiting for the THRE bit to go high.  Each time the THRE
bit does go high, the count is reset to 0 again and it is incremented
for each byte that is loaded into the THR.
2013-10-25 15:17:06 +03:00
Bogdan Marinescu 544ac9e728 Disable DEVICE_STDIO_MESSAGES for LPC81X
Because the LPC81X HAL implementation calls error(), which in turn calls
fprintf(), quite a bit of code is added to the image, which is not a good
idea on such resource constrained targets.
2013-10-25 14:51:01 +03:00
Joris Aerts 739f2a6375 Add can_api hal implementation to LPC11CXX target
Most of the functionality works, interrupts might need a little more work.
2013-10-22 11:02:10 -07:00
Joris Aerts 067e446ae2 Add CAN->filter to API and add placeholders to hal's
Add filter function and modify CAN->read definition to allow reading specific messages.
2013-10-22 10:57:28 -07:00
0xc0170 b0537af763 gpio irq enable/disable
- InterruptIn disable_irq/enable_irq
2013-10-19 22:28:29 +02:00
0xc0170 d9ed7aba77 CMSIS KL46 files (were KL25 renamed) 2013-10-17 19:32:40 +02:00
Andreas Rebert a0a6cbe1d3 Merge branch 'master' into lpc4088 2013-10-11 14:02:59 +02:00
Andreas Rebert a574fd73b3 Bugfixes for I2C and port impl 2013-10-11 14:01:49 +02:00
0xc0170 122f24b83f Update: Merge branch 'master' into freedomKL46Z
Conflicts:
	workspace_tools/targets.py
2013-10-06 18:55:32 +02:00
Joris Aerts 7ed6acb08a Move pwmout_api.c/PeripheralNames.h to LPC11XX_11CXX common
Because CT32B1 (P1_1, P1_2 and P1_3) is used by us_ticker.c for wait and ticker function. Since wait/ticker is commonly used by mbed code and I decided CT32B1 of LPC11XX should only be used for this function, not for PwmOut.
P1_6 and P1_7 are used by UART (USBTX/USBRX) and I think they should not be assigned to other function.
2013-09-30 08:11:56 -07:00
Joris Aerts 4d0c864b16 Move adc_pinmap.h to LPC11XX_11CXX common
Merge back into analog_api.c. P1_3/ADC0_4 (SWDIO) now disabled for both targets
2013-09-30 08:07:26 -07:00
0xc0170 5dcd8ea10e ARM (KEIL) files for KL46Z 2013-09-29 20:40:06 +02:00
0xc0170 b83fd7fb3b MUX corrections, Arduino Analog signals
- added new MUX options to all drivers
  - removal of LED which are not there
  - analog arduino R3 signals were switched
2013-09-29 20:04:56 +02:00
Joris Aerts e1967755a5 Move spi_pinmap.h to LPC11XX_11CXX common
Merge back into spi_api.c. P0_10/SPI_0 (SWCLK) now disabled for both targets
2013-09-27 19:10:08 -07:00
Joris Aerts e9f5c8d3ca Move README.md to LPC11XX_11CXX common 2013-09-27 18:56:11 -07:00
Joris Aerts 3fe31ad50e Move objects.h to LPC11XX_11CXX common
Use #if DEVICE_CAN for can_s definition
2013-09-27 18:53:19 -07:00
Bogdan Marinescu f580c008b1 Merge pull request #78 from mconners/master
Added KL46Z support
2013-09-25 03:18:49 -07:00
Bogdan Marinescu 8f57c1e847 Merge remote-tracking branch 'github/master' 2013-09-25 10:27:17 +01:00
Bogdan Marinescu 30907d7772 Refactor LPC1114 and LPC11C24 code
Since most of the code for LPC1114 and LPC11C24 is similar, refactor the
code structure to avoid duplication of the common code.
2013-09-25 10:17:19 +01:00
Michael Conners 5bd25ac046 Added K20D5M support 2013-09-24 10:36:04 -04:00
Michael Conners afcc79ad27 Added KL46Z support 2013-09-24 10:01:06 -04:00
Andreas Rebert bb35d16521 Merged bugfixes and improvments for LPC1768 target to LPC4088 target 2013-09-23 11:39:52 +02:00
Emilio Monti 38ed9eb6a0 Merge pull request #72 from jorisa/master
Split uVision project source files in groups mbed/hal/src
2013-09-19 01:46:53 -07:00
Bogdan Marinescu 81b372d362 Merge pull request #73 from ytsuboi/master
Fixed LPC1114 ADC offset problem
2013-09-19 01:35:42 -07:00
Toyomasa Watarai 866858a816 Fixed LPC1114 ADC offset problem 2013-09-19 16:19:04 +09:00
Toyomasa Watarai f4bfe5aedb Revert "Fixed ADC offset problem"
This reverts commit 399acd1d6f.
2013-09-19 16:16:52 +09:00
Toyomasa Watarai 399acd1d6f Fixed ADC offset problem 2013-09-19 16:16:05 +09:00
Joris Aerts 979bba6864 Don't call mbed_interface_disconnect when DEVICE_SEMIHOST is disabled 2013-09-18 14:10:29 -07:00
Emilio Monti 96ea3db1b3 Merge pull request #66 from dinau/lpc2368_mod
LPC2368 mod
2013-09-16 08:00:20 -07:00
dinau efbc52465d LPC2368 [GCC_ARM]: Silence some warnings. 2013-09-13 22:01:21 +09:00
Emilio Monti 2481fbe2a2 Merge pull request #62 from arebert/lpc4088
LPC4088: PIN mode fix, export to external tools and MAC address retrieval
2013-09-13 05:59:14 -07:00
Erik Olieman 94ff741989 LPC1768 InterruptIn speedup
Use __CLZ to speed up GPIO interrupt processing.
2013-09-11 18:46:18 +03:00
Bogdan Marinescu 171dda705c Merge pull request #63 from jorisa/master
Fix hardfault when attaching callback to CAN2 when CAN1 is not defined
2013-09-10 03:22:55 -07:00
Joris Aerts efd3d8d8e0 Fix hardfault when attaching callback to CAN2 when CAN1 is not defined
Fault is triggered by trying to read LPC_CAN1->IER when the peripheral is powered off. Fixed by checking the power control register before checking the IER register.
2013-09-09 09:06:04 -07:00
Bogdan Marinescu cfa6a1d912 Merge pull request #61 from ytsuboi/master
Fixed problem in PWMOUT mapping table
2013-09-09 08:22:11 -07:00
Andreas Rebert 00cfdbad2a Merge remote-tracking branch 'upstream/master' into lpc4088 2013-09-09 14:13:08 +02:00
unknown 0e36bdd457 Bugfix: PIN Modes was not set correctly
Added: Export to uVision and Code Red toolchains
2013-09-09 14:10:11 +02:00
Bogdan Marinescu 1f243a900c Merge remote-tracking branch 'github/master' 2013-09-09 12:31:42 +03:00
Bogdan Marinescu fded46b459 [LPC1768] Fix serial_clear
serial_clear() erroneously disabled the UART FIFOs.
Reported by Adam Green.
2013-09-09 12:28:11 +03:00
Toyomasa Watarai d0d2df3ce5 Fixed problem in PWMOUT mapping table
Fixed problem in PWMOUT output issue.
Startup code cean-up (correced exception names).
Corrected test cases.
2013-09-09 18:15:51 +09:00
Bogdan Marinescu d51411294f Merge pull request #57 from adamgreen/serialTxDropsRx
serial_putc() can cause rx bytes to be dropped
2013-09-09 01:19:29 -07:00
Joris Aerts 743e178455 Fix MASKED_ACCESS bug in gpio_init, now same as LPC11xx (Also use PIN_SHIFT instead of magic number 8 in gpio_set) 2013-09-08 18:57:40 -07:00
Adam Green 5d27f98c7b serial_putc() can cause rx bytes to be dropped
While fixing this issue in the various LPC* ports, I noticed a comment
pointing to this mbed forum post which summarizes this bug quite well:
  https://mbed.org/forum/bugs-suggestions/topic/4473/

This bug was introduced in the following commit:
2662e105c4

The following code was added to serial_putc() as part of this commit:
    uint32_t lsr = obj->uart->LSR;
    lsr = lsr;
    uint32_t thr = obj->uart->THR;
    thr = thr;

As the forum post indicates, this causes the serial_putc() routine to
actually eat an inbound received byte if it exists since reading THR is
really reading the RBR, the Receiver Buffer Register.  This code looks
like code that was probably added so that the developer could take a
snapshot of these registers and look at them in the debugger.  It
probably got committed in error.
2013-09-07 00:44:44 -07:00
Bogdan Marinescu 95f6826196 Refactor code for LPC810/LPC812
There were lots of overlaps in the code for LPC810 and LPC812, including
duplicated source files. This commit adds a TARGET_LPC81X_COMMON folder in
both HAL and CMSIS, this folder keeps common code for the targets.
2013-09-05 19:00:19 +03:00
ytsuboi 46003d4c3c Merge remote-tracking branch 'upstream/master' 2013-09-05 13:01:12 +09:00
Abe Karplus 96101aed32 Added complete PwmOut mappings for KL25Z 2013-09-04 15:52:58 +03:00
ytsuboi 8dd6bdb701 [LPC810] add LPC810 support 2013-08-24 15:49:16 +09:00
Toyomasa Watarai 1ff64de847 Fixed gpio_irq_api bugs
Corrected improper implementation of channel_ids[] usage.
Revemod redundant arrays e.g. pin_names[] and trigger_events[]
2013-08-21 16:46:03 +09:00
Toyomasa Watarai 10e30b5cfb Fixed error handling and cleanup 2013-08-21 10:46:37 +09:00
Toyomasa Watarai 1d1c8c6391 Removed SWCLK and SWDIO pins from pinmap 2013-08-16 00:17:52 +09:00
Toyomasa Watarai 9f2a930f31 Fixed GPIO read operation 2013-08-14 22:43:03 +09:00
Toyomasa Watarai b632d8db46 Removed redundant code in serial_api 2013-08-14 22:29:31 +09:00
Toyomasa Watarai 83e065d1bc Fixed missing mask register setting for I2C 2013-08-14 22:28:30 +09:00
Adam Green 692e666ced Silence signed/unsigned comparison warnings in GCC.
i2c_frequency() compares a uint32_t ref variable to the int hz
function parameter passed in by the caller.  I forced this to be an
uint32_t comparison.

i2c_slave_write() declared i and count variables to be of type uint32_t
but used them as int type throughout the code (in comparisons and
returns) so I switched them to be of signed int type.

spi_frequency() contains a change similar to that made in
i2c_frequency().
2013-08-13 01:47:20 -07:00
Adam Green 461a3dd0d2 Cast to matching enumeration type instead of uint32_t
This commit targets the KL25Z code, whereas previous ones targetted
similar issues in the LPC1768 and LPC11U24 mbed HAL code.

These changes were made to silence GCC warnings and fix potential bugs
where they would never be equal when the enumeration wasn't a 32-bit
type.

For example, pinmap.c used to contain this code:
    if (pin == (uint32_t)NC) return;
I switched it to:
    if (pin == (PinName)NC) return;

I wonder why this casting to uint32_t was done in the first place?
Maybe another supported compiler requires it?
2013-08-13 01:47:20 -07:00
Adam Green cc56997a70 Cast to matching enumeration type instead of uint32_t
This commit targets the LPC11U24 code, whereas a previous one
targetted similar issues in the LPC1768 mbed HAL code.

These changes were made to silence GCC warnings and fix potential bugs
where they would never be equal when the enumeration wasn't a 32-bit
type.

For example, pinmap.c used to contain this code:
    if (pin == (uint32_t)NC) return;
I switched it to:
    if (pin == (PinName)NC) return;

I wonder why this casting to uint32_t was done in the first place?
Maybe another supported compiler requires it?
2013-08-13 01:47:19 -07:00
Adam Green 8fe7276b98 Silence signed/unsigned comparison warnings in GCC.
Why do the wait APIs take a signed integer if they are going to be
compared to unsigned quantities?
2013-08-13 01:47:19 -07:00
Adam Green c411823656 Fix operator precedence warning in can_api.c
The original code was:
    if(LPC_CAN1->IER | LPC_CAN2->IER != 0) {

This would actually be interpreted as:
    if(LPC_CAN1->IER | (LPC_CAN2->IER != 0)) {
I simplified it to:
    if(LPC_CAN1->IER | LPC_CAN2->IER) {
With the comparison removed, the GCC warning no longer fires since the
user's intent is no longer unclear.  However, the end result should be
the same.
2013-08-13 01:47:19 -07:00
Adam Green 15f833bc1b Cast to matching enumeration type instead of uint32_t
These were done to silence GCC warnings and fix potential bugs where
they would never be equal when the enumeration wasn't a 32-bit type.

For example, common/pinmap_common.c used to contain this code:
    if (pin == (uint32_t)NC)
I switched it to:
    if (pin == (PinName)NC)

I wonder why this casting to uint32_t was done in the first place?
Maybe another supported compiler requires it?
2013-08-13 01:47:19 -07:00
Bogdan Marinescu 1a47a218a4 [KL25Z] Fixed counter type for i2c_read operations. 2013-08-12 12:31:05 +03:00
Andreas Rebert 75dba19438 Updated pin mapping and CAN HAL for LPC4088 target 2013-08-08 13:57:02 +02:00
Bogdan Marinescu 9ee1fc9f55 [KL25Z] Fix I2C issue related to the silicon errata.
Makes a difference when running the I2C EEPROM test at 400KHz, which has a 100%
success rate after this change.
2013-08-07 14:49:11 +03:00
Bogdan Marinescu 1e8e50996c [KL25Z] Restore full SPI pin mappings 2013-08-07 14:42:02 +03:00
Emilio Monti 1142df8cfd Merge pull request #22 from matthewelse/anotherpullrequest
PWM Patch Pull Request
2013-08-07 02:20:51 -07:00
Matthew Else e1eb357c53 Added changes to PWM API from LPC1114 to LPC11C24 2013-08-07 09:45:47 +01:00
Matthew Else b437a3ca22 Removed can_api.c from TARGET_LPC11CXX, as it's not ready for pull request yet. 2013-08-07 09:43:28 +01:00
Toyomasa Watarai 0c0b51f663 Fixed pwm_api bug
Corrected pwm_timer_map table for LPC1114
2013-08-07 16:24:58 +09:00
0xc0170 6127ed3bb7 KL25Z adc channels A
- only channels B were available
2013-08-06 21:21:03 +02:00
Matthew Else 548d18ebd7 Pull in changes to the main mbed code base. 2013-08-06 20:04:32 +01:00
Matthew Else d29ebefbd9 Begin to add can_api.c to LPC11C24 codebase. Not complete yet, which is why it's #if 0ed out. Lots of build errors come up if #if0 isn't there, which is why it is for now. 2013-08-06 17:41:31 +01:00
Emilio Monti e42786649f The LPC1347 board does not have an interface chip 2013-08-06 16:36:03 +01:00
Matthew Else 45470aba31 Updated READMEs 2013-08-06 15:09:41 +01:00
Matthew Else bf02700a32 Merge https://github.com/jorisa/mbed 2013-08-06 09:43:52 +01:00
Matthew Else f7a2be4bed Merge remote-tracking branch 'upstream/master' 2013-08-06 09:42:09 +01:00
Joris Aerts c747e2533f Rename some argument and enum names to match existing naming
Add CAN->mode(Mode mode) function (not implemented in hal)
2013-08-05 17:28:27 -07:00
emilmont 4f03cd09b8 Remove undefined peripherals 2013-08-05 22:09:32 +01:00
0xc0170 e1af24c1f2 Spaces correction 2013-08-05 19:06:22 +02:00
Matthew Else ef28879863 Merged remote tracking branch 'upstream/master' 2013-08-05 17:22:01 +01:00
Matthew Else 2c45596673 Merge https://github.com/jorisa/mbed 2013-08-05 17:11:58 +01:00
Matthew Else 7c8c7228c8 Pushed LPC1114 I2C updates to the LPC11C24 2013-08-05 17:09:22 +01:00
0xc0170 3c0775f5c3 More pin mux options for KL25Z
- as reported in mbed bug section, add all available mux options
2013-08-04 21:33:06 +02:00
Emilio Monti 54893092c3 Merge pull request #17 from matthewelse/forpullrequest
LPC1114 Port Pull Request
2013-08-02 08:56:44 -07:00
matthewelse 7827d62504 Added alternative DIP package names for pins in the LPC1114
Added this so it is consistent with the notebook page.
2013-08-02 10:38:05 +01:00
Joris Aerts f685efa9b2 Merge remote-tracking branch 'upstream/master' 2013-08-01 17:24:20 -07:00
Matthew Else d899612525 Merge branch 'forpullrequest' 2013-08-01 16:25:28 +01:00
Matthew Else 0f7ece02a8 Fixed I2C API 2013-08-01 16:23:13 +01:00
Matthew Else df5c36a9ae Uncommented i2c_wait_SI(obj), as it should not have been commented out. 2013-08-01 16:04:18 +01:00
Matthew Else dc68b76d0f Added timeout for i2c_stop in LPC1114 target. 2013-08-01 15:46:05 +01:00
Joris Aerts a16dc72272 Add @param documentation for new event parameter
Add clear irq to attach() template function
Call irq_handler for every interrupt set
2013-07-31 10:45:28 -07:00
Joris Aerts 63b2b271d1 Refactor CAN interrupt handling to LPC176X HAL implementation
Add handlers for other CAN interrupt events
Changed CAN private entities to protected
2013-07-31 07:26:32 -07:00
Joris Aerts 8ef8aac36e Merge remote-tracking branch 'upstream/master' 2013-07-30 19:16:34 -07:00
Joris Aerts 51bfe267f4 Add can_t->index to struct and set it during can_init 2013-07-30 15:17:40 -07:00
Matthew Else 07cddbf038 Merge remote-tracking branch 'upstream/master' 2013-07-30 12:01:49 +01:00
Bogdan Marinescu 1cd95c2467 [KL25Z] Fix clock generation for I2C and SPI
Don't set a clock higher than the one requested for the I2C and SPI interfaces,
even if this setting is the closest to the requested one. This was causing
some issues with the EEPROM test and possibly other issues with the SPI SD test.
2013-07-29 18:20:04 +03:00
matthewelse 429d2e61eb Enabled CAN for LPC11CXX in device.h 2013-07-29 10:59:18 +01:00
Matthew Else 200b263dcd Added basic stuff necessary to compile for LPC11C24 target. 2013-07-27 18:12:35 +01:00
Matthew Else 153153f261 Added serial_break_clear/serial_break_set
Fixes #24
2013-07-26 11:44:09 +01:00
Matthew Else 3172fd97ca Fix both edge bug in gpio_irq_api.c
Fixes #22
2013-07-26 09:41:20 +01:00
Matthew Else a356553c7d Fixed incorrect use of static in port_api.c
This was causing errors when compiling in GCC_ARM
2013-07-25 16:01:45 +01:00
Matthew Else c3ebd47071 Tidying up gpio_irq_api.c 2013-07-25 10:43:49 +01:00
Matthew Else a7ba27618d Fixed bug in gpio_irq_api
Test interruptin now works. Fixes #16
2013-07-25 10:26:46 +01:00
Matthew Else df067bd4e9 Complete support for GPIO interrupts. 2013-07-24 16:02:01 +01:00
Matthew Else 3d08be9700 Attempt to fix the interrupts problem. 2013-07-24 11:00:07 +01:00
Toyomasa Watarai a125a25a97 Implemented PortIn, PortOut and PortInOut API #8
Followingt test cases have been passed:
* PortOut (#24)
* PortOut PortIn (#9)
* PortInOut (#8)
2013-07-24 18:37:12 +09:00
matthewelse d67d4f7fc1 Create README.md 2013-07-23 15:54:13 +01:00
Matthew Else 55f91f1da8 Fixed errors in gpio_irq_api.c 2013-07-23 15:44:24 +01:00
Matthew Else c56d1a5236 Fully implemented GPIO_IRQ
* Removed unused variables/comments.
* As of yet, untested...
2013-07-23 15:35:38 +01:00
Matthew Else 819ca5547c Removed extraneous comment from the function 2013-07-23 14:21:40 +01:00
Matthew Else 8011992021 Fully implemented gpio_irq_set 2013-07-23 14:19:33 +01:00
Matthew Else fea818fccb Updates to interrupt handling 2013-07-22 13:56:56 +01:00
Matthew Else 1da8e8a2c7 Started to implement gpio_irq_set 2013-07-22 13:30:00 +01:00
Matthew Else 4cf6f09411 Enabled the interrupts api to compile 2013-07-22 12:46:46 +01:00
Toyomasa Watarai 2a989551aa Fixed gpio_api
Corrected base address of GPIO port register
2013-07-22 18:53:45 +09:00
Matthew Else 1097af7091 Added DIP package pins to PinNames.h 2013-07-22 09:30:47 +01:00
ytsuboi ca31bda530 Removed printf debug lines 2013-07-22 14:55:19 +09:00
Toyomasa Watarai 794ab9cbd3 Fixed #9 and test ticker test code
Clean-up GPIO stuff, but it shoud be same behavior as before.
2013-07-21 23:04:46 +09:00
Matthew Else 84a76cd8d8 Added a load of debug lines
Basically this outputs a load of stuff to the serial port. I'm just
using this to get an idea of where the error lies within the code...
2013-07-19 16:56:49 +01:00
Matthew Else 66ca1c9db2 Refactored bits of gpio_api.c
In between the last two commits, I added debugging lines using serial to
try and locate the line of code that was causing the issues with GPIO.
However, didn't get anywhere with this because the gpio_write function
is defined in a header file, rather than in an implementation file, so
the printf function can't go there. As a result, it's just refactoring.
2013-07-19 15:23:25 +01:00
Matthew Else a9bb4aa5cb Lots of changes, fixing build bugs and renaming
Files renamed to fit with the new style folder structure
2013-07-19 13:59:50 +01:00
Matthew Else 18c291b7ce Added ytsuboi's modifications for using the 1114 2013-07-19 11:24:51 +01:00
Bogdan Marinescu 0c33d40fbb Added support for UART break generation. 2013-07-17 15:29:39 +03:00
samuel.mokrani@arm.com f2ea747280 [LPC1347] Change LED pin names 2013-07-17 15:27:10 +03:00
Bogdan Marinescu 358e84edf3 [LPC1347] Added GPIO interrupts 2013-07-17 15:17:20 +03:00
samuel.mokrani@arm.com 5b0fe44b0d [LPC1347]: first implementation of analogIn (not tested) 2013-07-17 15:17:19 +03:00
samuel.mokrani@arm.com 6b7f4b998e [LPC1347]: first implementation of PWMOut (not tested) 2013-07-17 15:17:09 +03:00
Bogdan Marinescu 721082257c Preliminary support for LPC13XX
Works only with GCC_ARM for now.
2013-07-17 14:57:02 +03:00
jesusalvarez 804176b806 Update targets and pins for LPC43xx 2013-07-07 23:27:11 -04:00
0xc0170 43ace93009 removed KL05Z hw tests + mv KL05Z to TARGET_Freescale 2013-07-04 17:57:52 +02:00
0xc0170 551f06b66b Merge branch 'master' into freedomKL05
Conflicts:
	workspace_tools/toolchains/arm.py
2013-07-04 17:40:46 +02:00
0xc0170 2b57ae9c23 KL25 + KL05 - no pull down, pullup for INPUT pins by default
- pull down removal
  - ARMCC - debug information option
2013-07-03 19:39:19 +02:00
Emilio Monti 597c62e06a Add the vendor name as a proper target label 2013-07-03 17:14:43 +01:00
Helmut Schmucker e38bce5ccd fix for mbed lib issue 1 (i2c problem)
see also https://mbed.org/users/mbed_official/code/mbed/issues/1
2013-07-03 16:12:03 +01:00
0xc0170 c1c1102a89 i2c api update 2013-07-02 20:27:20 +02:00
0xc0170 9ff042699b Update freedomKL05 from upstream master 2013-07-02 19:44:15 +02:00
0xc0170 90bb8521aa ADC, code indentation
- ADC resolution - 12bit, all pins definition
  - code indentation
2013-07-02 19:34:11 +02:00
Joe Turner fac01e3186 Fix setting GPIO input/output mode. 2013-07-02 10:37:24 +01:00
0xc0170 ed200183d0 RTC OSC32, systemUpdate v0.1
- RTC clock init from crystal, tested
  - system update function
  - startup - handler PORTB correction
2013-07-01 21:32:22 +02:00
Emilio Monti 95e66aa4c6 Move the target dependent code from the shared code to the HAL implementation 2013-07-01 18:05:31 +01:00
Bogdan Marinescu 28961db4a5 Added timeout to i2c_stop operations
Fixes this issue:

http://mbed.org/users/mbed_official/code/mbed/issues/3
2013-07-01 16:28:35 +01:00
Bogdan Marinescu bfeb47f523 I2C API refactoring
Now the I2C send/receive functions in the mbed HAL return the number of
bytes actually transferred or an error code (a negative value). The
public API remains unchanged.
2013-07-01 16:28:32 +01:00
0xc0170 20789374a0 i2C - pulse definition, serial - define correction 2013-06-29 09:10:26 +02:00
0xc0170 7d3864f27b Update KL05 to mbed new structure 2013-06-29 09:08:28 +02:00
Joe Turner 3e40b905f0 Merge branch 'master' of git://github.com/mbedmicro/mbed into STM32F4
Conflicts:
	workspace_tools/targets.py
2013-06-26 13:34:34 +01:00
jesusalvarez ecd051c7a1 LPC43xx port from Micromint 2013-06-25 02:20:08 -04:00
Emilio Monti 984ba4b113 Refactor the build system:
* add sets of TARGET and TOOLCHAIN "labels"
2013-06-24 14:32:08 +01:00