This PR provides implementation of ticker_free() function for the following boards:
ARCH_PRO
EV_COG_AD3029LZ
EV_COG_AD4050LZ
K22F
K64F
K82F
KW24D
KW41Z
LPC546XX
NRF51_DK
NRF52_DK
NUCLEO_F207ZG
NUCLEO_F401RE
NUCLEO_F429ZI
NUCLEO_F746ZG
REALTEK_RTL8195AM
I modified the _page_program() because when the request of the size exceeding the maximum size(256 byte) per one writing of Flash recieved, it was not able to loop the writing with sifting the address every 256 byte.
Also I modified the return value of flash_get_page_size() because I found that the minimum size per one writing of Flash is 1 byte by reviewing Flash spec.
"FLASH_PAGE_SIZE" macro's value is remain 256, it doesn't be used at flash_get_page_size(), used at _page_program() for refferencing of the maximum page size.
Although other venders implement this feature by using RTC, in my H/W(RZ_A1), I cannot use RTC because it does not satisfy the spec of LP Ticker (ms order and low frequency between 8 KHz and 64 KHz).
Therefore I implemented this feature by creating 1024 division by MTU2(Multi function Timer pulse Unit 2) in order to satisfy this spec.
As a result of investigating, the most unaffected channel among MTU2 placed on GR-PEACH and GR-LYCHEE was channel 3, so I use channel 3 for this feature.
- mbed_drv_cfg.h
I added a macro of MTU2 channel to this file for commonalizing code for GR-PEACH and GR-LYCHEE, and referenced it's macro at us_ticker.c.
- targets.json
I added a macro for enabling LP Ticker.
- mtu2.c mtu2.h
I defined fuction of MTU2's clock supply and stop.
Because MTU2 is utilized by pwm driver too, those function were referenced at lp_ticker driver and pwm driver.
- lp_ticker.c lp_ticker_init()
In order to satisfy the LP Ticker spec, I implemented by creating 1024 division by MTU2.
When an interrupt is required, it will be set with ticker_set_interrupt().
- lp_ticker.c lp_ticker_free()
This function stops the counting and powerdown the lp_ticker.
- lp_ticker.c lp_read()
This function returns the timer counter of MTU2.
- lp_ticker.c lp_ticker_set_interrupt()
In order to satisfy specifications, I implemented lp_ticker_set_interrupt() function.
- lp_ticker.c lp_ticker_fire_interrupt()
In order to satisfy spec, I implemented lp_ticker_fire_interrupt() function.
Also I added GIC_EnableIRQ for allowing the interrupt at end of function.
- lp_ticker.c lp_ticker_get_info()
To satisfy the spec, I implemented lp_ticker_get_info() function. The value of freq includes rounding off.