Allow for the high frequency clock that controlls things such as the
main CPU to be switched over to USHFRCODIV2. This is a 24 MHz PLL
that is trimmed using clock recovery from the USB signal, and is
accurate to within 1% of 24 MHz.
Signed-off-by: Sean Cross <sean@xobs.io>
FLASH_CR_OPTSTRT needs to be written to FLASH_CR, and there is no reason
to mask the last two data bits.
Signed-off-by: Bruno Randolf <br1@einfach.org>
Reviewed-by: Karl Palsson <karlp@tweak.net.au>
(original code appeared to be badly copied from the flash_common_f24 codebase)
According to RM0351 and RM0394 flash needs to be programmed by double words.
Also fix flash_program() which was wrong anyways.
Reviewed-by: Karl Palsson <karlp@tweak.net.au>
48Mhz has no purpose other than to be a naiive method of haivng working
USB. 120MHz never had any purpose, other than to match the f2 code it
was copied from. Drop them both. Remaining configs are all max speeds
for various F4 parts. Lower speeds are all custom
Some families had partially moved to peripheral api, and others were
only documenting common code, but not specific code. Delete dummy .c
files, and check that all specific apis are also being documented, not
just common apis.
Functions that are already documented in the top level common api.h file
won't add any more documentation from later .c files. Keep docs for
part specifics, in the .h files where they're accessible to IDEs and
also the documentation generation, and drop all (including the redundant
ones) from the .c file.
the group defaults to the implicit container based on location, so drop
all the explicit @ingroups, less to maintain. Properly use /**@}*/ to
close all groups too, even though it mostly seems to have worked anyway.
Properly close all groups opened for files.
here, it's a bit of a mess.. G0 flash controller does not really
match exsting feature split. IE it has instruction cache only ..
so, no flash_idcache.c as it. flash_common_f could be used, but
flash_unlock would not take care of option byte ?
prefetch, icache and lock is ok. I had no look at flash programming
or erase yet..
Drops all the l1 copies of this code, and automatically gains all the
following apis that weren't even available before:
void adc_set_clk_prescale(uint32_t prescaler);
void adc_set_resolution(uint32_t adc, uint32_t resolution);
void adc_enable_overrun_interrupt(uint32_t adc);
void adc_disable_overrun_interrupt(uint32_t adc);
bool adc_get_overrun_flag(uint32_t adc);
void adc_clear_overrun_flag(uint32_t adc);
bool adc_awd(uint32_t adc);
void adc_eoc_after_each(uint32_t adc);
void adc_eoc_after_group(uint32_t adc);
void adc_set_dma_continue(uint32_t adc);
void adc_set_dma_terminate(uint32_t adc);
Sampling time and sequence length, along with the vbat channel are
specific to the f4/f7, and can't be shared with the l1 and friends.
Pull them out to their own common file.
In adc_calibrate_async() we should only set the ADCAL bit and leave the rest alone.
While in the past there were only "rs" bits in this register, this is no
longer the case.
Reviewed-by: Karl Palsson <karlp@tweak.net.au>