Merged nuttx/nuttx into neilh20/aNuttx:master

This commit is contained in:
neil H
2016-09-08 15:09:39 -07:00
1232 changed files with 47869 additions and 4605 deletions
+280 -2
View File
@@ -10536,8 +10536,7 @@
nuttx/libc/mqueue to nuttx/sched/mqueue. Also add syscall support nuttx/libc/mqueue to nuttx/sched/mqueue. Also add syscall support
for mq_setattr() and mq_getattr(). This is necessary in protected and for mq_setattr() and mq_getattr(). This is necessary in protected and
kernel builds because in those cases the message queue structure is kernel builds because in those cases the message queue structure is
protected and cannot be accessed directly from user mode code. Noted protected and cannot be accessed directly from user mode code (2015-06-03).
by Jouko Holopainen (2015-06-03).
* drivers/net/tun.c: TUN driver bug fix. From Max Neklyudov (2015-06-03. * drivers/net/tun.c: TUN driver bug fix. From Max Neklyudov (2015-06-03.
* drivers/net/Kconfig, include/nuttx/net/mii.h, and * drivers/net/Kconfig, include/nuttx/net/mii.h, and
arch/arm/src/lpc17xx/lpc17_ethernet.c: Add support for the Micrel arch/arm/src/lpc17xx/lpc17_ethernet.c: Add support for the Micrel
@@ -12392,5 +12391,284 @@
banks. This fixes a race condition where the HW fills a FIFO bank banks. This fixes a race condition where the HW fills a FIFO bank
while the SW is busy, resulting in out of sequence USB packets while the SW is busy, resulting in out of sequence USB packets
(2016-07-23). (2016-07-23).
* Freedom-K64F: Add PWM support. From Jordan MacIntyre (2016-07-25).
7.18 2016-xx-xx Gregory Nutt <gnutt@nuttx.org> 7.18 2016-xx-xx Gregory Nutt <gnutt@nuttx.org>
* drivers/serial/pty.c, serial.c, usbdev/cdcacm.c, include/nuttx/fs/ioctl.h:
Fix FIONWRITE and add FIONSPACE. All implementations of FIONWRITE
were wrong. FIONWRITE should return the number of bytes waiting in
the outgoing send queue, not the free space. Rather, FIONSPACE should
return the free space in the send queue (2016-07-25).
* lib_dumpbuffer: Now prints a large on-stack buffer first to avoid
problems when the syslog output is prefixed with time. From Pierre-
noel Bouteville (2016-07-27).
* sched/clock and sched/sched: Add standard adjtime() interface and
basic timekeeping support. Normally used with an NTP client to keep
system time in synchronizationi. From Max Neklyudov (Merged on
20160-07-28).
* arch/arm/src/stm32: Add timekeeping support for the STM32 tickless
mode. From Max Neklyudov (Merged on 20160-07-28).
* Top-Level Makefiles. Fix a chicken-and-egg problem. In the menuconfig
target, the context dependency was executed before kconfig-mconf.
That was necessary because the link at apps/platform/board needed to
be set up before creating the apps/Kconfig file. Otherwise, the
platform Kconfig files would not be included. But this introduces
the chicken-and-egg problem in some configurations.
In particular: (1) An NX graphics configuration is used that requires
auto-generation of source files using cpp, (2) the configuration is
set for Linux, but (3) we are running under Cygwin with (4) a Windows
native toolchain. In this case, POSIX-style symbolic links are set
up but the Windows native toolchain cannot follow them.
The reason we are running 'make menuconfig' is to change from Linux
to Cygwin, but the target fails. During the context phase, NX runs
CPP to generate source files but that fails because the Windows native
toolchain cannot follow the links. Checkmate.
This was fixed by changing all of the make menuconfig (and related)
targets. They no longer depend on context being run. Instead, they
depend only on the dirlinks target. The dirlinks target only sets
up the directory links but does not try to run all of the context
setup; the compiler is never invoked; no code is autogeneraed; and
things work (2016-07-28).
* tools/refresh.sh: Recent complexities added to apps/ means that
configuration needs correct Make.defs file in place in order to
configure properly (2016-07-28).
* tools/kconfig2html.c: Update to handle absolute paths when sourcing
Kconfig files (2016-07-29).
* libc/math: This fixes the following libc/math issues: (1) asin[f l]()
use Newtons method to converge on a solution. But Newtons method
converges very slowly (> 500,000 iterations) for values of x close
to 1.0; and, in the case of asinl(), sometimes fails to converge
(loops forever). The attached patch uses an trig identity for
values of x > sqrt(2). The resultant functions converge in no more
than 5 iterations, 6 for asinl(). (2) The NuttX erf[f l]() functions
are based on Chebyshev fitting to a good guess. The problem theres a
bug in the implementation that causes the functions to blow up with x
near -3.0. This patch fixes that problem. It should be noted that
this method returns the error function erf(x) with fractional error
less than 1.2E-07 and thats fine for the float version erff(), but
the same method is used for double and long double version which
will yield only slightly better precision. This patch doesn't address
the issue of lower precision for erf() and erfl(). (3) a faster
version of copysignf() for floats is included. From David S. Alessio
(2016-07-30).
* I/O Expander: Remove hard-coded PCA9555 fields from ioexpander.h
definitons. Add support for an attach() method that may be used when
any subset of pin interrupts occur (2016-07-31).
* PCA9555 Driver: Replace the signalling logic with a simple callback
using the new definitons of ioexpander.h. This repartitioning of
functionality is necessary because (1) the I/O expander driver is the
lower-lower part of any driver that uses GPIOs (include the GPIO
driver itself) and should not be interacting directly with the much
higher level application layer. And (2) in order to be compatible
with the GPIO driver (and any arbitrary upper half driver), the
PCA9555 should not directly signal, but should call back into the
upper half. The upper half driver that interacts directly with the
application is the appropriate place to be generating signal
(2016-07-31).
* drivers/ioexpander/skeleton.c: Add a skeleton I/O Expander driver
(based on the PCA9555 driver) (2016-07-31).
* I/O Expander Interface: Encode and extend I/O expander options to
include interrupt configuration (2016-07-31).
* drivers/ioexpander: Add an (untested) TCA64XX I/O Expander driver
leveraged from Project Ara (2016-07-31).
* I/O Expander Interface: Add argument to interrupt callback. Add a
method to detach the interrupt (2016-08-01).
* drivers/ioexpander: Add a GPIO lower-half driver that can be used to
register a GPIO character driver for accessing pins on an I/O expander
(2016-08-01).
* drivers/ioexpander: Add PCF8574 I/O Expander driver. Some cleanup
also of other expander drivers (2016-08-01).
* drivers/ioexpander: GPIO driver: Add IOCTLs to get the pin type and
to unregister a signal handler (2016-08-01).
* configs/sim: Add simulator-based test support for apps/examples/gpio
2016-08-01).
* drivers/sensors: Add KXJT9 Accelerometer driver from the Motorola
Moto Z MDK (2016-08-02).
* arch/arm/sim: Add a simulated I/O Expander driver (2016-08-03).
* configs/sim: Add logic to set the simulated I/O expander for testing
with apps/examples/gpio (2016-08-03).
* fs/fat: FAT performance improvement. In large files, seeking to a
position from the beginning of the file can be very time consuming.
ftell does lssek(fd, 0, SET_CURR). In that case, that is wasted time
since we are going to seek to the same position. This fix short-
circutes fat_seek() in all cases where we attempt to seek to current
position. Suggested by Nate Weibley (2016-08-03).
* tools/sethost.sh: Add sethost.sh. This is a script that you can use
to quickly change the host platform from Linux to Windows/Cygwin.
Might save you a lot of headaches (2016-08-03).
* arch/arm/src/tiva: Add tiva PWM lower-half driver implementation.
From Young (2016-08-05).
* drivers/spi/spi_transfer.c: Add a helper function that encapsulates
and manages a sequence of SPI transfers (2016-08-05).
* drivers/spi: Add an SPI character driver that will permit access to
the SPI bus for testing purposes. This driver is a simple wrapper
around spi_transfer() (2016-08-05).
* drivers/wireless: Add MFRC522 RFID ISO14443 and Mifare transceiver
driver. From Alan Carvalho de Assis (2016-08-06).
* configs/stm32f103-minimum: Add board support to MFRC522 driver. From
Alan Carvalho de Assis (2016-08-06).
* arch/renesas: Rename arch/sh to arch/renesas (2016-08-06).
* arch/arm/src/efm32, stm32, stm32l4: STM32 and EFM32 SPI drivers
adopted an incompatible conventions somewhere along the line. The
set the number of bits to negative when calling SPI_SETBITS which had
the magical side-effect of setting LSB first order of bit
transmission. This is not only a hokey way to pass control
information but is supported by no other SPI drivers. This change
three things: (1) It adds HWFEAT_LSBFIRST as a new H/W feature.
(2) It changes the implementations of SPI_SETBITS in the STM32 and
EFM32 derivers so that negated bit numbers are simply errors and it
adds the SPI_HWFEATURES method that can set the LSB bit order, and
(3) It changes all calls with negative number of bits from all
drivers: The number of bits is now always positive and SPI_HWFEATURES
is called with HWFEAT_LSBFIRST to set the bit order (2016-08-08).
* arch/arm/src/stm32: Add missing SPI2 and SPI3 support for STM32F3F3.
Add STM32F37XX DMA channel configuration. For STM32F37XX,
SYSCFG_EXTICR_PORTE defined twice. From Alan Carvalho de Assis
(2016-08-08).
* arch/arm/src/stm32: Make stm32_pwr_enablebkp thread safe. From
Max Neklyudov (2016-08-09).
* arch/arm/src/stm32: SAM3/4 GPIO: Enable peripheral clock for GPIO port
when GPIO is configured as input. The value of a GPIO input is only
sampled when the peripheral clock for the port controller the GPIO
resides in is enabled. Therefore we need to enable the clock even when
polling a GPIO. From Wolfgang Reissnegger (2016-08-09).
* arch/arm/src/tiva: Fix two bugs of tiva pwm lower-half driver
implementation. From Young (2016-08-10).
* sched/group: Explicitly initialize the group tg_exitsem with
sem_init(). The existing logic worked because the correct
initialization value is all zero, but it is better to initialize the
semaphore explicitly (2016-08-10).
* arch/arm/stm32: Fix bad pllmul values for STM32F1XX connectivity line.
STM32F1XX connectivity line supports only x4, x5, x6, x7, x8, x9 and
x6.5 values. From Michał Łyszczek (2016-08-11).
* include/nuttx/timers: Add oneshot timer lower half interface
(2016-08-11).
* arch/arm/src/stm32: Add a experimental oneshot, lower-half driver for
STM32 (2016-08-11).
* arch/arm/src/samv7: Add option to support oneshot timer without free-
running timer. Add oneshot lower half driver (2016-08-11).
* arch/arm/src/sama5: Add option to support oneshot timer without free-
running timer. Add oneshot lower half driver (2016-08-11).
* arch/arm/src/sam34: SAM4CM: Add option to support oneshot timer without
free-running timer. Add oneshot lower half driver (2016-08-11).
* arch/arm/src/stm32l4: Add oneshot lower half driver (2016-08-11).
* libc/stdlib: strtod() was not returning endptr on error conditions
(2016-08-11).
* libc/math: floor(), floorf(), and floorl(): Fix logic error. Was not
correctly handling negative integral value (2016-08-11).
* configs/sim: Add a configuration useful for testing Mini Basic
(2016-08-12).
* drivers/timers: Add an upper-half, oneshot timer character driver
(2016-08-12).
* arch/sim/src: Add a simulated oneshot lowerhalf driver (2016-08-12).
* arch/arm/src/stm32: STM32F3 SPI: Fix the number of bit setting for
the F3. That and data packing work differently on the STM32F3 than
for other STM32 parts (2016-08-12).
* arch/arm/stm32 and stm32l4: Enabling SPI DMA loses other bits in CR2
(2016-08-13).
* arch/arm/src/stm32: STM32F3 SPI: Cannot write always 16-bit value to
DR register because of how the F3 implements data packing (2016-08-13).
* Kinetis: Add support for I2C and RTC. From v01d (phreakuencies)
(2016-08-13).
* teensy 3.x i2c. From v01d (phreakuencies) (2016-08-13).
* SH1106 0.96 OLED module support (SSD1306 compatible) + I2C fixes.
From v01d (phreakuencies) (2016-08-13).
* Add support for SAMV7 DACC module. From iotr Mienkowski (2016-08-15).
* Add oneshot board initialization to stm32f103-minimum. From Alan
Carvalho de Assis (2016-08-15).
* drivers/audio/tone.c: Add Audio Tone Generator for NuttX. From Alan
Carvalho de Assis (2016-08-16).
* configs/stm32f103-minimum: Add board configuration to initialize Audio
Tone Generator. From Alan Carvalho de Assis (2016-08-16).
* STM32F411 and STM32F446 map i2c2_sda_4 to different alternate function
numbers. From Konstantin Berezenko (2016-08-17).
* STM32 DMA Fix: Change stm32 adc dma callback to send channel number
instead of index. From Konstantin Berezenko (2016-08-17).
* SAMA5: Add missing oneshot max_delay method (2016-08-18).
* configs/stm32bufferfly2: Add support for the Kamami stm32butterfly2
development board with optional ETH phy. From Michał Łyszczek
(2016-08-19).
* libc/misc: Separate XorShift128 PRNG from /dev/urandom and make it
generally available (2016-08-20).
* sched/sched_cpuload_oneshot: Use the oneshot timer with optional
entropy to measure cPU load if so configured (2016-08-20).
* drivers/usbhost/usbhost_composite.c: An an EXPERIMENTAL prototype of
how USB host support for composite devices might be implemented. This
feature is EXPERIMENTAL because (1) it is untested and (2) has some
know design issues that must be addressed before it can be of use
(2016-08-28).
* CXXFLAGS: add -fcheck-new whenever -fno-exceptions is used. From Beat
Küng (2016-08-23).
* tools/mkfsdata.pl was still generating the old-style apps/include
inclusion paths (2016-08-23).
* drivers/sensors: Add drvier for the LIS3MDL 3 axis magnetometer. From
Alexander Entinger (2016-08-23).
* drivers/sensors: Add driver for the MLX90393 3 axis magnetometer.
From Alexander Entinger (2016-08-23).
* drivers/mtd: Add Fujistu MB85RS256B ramtron support. From Beat Küng
(2016-08-23).
* drivers/sensors: Add driver for the LIS3DSH 3 axis accelerometer. From
Alexander Entinger (2016-08-24).
* drivers/sensors: Add driver for the Bosch BMG160 3 axis gyroscope.
From Alexander Entinger (2016-08-24).
* STM32: Add IAR-style STM32F1xx vectors. Tested on STM32F103RB and
STM32F107RC. From Aleksandr Vyhovanec (2016-08-24).
* libc/header files: Add POSIX type sig_atomic_t. From Sebastien
Lorquet (2016-08-24).
* libc/header files: isatty() should be prototypes in unstid.h, not
termios.h. From Sebastien Lorquet (2016-08-24).
* Documentation: Update to NuttX C coding style document with additions
discussing long comments on the right side of a statement or data
definition (2016-08-24).
* LPC43xx serial: Fix typos in LPC43 serial driver. Found by Vytautas
Lukenskas (2016-08-24).
* libc/time: This commit adds the difftime() function. The function
depends on the toolchain-dependent CONFIG_HAVE_DOUBLE so is not
available on tiny platforms. From Sebastien Lorquet (2016-08-24).
* libc/stdio: Add support for remove(). From Sebastien Lorquet
(2016-08-25).
* STM32 OTGFS device: Fix for lost first word from FIFO
1) Do not overwrite Reserved Bits in GINTSTS (per ref manual)*
2) Acknowledge all pending int on entry to ISR that are Only rc_w1*
3) Do not disable RXFVL*
4) Loop until RXFVL is cleared*
5) Only clear the NAK on the endpoint on the
OTGFS_GRXSTSD_PKTSTS_SETUPDONE to not loose the first WORD of
FIFO all the data (Bug Fix)
Changed marked *are just driver clean up and ensure ints are not lost.
The bug fix is #5
Test case open putty and observer the Set/Get LineCoding. Without this
fix #5 the Get will not match the Set, and in fact the data might be
skewed by 4 bytes, that are lost from the FIFO if the
OTGFS_DOEPCTL0_CNAK bit is set in the OTGFS_GRXSTSD_PKTSTS_SETUPRECVD
as opposed to the OTGFS_GRXSTSD_PKTSTS_SETUPDONE
Set Line Coding DATA1: 4B | 00 c2 01 00 00 00 08 | c8 1B
Get Line Coding DATA1: 4B | .. .. .. .. 00 00 08 c8 .. 00 00 07 | 7a 72
From David Sidrane (2016-08-25).
* Add system() to stdlib.h. Actual implementation is in
apps/system/system (2016-08-25).
* include/nuttx/input: Add missing prototype for btn_lower_initialize()
(2016-08-27).
* configs/stm32f103-minimum: Add board config support to SPI LCD module
JLX12864G-086. From Alan Carvalho de Assis (2016-08-28).
* net/tcp: tcp_ipvX_bind() not actually using the ported selected with
port==0. Also removes duplicate call to pkt_input(). Issues noted by
Pascal Speck (2016-08-30).
* STM32 F7: Remove duplicate call to pkt_input from Ethernet driver.
Issues noted by Pascal Speck (2016-08-30).
* STM32L4 OTGFS device: Apply stm32 fix to stm32l4. From Sebastien
Lorquet (2016-08-31).
* drivers/contactless: Remove contactless drivers from drivers/wireless
to drivers contactless. From Sebastien Lorquet (2016-08-31).
* USB host composite is at least partially functional. No longer depends
on CONFIG_EXPERIMENTAL (2016-09-02).
* MTD: Fixed cloned typos in several FLASH drivers. From Aleksandr
Vyhovanec (2016-09-02).
* MTD: SPI-based driver for Macronix MX25L3233F or MX25L6433F. From
Aleksandr Vyhovanec (2016-09-02).
+2 -2
View File
@@ -8,7 +8,7 @@
<tr align="center" bgcolor="#e4e4e4"> <tr align="center" bgcolor="#e4e4e4">
<td> <td>
<h1><big><font color="#3c34ec"><i>NuttShell (NSH)</i></font></big></h1> <h1><big><font color="#3c34ec"><i>NuttShell (NSH)</i></font></big></h1>
<p>Last Updated: July 20, 2016</p> <p>Last Updated: August 4, 2016</p>
</td> </td>
</tr> </tr>
</table> </table>
@@ -3277,7 +3277,7 @@ nsh&gt;
</tr> </tr>
<tr> <tr>
<td><b><code>mkfifo</code></b></td> <td><b><code>mkfifo</code></b></td>
<td><code>CONFIG_NFILE_DESCRIPTORS</code> &gt; 0 &amp;&amp; <code>CONFIG_PIPES</code></td> <td><code>CONFIG_NFILE_DESCRIPTORS</code> &gt; 0 &amp;&amp; <code>CONFIG_PIPES</code> &amp;&amp; <code>CONFIG_DEV_FIFO_SIZE</code> &gt; 0</td>
<td><code>CONFIG_NSH_DISABLE_MKFIFO</code></td> <td><code>CONFIG_NSH_DISABLE_MKFIFO</code></td>
</tr> </tr>
<tr> <tr>
+38 -4
View File
@@ -12,7 +12,7 @@
<h1><big><font color="#3c34ec"> <h1><big><font color="#3c34ec">
<i>NuttX C Coding Standard</i> <i>NuttX C Coding Standard</i>
</font></big></h1> </font></big></h1>
<p>Last Updated: July 28, 2015</p> <p>Last Updated: August 24, 2016</p>
</td> </td>
</tr> </tr>
</table> </table>
@@ -498,8 +498,8 @@
<p> <p>
<b>Comments to the Right of Statements</b>. <b>Comments to the Right of Statements</b>.
Comments to the right of statements in C source files are discouraged Comments to the right of statements in C source files are discouraged.
If such comments are used, they should at least be aligned so that the comment begins in the same comment on each line. If such comments are used, they should be (1) very short so that they do not exceed the line width (typically 78 characters), (2) fit on one line, and (3) be aligned so that the comment begins in the same comment on each line.
</p> </p>
<center><table width="60%" border=1> <center><table width="60%" border=1>
<tr><td bgcolor="white"> <tr><td bgcolor="white">
@@ -538,7 +538,7 @@
<p> <p>
<b>Comments to the Right of Data Definitions</b>. <b>Comments to the Right of Data Definitions</b>.
Comments to the right of a declaration with an enumeration or structure, on the other hand, are encourage. Comments to the right of a declaration with an enumeration or structure, on the other hand, are encouraged, provided that the comments are short and do not exceed the maximum line width (usually 78 characters).
Columnar alignment of comments is very desireable (but often cannot be achieved without violating the line width). Columnar alignment of comments is very desireable (but often cannot be achieved without violating the line width).
</p> </p>
<center><table width="60%" border=1> <center><table width="60%" border=1>
@@ -586,6 +586,40 @@ struct animals_s
</td></tr> </td></tr>
</table></center> </table></center>
<p>
<b>Long Comments on the Right</b>.
Comments on the right of statements or data definitions must be short and fit on the same line without exceeding the maximum line length.
If a longer comment is needed, then it should appear above the statement of definition rather than to the right of the definition.
</p>
<center><table width="60%" border=1>
<tr><td bgcolor="white">
<p><font color="red"><b>Incorrect</b></p>
<ul><pre>
dog = cat; /* This assignment will convert what was at one time a lowly dog into a ferocious feline. */
</ul></pre></font>
</td></tr>
<tr><td bgcolor="white">
<p><font color="blue"><b>Acceptable</b></p>
<ul><pre>
dog = cat; /* This assignment will convert what was at one time a
* lowly dog into a ferocious feline. */
</ul></pre></font>
</td></tr>
<tr><td bgcolor="white">
<p><font color="green"><b>Preferred</b></p>
<ul><pre>
/* This assignment will convert what was at one time a lowly dog into a
* ferocious feline.
*/
dog = cat;
</ul></pre></font>
</td></tr>
</table></center>
<p>
<b>Note</b> that if the comment is continued on multiple lines, the comment alignment and multi-line comment rules still apply with one exception: The closing <code>*/</code> appears on the same line as the final text of the comment. This exception to the rule is enforced to keep the statements and definitions from becoming to spread out.
</p>
<p> <p>
<b>Block comments</b>. <b>Block comments</b>.
Block comments are only used to delimit groupings with the overall <a href="#fileorganization">file organization</a> and should not be used unless the usage is consistent with delimiting logical groupings in the program. Block comments are only used to delimit groupings with the overall <a href="#fileorganization">file organization</a> and should not be used unless the usage is consistent with delimiting logical groupings in the program.
+103 -8
View File
@@ -12,7 +12,7 @@
<h1><big><font color="#3c34ec"> <h1><big><font color="#3c34ec">
<i>NuttX RTOS Porting Guide</i> <i>NuttX RTOS Porting Guide</i>
</font></big></h1> </font></big></h1>
<p>Last Updated: June 22, 2016</p> <p>Last Updated: August 31, 2016</p>
</td> </td>
</tr> </tr>
</table> </table>
@@ -948,22 +948,46 @@ drivers/
| |-- Kconfig | |-- Kconfig
| |-- Make.defs | |-- Make.defs
| `-- <i>(Common ADC and DAC driver source files)</i> | `-- <i>(Common ADC and DAC driver source files)</i>
|-- audio/
| |-- Kconfig
| |-- Make.defs
| `-- <i>(Common audio device source files)</i>
|-- bch/ |-- bch/
| |-- Kconfig | |-- Kconfig
| |-- Make.defs | |-- Make.defs
| `-- <i>(bch driver source files)</i> | `-- <i>(bch driver source files)</i>
|-- contactless/
| |-- Kconfig
| |-- Make.defs
| `-- <i>(Common contactless device driver source files)</i>
|-- input/ |-- input/
| |-- Kconfig | |-- Kconfig
| |-- Make.defs | |-- Make.defs
| `-- <i>(Common touchscreen and keypad driver source files)</i> | `-- <i>(Common touchscreen and keypad driver source files)</i>
|-- ioexpander/
| |-- Kconfig
| |-- Make.defs
| `-- <i>(Common I/O expander and GPIO-related driver source files)</i>
|-- lcd/ |-- lcd/
| |-- Kconfig | |-- Kconfig
| |-- Make.defs | |-- Make.defs
| `-- <i>(Common LCD driver source files)</i> | `-- <i>(Common LCD driver source files)</i>
|-- leds/
| |-- Kconfig
| |-- Make.defs
| `-- <i>(Common LED device driver source files)</i>
|-- loop/
| |-- Kconfig
| |-- Make.defs
| `-- <i>(Common loop device driver source files)</i>
|-- mmcsd/ |-- mmcsd/
| |-- Kconfig | |-- Kconfig
| |-- Make.defs | |-- Make.defs
| `-- <i>(Common MMC/SD card driver source files)</i> | `-- <i>(Common MMC/SD card driver source files)</i>
|-- modem/
| |-- Kconfig
| |-- Make.defs
| `-- <i>(Common modem driver source files)</i>
|-- mtd/ |-- mtd/
| |-- Kconfig | |-- Kconfig
| |-- Make.defs | |-- Make.defs
@@ -972,11 +996,19 @@ drivers/
| |-- Kconfig | |-- Kconfig
| |-- Make.defs | |-- Make.defs
| `-- <i>(Common network driver source files)</i> | `-- <i>(Common network driver source files)</i>
|-- pipes/
| |-- Kconfig
| |-- Make.defs
| `-- <i>(Common pipe and FIFO driver source files)</i>
|-- power/
| |-- Kconfig
| |-- Make.defs
| `-- <i>(Common power-related driver source files)</i>
|-- sensors/ |-- sensors/
| |-- Kconfig | |-- Kconfig
| |-- Make.defs | |-- Make.defs
| `-- <i>(Common sensor driver source files)</i> | `-- <i>(Common sensor driver source files)</i>
|-- serial/ |-- sercomm/
| |-- Kconfig | |-- Kconfig
| |-- Make.defs | |-- Make.defs
| `-- <i>(Files for the Calypso SERCOMM driver)</i> | `-- <i>(Files for the Calypso SERCOMM driver)</i>
@@ -984,6 +1016,18 @@ drivers/
| |-- Kconfig | |-- Kconfig
| |-- Make.defs | |-- Make.defs
| `-- <i>(Common front-end character drivers for chip-specific UARTs)</i> | `-- <i>(Common front-end character drivers for chip-specific UARTs)</i>
|-- spi/
| |-- Kconfig
| |-- Make.defs
| `-- <i>(Common SPI-related drivers and helper fuctions)</i>
|-- syslog/
| |-- Kconfig
| |-- Make.defs
| `-- <i>(System logging device support)</i>
|-- timers/
| |-- Kconfig
| |-- Make.defs
| `-- <i>(Timer-based device driver support)</i>
|-- usbdev/ |-- usbdev/
| |-- Kconfig | |-- Kconfig
| |-- Make.defs | |-- Make.defs
@@ -992,6 +1036,10 @@ drivers/
| |-- Kconfig | |-- Kconfig
| |-- Make.defs | |-- Make.defs
| `-- <i>(Common USB host driver source files)</i> | `-- <i>(Common USB host driver source files)</i>
|-- usbmonitor/
| |-- Kconfig
| |-- Make.defs
| `-- <i>(USB monitor source files)</i>
|-- wireless/ |-- wireless/
| |-- Kconfig | |-- Kconfig
| |-- Make.defs | |-- Make.defs
@@ -1088,16 +1136,32 @@ include/
| | `-- <i>(Audio driver header files)</i> | | `-- <i>(Audio driver header files)</i>
| |-binfmt/ | |-binfmt/
| | `-- <i>(Binary format header files)</i> | | `-- <i>(Binary format header files)</i>
| |-contactless/
| | `-- <i>(Contactless driver header files)</i>
| |-crypto/
| | `-- <i>(Cryptographic support header files)</i>
| |-drivers/
| | `-- <i>(Miscellaneous driver header files)</i>
| |-eeprom/
| | `-- <i>(EEPROM driver header files)</i>
| |-fs/ | |-fs/
| | `-- <i>(File System header files)</i> | | `-- <i>(File System header files)</i>
| |-input/ | |-input/
| | `-- <i>(Input device driver header files)</i> | | `-- <i>(Input device driver header files)</i>
| |-ioexpander/
| | `-- <i>(I/O exander and GPIO drvier header files)</i>
| |-lcd/ | |-lcd/
| | `-- <i>(LCD driver header files)</i> | | `-- <i>(LCD driver header files)</i>
| |-leds/
| | `-- <i>(LED driver header files)</i>
| |-lib/
| | `-- <i>(Non-standard C library driver header files)</i>
| |-mm/
| | `-- <i>(Memory management header files)</i>
| |-modem/
| | `-- <i>(Modem driver header files)</i>
| |-mtd/ | |-mtd/
| | `-- <i>(Memory technology device header files)</i> | | `-- <i>(Memory technology device header files)</i>
| |-serial/
| | `-- <i>(Serial driver header files)</i>
| |-net/ | |-net/
| | `-- <i>(Networking header files)</i> | | `-- <i>(Networking header files)</i>
| |-nx/ | |-nx/
@@ -1114,8 +1178,12 @@ include/
| | `-- <i>(SPI driver header files)</i> | | `-- <i>(SPI driver header files)</i>
| |-syslog/ | |-syslog/
| | `-- <i>(SYSLOG header files)</i> | | `-- <i>(SYSLOG header files)</i>
| |-timers/
| | `-- <i>(Timer-related driver header files)</i>
| |-usb/ | |-usb/
| | `-- <i>(USB driver header files)</i> | | `-- <i>(USB driver header files)</i>
| |-video/
| | `-- <i>(Video-related driver header files)</i>
| `-wireless/ | `-wireless/
| `-- <i>(Wireless device driver header files)</i> | `-- <i>(Wireless device driver header files)</i>
`- sys/ `- sys/
@@ -1148,16 +1216,28 @@ include/
</p> </p>
<ul><pre> <ul><pre>
libc/ libc/
|-- aio/
| `-- <i>(Implementation of functions from aio.h)</i>
|-- audio/
| `-- <i>(Implementation of audio-related functions)</i>
|-- dirent/
| `-- <i>(Implementation of functions from dirent.h)</i>
|-- fixedmath/
| `-- <i>(Implementation of functions from fixedmath.h)</i>
|-- hex2bin/
| `-- <i>(Implementation of functions from hex2bin.h)</i>
|-- libgen/ |-- libgen/
| `-- <i>(Implementation of functions from libgen.h)</i> | `-- <i>(Implementation of functions from libgen.h)</i>
|-- math/ |-- math/
| `-- <i>(Implementation of functions from fixedmath.h)</i> | `-- <i>(Implementation of functions from fixedmath.h)</i>
|-- misc/ |-- misc/
| `-- <i>(Implementation of miscellaneous library functions)</i> | `-- <i>(Implementation of miscellaneous library functions)</i>
|-- mqueue/
| `-- <i>(Implementation of some functions from mqueue.h)</i>
|-- net/ |-- net/
| `-- <i>(Implementation of network-related library functions)</i> | `-- <i>(Implementation of network-related library functions)</i>
|-- netdb/
| `-- <i>(Implementation of functions from netdb.h)</i>
|-- pthread/
| `-- <i>(Implementation of functions from pthread.h)</i>
|-- queue/ |-- queue/
| `-- <i>(Implementation of functions from queue.h)</i> | `-- <i>(Implementation of functions from queue.h)</i>
|-- sched/ |-- sched/
@@ -1166,16 +1246,31 @@ libc/
| `-- <i>(Implementation of some functions from semaphore.h)</i> | `-- <i>(Implementation of some functions from semaphore.h)</i>
|-- signal/ |-- signal/
| `-- <i>(Implementation of some functions from signal.h)</i> | `-- <i>(Implementation of some functions from signal.h)</i>
|-- spawn/
| `-- <i>(Implementation of some functions from spawn.h)</i>
|-- stdio/ |-- stdio/
| `-- <i>(Implementation of functions from stdio.h)</i> | `-- <i>(Implementation of functions from stdio.h)</i>
|-- stdlib/ |-- stdlib/
| `-- <i>(Implementation of functions from stdlib.h)</i> | `-- <i>(Implementation of functions from stdlib.h)</i>
|-- string/ |-- string/
| `-- <i>(Implementation of functions from string.h)</i> | `-- <i>(Implementation of functions from string.h)</i>
|-- symtab/
| `-- <i>(Implementation of symbol-table library functions)</i>
|-- syslog/
| `-- <i>(Implementation of functions from syslog.h)</i>
|-- termios/
| `-- <i>(Implementation of functions from termios.h)</i>
|-- time/ |-- time/
| `-- <i>(Implementation of some functions from time.h)</i> | `-- <i>(Implementation of some functions from time.h)</i>
`-- unistd/ |-- tls/
`-- <i>(Implementation of some functions from unistd.h)</i> | `-- <i>(Implementation of some functions from tls.h)</i>
|-- wqueue/
| `-- <i>(Implementation of some functions from wqueue.h)</i>
|-- unistd/
| `-- <i>(Implementation of some functions from unistd.h)</i>
`-- zoneinfo/
`-- <i>(Implementation of timezone database)</i>
</pre></ul> </pre></ul>
<h2>2.13 <a name="DirStructLibXX">nuttx/libxx</a></h2> <h2>2.13 <a name="DirStructLibXX">nuttx/libxx</a></h2>
+3 -3
View File
@@ -31,11 +31,11 @@ nuttx/
| |- arm/ | |- arm/
| | `- src | | `- src
| | `- <a href="https://bitbucket.org/nuttx/nuttx/src/master/arch/arm/src/lpc214x/README.txt" target="_blank">lpc214x/README.txt</a> | | `- <a href="https://bitbucket.org/nuttx/nuttx/src/master/arch/arm/src/lpc214x/README.txt" target="_blank">lpc214x/README.txt</a>
| |- sh/ | |- renesas/
| | |- include/ | | |- include/
| | | `-<a href="https://bitbucket.org/nuttx/nuttx/src/master/arch/sh/include/README.txt" target="_blank">README.txt</a> | | | `-<a href="https://bitbucket.org/nuttx/nuttx/src/master/arch/renesas/include/README.txt" target="_blank">README.txt</a>
| | |- src/ | | |- src/
| | | `-<a href="https://bitbucket.org/nuttx/nuttx/src/master/arch/sh/src/README.txt" target="_blank">README.txt</a> | | | `-<a href="https://bitbucket.org/nuttx/nuttx/src/master/arch/renesas/src/README.txt" target="_blank">README.txt</a>
| |- x86/ | |- x86/
| | |- include/ | | |- include/
| | | `-<a href="https://bitbucket.org/nuttx/nuttx/src/master/arch/x86/include/README.txt" target="_blank">README.txt</a> | | | `-<a href="https://bitbucket.org/nuttx/nuttx/src/master/arch/x86/include/README.txt" target="_blank">README.txt</a>
-1
View File
@@ -1367,7 +1367,6 @@ endif # DEBUG_SPI
config DEBUG_TIMER config DEBUG_TIMER
bool "Timer Debug Features" bool "Timer Debug Features"
default n default n
depends on TIMER
---help--- ---help---
Enable timer debug features. Enable timer debug features.
+9 -7
View File
@@ -181,7 +181,7 @@ endif
BIN = nuttx$(EXEEXT) BIN = nuttx$(EXEEXT)
all: $(BIN) all: $(BIN)
.PHONY: context clean_context check_context export subdir_clean clean subdir_distclean distclean apps_clean apps_distclean .PHONY: dirlinks context clean_context check_context export subdir_clean clean subdir_distclean distclean apps_clean apps_distclean
# Target used to copy include/nuttx/lib/math.h. If CONFIG_ARCH_MATH_H is # Target used to copy include/nuttx/lib/math.h. If CONFIG_ARCH_MATH_H is
# defined, then there is an architecture specific math.h header file # defined, then there is an architecture specific math.h header file
@@ -315,6 +315,8 @@ ifneq ($(CONFIG_ARCH_CHIP),)
endif endif
dirlinks: include/arch include/arch/board include/arch/chip $(ARCH_SRC)/board $(ARCH_SRC)/chip dirlinks: include/arch include/arch/board include/arch/chip $(ARCH_SRC)/board $(ARCH_SRC)/chip
$(Q) $(MAKE) -C configs dirlinks TOPDIR="$(TOPDIR)"
$(Q) $(MAKE) -C $(CONFIG_APPS_DIR) dirlinks TOPDIR="$(TOPDIR)"
# context # context
# #
@@ -470,32 +472,32 @@ pass2dep: context tools/mkdeps$(HOSTEXEEXT) tools/cnvwindeps$(HOSTEXEEXT)
# location: http://ymorin.is-a-geek.org/projects/kconfig-frontends. See # location: http://ymorin.is-a-geek.org/projects/kconfig-frontends. See
# README.txt file in the NuttX tools GIT repository for additional information. # README.txt file in the NuttX tools GIT repository for additional information.
do_config: context apps_preconfig do_config: dirlinks apps_preconfig
$(Q) APPSDIR=${CONFIG_APPS_DIR} kconfig-conf Kconfig $(Q) APPSDIR=${CONFIG_APPS_DIR} kconfig-conf Kconfig
config: do_config clean_context config: do_config clean_context
do_oldconfig: context apps_preconfig do_oldconfig: dirlinks apps_preconfig
$(Q) APPSDIR=${CONFIG_APPS_DIR} kconfig-conf --oldconfig Kconfig $(Q) APPSDIR=${CONFIG_APPS_DIR} kconfig-conf --oldconfig Kconfig
oldconfig: do_oldconfig clean_context oldconfig: do_oldconfig clean_context
do_olddefconfig: context apps_preconfig do_olddefconfig: dirlinks apps_preconfig
$(Q) APPSDIR=${CONFIG_APPS_DIR} kconfig-conf --olddefconfig Kconfig $(Q) APPSDIR=${CONFIG_APPS_DIR} kconfig-conf --olddefconfig Kconfig
olddefconfig: do_olddefconfig clean_context olddefconfig: do_olddefconfig clean_context
do_menuconfig: context apps_preconfig do_menuconfig: dirlinks apps_preconfig
$(Q) APPSDIR=${CONFIG_APPS_DIR} kconfig-mconf Kconfig $(Q) APPSDIR=${CONFIG_APPS_DIR} kconfig-mconf Kconfig
menuconfig: do_menuconfig clean_context menuconfig: do_menuconfig clean_context
do_qconfig: context apps_preconfig do_qconfig: dirlinks apps_preconfig
$(Q) APPSDIR=${CONFIG_APPS_DIR} kconfig-qconf Kconfig $(Q) APPSDIR=${CONFIG_APPS_DIR} kconfig-qconf Kconfig
qconfig: do_qconfig clean_context qconfig: do_qconfig clean_context
gconfig: context apps_preconfig gconfig: dirlinks apps_preconfig
$(Q) APPSDIR=${CONFIG_APPS_DIR} kconfig-gconf Kconfig $(Q) APPSDIR=${CONFIG_APPS_DIR} kconfig-gconf Kconfig
gconfig: do_gconfig clean_context gconfig: do_gconfig clean_context
+7 -5
View File
@@ -174,7 +174,7 @@ endif
BIN = nuttx$(EXEEXT) BIN = nuttx$(EXEEXT)
all: $(BIN) all: $(BIN)
.PHONY: context clean_context check_context configenv config oldconfig menuconfig export subdir_clean clean subdir_distclean distclean apps_clean apps_distclean .PHONY: dirlinks context clean_context check_context configenv config oldconfig menuconfig export subdir_clean clean subdir_distclean distclean apps_clean apps_distclean
# Target used to copy include\nuttx\math.h. If CONFIG_ARCH_MATH_H is # Target used to copy include\nuttx\math.h. If CONFIG_ARCH_MATH_H is
# defined, then there is an architecture specific math.h header file # defined, then there is an architecture specific math.h header file
@@ -335,6 +335,8 @@ endif
endif endif
dirlinks: include\arch include\arch\board include\arch\chip $(ARCH_SRC)\board $(ARCH_SRC)\chip dirlinks: include\arch include\arch\board include\arch\chip $(ARCH_SRC)\board $(ARCH_SRC)\chip
$(Q) $(MAKE) -C configs dirlinks TOPDIR="$(TOPDIR)"
$(Q) $(MAKE) -C $(CONFIG_APPS_DIR) dirlinks TOPDIR="$(TOPDIR)"
# context # context
# #
@@ -466,22 +468,22 @@ pass2dep: context tools\mkdeps$(HOSTEXEEXT)
# location: http://ymorin.is-a-geek.org/projects/kconfig-frontends. See # location: http://ymorin.is-a-geek.org/projects/kconfig-frontends. See
# misc\tools\README.txt for additional information. # misc\tools\README.txt for additional information.
do_config: context apps_preconfig do_config: dirlinks apps_preconfig
$(Q) set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& kconfig-conf Kconfig $(Q) set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& kconfig-conf Kconfig
config: do_config clean_context config: do_config clean_context
do_oldconfig: context apps_preconfig do_oldconfig: dirlinks apps_preconfig
$(Q) set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& kconfig-conf --oldconfig Kconfig $(Q) set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& kconfig-conf --oldconfig Kconfig
oldconfig: do_oldconfig clean_context oldconfig: do_oldconfig clean_context
do_olddefconfig: context apps_preconfig do_olddefconfig: dirlinks apps_preconfig
$(Q) set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& kconfig-conf --olddefconfig Kconfig $(Q) set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& kconfig-conf --olddefconfig Kconfig
olddefconfig: do_olddefconfig clean_context olddefconfig: do_olddefconfig clean_context
do_menuconfig: context configenv apps_preconfig do_menuconfig: dirlinks configenv apps_preconfig
$(Q) set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& kconfig-mconf Kconfig $(Q) set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& kconfig-mconf Kconfig
menuconfig: do_menuconfig clean_context menuconfig: do_menuconfig clean_context
+40 -3
View File
@@ -15,6 +15,7 @@ README
- NuttX Configuration Tool - NuttX Configuration Tool
- Finding Selections in the Configuration Menus - Finding Selections in the Configuration Menus
- Reveal Hidden Configuration Options - Reveal Hidden Configuration Options
- Make Sure that You on on the Right Platform
- Comparing Two Configurations - Comparing Two Configurations
- Incompatibilities with Older Configurations - Incompatibilities with Older Configurations
- NuttX Configuration Tool under DOS - NuttX Configuration Tool under DOS
@@ -576,6 +577,38 @@ Reveal Hidden Configuration Options
cannot be selected and has no value). About all you do is to select cannot be selected and has no value). About all you do is to select
the <Help> option to see what the dependencies are. the <Help> option to see what the dependencies are.
Make Sure that You on on the Right Platform
-------------------------------------------
Saved configurations may run on Linux, Cygwin (32- or 64-bit), or other
platforms. The platform characteristics can be changed use 'make
menuconfig'. Sometimes this can be confusing due to the differences
between the platforms. Enter sethost.sh
sethost.sh is a simple script that changes a configuration to your
host platform. This can greatly simplify life if you use many different
configurations. For example, if you are running on Linux and you
configure like this:
$ cd tools
$ ./configure.sh board/configuration
$ cd ..
The you can use the following command to both (1) make sure that the
configuration is up to date, AND (2) the configuration is set up
correctly for Linux:
$ tools/sethost.sh -l
Or, if you are on a Windows/Cygwin 64-bit platform:
$ tools/sethost.sh -w
Other options are available from the help option built into the
script. You can see all options with:
$ tools/sethost.sh -h
Comparing Two Configurations Comparing Two Configurations
---------------------------- ----------------------------
@@ -948,9 +981,13 @@ Native Windows Build
-------------------- --------------------
The beginnings of a Windows native build are in place but still not often The beginnings of a Windows native build are in place but still not often
used as of this writing. The windows native build logic initiated used as of this writing. The build was functional but because of lack of
if CONFIG_WINDOWS_NATIVE=y is defined in the NuttX configuration file: use may find some issues to be resolved with this build configuration.
The windows native build logic initiated if CONFIG_WINDOWS_NATIVE=y is
defined in the NuttX configuration file:
This build: This build:
- Uses all Windows style paths - Uses all Windows style paths
@@ -1213,7 +1250,7 @@ nuttx/
| |- arm/ | |- arm/
| | `- src | | `- src
| | `- lpc214x/README.txt | | `- lpc214x/README.txt
| |- sh/ | |- renesas/
| | |- include/ | | |- include/
| | | `-README.txt | | | `-README.txt
| | |- src/ | | |- src/
+1 -1
View File
@@ -9063,7 +9063,7 @@ detailed bugfix information):
for mq_setattr() and mq_getattr(). This is necessary in protected for mq_setattr() and mq_getattr(). This is necessary in protected
and kernel builds because in those cases the message queue and kernel builds because in those cases the message queue
structure is protected and cannot be accessed directly from user structure is protected and cannot be accessed directly from user
mode code. Noted by Jouko Holopainen. mode code.
* File Systems/Block Drivers/MTD: * File Systems/Block Drivers/MTD:
+6 -5
View File
@@ -219,7 +219,7 @@ o Task/Scheduler (sched/)
Description: Task control information is retained in simple lists. This Description: Task control information is retained in simple lists. This
is completely appropriate for small embedded systems where is completely appropriate for small embedded systems where
the number of tasks, N, is relatively small. Most list the number of tasks, N, is relatively small. Most list
operations are O(N). This could become as issue if N gets operations are O(N). This could become an issue if N gets
very large. very large.
In that case, these simple lists should be replaced with In that case, these simple lists should be replaced with
@@ -819,7 +819,7 @@ o Binary loaders (binfmt/)
"Read-Only Data in RAM" at "Read-Only Data in RAM" at
http://nuttx.org/Documentation/NuttXNxFlat.html#limitations). http://nuttx.org/Documentation/NuttXNxFlat.html#limitations).
The newer 4.6.3compiler generated PC relative relocations to the strings: The newer 4.6.3 compiler generated PC relative relocations to the strings:
.L2: .L2:
.word .LC0-(.LPIC0+4) .word .LC0-(.LPIC0+4)
@@ -927,8 +927,7 @@ o Network (net/, drivers/net)
CONFIG_NET_NOINTS). This is really a very bad use of CPU CONFIG_NET_NOINTS). This is really a very bad use of CPU
resources; All of the network stack processing should be resources; All of the network stack processing should be
modified to use a work queue (and, all use of CONFIG_NET_NOINTS=n modified to use a work queue (and, all use of CONFIG_NET_NOINTS=n
should be eliminated). This applies to almost all Ethernet should be eliminated). This applies to many Ethernet drivers:
drivers:
ARCHITECTURE CONFIG_NET_NOINTS? ADDRESS FILTER SUPPORT? ARCHITECTURE CONFIG_NET_NOINTS? ADDRESS FILTER SUPPORT?
C5471 NO NO C5471 NO NO
@@ -1340,6 +1339,8 @@ o Libraries (libc/)
UPDATE: 2015-09-01: A fix for the noted problems with asin() UPDATE: 2015-09-01: A fix for the noted problems with asin()
has been applied. has been applied.
2016-07-30: Numerous fixes and performance improvements from
David Alessio.
Status: Open Status: Open
Priority: Low for casual users but clearly high if you need care about Priority: Low for casual users but clearly high if you need care about
@@ -1735,7 +1736,7 @@ o ARM (arch/arm/)
upon return. This could be improved as well: If there is no upon return. This could be improved as well: If there is no
context switch, then the static registers need not be restored context switch, then the static registers need not be restored
because they will not be modified by the called C code. because they will not be modified by the called C code.
(see arch/sh/src/sh1/sh1_vector.S for example) (see arch/renesas/src/sh1/sh1_vector.S for example)
Status: Open Status: Open
Priority: Low Priority: Low
+12 -12
View File
@@ -45,7 +45,7 @@ config ARCH_RGMP
RTOS and GPOS on Multi-Processor (RGMP) architecture. See RTOS and GPOS on Multi-Processor (RGMP) architecture. See
http://rgmp.sourceforge.net/wiki/index.php/Main_Page. http://rgmp.sourceforge.net/wiki/index.php/Main_Page.
config ARCH_SH config ARCH_RENESAS
bool "Renesas" bool "Renesas"
select ARCH_NOINTC select ARCH_NOINTC
select ARCH_HAVE_INTERRUPTSTACK select ARCH_HAVE_INTERRUPTSTACK
@@ -83,23 +83,23 @@ endchoice
config ARCH config ARCH
string string
default "arm" if ARCH_ARM default "arm" if ARCH_ARM
default "avr" if ARCH_AVR default "avr" if ARCH_AVR
default "hc" if ARCH_HC default "hc" if ARCH_HC
default "mips" if ARCH_MIPS default "mips" if ARCH_MIPS
default "rgmp" if ARCH_RGMP default "rgmp" if ARCH_RGMP
default "sh" if ARCH_SH default "renesas" if ARCH_RENESAS
default "sim" if ARCH_SIM default "sim" if ARCH_SIM
default "x86" if ARCH_X86 default "x86" if ARCH_X86
default "z16" if ARCH_Z16 default "z16" if ARCH_Z16
default "z80" if ARCH_Z80 default "z80" if ARCH_Z80
source arch/arm/Kconfig source arch/arm/Kconfig
source arch/avr/Kconfig source arch/avr/Kconfig
source arch/hc/Kconfig source arch/hc/Kconfig
source arch/mips/Kconfig source arch/mips/Kconfig
source arch/rgmp/Kconfig source arch/rgmp/Kconfig
source arch/sh/Kconfig source arch/renesas/Kconfig
source arch/sim/Kconfig source arch/sim/Kconfig
source arch/x86/Kconfig source arch/x86/Kconfig
source arch/z16/Kconfig source arch/z16/Kconfig
+13 -10
View File
@@ -150,11 +150,13 @@ arch/arm - ARM-based micro-controllers
Architecture Support Architecture Support
arch/arm/include and arch/arm/src/common arch/arm/include and arch/arm/src/common
arch/arm/src/arm and arch/arm/include/arm arch/arm/src/arm and arch/arm/include/arm
arch/arm/src/armv7-a and arch/arm/include/armv6-m
arch/arm/src/armv7-a and arch/arm/include/armv7-a arch/arm/src/armv7-a and arch/arm/include/armv7-a
arch/arm/src/armv7-m and arch/arm/include/armv7-m arch/arm/src/armv7-m and arch/arm/include/armv7-m
arch/arm/src/armv7-r and arch/arm/include/armv7-4 arch/arm/src/armv7-r and arch/arm/include/armv7-r
MCU support MCU support
arch/arm/include/a1x and arch/arm/src/a1x
arch/arm/include/c5471 and arch/arm/src/c5471 arch/arm/include/c5471 and arch/arm/src/c5471
arch/arm/include/calypso and arch/arm/src/calypso arch/arm/include/calypso and arch/arm/src/calypso
arch/arm/include/dm320 and arch/arm/src/dm320 arch/arm/include/dm320 and arch/arm/src/dm320
@@ -210,6 +212,16 @@ arch/mips
arch/mips/include/pic32mx and arch/mips/src/pic32mx arch/mips/include/pic32mx and arch/mips/src/pic32mx
arch/mips/include/pic32mz and arch/mips/src/pic32mz arch/mips/include/pic32mz and arch/mips/src/pic32mz
arch/renesas - Support for Renesas and legacy Hitachi microcontrollers.
This include SuperH and M16C.
Architecture Support
arch/renesas/include and arch/renesas/src/common
MCU support
arch/renesas/include/m16c and arch/renesas/src/m16c
arch/renesas/include/sh1 and arch/renesas/src/sh1
arch/rgmp arch/rgmp
RGMP stands for RTOS and GPOS on Multi-Processor. RGMP is a project RGMP stands for RTOS and GPOS on Multi-Processor. RGMP is a project
@@ -221,15 +233,6 @@ arch/rgmp
See http://rgmp.sourceforge.net/wiki/index.php/Main_Page for further See http://rgmp.sourceforge.net/wiki/index.php/Main_Page for further
information about RGMP. information about RGMP.
arch/sh - SuperH and related Hitachi/Renesas microcontrollers
Architecture Support
arch/sh/include and arch/sh/src/common
MCU support
arch/sh/include/m16c and arch/sh/src/m16c
arch/sh/include/sh1 and arch/sh/src/sh1
arch/x86 - Intel x86 architectures arch/x86 - Intel x86 architectures
This directory holds related, 32- and 64-bit architectures from Intel. This directory holds related, 32- and 64-bit architectures from Intel.
At present, this includes the following subdirectories: At present, this includes the following subdirectories:
+14 -8
View File
@@ -51,6 +51,7 @@ config ARCH_CHIP_DM320
config ARCH_CHIP_EFM32 config ARCH_CHIP_EFM32
bool "Energy Micro" bool "Energy Micro"
select ARCH_HAVE_CMNVECTOR select ARCH_HAVE_CMNVECTOR
select ARCH_HAVE_SPI_BITORDER
select ARMV7M_CMNVECTOR select ARMV7M_CMNVECTOR
---help--- ---help---
Energy Micro EFM32 microcontrollers (ARM Cortex-M). Energy Micro EFM32 microcontrollers (ARM Cortex-M).
@@ -206,14 +207,15 @@ config ARCH_CHIP_SAM34
config ARCH_CHIP_SAMV7 config ARCH_CHIP_SAMV7
bool "Atmel SAMV7" bool "Atmel SAMV7"
select ARCH_HAVE_CMNVECTOR select ARCH_HAVE_CMNVECTOR
select ARMV7M_CMNVECTOR
select ARCH_CORTEXM7 select ARCH_CORTEXM7
select ARCH_HAVE_MPU select ARCH_HAVE_MPU
select ARM_HAVE_MPU_UNIFIED
select ARCH_HAVE_RAMFUNCS select ARCH_HAVE_RAMFUNCS
select ARCH_HAVE_TICKLESS select ARCH_HAVE_TICKLESS
select ARMV7M_HAVE_STACKCHECK
select ARCH_HAVE_I2CRESET select ARCH_HAVE_I2CRESET
select ARCH_HAVE_SPI_CS_CONTROL
select ARM_HAVE_MPU_UNIFIED
select ARMV7M_CMNVECTOR
select ARMV7M_HAVE_STACKCHECK
---help--- ---help---
Atmel SAMV7 (ARM Cortex-M7) architectures Atmel SAMV7 (ARM Cortex-M7) architectures
@@ -221,10 +223,12 @@ config ARCH_CHIP_STM32
bool "STMicro STM32 F1/F2/F3/F4" bool "STMicro STM32 F1/F2/F3/F4"
select ARCH_HAVE_CMNVECTOR select ARCH_HAVE_CMNVECTOR
select ARCH_HAVE_MPU select ARCH_HAVE_MPU
select ARM_HAVE_MPU_UNIFIED
select ARCH_HAVE_I2CRESET select ARCH_HAVE_I2CRESET
select ARCH_HAVE_HEAPCHECK select ARCH_HAVE_HEAPCHECK
select ARCH_HAVE_TICKLESS select ARCH_HAVE_TICKLESS
select ARCH_HAVE_TIMEKEEPING
select ARCH_HAVE_SPI_BITORDER
select ARM_HAVE_MPU_UNIFIED
select ARMV7M_HAVE_STACKCHECK select ARMV7M_HAVE_STACKCHECK
---help--- ---help---
STMicro STM32 architectures (ARM Cortex-M3/4). STMicro STM32 architectures (ARM Cortex-M3/4).
@@ -232,12 +236,13 @@ config ARCH_CHIP_STM32
config ARCH_CHIP_STM32F7 config ARCH_CHIP_STM32F7
bool "STMicro STM32 F7" bool "STMicro STM32 F7"
select ARCH_HAVE_CMNVECTOR select ARCH_HAVE_CMNVECTOR
select ARMV7M_CMNVECTOR
select ARCH_CORTEXM7 select ARCH_CORTEXM7
select ARCH_HAVE_MPU select ARCH_HAVE_MPU
select ARM_HAVE_MPU_UNIFIED
select ARCH_HAVE_I2CRESET select ARCH_HAVE_I2CRESET
select ARCH_HAVE_HEAPCHECK select ARCH_HAVE_HEAPCHECK
select ARCH_HAVE_SPI_BITORDER
select ARM_HAVE_MPU_UNIFIED
select ARMV7M_CMNVECTOR
select ARMV7M_HAVE_STACKCHECK select ARMV7M_HAVE_STACKCHECK
---help--- ---help---
STMicro STM32 architectures (ARM Cortex-M7). STMicro STM32 architectures (ARM Cortex-M7).
@@ -245,13 +250,14 @@ config ARCH_CHIP_STM32F7
config ARCH_CHIP_STM32L4 config ARCH_CHIP_STM32L4
bool "STMicro STM32 L4" bool "STMicro STM32 L4"
select ARCH_HAVE_CMNVECTOR select ARCH_HAVE_CMNVECTOR
select ARMV7M_CMNVECTOR
select ARCH_CORTEXM4 select ARCH_CORTEXM4
select ARCH_HAVE_MPU select ARCH_HAVE_MPU
select ARM_HAVE_MPU_UNIFIED
select ARCH_HAVE_I2CRESET select ARCH_HAVE_I2CRESET
select ARCH_HAVE_HEAPCHECK select ARCH_HAVE_HEAPCHECK
select ARCH_HAVE_TICKLESS select ARCH_HAVE_TICKLESS
select ARCH_HAVE_SPI_BITORDER
select ARM_HAVE_MPU_UNIFIED
select ARMV7M_CMNVECTOR
select ARMV7M_HAVE_STACKCHECK select ARMV7M_HAVE_STACKCHECK
---help--- ---help---
STMicro STM32 architectures (ARM Cortex-M4). STMicro STM32 architectures (ARM Cortex-M4).
+3 -3
View File
@@ -1,5 +1,5 @@
#ifndef _CALYPSO_CLK_H #ifndef __ARCH_ARM_INCLUDE_CALYPSO_CLOCK_H
#define _CALYPSO_CLK_H #define __ARCH_ARM_INCLUDE_CALYPSO_CLOCK_H
#include <stdint.h> #include <stdint.h>
@@ -64,4 +64,4 @@ void calypso_debugunit(int enable);
void calypso_rhea_cfg(uint8_t fac0, uint8_t fac1, uint8_t timeout, void calypso_rhea_cfg(uint8_t fac0, uint8_t fac1, uint8_t timeout,
uint8_t ws_h, uint8_t ws_l, uint8_t w_en0, uint8_t w_en1); uint8_t ws_h, uint8_t ws_l, uint8_t w_en0, uint8_t w_en1);
#endif /* _CALYPSO_CLK_H */ #endif /* __ARCH_ARM_INCLUDE_CALYPSO_CLOCK_H */
+3 -3
View File
@@ -1,5 +1,5 @@
#ifndef _DEBUG_H #ifndef __ARCH_ARM_INCLUDE_CALYPSO_DEBUG_H
#define _DEBUG_H #define __ARCH_ARM_INCLUDE_CALYPSO_DEBUG_H
#ifndef ARRAY_SIZE #ifndef ARRAY_SIZE
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
@@ -28,4 +28,4 @@
#define printd(x, args ...) #define printd(x, args ...)
#endif #endif
#endif /* _DEBUG_H */ #endif /* __ARCH_ARM_INCLUDE_CALYPSO_DEBUG_H */
+3 -4
View File
@@ -1,6 +1,5 @@
#ifndef __ARCH_ARM_INCLUDE_CALYPSO_DEFINES_H
#ifndef _DEFINES_H #define __ARCH_ARM_INCLUDE_CALYPSO_DEFINES_H
#define _DEFINES_H
#define __attribute_const__ __attribute__((__const__)) #define __attribute_const__ __attribute__((__const__))
@@ -15,4 +14,4 @@
/* force placement in zero-waitstate memory */ /* force placement in zero-waitstate memory */
#define __ramtext __section(".ramtext") #define __ramtext __section(".ramtext")
#endif /* !_DEFINES_H */ #endif /* !__ARCH_ARM_INCLUDE_CALYPSO_DEFINES_H */
+3 -3
View File
@@ -41,8 +41,8 @@
#error "This file should never be included directly! Use <nuttx/irq.h>" #error "This file should never be included directly! Use <nuttx/irq.h>"
#endif #endif
#ifndef _CALYPSO_IRQ_H #ifndef __ARCH_ARM_INCLUDE_CALYPSO_IRQ_H
#define _CALYPSO_IRQ_H #define __ARCH_ARM_INCLUDE_CALYPSO_IRQ_H
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
@@ -78,4 +78,4 @@ enum irq_nr {
#define IRQ_SYSTIMER IRQ_TIMER2 #define IRQ_SYSTIMER IRQ_TIMER2
#endif /* _CALYPSO_IRQ_H */ #endif /* __ARCH_ARM_INCLUDE_CALYPSO_IRQ_H */
+3 -3
View File
@@ -1,5 +1,5 @@
#ifndef _MEMORY_H #ifndef __ARCH_ARM_INCLUDE_CALYPSO_MEMORY_H
#define _MEMORY_H #define __ARCH_ARM_INCLUDE_CALYPSO_MEMORY_H
#define __arch_getb(a) (*(volatile unsigned char *)(a)) #define __arch_getb(a) (*(volatile unsigned char *)(a))
#define __arch_getw(a) (*(volatile unsigned short *)(a)) #define __arch_getw(a) (*(volatile unsigned short *)(a))
@@ -25,4 +25,4 @@
#define readw(a) __arch_getw(a) #define readw(a) __arch_getw(a)
#define readl(a) __arch_getl(a) #define readl(a) __arch_getl(a)
#endif /* _MEMORY_H */ #endif /* __ARCH_ARM_INCLUDE_CALYPSO_MEMORY_H */
+3 -3
View File
@@ -1,5 +1,5 @@
#ifndef _CAL_TIMER_H #ifndef __ARCH_ARM_INCLUDE_CALYPSO_TIMER_H
#define _CAL_TIMER_H #define __ARCH_ARM_INCLUDE_CALYPSO_TIMER_H
/* Enable or Disable a timer */ /* Enable or Disable a timer */
void hwtimer_enable(int num, int on); void hwtimer_enable(int num, int on);
@@ -22,4 +22,4 @@ void wdog_reset(void);
/* power up the timers */ /* power up the timers */
void hwtimer_init(void); void hwtimer_init(void);
#endif /* _CAL_TIMER_H */ #endif /* __ARCH_ARM_INCLUDE_CALYPSO_TIMER_H */
+2 -2
View File
@@ -1,5 +1,5 @@
#ifndef _CALYPSO_UWIRE_H #ifndef __ARCH_ARM_INCLUDE_CALYPSO_UWIRE_H
#define _CALYPSO_UWIRE_H #define __ARCH_ARM_INCLUDE_CALYPSO_UWIRE_H
void uwire_init(void); void uwire_init(void);
int uwire_xfer(int cs, int bitlen, const void *dout, void *din); int uwire_xfer(int cs, int bitlen, const void *dout, void *din);
#endif #endif
+3 -3
View File
@@ -37,8 +37,8 @@
* only indirectly through nuttx/irq.h * only indirectly through nuttx/irq.h
*/ */
#ifndef __ARCH_LPC214X_IRQ_H #ifndef __ARCH_ARM_INCLUDE_LPC214X_IRQ_H
#define __ARCH_LPC214X_IRQ_H #define __ARCH_ARM_INCLUDE_LPC214X_IRQ_H
/**************************************************************************** /****************************************************************************
* Included Files * Included Files
@@ -127,5 +127,5 @@ void up_detach_vector(int vector);
#endif #endif
#endif #endif
#endif /* __ARCH_LPC214X_IRQ_H */ #endif /* __ARCH_ARM_INCLUDE_LPC214X_IRQ_H */
+3 -3
View File
@@ -43,8 +43,8 @@
* only indirectly through nuttx/irq.h * only indirectly through nuttx/irq.h
*/ */
#ifndef __ARCH_LPC2378_IRQ_H #ifndef __ARCH_ARM_INCLUDE_LPC2378_IRQ_H
#define __ARCH_LPC2378_IRQ_H #define __ARCH_ARM_INCLUDE_LPC2378_IRQ_H
/**************************************************************************** /****************************************************************************
* Included Files * Included Files
@@ -149,4 +149,4 @@ void up_detach_vector(int vector);
#endif #endif
#endif #endif
#endif /* __ARCH_LPC2378_IRQ_H */ #endif /* __ARCH_ARM_INCLUDE_LPC2378_IRQ_H */
+4 -4
View File
@@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* c5471/chip.h * arch/arm/src/c5471/chip.h
* *
* Copyright (C) 2007 Gregory Nutt. All rights reserved. * Copyright (C) 2007 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@@ -33,8 +33,8 @@
* *
****************************************************************************/ ****************************************************************************/
#ifndef __C5471_CHIP_H #ifndef __ARCH_ARM_SRC_C5471_CHIP_H
#define __C5471_CHIP_H #define __ARCH_ARM_SRC_C5471_CHIP_H
/**************************************************************************** /****************************************************************************
* Included Files * Included Files
@@ -368,4 +368,4 @@
* Public Function Prototypes * Public Function Prototypes
****************************************************************************/ ****************************************************************************/
#endif /* __C5471_CHIP_H */ #endif /* __ARCH_ARM_SRC_C5471_CHIP_H */
+3 -3
View File
@@ -37,8 +37,8 @@
* *
****************************************************************************/ ****************************************************************************/
#ifndef __CALYPSO_CHIP_H #ifndef __ARCH_ARM_SRC_CALYPSO_CHIP_H
#define __CALYPSO_CHIP_H #define __ARCH_ARM_SRC_CALYPSO_CHIP_H
/**************************************************************************** /****************************************************************************
* Included Files * Included Files
@@ -208,4 +208,4 @@
* Public Function Prototypes * Public Function Prototypes
****************************************************************************/ ****************************************************************************/
#endif /* __CALYPSO_CHIP_H */ #endif /* __ARCH_ARM_SRC_CALYPSO_CHIP_H */
+3 -3
View File
@@ -33,8 +33,8 @@
* *
************************************************************************************/ ************************************************************************************/
#ifndef __DM320_CHIP_H #ifndef __ARCH_ARM_SRC_DM320_CHIP_H
#define __DM320_CHIP_H #define __ARCH_ARM_SRC_DM320_CHIP_H
/************************************************************************************ /************************************************************************************
* Included Files * Included Files
@@ -58,4 +58,4 @@
* Inline Functions * Inline Functions
************************************************************************************/ ************************************************************************************/
#endif /* __DM320_CHIP_H */ #endif /* __ARCH_ARM_SRC_DM320_CHIP_H */
+3 -3
View File
@@ -33,8 +33,8 @@
* *
************************************************************************************/ ************************************************************************************/
#ifndef __DM320_DM320_EMIF_H #ifndef __ARCH_ARM_SRC_DM320_DM320_EMIF_H
#define __DM320_DM320_EMIF_H #define __ARCH_ARM_SRC_DM320_DM320_EMIF_H
/************************************************************************************ /************************************************************************************
* Included Files * Included Files
@@ -105,4 +105,4 @@
#endif #endif
#endif /* __DM320_DM320_EMIF_H */ #endif /* __ARCH_ARM_SRC_DM320_DM320_EMIF_H */
+2 -2
View File
@@ -33,8 +33,8 @@
* *
************************************************************************************/ ************************************************************************************/
#ifndef __DM320_DM320GIO_H #ifndef __ARCH_ARM_SRC_DM320_DM320_GIO_H
#define __DM320_DM320GIO_H #define __ARCH_ARM_SRC_DM320_DM320_GIO_H
/************************************************************************************ /************************************************************************************
* Included Files * Included Files
+3 -3
View File
@@ -33,8 +33,8 @@
* *
************************************************************************************/ ************************************************************************************/
#ifndef __DM320_DM320_INTC_H #ifndef __ARCH_ARM_SRC_DM320_DM320_INTC_H
#define __DM320_DM320_INTC_H #define __ARCH_ARM_SRC_DM320_DM320_INTC_H
/************************************************************************************ /************************************************************************************
* Included Files * Included Files
@@ -98,4 +98,4 @@
#endif #endif
#endif /* __DM320_DM320_INTC_H */ #endif /* __ARCH_ARM_SRC_DM320_DM320_INTC_H */
+3 -3
View File
@@ -33,8 +33,8 @@
* *
************************************************************************************/ ************************************************************************************/
#ifndef __DM320_MEMORYMAP_H #ifndef __ARCH_ARM_SRC_DM320_DM320_MEMORYMAP_H
#define __DM320_MEMORYMAP_H #define __ARCH_ARM_SRC_DM320_DM320_MEMORYMAP_H
/************************************************************************************ /************************************************************************************
* Included Files * Included Files
@@ -261,4 +261,4 @@
#endif #endif
#endif /* __DM320_MEMORYMAP_H */ #endif /* __ARCH_ARM_SRC_DM320_DM320_MEMORYMAP_H */
+3 -3
View File
@@ -33,8 +33,8 @@
* *
************************************************************************************/ ************************************************************************************/
#ifndef __DM320_TIMER_H #ifndef __ARCH_ARM_SRC_DM320_DM320_TIMER_H
#define __DM320_TIMER_H #define __ARCH_ARM_SRC_DM320_DM320_TIMER_H
/************************************************************************************ /************************************************************************************
* Included Files * Included Files
@@ -105,4 +105,4 @@
#endif #endif
#endif /* __DM320_TIMER_H */ #endif /* __ARCH_ARM_SRC_DM320_DM320_TIMER_H */
+3 -3
View File
@@ -33,8 +33,8 @@
* *
************************************************************************************/ ************************************************************************************/
#ifndef __DM320_UART_H #ifndef __ARCH_ARM_SRC_DM320_DM320_UART_H
#define __DM320_UART_H #define __ARCH_ARM_SRC_DM320_DM320_UART_H
/************************************************************************************ /************************************************************************************
* Included Files * Included Files
@@ -173,4 +173,4 @@
* Inline Functions * Inline Functions
************************************************************************************/ ************************************************************************************/
#endif /* __DM320_UART_H */ #endif /* __ARCH_ARM_SRC_DM320_DM320_UART_H */
+76 -36
View File
@@ -185,6 +185,10 @@ static uint32_t spi_setfrequency(struct spi_dev_s *dev,
uint32_t frequency); uint32_t frequency);
static void spi_setmode(struct spi_dev_s *dev, enum spi_mode_e mode); static void spi_setmode(struct spi_dev_s *dev, enum spi_mode_e mode);
static void spi_setbits(struct spi_dev_s *dev, int nbits); static void spi_setbits(struct spi_dev_s *dev, int nbits);
#ifdef CONFIG_SPI_HWFEATURES
static int spi_hwfeatures(FAR struct spi_dev_s *dev,
spi_hwfeatures_t features);
#endif
static uint8_t spi_status(struct spi_dev_s *dev, enum spi_dev_e devid); static uint8_t spi_status(struct spi_dev_s *dev, enum spi_dev_e devid);
#ifdef CONFIG_SPI_CMDDATA #ifdef CONFIG_SPI_CMDDATA
static int spi_cmddata(struct spi_dev_s *dev, enum spi_dev_e devid, static int spi_cmddata(struct spi_dev_s *dev, enum spi_dev_e devid,
@@ -218,7 +222,7 @@ static const struct spi_ops_s g_spiops =
.setmode = spi_setmode, .setmode = spi_setmode,
.setbits = spi_setbits, .setbits = spi_setbits,
#ifdef CONFIG_SPI_HWFEATURES #ifdef CONFIG_SPI_HWFEATURES
.hwfeatures = 0, .hwfeatures = spi_hwfeatures,
#endif #endif
.status = spi_status, .status = spi_status,
#ifdef CONFIG_SPI_CMDDATA #ifdef CONFIG_SPI_CMDDATA
@@ -976,47 +980,16 @@ static void spi_setbits(struct spi_dev_s *dev, int nbits)
const struct efm32_spiconfig_s *config; const struct efm32_spiconfig_s *config;
uint32_t regval; uint32_t regval;
uint32_t setting; uint32_t setting;
bool lsbfirst;
spiinfo("nbits=%d\n", nbits); spiinfo("nbits=%d\n", nbits);
DEBUGASSERT(priv && priv->config); DEBUGASSERT(priv && priv->config);
config = priv->config; config = priv->config;
/* Bit order is encoded by the sign of nbits */ /* Has the number of bits changed? */
if (nbits < 0) if (nbits != priv->nbits)
{ {
/* LSB first */
lsbfirst = true;
nbits = -nbits;
}
else
{
/* MSH first */
lsbfirst = false;
}
/* Has the number of bits or the bit order changed? */
if (nbits != priv->nbits || lsbfirst != priv->lsbfirst)
{
/* Set the new bit order */
regval = spi_getreg(config, EFM32_USART_CTRL_OFFSET);
if (lsbfirst)
{
regval &= ~USART_CTRL_MSBF;
}
else
{
regval |= USART_CTRL_MSBF;
}
spi_putreg(config, EFM32_USART_CTRL_OFFSET, regval);
/* Select the new number of bits */ /* Select the new number of bits */
switch (nbits) switch (nbits)
@@ -1086,11 +1059,78 @@ static void spi_setbits(struct spi_dev_s *dev, int nbits)
* faster * faster
*/ */
priv->nbits = nbits; priv->nbits = nbits;
priv->lsbfirst = lsbfirst;
} }
} }
/****************************************************************************
* Name: spi_hwfeatures
*
* Description:
* Set hardware-specific feature flags.
*
* Input Parameters:
* dev - Device-specific state data
* features - H/W feature flags
*
* Returned Value:
* Zero (OK) if the selected H/W features are enabled; A negated errno
* value if any H/W feature is not supportable.
*
****************************************************************************/
#ifdef CONFIG_SPI_HWFEATURES
static int spi_hwfeatures(FAR struct spi_dev_s *dev, spi_hwfeatures_t features)
{
#ifdef CONFIG_SPI_BITORDER
struct efm32_spidev_s *priv = (struct efm32_spidev_s *)dev;
const struct efm32_spiconfig_s *config;
uint32_t regval;
bool lsbfirst;
spiinfo("features=%08x\n", features);
DEBUGASSERT(priv && priv->config);
config = priv->config;
/* Bit order is encoded by the sign of nbits */
lsbfirst = ((features & HWFEAT_LSBFIRST) != 0);
/* Has the number of bits or the bit order changed? */
if (lsbfirst != priv->lsbfirst)
{
/* Set the new bit order */
regval = spi_getreg(config, EFM32_USART_CTRL_OFFSET);
if (lsbfirst)
{
regval &= ~USART_CTRL_MSBF;
}
else
{
regval |= USART_CTRL_MSBF;
}
spi_putreg(config, EFM32_USART_CTRL_OFFSET, regval);
/* Save the selection so the subsequence re-configurations will be
* faster
*/
priv->lsbfirst = lsbfirst;
}
/* Other H/W features are not supported */
return ((features & ~HWFEAT_LSBFIRST) == 0) ? OK : -ENOSYS;
#else
return -ENOSYS;
#endif
}
#endif
/**************************************************************************** /****************************************************************************
* Name: spi_status * Name: spi_status
* *
+60
View File
@@ -37,94 +37,130 @@ config ARCH_CHIP_MK20DX128VLH5
config ARCH_CHIP_MK20DX64VLH7 config ARCH_CHIP_MK20DX64VLH7
bool "MK20DX64VLH7" bool "MK20DX64VLH7"
select ARCH_FAMILY_K20 select ARCH_FAMILY_K20
select KINETIS_HAVE_I2C1
config ARCH_CHIP_MK20DX128VLH7 config ARCH_CHIP_MK20DX128VLH7
bool "MK20DX128VLH7" bool "MK20DX128VLH7"
select ARCH_FAMILY_K20 select ARCH_FAMILY_K20
select KINETIS_HAVE_I2C1
config ARCH_CHIP_MK20DX256VLH7 config ARCH_CHIP_MK20DX256VLH7
bool "MK20DX256VLH7" bool "MK20DX256VLH7"
select ARCH_FAMILY_K20 select ARCH_FAMILY_K20
select KINETIS_HAVE_I2C1
config ARCH_CHIP_MK40N512VLQ100 config ARCH_CHIP_MK40N512VLQ100
bool "MK40N512VLQ100" bool "MK40N512VLQ100"
select ARCH_FAMILY_K40 select ARCH_FAMILY_K40
select KINETIS_HAVE_I2C1
config ARCH_CHIP_MK40N512VMD100 config ARCH_CHIP_MK40N512VMD100
bool "MK40N512VMD100" bool "MK40N512VMD100"
select ARCH_FAMILY_K40 select ARCH_FAMILY_K40
select KINETIS_HAVE_I2C1
config ARCH_CHIP_MK40X128VLQ100 config ARCH_CHIP_MK40X128VLQ100
bool "MK40X128VLQ100" bool "MK40X128VLQ100"
select ARCH_FAMILY_K40 select ARCH_FAMILY_K40
select KINETIS_HAVE_I2C1
config ARCH_CHIP_MK40X128VMD100 config ARCH_CHIP_MK40X128VMD100
bool "MK40X128VMD100" bool "MK40X128VMD100"
select ARCH_FAMILY_K40 select ARCH_FAMILY_K40
select KINETIS_HAVE_I2C1
config ARCH_CHIP_MK40X256VLQ100 config ARCH_CHIP_MK40X256VLQ100
bool "MK40X256VLQ100" bool "MK40X256VLQ100"
select ARCH_FAMILY_K40 select ARCH_FAMILY_K40
select KINETIS_HAVE_I2C1
config ARCH_CHIP_MK40X256VMD100 config ARCH_CHIP_MK40X256VMD100
bool "MK40X256VMD100" bool "MK40X256VMD100"
select ARCH_FAMILY_K40 select ARCH_FAMILY_K40
select KINETIS_HAVE_I2C1
config ARCH_CHIP_MK60N256VLQ100 config ARCH_CHIP_MK60N256VLQ100
bool "MK60N256VLQ100" bool "MK60N256VLQ100"
select ARCH_FAMILY_K60 select ARCH_FAMILY_K60
select KINETIS_HAVE_I2C1
config ARCH_CHIP_MK60N256VMD100 config ARCH_CHIP_MK60N256VMD100
bool "MK60N256VMD100" bool "MK60N256VMD100"
select ARCH_FAMILY_K60 select ARCH_FAMILY_K60
select KINETIS_HAVE_I2C1
select KINETIS_HAVE_I2C2
config ARCH_CHIP_MK60N512VLL100 config ARCH_CHIP_MK60N512VLL100
bool "MK60N512VLL100" bool "MK60N512VLL100"
select ARCH_FAMILY_K60 select ARCH_FAMILY_K60
select KINETIS_HAVE_I2C1
select KINETIS_HAVE_I2C2
config ARCH_CHIP_MK60N512VLQ100 config ARCH_CHIP_MK60N512VLQ100
bool "MK60N512VLQ100" bool "MK60N512VLQ100"
select ARCH_FAMILY_K60 select ARCH_FAMILY_K60
select KINETIS_HAVE_I2C1
select KINETIS_HAVE_I2C2
config ARCH_CHIP_MK60N512VMD100 config ARCH_CHIP_MK60N512VMD100
bool "MK60N512VMD100" bool "MK60N512VMD100"
select ARCH_FAMILY_K60 select ARCH_FAMILY_K60
select KINETIS_HAVE_I2C1
select KINETIS_HAVE_I2C2
config ARCH_CHIP_MK60X256VLQ100 config ARCH_CHIP_MK60X256VLQ100
bool "MK60X256VLQ100" bool "MK60X256VLQ100"
select ARCH_FAMILY_K60 select ARCH_FAMILY_K60
select KINETIS_HAVE_I2C1
select KINETIS_HAVE_I2C2
config ARCH_CHIP_MK60X256VMD100 config ARCH_CHIP_MK60X256VMD100
bool "MK60X256VMD100" bool "MK60X256VMD100"
select ARCH_FAMILY_K60 select ARCH_FAMILY_K60
select KINETIS_HAVE_I2C1
select KINETIS_HAVE_I2C2
config ARCH_CHIP_MK64FN1M0VLL12 config ARCH_CHIP_MK64FN1M0VLL12
bool "MK64FN1M0VLL12" bool "MK64FN1M0VLL12"
select ARCH_FAMILY_K64 select ARCH_FAMILY_K64
select KINETIS_HAVE_I2C1
select KINETIS_HAVE_I2C2
config ARCH_CHIP_MK64FX512VLL12 config ARCH_CHIP_MK64FX512VLL12
bool "MK64FX512VLL12" bool "MK64FX512VLL12"
select ARCH_FAMILY_K64 select ARCH_FAMILY_K64
select KINETIS_HAVE_I2C1
select KINETIS_HAVE_I2C2
config ARCH_CHIP_MK64FX512VDC12 config ARCH_CHIP_MK64FX512VDC12
bool "MK64FX512VDC12" bool "MK64FX512VDC12"
select ARCH_FAMILY_K64 select ARCH_FAMILY_K64
select KINETIS_HAVE_I2C1
select KINETIS_HAVE_I2C2
config ARCH_CHIP_MK64FN1M0VDC12 config ARCH_CHIP_MK64FN1M0VDC12
bool "MK64FN1M0VDC12" bool "MK64FN1M0VDC12"
select ARCH_FAMILY_K64 select ARCH_FAMILY_K64
select KINETIS_HAVE_I2C1
select KINETIS_HAVE_I2C2
config ARCH_CHIP_MK64FX512VLQ12 config ARCH_CHIP_MK64FX512VLQ12
bool "MK64FX512VLQ12" bool "MK64FX512VLQ12"
select ARCH_FAMILY_K64 select ARCH_FAMILY_K64
select KINETIS_HAVE_I2C1
select KINETIS_HAVE_I2C2
config ARCH_CHIP_MK64FX512VMD12 config ARCH_CHIP_MK64FX512VMD12
bool "MK64FX512VMD12" bool "MK64FX512VMD12"
select ARCH_FAMILY_K64 select ARCH_FAMILY_K64
select KINETIS_HAVE_I2C1
select KINETIS_HAVE_I2C2
config ARCH_CHIP_MK64FN1M0VMD12 config ARCH_CHIP_MK64FN1M0VMD12
bool "MK64FN1M0VMD12" bool "MK64FN1M0VMD12"
select ARCH_FAMILY_K64 select ARCH_FAMILY_K64
select KINETIS_HAVE_I2C1
select KINETIS_HAVE_I2C2
endchoice endchoice
@@ -148,6 +184,14 @@ config ARCH_FAMILY_K64
menu "Kinetis Peripheral Support" menu "Kinetis Peripheral Support"
config KINETIS_HAVE_I2C1
bool
default n
config KINETIS_HAVE_I2C2
bool
default n
config KINETIS_TRACE config KINETIS_TRACE
bool "Trace" bool "Trace"
default n default n
@@ -255,12 +299,23 @@ config KINETIS_SPI2
config KINETIS_I2C0 config KINETIS_I2C0
bool "I2C0" bool "I2C0"
default n default n
select I2C
---help--- ---help---
Support I2C0 Support I2C0
config KINETIS_I2C1 config KINETIS_I2C1
bool "I2C1" bool "I2C1"
default n default n
select I2C
depends on KINETIS_HAVE_I2C1
---help---
Support I2C1
config KINETIS_I2C2
bool "I2C2"
default n
select I2C
depends on KINETIS_HAVE_I2C2
---help--- ---help---
Support I2C1 Support I2C1
@@ -418,6 +473,9 @@ config KINETIS_PIT
endmenu endmenu
menu "Kinetis FTM PWM Configuration"
depends on KINETIS_FTM0 || KINETIS_FTM1 || KINETIS_FTM2
config KINETIS_FTM0_PWM config KINETIS_FTM0_PWM
bool "FTM0 PWM" bool "FTM0 PWM"
default n default n
@@ -481,6 +539,8 @@ config KINETIS_FTM2_CHANNEL
If FTM2 is enabled for PWM usage, you also need specifies the timer output If FTM2 is enabled for PWM usage, you also need specifies the timer output
channel {0,..,1} channel {0,..,1}
endmenu # Kinetis FTM PWM Configuration
menu "Kinetis GPIO Interrupt Configuration" menu "Kinetis GPIO Interrupt Configuration"
config KINETIS_GPIOIRQ config KINETIS_GPIOIRQ
+9 -1
View File
@@ -1,7 +1,7 @@
############################################################################ ############################################################################
# arch/arm/src/kinetis/Make.defs # arch/arm/src/kinetis/Make.defs
# #
# Copyright (C) 2011, 2013-2015 Gregory Nutt. All rights reserved. # Copyright (C) 2011, 2013-2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@@ -131,6 +131,14 @@ ifeq ($(CONFIG_PWM),y)
CHIP_CSRCS += kinetis_pwm.c CHIP_CSRCS += kinetis_pwm.c
endif endif
ifeq ($(CONFIG_I2C),y)
CHIP_CSRCS += kinetis_i2c.c
endif
ifeq ($(CONFIG_RTC),y)
CHIP_CSRCS += kinetis_rtc.c
endif
ifeq ($(CONFIG_NET),y) ifeq ($(CONFIG_NET),y)
ifeq ($(CONFIG_KINETIS_ENET),y) ifeq ($(CONFIG_KINETIS_ENET),y)
CHIP_CSRCS += kinetis_enet.c CHIP_CSRCS += kinetis_enet.c
+123 -26
View File
@@ -78,31 +78,35 @@
#define KINETIS_I2C0_SLTH (KINETIS_I2C0_BASE+KINETIS_I2C_SLTH_OFFSET) #define KINETIS_I2C0_SLTH (KINETIS_I2C0_BASE+KINETIS_I2C_SLTH_OFFSET)
#define KINETIS_I2C0_SLTL (KINETIS_I2C0_BASE+KINETIS_I2C_SLTL_OFFSET) #define KINETIS_I2C0_SLTL (KINETIS_I2C0_BASE+KINETIS_I2C_SLTL_OFFSET)
#define KINETIS_I2C1_A1 (KINETIS_I2C1_BASE+KINETIS_I2C_A1_OFFSET) #ifdef CONFIG_KINETIS_HAVE_I2C1
#define KINETIS_I2C1_F (KINETIS_I2C1_BASE+KINETIS_I2C_F_OFFSET) # define KINETIS_I2C1_A1 (KINETIS_I2C1_BASE+KINETIS_I2C_A1_OFFSET)
#define KINETIS_I2C1_C1 (KINETIS_I2C1_BASE+KINETIS_I2C_C1_OFFSET) # define KINETIS_I2C1_F (KINETIS_I2C1_BASE+KINETIS_I2C_F_OFFSET)
#define KINETIS_I2C1_S (KINETIS_I2C1_BASE+KINETIS_I2C_S_OFFSET) # define KINETIS_I2C1_C1 (KINETIS_I2C1_BASE+KINETIS_I2C_C1_OFFSET)
#define KINETIS_I2C1_D (KINETIS_I2C1_BASE+KINETIS_I2C_D_OFFSET) # define KINETIS_I2C1_S (KINETIS_I2C1_BASE+KINETIS_I2C_S_OFFSET)
#define KINETIS_I2C1_C2 (KINETIS_I2C1_BASE+KINETIS_I2C_C2_OFFSET) # define KINETIS_I2C1_D (KINETIS_I2C1_BASE+KINETIS_I2C_D_OFFSET)
#define KINETIS_I2C1_FLT (KINETIS_I2C1_BASE+KINETIS_I2C_FLT_OFFSET) # define KINETIS_I2C1_C2 (KINETIS_I2C1_BASE+KINETIS_I2C_C2_OFFSET)
#define KINETIS_I2C1_RA (KINETIS_I2C1_BASE+KINETIS_I2C_RA_OFFSET) # define KINETIS_I2C1_FLT (KINETIS_I2C1_BASE+KINETIS_I2C_FLT_OFFSET)
#define KINETIS_I2C1_SMB (KINETIS_I2C1_BASE+KINETIS_I2C_SMB_OFFSET) # define KINETIS_I2C1_RA (KINETIS_I2C1_BASE+KINETIS_I2C_RA_OFFSET)
#define KINETIS_I2C1_A2 (KINETIS_I2C1_BASE+KINETIS_I2C_A2_OFFSET) # define KINETIS_I2C1_SMB (KINETIS_I2C1_BASE+KINETIS_I2C_SMB_OFFSET)
#define KINETIS_I2C1_SLTH (KINETIS_I2C1_BASE+KINETIS_I2C_SLTH_OFFSET) # define KINETIS_I2C1_A2 (KINETIS_I2C1_BASE+KINETIS_I2C_A2_OFFSET)
#define KINETIS_I2C1_SLTL (KINETIS_I2C1_BASE+KINETIS_I2C_SLTL_OFFSET) # define KINETIS_I2C1_SLTH (KINETIS_I2C1_BASE+KINETIS_I2C_SLTH_OFFSET)
# define KINETIS_I2C1_SLTL (KINETIS_I2C1_BASE+KINETIS_I2C_SLTL_OFFSET)
#endif
#define KINETIS_I2C2_A1 (KINETIS_I2C2_BASE+KINETIS_I2C_A1_OFFSET) #ifdef CONFIG_KINETIS_HAVE_I2C2
#define KINETIS_I2C2_F (KINETIS_I2C2_BASE+KINETIS_I2C_F_OFFSET) # define KINETIS_I2C2_A1 (KINETIS_I2C2_BASE+KINETIS_I2C_A1_OFFSET)
#define KINETIS_I2C2_C1 (KINETIS_I2C2_BASE+KINETIS_I2C_C1_OFFSET) # define KINETIS_I2C2_F (KINETIS_I2C2_BASE+KINETIS_I2C_F_OFFSET)
#define KINETIS_I2C2_S (KINETIS_I2C2_BASE+KINETIS_I2C_S_OFFSET) # define KINETIS_I2C2_C1 (KINETIS_I2C2_BASE+KINETIS_I2C_C1_OFFSET)
#define KINETIS_I2C2_D (KINETIS_I2C2_BASE+KINETIS_I2C_D_OFFSET) # define KINETIS_I2C2_S (KINETIS_I2C2_BASE+KINETIS_I2C_S_OFFSET)
#define KINETIS_I2C2_C2 (KINETIS_I2C2_BASE+KINETIS_I2C_C2_OFFSET) # define KINETIS_I2C2_D (KINETIS_I2C2_BASE+KINETIS_I2C_D_OFFSET)
#define KINETIS_I2C2_FLT (KINETIS_I2C2_BASE+KINETIS_I2C_FLT_OFFSET) # define KINETIS_I2C2_C2 (KINETIS_I2C2_BASE+KINETIS_I2C_C2_OFFSET)
#define KINETIS_I2C2_RA (KINETIS_I2C2_BASE+KINETIS_I2C_RA_OFFSET) # define KINETIS_I2C2_FLT (KINETIS_I2C2_BASE+KINETIS_I2C_FLT_OFFSET)
#define KINETIS_I2C2_SMB (KINETIS_I2C2_BASE+KINETIS_I2C_SMB_OFFSET) # define KINETIS_I2C2_RA (KINETIS_I2C2_BASE+KINETIS_I2C_RA_OFFSET)
#define KINETIS_I2C2_A2 (KINETIS_I2C2_BASE+KINETIS_I2C_A2_OFFSET) # define KINETIS_I2C2_SMB (KINETIS_I2C2_BASE+KINETIS_I2C_SMB_OFFSET)
#define KINETIS_I2C2_SLTH (KINETIS_I2C2_BASE+KINETIS_I2C_SLTH_OFFSET) # define KINETIS_I2C2_A2 (KINETIS_I2C2_BASE+KINETIS_I2C_A2_OFFSET)
#define KINETIS_I2C2_SLTL (KINETIS_I2C2_BASE+KINETIS_I2C_SLTL_OFFSET) # define KINETIS_I2C2_SLTH (KINETIS_I2C2_BASE+KINETIS_I2C_SLTH_OFFSET)
# define KINETIS_I2C2_SLTL (KINETIS_I2C2_BASE+KINETIS_I2C_SLTL_OFFSET)
#endif
/* Register Bit Definitions *****************************************************************/ /* Register Bit Definitions *****************************************************************/
@@ -115,12 +119,90 @@
#define I2C_F_ICR_SHIFT (0) /* Bits 0-5: Clock rate */ #define I2C_F_ICR_SHIFT (0) /* Bits 0-5: Clock rate */
#define I2C_F_ICR_MASK (0x3f << I2C_F_ICR_SHIFT) #define I2C_F_ICR_MASK (0x3f << I2C_F_ICR_SHIFT)
# define I2C_F_ICR(n) ((uint8_t)(n) << I2C_F_ICR_SHIFT)
#define I2C_F_MULT_SHIFT (6) /* Bits 6-7: Multiplier factor */ #define I2C_F_MULT_SHIFT (6) /* Bits 6-7: Multiplier factor */
#define I2C_F_MULT_MASK (3 << I2C_F_MULT_SHIFT) #define I2C_F_MULT_MASK (3 << I2C_F_MULT_SHIFT)
# define I2C_F_MULT_1 (0 << I2C_F_MULT_SHIFT) # define I2C_F_MULT_1 (0 << I2C_F_MULT_SHIFT)
# define I2C_F_MULT_2 (1 << I2C_F_MULT_SHIFT) # define I2C_F_MULT_2 (1 << I2C_F_MULT_SHIFT)
# define I2C_F_MULT_4 (2 << I2C_F_MULT_SHIFT) # define I2C_F_MULT_4 (2 << I2C_F_MULT_SHIFT)
/* From Table 51-54. I2C divider and hold values. Duplicate divider values differ in hold
* times. Refer to the Table 51-54. in the K64 Sub-Family Reference Manual.
*/
#define I2C_F_DIV20 ((uint8_t)0x00)
#define I2C_F_DIV22 ((uint8_t)0x01)
#define I2C_F_DIV24 ((uint8_t)0x02)
#define I2C_F_DIV26 ((uint8_t)0x03)
#define I2C_F_DIV28 ((uint8_t)0x04)
#define I2C_F_DIV30 ((uint8_t)0x05)
#define I2C_F_DIV34 ((uint8_t)0x06)
#define I2C_F_DIV36 ((uint8_t)0x0a)
#define I2C_F_DIV40_1 ((uint8_t)0x07)
#define I2C_F_DIV41 ((uint8_t)0x08)
#define I2C_F_DIV32 ((uint8_t)0x09)
#define I2C_F_DIV36 ((uint8_t)0x0a)
#define I2C_F_DIV40_2 ((uint8_t)0x0b)
#define I2C_F_DIV44 ((uint8_t)0x0c)
#define I2C_F_DIV48_1 ((uint8_t)0x0d)
#define I2C_F_DIV56_1 ((uint8_t)0x0e)
#define I2C_F_DIV68 ((uint8_t)0x0f)
#define I2C_F_DIV48_2 ((uint8_t)0x10)
#define I2C_F_DIV56_2 ((uint8_t)0x11)
#define I2C_F_DIV64 ((uint8_t)0x12)
#define I2C_F_DIV72 ((uint8_t)0x13)
#define I2C_F_DIV80_1 ((uint8_t)0x14)
#define I2C_F_DIV88 ((uint8_t)0x15)
#define I2C_F_DIV104 ((uint8_t)0x16)
#define I2C_F_DIV128_1 ((uint8_t)0x17)
#define I2C_F_DIV80_2 ((uint8_t)0x18)
#define I2C_F_DIV96 ((uint8_t)0x19)
#define I2C_F_DIV112 ((uint8_t)0x1a)
#define I2C_F_DIV128_2 ((uint8_t)0x1b)
#define I2C_F_DIV144 ((uint8_t)0x1c)
#define I2C_F_DIV160_1 ((uint8_t)0x1d)
#define I2C_F_DIV192_1 ((uint8_t)0x1e)
#define I2C_F_DIV240 ((uint8_t)0x1f)
#define I2C_F_DIV160_2 ((uint8_t)0x20)
#define I2C_F_DIV192_2 ((uint8_t)0x1e)
#define I2C_F_DIV224 ((uint8_t)0x22)
#define I2C_F_DIV256 ((uint8_t)0x23)
#define I2C_F_DIV288 ((uint8_t)0x24)
#define I2C_F_DIV320_1 ((uint8_t)0x25)
#define I2C_F_DIV384_1 ((uint8_t)0x26)
#define I2C_F_DIV480 ((uint8_t)0x27)
#define I2C_F_DIV320_2 ((uint8_t)0x28)
#define I2C_F_DIV384_2 ((uint8_t)0x29)
#define I2C_F_DIV448 ((uint8_t)0x2a)
#define I2C_F_DIV512 ((uint8_t)0x2b)
#define I2C_F_DIV576 ((uint8_t)0x2c)
#define I2C_F_DIV640_1 ((uint8_t)0x2d)
#define I2C_F_DIV768_1 ((uint8_t)0x2e)
#define I2C_F_DIV960 ((uint8_t)0x2f)
#define I2C_F_DIV640_2 ((uint8_t)0x30)
#define I2C_F_DIV768_3 ((uint8_t)0x31)
#define I2C_F_DIV896 ((uint8_t)0x32)
#define I2C_F_DIV1024 ((uint8_t)0x33)
#define I2C_F_DIV1152 ((uint8_t)0x34)
#define I2C_F_DIV1280_1 ((uint8_t)0x35)
#define I2C_F_DIV1536_1 ((uint8_t)0x36)
#define I2C_F_DIV1920 ((uint8_t)0x37)
#define I2C_F_DIV1280_2 ((uint8_t)0x38)
#define I2C_F_DIV1536_2 ((uint8_t)0x39)
#define I2C_F_DIV1792 ((uint8_t)0x3a)
#define I2C_F_DIV2048 ((uint8_t)0x3b)
#define I2C_F_DIV2304 ((uint8_t)0x3c)
#define I2C_F_DIV2560 ((uint8_t)0x3d)
#define I2C_F_DIV3072 ((uint8_t)0x3e)
#define I2C_F_DIV3840 ((uint8_t)0x3f)
/* I2C Control Register 1 (8-bit) */ /* I2C Control Register 1 (8-bit) */
#define I2C_C1_DMAEN (1 << 0) /* Bit 0: DMA enable */ #define I2C_C1_DMAEN (1 << 0) /* Bit 0: DMA enable */
@@ -149,6 +231,7 @@
#define I2C_C2_AD_SHIFT (0) /* Bits 0-2: Slave address */ #define I2C_C2_AD_SHIFT (0) /* Bits 0-2: Slave address */
#define I2C_C2_AD_MASK (7 << I2C_C2_AD_SHIFT) #define I2C_C2_AD_MASK (7 << I2C_C2_AD_SHIFT)
# define I2C_C2_AD(n) ((uint8_t)(n) << I2C_C2_AD_SHIFT)
#define I2C_C2_RMEN (1 << 3) /* Bit 3: Range address matching enable */ #define I2C_C2_RMEN (1 << 3) /* Bit 3: Range address matching enable */
#define I2C_C2_SBRC (1 << 4) /* Bit 4: Slave baud rate control */ #define I2C_C2_SBRC (1 << 4) /* Bit 4: Slave baud rate control */
#define I2C_C2_HDRS (1 << 5) /* Bit 5: High drive select */ #define I2C_C2_HDRS (1 << 5) /* Bit 5: High drive select */
@@ -156,9 +239,23 @@
#define I2C_C2_GCAEN (1 << 7) /* Bit 7: General call address enable */ #define I2C_C2_GCAEN (1 << 7) /* Bit 7: General call address enable */
/* I2C Programmable Input Glitch Filter register (8-bit) */ /* I2C Programmable Input Glitch Filter register (8-bit) */
#if defined(KINETIS_K20) || defined(KINETIS_K40) || defined(KINETIS_K60)
# define I2C_FLT_SHIFT (0) /* Bits 0-4: I2C programmable filter factor */
# define I2C_FLT_MASK (31 << I2C_FLT_SHIFT)
# define I2C_FLT(n) ((uint8_t)(n) << I2C_FLT_SHIFT)
/* Bits 5-7: Reserved */ /* Bits 5-7: Reserved */
#define I2C_FLT_SHIFT (0) /* Bits 0-4: I2C programmable filter factor */ #endif
#define I2C_FLT_MASK (31 << I2C_FLT_SHIFT)
#ifdef KINETIS_K64
# define I2C_FLT_SHIFT (0) /* Bits 0-3: I2C programmable filter factor */
# define I2C_FLT_MASK (15 << I2C_FLT_SHIFT)
# define I2C_FLT(n) ((uint8_t)(n) << I2C_FLT_SHIFT)
# define I2C_FLT_STARTF (1 << 4) /* I2C bus start detect flag */
# define I2C_FLT_SSIE (1 << 5) /* I2C bus stop or start interrupt enable */
# define I2C_FLT_STOPF (1 << 6) /* I2C bus stop detect flag */
# define I2C_FLT_SHEN (1 << 7) /* Stop hold enable */
#endif
/* I2C Range Address register (8-bit) */ /* I2C Range Address register (8-bit) */
/* Bit 0: Reserved */ /* Bit 0: Reserved */
+4 -4
View File
@@ -59,7 +59,7 @@
#define KINETIS_RTC_CR_OFFSET 0x0010 /* RTC Control Register */ #define KINETIS_RTC_CR_OFFSET 0x0010 /* RTC Control Register */
#define KINETIS_RTC_SR_OFFSET 0x0014 /* RTC Status Register */ #define KINETIS_RTC_SR_OFFSET 0x0014 /* RTC Status Register */
#define KINETIS_RTC_LR_OFFSET 0x0018 /* RTC Lock Register */ #define KINETIS_RTC_LR_OFFSET 0x0018 /* RTC Lock Register */
#if defined(KINETIS_K40) || defined(KINETIS_K64) #if defined(KINETIS_K20) || defined(KINETIS_K40) || defined(KINETIS_K64)
# define KINETIS_RTC_IER_OFFSET 0x001c /* RTC Interrupt Enable Register (K40) */ # define KINETIS_RTC_IER_OFFSET 0x001c /* RTC Interrupt Enable Register (K40) */
#endif #endif
#ifdef KINETIS_K60 #ifdef KINETIS_K60
@@ -77,7 +77,7 @@
#define KINETIS_RTC_CR (KINETIS_RTC_BASE+KINETIS_RTC_CR_OFFSET) #define KINETIS_RTC_CR (KINETIS_RTC_BASE+KINETIS_RTC_CR_OFFSET)
#define KINETIS_RTC_SR (KINETIS_RTC_BASE+KINETIS_RTC_SR_OFFSET) #define KINETIS_RTC_SR (KINETIS_RTC_BASE+KINETIS_RTC_SR_OFFSET)
#define KINETIS_RTC_LR (KINETIS_RTC_BASE+KINETIS_RTC_LR_OFFSET) #define KINETIS_RTC_LR (KINETIS_RTC_BASE+KINETIS_RTC_LR_OFFSET)
#if defined(KINETIS_K40) || defined(KINETIS_K64) #if defined(KINETIS_K20) || defined(KINETIS_K40) || defined(KINETIS_K64)
# define KINETIS_RTC_IER (KINETIS_RTC_BASE+KINETIS_RTC_IER_OFFSET) # define KINETIS_RTC_IER (KINETIS_RTC_BASE+KINETIS_RTC_IER_OFFSET)
#endif #endif
#ifdef KINETIS_K60 #ifdef KINETIS_K60
@@ -135,13 +135,13 @@
#define RTC_LR_TCL (1 << 3) /* Bit 3: Time Compensation Lock */ #define RTC_LR_TCL (1 << 3) /* Bit 3: Time Compensation Lock */
#define RTC_LR_CRL (1 << 4) /* Bit 4: Control Register Lock */ #define RTC_LR_CRL (1 << 4) /* Bit 4: Control Register Lock */
#define RTC_LR_SRL (1 << 5) /* Bit 5: Status Register Lock */ #define RTC_LR_SRL (1 << 5) /* Bit 5: Status Register Lock */
#ifdef KINETIS_K40 #if defined(KINETIS_K20) || defined(KINETIS_K40)
# define RTC_LR_LRL (1 << 6) /* Bit 6: Lock Register Lock (K40) */ # define RTC_LR_LRL (1 << 6) /* Bit 6: Lock Register Lock (K40) */
#endif #endif
/* Bits 7-31: Reserved */ /* Bits 7-31: Reserved */
/* RTC Interrupt Enable Register (32-bits, K40) */ /* RTC Interrupt Enable Register (32-bits, K40) */
#if defined(KINETIS_K40) || defined(KINETIS_K64) #if defined(KINETIS_K20) || defined(KINETIS_K40) || defined(KINETIS_K64)
# define RTC_IER_TIIE (1 << 0) /* Bit 0: Time Invalid Interrupt Enable */ # define RTC_IER_TIIE (1 << 0) /* Bit 0: Time Invalid Interrupt Enable */
# define RTC_IER_TOIE (1 << 1) /* Bit 1: Time Overflow Interrupt Enable */ # define RTC_IER_TOIE (1 << 1) /* Bit 1: Time Overflow Interrupt Enable */
# define RTC_IER_TAIE (1 << 2) /* Bit 2: Time Alarm Interrupt Enable */ # define RTC_IER_TAIE (1 << 2) /* Bit 2: Time Alarm Interrupt Enable */
+113
View File
@@ -0,0 +1,113 @@
/****************************************************************************
* arch/arm/src/kinetis/kinetis_alarm.h
*
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
* Author: Matias v01d <phreakuencies@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef __ARCH_ARM_SRC_KINETIS_ALARM_H
#define __ARCH_ARM_SRC_KINETIS_ALARM_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include "chip.h"
#ifdef CONFIG_RTC_ALARM
/****************************************************************************
* Public Types
****************************************************************************/
#ifndef __ASSEMBLY__
/* The form of an alarm callback */
typedef CODE void (*alarmcb_t)(void);
/****************************************************************************
* Public Functions
****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Name: kinetis_rtc_setalarm
*
* Description:
* Set up an alarm.
*
* Input Parameters:
* tp - the time to set the alarm
* callback - the function to call when the alarm expires.
*
* Returned Value:
* Zero (OK) on success; a negated errno on failure
*
****************************************************************************/
struct timespec;
int kinetis_rtc_setalarm(FAR const struct timespec *tp, alarmcb_t callback);
/****************************************************************************
* Name: kinetis_rtc_cancelalarm
*
* Description:
* Cancel a pending alarm alarm
*
* Input Parameters:
* none
*
* Returned Value:
* Zero (OK) on success; a negated errno on failure
*
****************************************************************************/
int kinetis_rtc_cancelalarm(void);
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* CONFIG_RTC_ALARM */
#endif /* __ARCH_ARM_SRC_KINETIS_ALARM_H */
File diff suppressed because it is too large Load Diff
+87
View File
@@ -0,0 +1,87 @@
/****************************************************************************
* arch/arm/src/kinetis/kinetis_i2c.h
*
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
* Author: Matias v01d <phreakuencies@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef __ARCH_ARM_SRC_KINETIS_KINETIS_I2C_H
#define __ARCH_ARM_SRC_KINETIS_KINETIS_I2C_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <nuttx/i2c/i2c_master.h>
#include "chip/kinetis_i2c.h"
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: kinetis_i2cbus_initialize
*
* Description:
* Initialize the selected I2C port. And return a unique instance of struct
* struct i2c_master_s. This function may be called to obtain multiple
* instances of the interface, each of which may be set up with a
* different frequency and slave address.
*
* Input Parameter:
* Port number (for hardware that has multiple I2C interfaces)
*
* Returned Value:
* Valid I2C device structure reference on succcess; a NULL on failure
*
****************************************************************************/
FAR struct i2c_master_s *kinetis_i2cbus_initialize(int port);
/****************************************************************************
* Name: kinetis_i2cbus_uninitialize
*
* Description:
* De-initialize the selected I2C port, and power down the device.
*
* Input Parameter:
* Device structure as returned by the lpc43_i2cbus_initialize()
*
* Returned Value:
* OK on success, ERROR when internal reference count mismatch or dev
* points to invalid hardware device.
*
****************************************************************************/
int kinetis_i2cbus_uninitialize(FAR struct i2c_master_s *dev);
#endif /* __ARCH_ARM_SRC_KINETIS_KINETIS_I2C_H */
+1 -1
View File
@@ -58,7 +58,7 @@
#include "chip.h" #include "chip.h"
#include "kinetis.h" #include "kinetis.h"
#include "chip/kinetis_pwm.h" #include "kinetis_pwm.h"
#include "chip/kinetis_gpio.h" #include "chip/kinetis_gpio.h"
#include "chip/kinetis_ftm.h" #include "chip/kinetis_ftm.h"
#include "chip/kinetis_sim.h" #include "chip/kinetis_sim.h"
+373
View File
@@ -0,0 +1,373 @@
/****************************************************************************
* arch/arm/src/kinetis/kinetis_rtc.c
*
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
* Author: Matias v01d <phreakuencies@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <nuttx/arch.h>
#include <nuttx/irq.h>
#include <nuttx/timers/rtc.h>
#include <arch/board/board.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include <errno.h>
#include "up_arch.h"
#include "kinetis_config.h"
#include "chip.h"
#include "chip/kinetis_rtc.h"
#include "chip/kinetis_sim.h"
#include "kinetis.h"
#include "kinetis_alarm.h"
#if defined(CONFIG_RTC)
/****************************************************************************
* Private Data
****************************************************************************/
#ifdef CONFIG_RTC_ALARM
static alarmcb_t g_alarmcb;
#endif
/****************************************************************************
* Public Data
****************************************************************************/
volatile bool g_rtc_enabled = false;
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: kinetis_rtc_interrupt
*
* Description:
* RTC interrupt service routine
*
* Input Parameters:
* irq - The IRQ number that generated the interrupt
* context - Architecture specific register save information.
*
* Returned Value:
* Zero (OK) on success; A negated errno value on failure.
*
****************************************************************************/
#if defined(CONFIG_RTC_ALARM)
static int kinetis_rtc_interrupt(int irq, void *context)
{
if (g_alarmcb != NULL)
{
/* Alarm callback */
g_alarmcb();
g_alarmcb = NULL;
}
/* Clear pending flags, disable alarm */
putreg32(0, KINETIS_RTC_TAR); /* unset alarm (resets flags) */
putreg32(0, KINETIS_RTC_IER); /* disable alarm interrupt */
return 0;
}
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: up_rtc_initialize
*
* Description:
* Initialize the hardware RTC per the selected configuration. This
* function is called once during the OS initialization sequence
*
* Input Parameters:
* None
*
* Returned Value:
* Zero (OK) on success; a negated errno on failure
*
****************************************************************************/
int up_rtc_initialize(void)
{
int regval;
/* Enable RTC module */
regval = getreg32(KINETIS_SIM_SCGC6);
regval |= SIM_SCGC6_RTC;
putreg32(regval, KINETIS_SIM_SCGC6);
/* Disable counters (just in case) */
putreg32(0, KINETIS_RTC_SR);
/* Enable oscilator */
/* capacitance values from teensyduino */
putreg32(RTC_CR_SC16P | RTC_CR_SC4P | RTC_CR_OSCE, KINETIS_RTC_CR);
/* TODO: delay some time (1024 cycles? would be 30ms) */
/* Disable interrupts */
putreg32(0, KINETIS_RTC_IER);
/* Reset flags requires writing the seconds register, the following line
* avoids altering any stored time value.
*/
putreg32(getreg32(KINETIS_RTC_TSR), KINETIS_RTC_TSR);
#if defined(CONFIG_RTC_ALARM)
/* Enable alarm interrupts. REVISIT: This will not work. up_rtc_initialize()
* is called very early in initialization BEFORE the interrupt system will be
* enabled. All interrupts will disabled later when the interrupt system is
* disabled. This must be done later when the alarm is first set.
*/
irq_attach(KINETIS_IRQ_RTC, kinetis_rtc_interrupt);
up_enable_irq(KINETIS_IRQ_RTC);
#endif
/* Enable counters */
putreg32(RTC_SR_TCE, KINETIS_RTC_SR);
/* Mark RTC enabled */
g_rtc_enabled = true;
return OK;
}
/****************************************************************************
* Name: up_rtc_time
*
* Description:
* Get the current time in seconds. This is similar to the standard
* time() function. This interface is only required if the low-resolution
* RTC/counter hardware implementation selected. It is only used by the
* RTOS during initialization to set up the system time when CONFIG_RTC is
* set but neither CONFIG_RTC_HIRES nor CONFIG_RTC_DATETIME are set.
*
* Input Parameters:
* None
*
* Returned Value:
* The current time in seconds
*
****************************************************************************/
#ifndef CONFIG_RTC_HIRES
time_t up_rtc_time(void)
{
return getreg32(KINETIS_RTC_TSR);
}
#endif
/****************************************************************************
* Name: up_rtc_gettime
*
* Description:
* Get the current time from the high resolution RTC clock/counter. This
* interface is only supported by the high-resolution RTC/counter hardware
* implementation. It is used to replace the system timer.
*
* Input Parameters:
* tp - The location to return the high resolution time value.
*
* Returned Value:
* Zero (OK) on success; a negated errno on failure
*
****************************************************************************/
#ifdef CONFIG_RTC_HIRES
int up_rtc_gettime(FAR struct timespec *tp)
{
irqstate_t flags;
uint32_t seconds, prescaler, prescaler2;
/* Get prescaler and seconds register. this is in a loop which ensures that
* registers will be re-read if during the reads the prescaler has
* wrapped-around.
*/
flags = enter_critical_section();
do
{
prescaler = getreg32(KINETIS_RTC_TPR);
seconds = getreg32(KINETIS_RTC_TSR);
prescaler2 = getreg32(KINETIS_RTC_TPR);
}
while (prescaler > prescaler2);
leave_critical_section(flags);
/* Build seconds + nanoseconds from seconds and prescaler register */
tp->tv_sec = seconds;
tp->tv_nsec = prescaler * (1000000000 / CONFIG_RTC_FREQUENCY);
return OK;
}
#endif
/****************************************************************************
* Name: up_rtc_settime
*
* Description:
* Set the RTC to the provided time. All RTC implementations must be able
* to set their time based on a standard timespec.
*
* Input Parameters:
* tp - the time to use
*
* Returned Value:
* Zero (OK) on success; a negated errno on failure
*
****************************************************************************/
int up_rtc_settime(FAR const struct timespec *tp)
{
irqstate_t flags;
uint32_t seconds, prescaler;
seconds = tp->tv_sec;
prescaler = tp->tv_nsec * (CONFIG_RTC_FREQUENCY / 1000000000);
flags = enter_critical_section();
putreg32(0, KINETIS_RTC_SR); /* Disable counter */
putreg32(prescaler, KINETIS_RTC_TPR); /* Always write prescaler first */
putreg32(seconds, KINETIS_RTC_TSR);
putreg32(RTC_SR_TCE, KINETIS_RTC_SR); /* Re-enable counter */
leave_critical_section(flags);
return OK;
}
/****************************************************************************
* Name: kinetis_rtc_setalarm
*
* Description:
* Set up an alarm.
*
* Input Parameters:
* tp - the time to set the alarm
* callback - the function to call when the alarm expires.
*
* Returned Value:
* Zero (OK) on success; a negated errno on failure
*
****************************************************************************/
#ifdef CONFIG_RTC_ALARM
int kinetis_rtc_setalarm(FAR const struct timespec *tp, alarmcb_t callback)
{
/* Is there already something waiting on the ALARM? */
if (g_alarmcb == NULL)
{
/* No.. Save the callback function pointer */
g_alarmcb = callback;
/* Enable and set RTC alarm */
putreg32(tp->tv_sec, KINETIS_RTC_TAR); /* Set alarm (also resets
* flags) */
putreg32(RTC_IER_TAIE, KINETIS_RTC_IER); /* Enable alarm interrupt */
return OK;
}
else
{
return -EBUSY;
}
}
#endif
/****************************************************************************
* Name: kinetis_rtc_cancelalarm
*
* Description:
* Cancel a pending alarm alarm
*
* Input Parameters:
* none
*
* Returned Value:
* Zero (OK) on success; a negated errno on failure
*
****************************************************************************/
#ifdef CONFIG_RTC_ALARM
int kinetis_rtc_cancelalarm(void)
{
if (g_alarmcb != NULL)
{
/* Cancel the global callback function */
g_alarmcb = NULL;
/* Unset the alarm */
putreg32(0, KINETIS_RTC_IER); /* disable alarm interrupt */
return OK;
}
else
{
return -ENODATA;
}
}
#endif
#endif /* KINETIS_RTC */
+4 -4
View File
@@ -90,13 +90,13 @@
# elif CONFIG_KL_TPM0_CHANNEL == 1 # elif CONFIG_KL_TPM0_CHANNEL == 1
# define PWM_TPM0_PINCFG GPIO_TPM0_CH1OUT # define PWM_TPM0_PINCFG GPIO_TPM0_CH1OUT
# elif CONFIG_KL_TPM0_CHANNEL == 2 # elif CONFIG_KL_TPM0_CHANNEL == 2
# define PWM_TPM0_PINCFG GPIO_TPM1_CH2OUT # define PWM_TPM0_PINCFG GPIO_TPM0_CH2OUT
# elif CONFIG_KL_TPM0_CHANNEL == 3 # elif CONFIG_KL_TPM0_CHANNEL == 3
# define PWM_TPM0_PINCFG GPIO_TPM1_CH3OUT # define PWM_TPM0_PINCFG GPIO_TPM0_CH3OUT
# elif CONFIG_KL_TPM0_CHANNEL == 4 # elif CONFIG_KL_TPM0_CHANNEL == 4
# define PWM_TPM0_PINCFG GPIO_TPM1_CH4OUT # define PWM_TPM0_PINCFG GPIO_TPM0_CH4OUT
# elif CONFIG_KL_TPM0_CHANNEL == 5 # elif CONFIG_KL_TPM0_CHANNEL == 5
# define PWM_TPM0_PINCFG GPIO_TPM1_CH5OUT # define PWM_TPM0_PINCFG GPIO_TPM0_CH5OUT
# else # else
# error "Unsupported value of CONFIG_KL_TPM1_CHANNEL" # error "Unsupported value of CONFIG_KL_TPM1_CHANNEL"
# endif # endif
+3 -3
View File
@@ -33,8 +33,8 @@
* *
****************************************************************************************************/ ****************************************************************************************************/
#ifndef __LPC214X_CHIP_H #ifndef __ARCH_ARM_SRC_LPC214X_CHIP_H
#define __LPC214X_CHIP_H #define __ARCH_ARM_SRC_LPC214X_CHIP_H
/**************************************************************************************************** /****************************************************************************************************
* Included Files * Included Files
@@ -346,4 +346,4 @@
* Public Function Prototypes * Public Function Prototypes
****************************************************************************************************/ ****************************************************************************************************/
#endif /* __LPC214X_CHIP_H */ #endif /* __ARCH_ARM_SRC_LPC214X_CHIP_H */
+3 -3
View File
@@ -33,8 +33,8 @@
* *
************************************************************************************/ ************************************************************************************/
#ifndef _ARCH_ARM_SRC_LPC214X_APB_H #ifndef __ARCH_ARM_SRC_LPC214X_LPC214X_APB_H
#define _ARCH_ARM_SRC_LPC214X_APB_H #define __ARCH_ARM_SRC_LPC214X_LPC214X_APB_H
/************************************************************************************ /************************************************************************************
* Included Files * Included Files
@@ -69,4 +69,4 @@
* Public Function Prototypes * Public Function Prototypes
************************************************************************************/ ************************************************************************************/
#endif /* _ARCH_ARM_SRC_LPC214X_APB_H */ #endif /* __ARCH_ARM_SRC_LPC214X_LPC214X_APB_H */
+3 -3
View File
@@ -33,8 +33,8 @@
* *
************************************************************************************/ ************************************************************************************/
#ifndef _ARCH_ARM_SRC_LPC214X_I2C_H #ifndef __ARCH_ARM_SRC_LPC214X_LPC214X_I2C_H
#define _ARCH_ARM_SRC_LPC214X_I2C_H #define __ARCH_ARM_SRC_LPC214X_LPC214X_I2C_H
/************************************************************************************ /************************************************************************************
* Included Files * Included Files
@@ -138,4 +138,4 @@
* Public Function Prototypes * Public Function Prototypes
************************************************************************************/ ************************************************************************************/
#endif /* _ARCH_ARM_SRC_LPC214X_I2C_H */ #endif /* __ARCH_ARM_SRC_LPC214X_LPC214X_I2C_H */
+3 -3
View File
@@ -33,8 +33,8 @@
* *
************************************************************************************/ ************************************************************************************/
#ifndef _ARCH_ARM_SRC_LPC214X_PINSEL_H #ifndef __ARCH_ARM_SRC_LPC214X_LPC214X_PINSEL_H
#define _ARCH_ARM_SRC_LPC214X_PINSEL_H #define __ARCH_ARM_SRC_LPC214X_LPC214X_PINSEL_H
/************************************************************************************ /************************************************************************************
* Included Files * Included Files
@@ -256,4 +256,4 @@
* Public Function Prototypes * Public Function Prototypes
************************************************************************************/ ************************************************************************************/
#endif /* _ARCH_ARM_SRC_LPC214X_PINSEL_H */ #endif /* __ARCH_ARM_SRC_LPC214X_LPC214X_PINSEL_H */
+3 -3
View File
@@ -33,8 +33,8 @@
* *
****************************************************************************************************/ ****************************************************************************************************/
#ifndef _ARCH_ARM_SRC_LPC214X_PLL_H #ifndef __ARCH_ARM_SRC_LPC214X_LPC214X_PLL_H
#define _ARCH_ARM_SRC_LPC214X_PLL_H #define __ARCH_ARM_SRC_LPC214X_LPC214X_PLL_H
/**************************************************************************************************** /****************************************************************************************************
* Included Files * Included Files
@@ -102,4 +102,4 @@
* Public Function Prototypes * Public Function Prototypes
****************************************************************************************************/ ****************************************************************************************************/
#endif /* _ARCH_ARM_SRC_LPC214X_PLL_H */ #endif /* __ARCH_ARM_SRC_LPC214X_LPC214X_PLL_H */
+3 -3
View File
@@ -33,8 +33,8 @@
* *
************************************************************************************/ ************************************************************************************/
#ifndef _ARCH_ARM_SRC_LPC214X_POWER_H #ifndef __ARCH_ARM_SRC_LPC214X_LPC214X_POWER_H
#define _ARCH_ARM_SRC_LPC214X_POWER_H #define __ARCH_ARM_SRC_LPC214X_LPC214X_POWER_H
/************************************************************************************ /************************************************************************************
* Included Files * Included Files
@@ -87,4 +87,4 @@
* Public Function Prototypes * Public Function Prototypes
************************************************************************************/ ************************************************************************************/
#endif /* _ARCH_ARM_SRC_LPC214X_POWER_H */ #endif /* __ARCH_ARM_SRC_LPC214X_LPC214X_POWER_H */
+3 -3
View File
@@ -33,8 +33,8 @@
* *
************************************************************************************/ ************************************************************************************/
#ifndef _ARCH_ARM_SRC_LPC214X_SPI_H #ifndef __ARCH_ARM_SRC_LPC214X_LPC214X_SPI_H
#define _ARCH_ARM_SRC_LPC214X_SPI_H #define __ARCH_ARM_SRC_LPC214X_LPC214X_SPI_H
/************************************************************************************ /************************************************************************************
* Included Files * Included Files
@@ -181,4 +181,4 @@ struct spi_dev_s; /* Forward reference */
FAR struct spi_dev_s *lpc214x_spibus_initialize(int port); FAR struct spi_dev_s *lpc214x_spibus_initialize(int port);
#endif /* _ARCH_ARM_SRC_LPC214X_SPI_H */ #endif /* __ARCH_ARM_SRC_LPC214X_LPC214X_SPI_H */

Some files were not shown because too many files have changed in this diff Show More