We should not add compiler extensions, it is not our job. We are not a
selfcontained project as kernel is so we should not introduce things
like this.
If we need to add some abstraction for this in the future to support
compilers doing these things differently then we will do that the same
way we dealt with the depricated attribute.
In places where we were defining memory mapped peripheral buffers we
were using directly a cast to "volatile int_type *". For consistency we
should use dereferenced accessor like: &MMIO32(address)
Added --terse and --mailback options to the make stylecheck target. It
also does continue even if it enounters a possible error.
We decided on two exceptions from the linux kernel coding standard:
- Empty wait while loops may end with ; on the same line.
- All blocks after while, if, for have to be in brackets even if they
only contain one statement. Otherwise it is easy to introduce an
error.
Checkpatch needs to be adapted to reflect those changes.
Added hash processor register definitions and main functions. Hash
processor is supported in stm32f21, stm32f41 and stm32f43 and can be
used to calculate Md5 and Sha1.
Implement an API to specifiy the interrupt trigger for GPIO pins, and
control interrupts. This completes the GPIO API.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Everything needed to set up and control the GPIO pins is implemented,
EXCEPT setting up interrupts. This is the subject of a subsequent patch.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Put the Doxygen blocks in well-formatted C comments. This looks better
and is less distracting than putting them in unformatted comments.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
The AHB bus allows faster control of GPIO pins versus the older APB bus.
The GPIO ports A through H default on the APB bus. Change the GPIOx
defines in gpio.h to use the base address of the AHB bus.
There's another reason to use the AHB bus: ports K tand highercan only be
accessed via the AHB bus.
***WARNING***
To work, GPIO acces to the AHB bus must be explictly enabled via the
GPIOHBCTL register. Without any additional change, this patch will break
any code using the older APB bus. If the GPIOHBCTL is not properly
modified, any acces to the GPIO register will cause a hard fault.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Add functions to enable and disable USB interrupts, and document how to
use these functions to run usbd_poll() from the usb ISR.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Change flash_erase_sector (f2/f4) to take numerical sector argument.
As opposed to using one of the defines in the header, this is more convenient when programatically deciding which sectors to erase.
Add a complete API for controlling the UART interrupts.
Doxygen documentation with inline code examples is also provided in this patch.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Add basic functionality needed to setup the UART and send/recieve data.
Interrupts, DMA, and more advanced features are not implemented in this patch.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
By somo copypaste error, the doxygen group rcc_defines was defined twice.
Don't do that. Keep Ken's doxygen structure and drop the old one.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
The lm4f/nvic.h include guard was wrongfully named LIBOPENCM3_LM3S_NVIC_H.
This caused the lm3s/nvic.h include a few lines down to not be compiled.
Rename the inlcude guard to the more appropriate LIBOPENCM3_LM4F_NVIC_H.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
f1/timer.
Added timer_ic_set_polarity to timer_common_f24 with
the enum tim_ic_pol now including trigger on both edges.
Changed timer_slave_set_polarity to use enum tim_et_pol
rather than tim_ic_pol.
In response to suggestion of stinkydiver73 on 24 March that
timers in all families have an option for triggers on both
edges, except F1.
Current way of having a globally, but weakly defined static buffer has
several shortcomings:
- It forces user to have a certain "magic" byte array variable if
they want to have a control buffer of different size.
- Having a globally defined static array and a separate function to
tell USB core about its size is error prone.
- Its inner workings are not easily understandable form cursory look
at API and one needs to go and look at the implementation code to
connect all the pieces into a solid picture of how it works
This commit adds two parameters to 'usbd_init' call that allow user to
specify the pointer to the area of memory and a size of that memory
which would be used by the USB core to store the data received during
DATA stage of control requests. This approach, while further
complicating the prototype of 'usbd_init', provides user with more
flexibility allowing for any custom area of memory of any size to be
used as control buffer. It also forces user to provide both address
and memory size at the same time thus avoiding the possibility of user
redefining 'usbd_control_buffer', but not calling
'usbd_set_control_buffer_size' after that.