Commit Graph

165 Commits (240758db42aaa42b2abd50daea5033c3cc7e80dc)

Author SHA1 Message Date
Martin Kojtal 5a1ccc0f2f
Merge pull request #11780 from OpenNuvoton/nuvoton_fpga_perif_free
Nuvoton: Add implementations of HAL API i2c_free and analogin_free
2019-11-04 09:49:36 +01:00
Chun-Chieh Li 72ea613a12 Nuvoton: Add i2c_free
1.  Disable interrupt
2.  Disable IP clock
3.  Free up pins

Support targets:

-   NUMAKER_PFM_NANO130
-   NUMAKER_PFM_NUC472
-   NUMAKER_PFM_M453
-   NUMAKER_PFM_M487/NUMAKER_IOT_M487
-   NU_PFM_M2351*
-   NUMAKER_IOT_M263A
-   NUMAKER_M252KG
2019-10-31 15:22:57 +08:00
Chun-Chieh Li 3abd02614a Nuvoton: Add analogin_free
1.  Deal with channel-wise and module-wise
2.  Disable IP clock
3.  Free up pin

Support targets:

-   NUMAKER_PFM_NANO130
-   NUMAKER_PFM_NUC472
-   NUMAKER_PFM_M453
-   NUMAKER_PFM_M487/NUMAKER_IOT_M487
-   NU_PFM_M2351*
-   NUMAKER_IOT_M263A
-   NUMAKER_M252KG
2019-10-31 15:19:15 +08:00
int_szyk d68a802f07 Add watchdog clock accuracy to Nuvoton targets. 2019-09-30 08:10:25 +02:00
Chun-Chieh Li bab5d27e26 [M453] Classify by M45xD/M45xC and M45xG/M45xE
M451 series can classify by M45xD/M45xC and M45xG/M45xE. To support this
classification:
1.  Create TARGET_M45xD_M45xC and TARGET_M45xG_M45xE targets.
2.  Mark NUMAKER_PFM_M453 belongs to TARGET_M45xG_M45xE by 'extra_labels_add'
    in targets.json.
3.  Fix pin name table according to the classification.
4.  Fix pinmap table according to the classification.
2019-08-20 13:12:43 +08:00
Chun-Chieh Li c3d7ef8341 [Nuvoton] Free up peripheral pins in peripheral free-up HAL API
Without free-up of peripheral pins, peripheral pins of the same peripheral may
share by multiple ports after port iteration, and this peripheral may fail with
pin interference.
2019-08-20 13:12:43 +08:00
Chun-Chieh Li 09bf844d76 [Nuvoton] Fix redundant call to UART IRQ handler
Honor RxIrq/TxIrq to avoid redundant call to UART IRQ handler.

This is also to fix FPGA CI test mbed_hal_fpga_ci_test_shield-uart.
2019-08-20 13:12:42 +08:00
Chun-Chieh Li d46c6fea47 [Nuvoton] Fix redundant SPI clock generation
Fix SPI clocks are generated redundantly at the end of transfer.

This is also to fix FPGA CI test mbed_hal_fpga_ci_test_shield-spi/
SPI - async mode.
2019-08-20 13:12:42 +08:00
Chun-Chieh Li 80c21aeff5 [Nuvoton] Fix I2C NACK error
Fix logic error on replying NACK at the end of transfer.

This is also to fix FPGA CI test mbed_hal_fpga_ci_test_shield-i2c/
i2c - test single byte read i2c API.
2019-08-20 13:12:42 +08:00
Chun-Chieh Li fef138a3cd [Nuvoton] Fix IP initialization sequence
Better IP initialization sequence:
1. Configure IP pins
2. Select IP clock source and then enable it
3. Reset the IP (SYS_ResetModule)

NOTE1: IP reset takes effect regardless of IP clock. So it doesn't matter if
       IP clock enable is before IP reset.
NOTE2: Non-configured pins may disturb IP's state, so IP pinout first and then
       IP reset.
NOTE3: IP reset at the end of IP initialization sequence can cover unexpected
       situation.
2019-08-20 13:12:41 +08:00
Chun-Chieh Li 560fe33ed8 [Nuvoton] Exclude USB UART from testing
USB UART is dedicated to USB COM and so must exclude from FPGA CI testing.
2019-08-20 13:12:41 +08:00
Chun-Chieh Li f88bd72c19 [Nuvoton] Force enum PinName to 32-bit
NU_PINNAME_BIND(...) requires enum PinName to be 32-bit to encode module
binding information in it.
2019-08-20 13:12:41 +08:00
Martin Kojtal ccb63d771e
Merge pull request #10857 from ARMmbed/feature-watchdog
Add Watchdog and ResetReason
2019-07-03 11:43:52 +01:00
Chun-Chieh Li 016ab2a417 [Nuvoton] Fix channel release in analogout_free() 2019-06-13 18:11:50 +08:00
Rajkumar Kanagaraj 50c6e9f481 Added the SPDX identifier 2019-05-24 12:32:53 +02:00
ccli8 84440531f1 [Nuvoton] Support watchdog timer 2019-05-24 12:20:01 +02:00
ccli8 6e514b6e08 [Nuvoton] Support reset reason 2019-05-24 11:35:44 +02:00
ccli8 be96ade527 [Nuvoton] Add button names BUTTON1/BUTTON2 2019-03-26 17:05:43 +08:00
deepikabhavnani 0dc5561991 Guard RAM start and size defines 2019-02-28 19:54:38 -06:00
deepikabhavnani 2a192509c3 Target_NUVOTON: Add ARM_LIB_STACK and ARM_LIB_HEAP section
Instead of user defined symbols in assembly files or C files,
use linker scripts to add heap and stack - this is inconsistent
with ARM std linker scripts
2019-02-28 19:54:38 -06:00
Deepika b2e189f453 Target_Nuvoton: Remove target specific implementation of _sbrk 2019-02-19 15:49:49 -06:00
Russ Butler 8669417e7b Add HAL API for spi pinmap
Add the functions to get spi pinmaps to all targets.
2019-02-08 09:10:37 -06:00
Russ Butler 34c176654d Add HAL API for serial pinmap
Add the functions serial_tx_pinmap, serial_rx_pinmap, serial_cts_pinmap
and serial_rts_pinmap to all targets.
2019-02-08 09:10:28 -06:00
Russ Butler be492fe07a Add HAL API for pwmout pinmap
Add the function pwm_pinmap to all targets.
2019-02-08 09:10:19 -06:00
Russ Butler 22a89773fa Add HAL API for i2c pinmap
Add the functions i2c_master_sda_pinmap, i2c_master_scl_pinmap,
i2c_slave_sda_pinmap and i2c_slave_scl_pinmap to all targets.
2019-02-08 09:10:12 -06:00
Russ Butler 7e8695a2c5 Add HAL API for can pinmap
Add the functions can_rd_pinmap and can_td_pinmap to all targets.
2019-02-08 09:10:10 -06:00
Russ Butler 3bd3aca6db Add HAL API for analog out pinmap
Add the function analogout_pinmap to all targets.
2019-02-08 09:10:05 -06:00
Russ Butler 4818f88d73 Add HAL API for analog in pinmap
Add the function analogin_pinmap to all targets.
2019-02-08 09:09:51 -06:00
ccli8 17fb5b7ff2 [Nuvoton] Fix UART flow control CTS/RTS
Configure RTS pin outout to active low when RTS is disabled. This allows the peer to be able
to send data if its CTS is still enabled.
2018-12-25 18:21:11 +08:00
ccli8 244d4b6405 [Nuvoton] Support boot stack size configuration option 2018-12-14 17:29:55 +08:00
Cruz Monrreal 0f0e63aaac
Merge pull request #8900 from OpenNuvoton/nuvoton_refine_uart
Nuvoton: Refine UART init/deinit
2018-12-04 11:51:16 -06:00
ccli8 a2c70f2ca4 [Nuvoton] Fix time to init/deinit stdio_uart
With support for checking H/W UART initialized or not, we can simplify stdio management:
1. When serial_init(&stdio_uart) calls in, just set the 'stdio_uart_inited' flag.
2. When serial_free(&stdio_uart) calls in, just clear the 'stdio_uart_inited' flag.
Except above, we needn't make special handling with 'stdio_uart'.
2018-11-29 10:23:22 +08:00
ccli8 a937a62bff [Nuvoton] Check configuration option for default UART baudrate setting 2018-11-28 16:59:15 +08:00
ccli8 ae98b94a10 [Nuvoton] Avoid re-configuring UART in serial_init() for the same H/W UART
The same H/W UART may be shared by multiple serial_t objects. This fix tries to avoid
re-configuring the same H/W UART in serial_init() when there are multiple serial_t
objects constructed. To re-configure UART, call serial_baud() and serial_format()
explicitly. This can avoid confusion when e.g. a newly constructed serial_t object
changes baudrate unexpectedly in serial_init().
2018-11-28 16:26:21 +08:00
ccli8 6b16112962 [Nuvoton] Remove unused pin_tx/pin_rx fields from serial_s struct 2018-11-28 16:17:39 +08:00
ccli8 e24a3c09d7 [Nuvoton] Fix license description for analog-out HAL files
1. Fix copyright year
2. Add SPDX
2018-11-27 09:44:27 +08:00
ccli8 e36c074359 [Nuvoton] Support DAC 2018-11-21 17:09:35 +08:00
Deepika e1ecce85ba Nuvoton: Fix alignment of execute region to 8-byte boundary
--legacyalign, --no_legacyalign are deprecated from ARMC6 compiler, in order to
remove deprecated flags all linker files (GCC and IAR as well to have uniformity)
should strictly align to 8-byte boundary
2018-10-09 10:15:07 -05:00
Martin Kojtal 59ce41f255
Merge pull request #8049 from OpenNuvoton/nuvoton_fix_hal_sleep
Nuvoton: Fix mbed_hal-sleep test failed
2018-10-01 11:48:25 +02:00
Cruz Monrreal 815683c2bd
Merge pull request #7941 from OpenNuvoton/nuvoton_fix_gpio_mode_mapping
Nuvoton: Fix GPIO mode mapping
2018-09-25 13:15:09 -05:00
ccli8 beb04a82dc [Nuvoton] Fix serial corruption due to deep sleep
Prevent deep sleep when there is still any character being transmitted on the UART.
This allows tickless to be safely enabled.
2018-09-10 10:55:44 +08:00
ccli8 310b12a235 [Nuvoton] Fix HAL sleep test failure with lp_ticker
Replace wait_us with nu_busy_wait_us in lp_ticker since wait_us is not allowed in sleep test
which would suspend us ticker layer on which wait_us relies. nu_busy_wait_us is implemented
by calling us ticker HAL API directly rather than relying on us ticker layer.
2018-09-10 10:55:44 +08:00
ccli8 ab7b93ca58 [Nuvoton] Synchronize us_ticker to lp_ticker
This is to make implementations of us_ticker/lp_ticker consistent.
2018-09-10 10:50:22 +08:00
ccli8 6639a92bcd [Nuvoton] Fix lp_ticker_free cannot pass speed test 2018-09-10 10:50:22 +08:00
ccli8 9ee83f575a [Nuvoton] Fix spurious us_ticker/lp_ticker interrupts
If us_ticker/lp_ticker is scheduled and then the interrupt is disabled, the originally scheduled
interrupt may still become pending. If this occurs, then an interrupt will fire twice on the next
call to us_ticker_set_interrupt/lp_ticker_set_interrupt - once immediately and then a second time
at the appropriate time.

This patch prevents the first interrupt by clearing interrupts in
us_ticker_set_interrupt/lp_ticker_set_interrupt before calling NVIC_EnableIRQ.
2018-09-10 10:50:21 +08:00
Yossi Levy acfda5895e Changes in PR #7774 of PinNames.h should be reverted. This commit reverts those files excpet for K82F and K64F which are left as an example 2018-09-05 14:13:05 +03:00
ccli8 55328ebdd5 [Nuvoton] Fix pin mode mapping between input pull mode/direction and I/O mode
1. Modify PinMode enum to fully support GPIO I/O modes.
2. Translate input pull mode/direction to I/O mode, where H/W doesn't support
   separate configuration for input pull mode/direction.
3. Allow for configuring I/O mode in addition to input pull mode.
2018-08-31 10:06:30 +08:00
Yossi Levy ed8e170d15 Moving SD, SPIF and FLASHIAP into mbedos and refactoring features storage directory structure. 2018-08-29 12:01:11 +03:00
Oren Cohen 787317b7eb Remove uVisor from mbed-os 2018-08-22 16:36:59 +03:00
ccli8 6909159420 [Nuvoton] Organize file structure
This re-organization is to avoid duplicates regarding targets of the same MCU series.
2018-08-01 18:00:16 +08:00