95 Commits

Author SHA1 Message Date
Stefan Agner
7681597e42 Use type suffix to avoid warnings
When compiling with all warnings enabled, some defines can lead to
warning due to missing unsigned type suffix:

warning: integer overflow in expression [-Woverflow]

This fix should not affected behavior at all, since calculation with
such overflows lead to the same actual address when writing to that
location. However, it makes the warning disappear and also defines
the right data type for a memory location.
2014-02-06 00:59:39 +01:00
Ken Sarkies
e8b1045386 Fix missing backslashes on some macro defines 2014-01-14 17:22:19 +10:30
Piotr Esden-Tempski
a909b5ca9e [Style] Global style fix run. 2014-01-03 01:07:30 +01:00
Karl Palsson
5c14780403 [build] Remove PyYAML dependency
This converts all the YAML files to JSON files, as json parsing is built
into python instead of being a separate library requiring installation.

YAML is a superset of JSON, but putting comments in is not quite as obvious
as it is in yaml.

The following glue was used to convert yaml to json:
python -c 'import sys, yaml, json; json.dump(yaml.load(sys.stdin), sys.stdout, indent=4)' < $1 > $2

Clearly I haven't tested this on every single platform, and this
doesn't address the large blobs of yaml in the lpc4300 scripts directory,
only the cortex NVIC generation process.

I've tested a few IRQ driven example apps, and I've checked the generated
output of some known cases like the LM3s that has explicit gaps, and they are
all generated correctly.
2014-01-02 20:55:15 +01:00
Piotr Esden-Tempski
f797c50b6a [Style] Fixed line length. 2013-08-22 22:54:30 -07:00
BuFran
65eaad938f [Style] checked and corrected 2013-08-22 22:29:40 -07:00
BuFran
c6f861139d Removed mostly copied code
REG1 REG2 REG3 -> REGx
2013-08-22 22:29:40 -07:00
BuFran
d3a073d9b5 [Style] Corrected many style errors (mainly line too long) 2013-08-22 22:29:40 -07:00
Ben Gamari
2a588f11aa lpc43xx/ssp; Add DMACR fields 2013-07-10 23:35:08 -04:00
Ben Gamari
5d4f759c92 lpc43xx/timer: Add timer utilities 2013-07-07 18:50:44 -07:00
Ben Gamari
9d89df0db6 lpc43xx/timer: Add register definitions 2013-07-07 18:50:35 -07:00
Ben Gamari
78081bd794 lpc43xx: Add irq.yaml for M0 core 2013-07-07 13:52:16 -07:00
Ben Gamari
c25461dfce lpc43xx: Move M4 specific files to m4/ 2013-07-07 13:52:15 -07:00
Ben Gamari
fa47bb80d5 lpc43xx/uart: Fix TER register definition
I'm not sure why bit 7 and offset 0x30 were used previously. Revision
1.6 of UM10503 claims that the TXEN bit is bit 0 in all UARTs' TER
registers.
2013-07-07 13:52:15 -07:00
Ben Gamari
dbf9c3bc39 lpc43xx/uart: Kill _BITMASK definitions for single-bit fields 2013-07-07 13:52:15 -07:00
Ben Gamari
b0550ce0bf lpc43xx/uart: Uncomment register definitions 2013-07-07 13:52:15 -07:00
Ben Gamari
8201703e64 lpc43xx/ssp: Fix duplicate function definition from merge 2013-07-07 13:52:14 -07:00
Ben Gamari
e8af7a98ee lpc43xx/ssp: Add ssp_transfer 2013-07-07 13:52:13 -07:00
Ben Gamari
0d29b1d2d6 lpc43: Use uint*_t instead of u* 2013-07-07 13:52:13 -07:00
Ben Gamari
fa9fa986df lpc43xx/uart: Add missing BEGIN/END_DECLS 2013-07-07 13:52:13 -07:00
TitanMKD
0dec187fee lpc43xx basic IPC for multicore M4 & M0 (with basic examples for hackrf jellybean). 2013-07-07 13:52:12 -07:00
TitanMKD
439957155b Added SGPIO structure for faster/better code generation (especially when optimized with -O2/-O3).
This structure is compliant with LPC43xx User Manual UM10503 Rev.1.4 - 3 September 2012.
2013-07-07 13:52:12 -07:00
Jared Boone
f4e45e74bc Add a duty cycle count argument to i2c0_init() to adjust for changes in APB1 clock. 2013-07-07 13:52:12 -07:00
Jared Boone
18bcbc3d28 Consolidate ssp_read and ssp_write into a single function, ssp_transfer. SSP bus transfers are bi-directional -- when bytes are written, they are also read. 2013-07-07 13:52:12 -07:00
Jared Boone
df922b9021 Corrected GPDMA_INTSTAT #define name typo. 2013-07-07 13:52:11 -07:00
Jared Boone
b44631f3b1 Removed #defines for GPDMA channel base addresses, changed "API" on other #defines to accept an ordinal instead. 2013-07-07 13:52:11 -07:00
Jared Boone
78884cef16 Changed GPDMA_CHANNELx #defines to use correct ("GPDMA_BASE") value as peripheral base address. 2013-07-07 13:52:11 -07:00
Jared Boone
0dc4443e26 Renamed DMA_BASE to GPDMA_BASE to match peripheral name (and #defines in gpdma.h). 2013-07-07 13:52:11 -07:00
Jared Boone
518b97efb6 Added generated headers and hand-crafted #defines for register fields common across many register sets. 2013-07-07 13:52:11 -07:00
Jared Boone
8abefef07d Rename indexed #define macros for channel-specific GPDMA registers, to match documentation and avoid conflict with the GPDMA_CONFIG register name. 2013-07-07 13:52:10 -07:00
Jared Boone
b1e5c77e1d New SGPIO field #defines, generated from sgpio.csv. 2013-07-07 13:52:10 -07:00
Jared Boone
733c117c53 Added generalized #defines for USB0 ENDPTCTRL register fields. 2013-07-07 13:52:10 -07:00
Michael Ossmann
4112a3c723 finished GPIO registers 2013-07-07 13:52:09 -07:00
Jared Boone
0323d020d0 USB controller in-memory structure #defines/typedefs for dTD and dQH. 2013-07-07 13:52:09 -07:00
Jared Boone
96ea1a35a3 #defines for making USB structure definitions a bit simpler. 2013-07-07 13:52:09 -07:00
Michael Ossmann
029bf6cbcc typo fix in eventrouter.h 2013-07-07 13:52:09 -07:00
Jared Boone
b5ba6451af Fixed typo from user manual. 2013-07-07 13:52:08 -07:00
Jared Boone
28df3a2e12 Tweaked #defines of USB0_ENDPTCTRLx to use an indexed #define, which will be handy in other places... 2013-07-07 13:52:08 -07:00
Jared Boone
24d8d81b43 Add generated bit/shift/mask #defines for CGU, CREG, RGU, USB (USB0 only) peripherals.
Added script used to generate #defines above.
Fixed one small change in the #define naming scheme in i2c0_init().
2013-07-07 13:52:08 -07:00
Michael Ossmann
a0624ecd21 creg.h updates from newer data sheet 2013-07-07 13:52:07 -07:00
TitanMKD
f8542c09a6 UART driver and Example code for JellyBean. 2013-07-07 13:52:07 -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
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
chrysn
bc5146b710 unified systick handling
the only change this results in in the example binaries is in the
hackrf-jellybean/systick example, where the the check in
systick_set_clocksource for overflowing from the stm32 area gets used.
2012-10-18 22:48:14 +02:00
chrysn
5ceb377a37 switch all interrupt lists to yaml format 2012-10-18 16:52:48 +02:00
chrysn
a8a6eb39e9 add irq cound to existing nvic.h files 2012-10-18 13:19:55 +02:00
chrysn
837de3ff97 nvic.h factored out (incomplete) 2012-10-18 10:27:51 +02:00
chrysn
a69d83d312 unified vector table initialization
the cortex generic interrupts get moved to lib/cm3/vector.c, the
platorms' individual irq names, initialization and handler prototypes go
to platoform specific irq.h files.

as the vector.c file heavily depends on platoform specific headers, it
can't be built once-and-for-all in lib/cm3/, so there are inclusion
stubs in the various architecture dirs; this might be better solved with
Makefile / include path handling.

one particular file is lib/lpc43xx/vector.c; that platform's
initialization code contains an additional section to copy everything
from flash to ram (which probably performs better there). that code
still resides in the inclusion stub, and gets mashed in using defines.
would need a cleaner implementation together with the Makefile solution.

this commit contains some files of the upcoming efm32 branch, from which
it was cherry-picked.

the .bin files produced from before and after this commit only differ in
lpc43xx, where the startup sequence was subtly modified.
2012-10-05 00:55:24 +02:00
Ken Sarkies
ff83a1ae1c Setup to document entire project using doxygen.
New doc directory with config files and generated html, LaTeX/pdf.
Makefile provided for autogeneration and explanatory README.

The project structure is hostile to doxygen, which can't cope with functions
of the same name. Doxygen is run for each family separately, and separately
for LaTeX generation. Customized layout files sort of "integrate" HTML, and
separate pdfs are generated for each family. Not ideal but seems the best
solution until doxygen changes, if at all.
2012-09-15 12:51:46 +09:30