28 Commits

Author SHA1 Message Date
Alexandru Gagniuc
5ea4763845 lm4f: Appease checkpath.pl and de-typedef enums
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2013-07-07 16:33:18 -07:00
Piotr Esden-Tempski
2f425af647 [Style] A small coding style fixing session. 2013-07-05 20:35:13 -07:00
Piotr Esden-Tempski
8da7fbd71e Changed to use accessors instead of casting to volatile pointers.
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)
2013-06-12 21:37:55 -07:00
Piotr Esden-Tempski
39fa9e4c58 Stile fixes run, 80 char boundry. 2013-06-12 21:07:35 -07:00
Piotr Esden-Tempski
34de1e776e Changed to use stdint types. 2013-06-12 19:11:22 -07:00
Piotr Esden-Tempski
7df63fcae0 First coarse run to fix coding style in locm3.
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.
2013-06-12 18:22:56 -07:00
Paul Fleischer
b876b72b39 lm4f: Add control over UART FIFOs 2013-06-02 18:05:49 -07:00
Alexandru Gagniuc
4535a4c9b6 lm4f: Implement GPIO interrupt control
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>
2013-06-02 16:16:46 -07:00
Alexandru Gagniuc
f53839f33f lm4f: Implement GPIO configuration and control
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>
2013-06-02 16:16:46 -07:00
Alexandru Gagniuc
a3784aa54f lm4f: Add GPIO register definitions
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2013-06-02 16:16:46 -07:00
Alexandru Gagniuc
991fbd01be lm4f: Add all GPIO ports to memorymap.h
The base addresses for GPIO ports J through Q were missing. Add them.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2013-06-02 16:16:46 -07:00
Alexandru Gagniuc
de55bbc46e lm4f: "Pretty-ize" the look of Doxygen comments in gpio.c/.h
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>
2013-06-02 16:16:46 -07:00
Alexandru Gagniuc
4c45702d2d lm4f: Switch GPIOs to using AHB bus ***WARNING***
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>
2013-06-02 16:16:46 -07:00
Alexandru Gagniuc
9d46103ced lm4f: Add functions for controlling USB interrupts
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>
2013-05-16 01:36:17 -05:00
Alexandru Gagniuc
ad048f7d5a lm4f: Add doxygen documentation for the USB driver
Add minimal documentation for the USB driver. The internal functions and
structs are excluded.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2013-05-16 01:36:10 -05:00
Alexandru Gagniuc
df5bc49245 lm4f: Add USB register definitions
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2013-05-15 18:17:06 -05:00
Alexandru Gagniuc
a8fc67d569 lm4f: Implement UART interrupt control
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>
2013-05-10 14:20:11 -07:00
Alexandru Gagniuc
8112861b60 lm4f: Add basic UART implementation
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>
2013-05-10 14:20:11 -07:00
Alexandru Gagniuc
a105bcaa83 lm4f: Add UART "convenience" macros
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2013-05-10 14:20:11 -07:00
Alexandru Gagniuc
3573bf170a lm4f: Add UART register definitions
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2013-05-10 14:20:11 -07:00
Alexandru Gagniuc
7b9e8ba2e4 lm4f-doc: Sanitize doxygen structure in rcc.h
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>
2013-05-10 14:11:24 -07:00
Alexandru Gagniuc
90172f9d72 lm4f: Fix include guard in nvic.h
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>
2013-05-08 11:23:55 -05:00
Ken Sarkies
1627cd60c3 Documentation structures added to place the non-STM32 families into the documentation tree.
Actual documentation has not been added. Volunteers?
2013-04-14 15:30:02 +02:00
Alexandru Gagniuc
7957cffaa3 lm4f: Add API for controlling the system run clock sources
Add an abstraction layer to handle the clock control for the run time clock on
LM4F (RCC). Sleep and deep-sleep clock configuration is not handled.

Complete documentation for the clock control API is included in doxygen-style
comments, and is included in [doc].

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>

Conflicts:
	lib/lm4f/Makefile
2013-01-09 00:39:20 -06:00
Alexandru Gagniuc
03d04ad10a lm4f: Add API for enabling/disabling peripherals clock source
The enum definitions are specified in the form
 31:5 register offset from SYSCTL_BASE for the clock register
 4:0  bit offset for the given peripheral

The names have the form [clock_type]_[periph_type]_[periph_number]
Where clock_type is
     RCC for run clock
     SCC for sleep clock
     DCC for deep-sleep clock

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2013-01-09 00:37:50 -06:00
Alexandru Gagniuc
1a9d628a02 lm4f: Add system control register definitions
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2013-01-01 17:51:49 -06:00
Alexandru Gagniuc
b2ac2ffc4b lm4f: Remove erroneous references to lm3s
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2012-12-31 01:35:27 -06:00
Alexandru Gagniuc
326c945b55 lm4f: Add lm4f support files copied from lm3s
Create lm4f code infrastructure from the lm3s infrastructure.

As far as the interrupt table is concerned, don't create an irq.yaml. Just
include the LM3S nvic.h. The LM3S vector table seems to be compatible with the
LM4F

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2012-12-31 01:35:25 -06:00