Commit Graph

2863 Commits

Author SHA1 Message Date
Matt Thompson
e79e2e2d97 Merged in extent3d/nuttx/lis3dh (pull request #598)
Added support for LIS3DH accelerometer sensor.

* Added support for LIS3DH accelerometer sensor.

* Fix line length

* Fix more line lengthts

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-02-13 19:00:29 +00:00
Gregory Nutt
4a36c946e1 Trivial update to some comments. 2018-02-12 14:46:40 -06:00
Alan Carvalho de Assis
1247828e74 drivers/lcd: Fix the default I2C address of SSD1306 OLED display (7- vs 8-bit addressing) 2018-02-11 16:56:20 -06:00
Mateusz Szafoni
118e97ff37 Merged in raiden00/nuttx (pull request #595)
Master

stm32_hritm: add interface to set timer frequency, fix slave timers reset configuration, change POWER_INFO to TIMER_INFO

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-02-11 13:12:00 +00:00
Gregory Nutt
8f8ee5009d Update some C comments. 2018-02-10 17:05:25 -06:00
Gregory Nutt
642d7e3ce2 Squashed commit of the following:
configs/flipnclick-pic32mz:  Add an nxlines configuration for use in testing the custom HiletGo Click board.
    arch/mips/src/pic32mz:  Correct some SPI-related typos.  configs/flipnclick-pic32mz: Finishes integration of HiletGo OLED. drivers/lcd:  Finish support for HiletGo OLED.
    drivers/lcd:  Add configuration support for HiletGo OLED.  configs/flipnclick-pic32mz:  Add board support for HiletGo OLED.
2018-02-10 09:43:12 -06:00
Gregory Nutt
fad70bf90e Update some comments 2018-02-03 09:35:46 -06:00
Gregory Nutt
2683f713ab Make sure that labeling is used consistently in all function headers (part 3). 2018-02-01 12:17:03 -06:00
Gregory Nutt
1567b82429 Make sure that labeling is used consistently in all function headers (part 2). 2018-02-01 12:03:55 -06:00
Gregory Nutt
7cf88d7dbd Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
Gregory Nutt
50ca32e254 Squashed commit of the following:
sched/:  Convert legitimate uses of task_create() to nxtask_create().  Review handling of returned values from all uses of kthread_create() (as well as nxtask_create()).
    graphics/:  Review return values for all calls to kthread_start() because it no longer returns an errno.
    drivers/:  threads started by drivers should be kernel threads, not user tasks.  Review return values for all calls to kthread_start() because it no longer returns an errno.
    configs/:  threads started by board bringup logic should be kernel threads, not user tasksi (part 2 of 2).
    sched/task:  Add nxtask_create().  Kthread_create() and nxtask_create() are internal OS functions and should not modify the errno variable.  configs/:  threads started by board bringup logic should be kernel threads, not user tasks.
2018-01-31 16:11:54 -06:00
Gregory Nutt
da50646bcf sched/wdog: wd_start() is an internal OS function and should not set the errno value. Reviewed and updated every call to wd_start() to verify if return value is used and if so if the errno value is accessed. 2018-01-31 10:09:14 -06:00
Juha Niskanen
a5cb1129f9 drivers/sensors/lis2dh: use realtime clock if monotonic is not available 2018-01-31 07:41:56 -06:00
Gregory Nutt
3521aaf944 Squashed commit of the following:
binfmt/, configs/, grahics/, libc/, mm/, net/, sched/:  OS references to the errno variable should always use the set_errno(), get_errno() macros
    arch/arm/src/stm32 and stm32f7:  Architecture-specific code is not permitted to modify the errno variable.  drivers/ and libc/:  OS references to the errno variable should always use the set_errno(), get_errno() macros
2018-01-30 17:57:36 -06:00
Gregory Nutt
30f2927101 binfmt/, drivers/, graphics/: Fix several inappropriate accesses to get_errno() that were missed in previous changes (some going back to nuttx-.23). 2018-01-30 17:23:10 -06:00
Juha Niskanen
dafa72edc3 drivers/sensors: add support to MAX44009 ambient light sensor 2018-01-29 07:56:06 -06:00
Alexander Oryshchenko
dd4fc9f5c3 arch/arm/src/stm32: Make STM32 usable with an external RTC. drivers/timers/ds3231.c: Correct some debug statments. 2018-01-24 06:55:14 -06:00
Alexander Oryshchenko
a7834bcb7b drivers/mtd/at24xx.c: Correct page size for AT24C02 part. 2018-01-24 06:51:34 -06:00
Gregory Nutt
a8b6be4aaf The existence of the network driver ioctl() method should depend on CONFIG_NETDEV_IOCTL rather than CONFIG_NETDEV_PHY_IOCTL. The former enables the method, the later enables a subset of possible driver IOCTLs. This change should be basically a no-operation. The affected ioctl methods only support those subset of driver IOCTLs selected by CONFIG_NETDEV_PHY_IOCTL and the network logic will tolerate a nul ioctl method. 2018-01-22 08:17:45 -06:00
Gregory Nutt
3fb0a50036 drivers/input/ft5x06.c: Remove cool logic to disable polling when there there is no client waiting for read data. That was a great idea to save CPU cycles when there is nothing reading from the touchscrren but, unfortunately, does not work with readers that open the driver in non-blocking mode. So I think we just have to eat the CPUs even when there is nothing waiting for touchscreen input. 2018-01-18 09:59:31 -06:00
Evgeniy Bobkov
7d36a81806 Fixes two bugs in multi-block SD-card operations on the STM32F7 platform. arch/arm/src/stm32f7: DBLOCKSIZE must be the size of SD-card block, not the total amount of transferred bytes. drivers/mmcsd: respect SDIO_CAPS_DMABEFOREWRITE on CMD25. 2018-01-16 12:41:02 -06:00
Fabio D'Urso
57b6dec74d If we want to open read-only in losetup.c, flags should be O_RDONLY not O_RDWR 2018-01-14 17:10:10 -06:00
Masayuki Ishikawa
324008c1e5 drivers/net: Add support for telnet character mode
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2018-01-09 20:19:26 +09:00
Gregory Nutt
49775ea801 fs/fat: Fix a bug in the FAT ftruncate logic. 2018-01-05 11:56:39 -06:00
Gregory Nutt
d04f166d84 arch/arm/src/lpc54xx: Add some hooks for future 802.1q VLAN support. configs/lpcxpresso-lpc54628: Automatically bring up network in the netnsh configuration. 2018-01-02 08:49:09 -06:00
Gregory Nutt
3c65be8c1a arch/arm/src/lpc54xx: Fix a few more Ethernet issues related to buffer management and address filtering. 2018-01-01 08:54:31 -06:00
Gregory Nutt
f23fb9dd14 arch/arm/src/lpc54xx: Completes basic packet transfer logic for Ethernet drivers. Still some unfinished logic for IPv6 multicast logic and for various non-mainstream configurations. But it is ready for tested. configs/lpcxpresso-lpc54628: Add a netnsh configuration that will be used to test the Ethernet driver. Untested on initial commit. 2017-12-30 12:51:57 -06:00
Gregory Nutt
6315f6468d arch/arm/src/lpc54xx: Adds basic Ethernet interrupt handling. Still missing all of the descriptor and packetk buffer handling logic. 2017-12-29 14:29:52 -06:00
Gregory Nutt
31330b2479 arch/arm/src/lpc54xx: Add a little -- very little -- Ethernet initialization logic. 2017-12-26 16:30:57 -06:00
Gregory Nutt
f5c5f89592 arch/arm/src/lpc54xx: Add (incomplete) Ethernet register definition file. Add framework for an Ethernet driver. Initial commit is just the drivers/skeleton.c with naming updated for the LPC54. 2017-12-26 12:55:58 -06:00
Gregory Nutt
eef12f1f91 arch/arm/src/lpc54xx: In SDMMC driver, add logic to transfer data when TXDR or RXDR interrupts occur. Also, add logic to set the RX watermark to 2 when receiving short, non-DMA data transfers. 2017-12-20 17:27:52 -06:00
Gregory Nutt
c867d42018 arch/arm/src/lpc54xx: Add support for card detect and write protect to SDMMC driver. configs/lpcxpresso-lpc54628: Add logic to bring up SDMMC. 2017-12-20 10:52:05 -06:00
ussi Kivilinna
5392955ec4 drivers/sensors/hts221.c: Fix sensor reset with BOOT bit 2017-12-20 10:11:52 -06:00
Gregory Nutt
5a0963f0b0 drivers/ft5x06.x and related: Minor cleanup after completing the FT5x06 driver verification. 2017-12-19 07:14:02 -06:00
Gregory Nutt
d29de95996 drivers/input/ft5x06.c: Fix a problem was was causing missing reports when the touch ends. 2017-12-18 20:06:42 -06:00
Gregory Nutt
d9997846b6 Lpcxpresso-Lpc54618 and FT5x06 driver. Some improvements in configuration and the touchscreen driver improves the behavior some. Now I get the calibration screen and detect touches (but no un-touches). 2017-12-18 17:22:35 -06:00
Gregory Nutt
ead23dca30 configs/lpcxpresso-lpc54628: Add an NxWM configuration. Not yet functional. 2017-12-18 13:33:37 -06:00
Gregory Nutt
4a5e18a6db drivers/ft5x06.c: Add additional configuration options: Optimize if multi-touch capability is not used. Add options to swap X/Y and thresholding to reduce the rate of false alarm reports (with no motion). 2017-12-18 10:31:49 -06:00
Gregory Nutt
23dfc0bf06 drivers/ft5x06: Add a polled mode of operation for the FT5x06 in attempt to work around the fact that the LPCXpresso-LPC54628 chose a non-interrupt pin for the FT5x06 interrupt. Driver is still not yet functional. 2017-12-18 08:58:07 -06:00
Juha Niskanen
db079608d9 drivers/power/bq2429x.c: Add trickle charging mode 2017-12-18 06:38:41 -06:00
Gregory Nutt
c014400895 drivers/input/ft5x06: Fix a misconception.. WAKE is an output, not an input. 2017-12-18 06:36:44 -06:00
Dmitriy Linikov
3582208496 Merged in hardlulz/modem-3.0-nuttx/fix-pcf8574-build (pull request #556)
Fixed build of PCF8574 driver when its interrupts aren't enabled by config.

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-12-18 12:10:49 +00:00
Gregory Nutt
91f48701ae arch/arm/src/sam34: Fix some compile warnings that I introduced with a possibly overzealous recent change. 2017-12-17 17:43:20 -06:00
Gregory Nutt
c62a9ea727 drivers/input/ft5x06.c: Add a driver for the FT5x06 capacitive, multi-touch, touchscreen controller. configs/lpcxpresso-lpc54628: Add support for the the FT5x06. Enable the driver as well as the apps/examples touchscreen test. Untested on initial commit. 2017-12-17 15:17:06 -06:00
Gregory Nutt
87252297d6 arch/arm/src/: Fix a error in last commit that was cloned in three places. 2017-12-17 14:38:20 -06:00
Masayuki Ishikawa
ab96e3fdc7 Merged in masayuki2009/nuttx.nuttx/lc823450_smp_improvement (pull request #554)
lc823450 smp improvement

* arch/arm/src/common: Apply irq_spin APIs to modifyregXX

    Replace enter_critical_section with spin_lock_irqsave.
    Replace leave_critical_section with spin_unlock_irqrestore.

    Please see 6150299f54 as well.

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* arch/arm/src/lc823450: Do not use modifyreg32() to enable Mutex.

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* arch/arm/src/lc823450: Modify IRQ control for i2s

    Interrupt will be handled on CPU0 with this change.

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* arch/arm/src/lc823450: Apply irq_spin APIs to dma/syscontrol/usbdev.

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* configs/lc823450-xgevk: Assign CPU1 to lpwork

    This change will improve load balancing for networking with RNDIS.

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* drivers/audio/wm8776.c: Improve stability in SMP mode

    Apply irq_spin APIs to improbe performance.
    Repeat to process a message to avoid deadlock.

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* configs/lc823450-xgevk: Enable SPINLOCK_IRQ and NXPLAYER in rndis

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-12-08 12:31:34 +00:00
Gregory Nutt
8bc90a1899 This adds basic architectural support for the LPC546xx family and includes support for the LPCXpresso-LPC54628 board. The basic NSH port is almost complete... still lacking GPIO support and LED support. There are still no significant drivers available.
Squashed commit of the following:

    arch/arm/src/lpc54xx:  Finish off some missing logic.  Complete now execpt for GPIO and LED support.
    arch/arm/src/lpc54xx:  Add lpc54_clrpend.c
    arch/arm/src/lpc54xx:  Serial driver is complete and compiles.
    arch/arm/src/lpc54xx:  Add beginning of a serial driver (still missing some logic)
    arch/arm/src/lpc54xx:  Fleshes out low level USART intialization.
    arch/arm/src/lpc546xx/Kconfig: Add hooks to integrate with common seril upper half.
    arch/arm/src/lpc54xx:  Beginning of USART console support.
    arch/arm/src/lpc54xx: Completes very basic clock configuration.
    arch/arm/src/lpc54xx:  Add clocking logic (still not complete)
    arch/arm/src/lpc54xx:  Beginning of PLL configuration logic.
    arch/arm/src/lpc54xx:  Fix a few things from first compile attempt.  Compilation cannot work until I at least finish the clock configuration logic.
    arch/arm/src/lpc54xx: Addes some SysTick logic.
    arch/arm/src/lpc54xx:  Completes basic startup logic (sans clock configuration) and interrupt configuration.
     arch/arm/src/lpc54xx:  Add generic ARMv7-M start-up logic (needs LPC54628 customizations); add emtpy file that will eventually hold the clock configuration logic.
    arch/arm/src/lpc54xx:  Add (incomplete) SYSCON register definition header file.
    arch/arm/src/lpc54xx:  Add FLEXCOMM header file.
    arch/arm/src/lpc54xx:  Bring in tickless clock logic from LPC43; configs/lpcxpresso-lpc54628: mount procfs if enabled.
    arch/arm/src/lpc54xx: Add RIT clock definitions; add SysTick initialization (not finished)
    LPC54xx and LPCXpresso-LPC54628: add more boilerplate files and stubbed out files.
    arch/arm/src/lpc54xx:  Add (incomplete) USART header file.
    Add another condition to a Kconfig; refresh a defconfig.
    arch/arm/src/lpc54xx/chip: Add LPC54628 memory map header files.
    configs/lpcxpresso-lpc54628:  Add basic build files for the LPCXpresso-LPC54628
    arch/: Basic build directory structure for the LPC54628
2017-12-07 13:30:02 -06:00
Jussi Kivilinna
ce88bc212d From c73dd8973accd312ca7675fde044df80e9cc62d5 Mon Sep 17 00:00:00 2001
From: Jussi Kivilinna <jussi.kivilinna@haltian.com>
Date: Thu, 7 Dec 2017 13:00:14 +0200
Subject: [PATCH] drivers/pipes: poll: fix off-by-one error in calculation of bytes in the buffer

Buffer calculation in pipe poll setup is off-by-one when read indexis larger than write index. This causes poll() not getting POLLINwhen buffer has one byte as calculation gives zero bytes in buffer.

Reproducible with:

  {
    char buf[8] = { 0, };
    int fds[2];
    struct pollfd in_pfd;

    pipe2(fds, 8);

    write(fds[1], buf, 7);
    read(fds[0], buf, 7);
    write(fds[1], buf, 1);

    in_pfd.fd = fds[0];
    in_pfd.events = POLLIN;
    ret = poll(&in_pfd, 1, -1); // pipe bug => stuck waiting
    assert(ret == 1);
  }
2017-12-07 07:12:11 -06:00
Ekaterina Kovylova
59a5c24739 drivers/mtd: Add a driver for Macronix MX35LFxGE4AB serial NAND flash. 2017-11-29 07:15:36 -06:00
Gregory Nutt
2fb52cf3d9 Framebuffer Driver: Small modification convention for multi-planar displays (of which there are none). 2017-11-29 07:06:53 -06:00
Gregory Nutt
1338360ff7 Fix a few typos. 2017-11-28 13:40:07 -06:00
Gregory Nutt
0c614311af Eliminate some warnings 2017-11-28 12:49:36 -06:00
Alan Carvalho de Assis
5a814a773d drivers/input/nunchuck.c: Add Nintendo Wii Nunchuck driver 2017-11-28 12:10:06 -06:00
Gregory Nutt
54f43ea1f1 Fix typos in Kconfig files: LCD_PACKEDMSFIRST, not LCD_PACKEDFIRST. 2017-11-26 07:57:17 -06:00
Gregory Nutt
5328e3bafb configs/: CONFIG_QENCODER was renamed to CONFIG_SENSORS_QENCODER: update occurrences in several Kconfig files 2017-11-25 18:46:43 -06:00
Gregory Nutt
c2c2c4f111 drivers/lcd: Make LCD driver configuration indepently selected from NX graphics configuration. This makes things awkward and loses some error checking but is a necessary step in order to make LCD drivers usable when the NX graphics system is disabled. 2017-11-25 13:13:30 -06:00
Gregory Nutt
3657723208 drivers/lcd: Add support for external LCD initialization required by some board logic. configs/zpa214xpa: Tried to get the LCD working again unsuccessfully. Too much bit rot I suppose. 2017-11-25 11:41:21 -06:00
Anthony Merlino
50f05d7514 Merged in antmerlino/nuttx/rndis-debug-build-error (pull request #539)
USB RNDIS - Fixes minor build error while using USB RNDIS with USB debugging information enabled

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-11-22 18:55:39 +00:00
Gregory Nutt
84de1fed9b Fix previous commit: In calculating the length of a run, the width has to be updated AFTER the start X position has been modified. 2017-11-22 06:13:56 -06:00
Gregory Nutt
9a4c3bbe99 drivers/lcd_framebuffer.c: If BPP is less then 8, then we need to byte-align the update region. 2017-11-22 05:35:33 -06:00
Gregory Nutt
f3b37e5da3 fs/procfs/fs_procfsprogrem: Add /proc/progmem. This is an alternative way to get the information that was previoulsy available in apps/system/free. apps/system/free was removed beause it made illegal calls into the OS violating the portable interface. This new procfs entry provides the same information with no such violation. 2017-11-13 09:08:39 -06:00
Masayuki Ishikawa
14e2b6dc5b Merged in masayuki2009/nuttx.nuttx/stm32f4discovery_rndis (pull request #533)
RNDIS support on STM32F4Discovery

* stm32f4discovery: Add stm32_netinit.c to avoid a compilation error

* stm32f4discovery: Add rndis initialization in stm32_bringup.c

    NOTE: MAC address for the host side starts 0xaa.  This assignment
    scheme should be fixed later.

* stm32f4discovery: Add rndis configuration

    NOTE: STM32F4Discovery + DM-STF4BB

* drivers/usbdev/rndis.c: Fix some issues in rndis.c

    Introduce rndis_transmit() and change rndis_rxdispatch() to avoid
    packet corruption. Introduce max packet size for dual speed which
    is mainly used for high speed mode. Fix adjusting MTU warning
    on Linux host. Fix data corruption if a packet size excceds MTU.

    NOTE: Max packet size is not configured dynamically. This should
    be fixed in the future version.

* stm32f4discovery: Modify #ifdef condition for rndis in stm32_bringup()

* drivers/usbdev/rndis.c: Change HPWORK to ETHWORK

* drivers/usbdev/rndis.c: Merge the commit 07b98ccbb5

    Previous commit b09365784a was based on old rndis.c thus resulted
    in reverting the commit 07b98ccbb5. This change merges the commit.

    NOTE: In the commit 07b98ccbb5, max packet size of bulkout was
    assumed to be 64. In this commit, priv->epbulkout->maxpacket is
    used instead.

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-11-13 08:55:41 +00:00
Juha Niskanen
25c1f4407e drivers: fix few compiler warnings about nxsem_post 2017-11-10 09:01:39 -06:00
Gregory Nutt
8008875f35 Cosmetic spacing and used UNUSEd macro 2017-11-09 12:25:13 -06:00
Jussi Kivilinna
509d729825 drivers/power/bq2429x.c: Add BATIO_OPRTN_SYSON for enabling BATFET after SYSOFF 2017-11-08 13:08:54 -06:00
Sakari Kapanen
07b98ccbb5 drivers/usbdev/rndis.c: fix packet receiving logic. The logic didn't take single-byte termination frames in account. 2017-11-08 07:33:09 -06:00
Gregory Nutt
349b513978 Very trivial changes from review of last PR 2017-11-08 06:34:23 -06:00
Masayuki Ishikawa
51b19d5f38 Merged in masayuki2009/nuttx.nuttx/lc823450 (pull request #531)
lc823450-xgevk audio support

* arch/arm/src/lc823450: Add IPL2 support

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* configs/lc823450-xgevk: Add IPL2 support

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* libc/audio: Fix compilation error in lib_buffer.c

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* drivers/audio: Add WM8774 support

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* arch/arm/src/lc823450: Add I2S support

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

* configs/lc823450-xgevk: Add WM8774 support

    Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-11-08 12:25:13 +00:00
Alan Carvalho de Assis
7c5f329294 drivers/lcd/max7219.c: Add support for MAX7219 vertically organized display. 2017-11-07 13:20:03 -06:00
Gregory Nutt
7deb24484c This comment converts the underlying IPC used by the UserFS from Unix domain local sockets to UDP LocalHost loopback sockets. The problem with the local sockets is that they do require operations on the top level psuedo-file system inode tree. That tree must be locked during certain traversals such as enumerate mountpoints or enumerating directory entries.
This conversion is unfortunate in the sense that Unix local domain sockets are relatively lightweight.  LocalHost UDP sockets are much heavier weight since they rely on the full UDP stack.  If anyone is up for a complete redesign, then using some shared memory and a POSIX message queue would be lightweight again.

This commit also fixes several bugs that were not testable before the inode tree deadlock.  I cannot say that the logic is 100% stable but it does not have basic functionality.

Squashed commit of the following:

    fs/userfs:  Order locking so that access to the shared I/O buffer is also locked.
    fs/userfs:  Converts to use LocalHost UDP loopback for IPC.
2017-11-05 12:25:58 -06:00
Mateusz Szafoni
2fc5237854 Merged in raiden00/nuttx (pull request #529)
Master

* cosmetics

* stm32_hrtim: add helper macros

* smps: cosmetics

* stm32f33xxx_adc: injected channels support, fix some definitions, add interface to disable interrupts

* stm32f334-dsico: beginning of lower-half driver for SMPS (buck-boost onboard converter)

* nucleo-f334r8/highpri: missing ADC trigger configuration

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-11-05 14:15:04 +00:00
Gregory Nutt
0942b5441d Update some comments 2017-11-04 14:33:20 -06:00
Gregory Nutt
205fe8053f Kconfigs: Add CONFIG_LCD_UPDATE that works like CONFIG_NX_UPDATE but can be enabled without enabling the graphics subsystem. 2017-11-04 14:08:21 -06:00
Alan Carvalho de Assis
829e6520e3 drivers/lcd/max7219.c: Add support to MAX7219 LED Matrix as LCD interface 2017-11-04 07:54:48 -06:00
Gregory Nutt
ac40630452 wireless/ieee802154: Fix a warning found in build testing. Mouse input: Cosmetic changes while reviewing logic. 2017-11-03 09:21:19 -06:00
Gregory Nutt
f3286d83e7 Costmetic 2017-11-02 19:17:33 -06:00
Gregory Nutt
29309e63aa Eliminate some warnings from building testing. 2017-11-02 17:27:48 -06:00
Gregory Nutt
e52bc92238 drivers/mtd/filemtd.c: Don't use file descriptors... Use the internal file system interfaces so that the loop device can be shared across threads. 2017-11-02 17:07:08 -06:00
Gregory Nutt
f9e7b84727 drivers/loop: Don't use file descriptors... Use the internal file system interfaces so that the loop device can be shared across threads. 2017-11-02 16:31:56 -06:00
Frank Benkert
c6942f6137 drivers/serial/serial.c: Optimize wait time in tcdram() for buffer emptying
According to the specification, the close function must wait until all data
has been written before it closes the file (except O_NONBLOCK is set). The
maximum waiting time for this is not specified.

To be able to edit the file list of the process, the close function has to lock
the file list semaphore. After that the close function of the serial driver is
called.

Waiting for the complete transmission of all data is done in the serial driver.
This causes the semaphore to remain locked until all data has been sent.
However, no other thread of the process can edit the file list for that time
(open, close, dup2, etc.). This is not optimal in a multithreaded environment.
Therefore, we have to keep the waiting time within the driver as short as possible.
2017-11-02 08:53:14 -06:00
Anthony Merlino
14fb37c995 Merged in antmerlino/nuttx/sixlowpan-mac802154 (pull request #526)
ieee802154: Simplifies notify() and rxframe() calls to a single notify() call. dataind's and all other "notifs" are now "primitives" which aligns with standard terminology

* mac802154: Adds missing breaks from case statement

* sixlowpan: Fixes bad logic where ACK is not requested if address is not a broadcast

* ieee802154: Simplification of "notifs" and "datainds" to generic primitives passed via a single notify call to the layer above the MAC

* Directories.mk should reference CONFIG_WIRELESS instead of CONFIG_DRIVERS_WIRELESS

* xbee_netdev: Network must be locked when calling sixlowpan_input

* sixlowpan: Reassembly buffer can't be freed if provided by radio driver

* sixlowpan: Don't free IOB if there is an error processing it as the MAC will try to pass it along to another receiver

* ieee802154: Adds basic logging to ieee802154_primitive.c

* Minor fixes after rebase

* xbee: Adds AT query timeout to retry if XBee doesn't respond to request

* same70-xplained: Adds Xbee support. Makes mikroBus slot Kconfig 'choice'

* mac802154: Removes unused function declaration

* drivers/mrf24j40: Fixes compilation error using . operator rather than -> operator

* mac802154_device: Changes a few mac802154_primtive_free's to ieee802154_primitive_free() and changes notif to primitive in a couple places.

* mac802154: Adds promiscous mode logic to bypass parsing of incoming frames. MAC char device also checks for promiscous mode and passes whole frames including header and FCS to the application if promiscous mode is enabled.

* sixlowpan: Fixes logic to correctly check if packet is large enough to include header.  This would cause packets to be considered too small when they are sufficiently sized.

* sixlowpan: Fixes forwarding logic to use forwarding device rather than received device to look up destination link layer address

* net/ipforward: Fixes typo that caused build error when IP forwarding was enabled with CONFIG_NET_ICMPv6_NEIGHBOR enabled as well.

* configs/same70-xplained: Simple spelling fix

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-11-01 20:15:21 +00:00
Anthony Merlino
02721f9d95 net/icmpv6: Add some header file necessary for correct build.
drivers/wireless/ieee80211:  Fix typos and spelling errors as needed for Photon build.
2017-11-01 06:58:33 -06:00
Dmitriy Linikov
61372551e9 Merged in hardlulz/modem-3.0-nuttx/fix-stmpe811-gpio (pull request #523)
Fix GPIO operation of STMPE811 driver.

Fixed issues:
1. STMPE811_GPIO_DIR was defined for register name
   and later was redefined to be the pin direction mask
   for `stmpe811_gpioconfig`

   I decided to change register name to be STMPE811_GPIO_DIR_REG,
   and keep pin direction mask STMPE811_GPIO_DIR, so that any
   external code that already use this driver will be unchanged.

2. The STMPE811 register GPIO_DIR uses bit value 1 for output
   and 0 for input, but `stmpe811_gpioconfig` set the opposite.

3. The call to `stmpe811_gpiowrite` from inside of `stmpe811_gpioconfig`
   leaded to deadlock.

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-10-31 16:54:28 +00:00
Gregory Nutt
cfc5f8fbaf drivers/net: Remove the old, unfinished Crystal LAN driver. I don't even have the hardware that it goes with anymore. 2017-10-28 10:27:00 -06:00
Alan Carvalho de Assis
b5f6d6c4f7 drivers/can/mcp2515.c: Fix BRP for SET_BITTIMING ioctl as well 2017-10-27 06:15:54 -06:00
Jussi Kivilinna
0ea4d2a11d sensors/lis2dh: fix use of obsolete dbg macro 2017-10-27 06:13:14 -06:00
Alan Carvalho de Assis
b0ce7753aa drivers/can/mcp2515.c: Fix the MCP2515 Bit Rate Prescale calculation. 2017-10-27 06:11:37 -06:00
Jussi Kivilinna
e557c3e8d5 drivers/sensors/lis2dh: fixes for self-test 2017-10-26 09:25:20 -06:00
Gregory Nutt
70c59a9d91 This commit adds support for semi-standard IPPROTO_ICMP6 sockets. This is a replacement for the non-standard ICMPv6 ping support that violated the portable POSIX OS interface.
Squashed commit of the following:

    net/icmpv6: IPPROT_ICMP6 socket logic now builds without error.
    net/icmpv6:  Add support for read-ahead and poll(). Initial commit is just cloned from ICMP with the appropriate name changes.
    configs/:  All defconfig filess that include CONFIG_NET_ICMPv6_SOCKET=y need to select CONFIG_SYSTEM_PING6=y and deselect CONFIG_DISABLE_POLL.
    Update NSH documention to show that ping6 is now a built in command.
    net/icmpv6:  Add icmpv6_sendto.c and icmpv6_recvfrom.c.  Initial versions are just clones from icmp/ with appropriate name changes.
    net/icmpv6:  Clone some ICMP socket logic as the beginning of support for ICMPv6 socket support.
    Rename CONFIG_NET_ICMPv6_PING to CONFIG_NET_ICMPv6_SOCKET.  Move prototype for icmpv6_ping from include/nuttx/net/icmpv6 to net/icmpv6/icmpv6.h
2017-10-24 11:23:08 -06:00
Gregory Nutt
fc0a5e19d0 drivers/bch: The character driver to block device access now supports an IOCTL to get the geomtry of the underlying block device. 2017-10-20 11:36:44 -06:00
Juha Niskanen
9653255cff Merged in juniskane/nuttx_stm32l4/stm32l1_stm32l4_rtc_update_pr (pull request #514)
STM32L1, STM32L4 RTC: add periodic interrupts, update L1 RTC implementation

* STM32L4 RTC: add support experimental CONFIG_RTC_PERIODIC

* STM32 RTC: separate STM32L1 RTC into a separate file

    STM32L1 RTC is very close to F4 or L4 versions, with two alarms
    and periodic wakeup support so backported L4 peripheral to L1.

* RTC: add periodic alarms to upper and lower halves

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-10-20 17:15:17 +00:00
Alan Carvalho de Assis
0be36a6ac1 drivers/sensors/apds9960.c: Use work_queue to read/process data when receive an IRQ 2017-10-20 08:54:44 -06:00
Jussi Kivilinna
fe9be72bec drivers/sensors/hts221: power-on sensor for loading calibration data 2017-10-20 08:33:44 -06:00
Alan Carvalho de Assis
3268a6ac5f drivers/sensor: Add driver for the APDS-9960 gesture sensor 2017-10-20 06:37:38 -06:00
Gregory Nutt
bc40403516 There was a reference counting problem in the TPC logic of net_clone(). net_clone() which is the common logic underlying dup() and dup2() for sockets. When net_clone() calls net_start_monitor() and net_start_monitor() returns a failure (because the underlying TCP connection) then net_clone() must back out the reference count on the structure. Problem noted by Pascal Speck and this implementation of the solution is based on his suggestion. 2017-10-19 11:09:23 -06:00
Jussi Kivilinna
5ef548677a drivrs/mtd/filemtd.c: add block device MTD interface. Block MTD interface allows using block device directly as MTD instead of having to use file-system in between. NOTE that this provides the opposite capability of FTL which will let you use an MTD interface directly as a block device. 2017-10-19 09:53:41 -06:00
Sebastien Lorquet
1182702b80 drivers/ioexpander: The IRQ subsystem now supports passing a void * parameter to IRQ handlers. Use that method to support multiple pc9555 devices, by passing a pointer to the device to the board defined irq handler. Now the CONFIG_ for multiple PCA devices just allocates device structures dynamically instead of statically when not enabled.
The same interrupt handler is entered with the device structure parameter in all situations,
multiple or single PCA. One should still be careful if multiple PCA devices share the same IRQ.
2017-10-19 08:10:40 -06:00
Gregory Nutt
d29cb09da3 drivers/usbdev: Move test for NULL pointer before the pointer is deferences. Noted by Juha Niskanen. 2017-10-18 11:06:14 -06:00
Gregory Nutt
8dd1bb03b2 drivers/usbdev: Add a debug assertion to CDC/ACM driver. 2017-10-18 07:10:34 -06:00
Gregory Nutt
85a1a3cc98 drivers/usbdev: Correct input flow control logic when watermarks are not enabled. Problem not by and change based on suggestion by Juha Niskanen. 2017-10-18 06:49:11 -06:00
Juha Niskanen
d101fad026 Merged in juniskane/nuttx_stm32l4/stm32_rtc_small_patches_pr (pull request #511)
Stm32 rtc small patches

* RTC: canceling an alarm marks it as inactive

* STM32L4, STM32F4, STM32F7 RTC: fix reading alarm value that is more than 24h in future

* STM32F0 RTC: fix backup register count in stm32_rtcc.h

    All other STM32: SHIFTR_SUBFS_MASK was correct in STM32F0 only

* STM32L1: use correct EXTI line definitions

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-10-17 16:45:48 +00:00
Gregory Nutt
5b385f4d4d kthread_create(): Rename kernel_thread() to kthread_create() for better naming consistency with task_create() and kthread_delete(). 2017-10-16 11:38:00 -06:00
Gregory Nutt
181875f3ba fs/vfs: Add new internal OS interface nx_read(). nx_read() is functionally equivalent to read() except that it does not modify the errno variable and it is not a cancellation point. Changed all references to read() in the OS to nx_read(). 2017-10-11 12:13:41 -06:00
Gregory Nutt
a00d8e16a1 Adds OS internal function nx_write() which is functionally equivalent to write() except that it does not set the errno variable and do not cause cancellation points. 2017-10-11 10:18:30 -06:00
Gregory Nutt
af072d52bc Adds OS internal functions nx_send(), ns_recv(), and nx_recvfrom() which are functionally equivalent to send(), recv(), and recvfrom() except that they do not set the errno variable and do not cause cancellation points. 2017-10-11 09:25:43 -06:00
Sebastien Lorquet
d16d4d5568 The INA219 is a combined voltage and current sensor that can measure up to 26 volts and a current that depends on an external shunt resistor. Connection happens via i2c/smbus and the chip features a power supply rail that is independent from the measured voltage, so it can measure low voltages.
This commit adds a driver for this chip.  Right now it measures bus voltage and current, and does not use the internal calibrated current reading, nor the available power measurement.
2017-10-10 17:03:56 -06:00
Gregory Nutt
eb79a575f6 Fix a few places where there was a semicolon following the 'if' condition, makeing the following logic unconditional. 2017-10-10 14:24:13 -06:00
Gregory Nutt
e11e3b2607 Squashed commit of the following:
Change all calls to mq_receive() and mq_timedreceive() in the OS to calls to nxmq_receive() and nxmq_timedreceive(), making appropriate changes for differences in return values.

    sched/mqueue:  Add nxmq_receive() and mxmq_timedreceive() which are functionally equivalent to the standard mq_receive and mq_timedreceive() except that (1) they do not create cancellation points, and (2) the do not modify the application's errno variable.
2017-10-10 09:57:40 -06:00
Gregory Nutt
fca07be1df Squashed commit of the following:
Change all calls to mq_send() and mq_timedsend() in the OS to calls to nxmq_send() and nxmq_timedsend(), making appropriate changes for differences in return values.

    sched/mqueue:  Add internal function nxmq_send() and nxmq_timedsend() that are equivalent to mq_send() and mq_timedsend() except that they do not create cancellation points and do to not modify the errno variable.
2017-10-10 08:44:12 -06:00
Gregory Nutt
d0eb182c00 Minor changes from review of last PR 2017-10-09 12:15:05 -06:00
Mateusz Szafoni
6c25f3d142 Merged in raiden00/nuttx (pull request #505)
Master

* power: Add powerled to Kconfig

* stm32_powerled.c: cosmetics

* stm32_hrtim.c: cosmetics

* stm32/Kconfig: add HRTIM configuration and add DAC external trigger configuration

* stm32f334-disco: Add powerled example configuration

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-10-09 18:07:09 +00:00
Gregory Nutt
ecf6dda2c5 Correct recurring typo: semaphore not semapore 2017-10-09 09:57:56 -06:00
Sakari Kapanen
01a4060a1b RNDIS: Use CONFIG_USBDEV_MAXPOWER instead of hardcoded value
RNDIS: Use LPWORK for network operations by default
2017-10-09 09:00:48 -06:00
Gregory Nutt
700f1a8e8c Eliminate some warnings found in build testing. 2017-10-08 16:27:17 -06:00
Gregory Nutt
4810499d3a Squashed commit of the following:
Replace all calls to sigqueue() in the OS proper with calls to nxsig_queue() to avoid accessing the errno variable.

    sched/signal:  Add nxsig_queue() which is functionally equivalent to sigqueue() except that it does not modify the errno variable.
2017-10-07 10:57:09 -06:00
Gregory Nutt
2318f895df Fix some compile problems found during build testing. 2017-10-07 09:40:02 -06:00
Gregory Nutt
9e25d89223 Squashed commit of the following:
Replace all usage kill() in the OS proper with nxsig_kill().

    sched/signal:  Add nxsig_kill() which is functionally equivalent to kill() except that it does not modify the errno variable.
2017-10-07 08:22:18 -06:00
Gregory Nutt
3b67c06711 net/Kconfig: Remove to improper use of comma in syntax 2017-10-06 15:14:09 -06:00
Gregory Nutt
5b04c25dcd drivers/serial/tcdrain: tcdrain() was recently added to the NuttX C library. But there is a problem. The specification of tcdrain() requires that it be a cancellation point. In order to do this, tcdrain was moved from the C library into the OS and the addition cancellation point hooks were added. In non-FLAT builds, access via system calls is also now supported. 2017-10-06 10:55:36 -06:00
Gregory Nutt
936df1bcb5 Adds new OS internal functions nxsig_sleep() and nxsig_usleep. These differ from the standard sleep() and usleep() in that (1) they don't cause cancellation points, and (2) don't set the errno variable (if applicable). All calls to sleep() and usleep() changed to calls to nxsig_sleep() and nxsig_usleep().
Squashed commit of the following:

    Change all calls to usleep() in the OS proper to calls to nxsig_usleep()

    sched/signal:  Add a new OS internal function nxsig_usleep() that is functionally equivalent to usleep() but does not cause a cancellaption point and does not modify the errno variable.

    sched/signal:  Add a new OS internal function nxsig_sleep() that is functionally equivalent to sleep() but does not cause a cancellaption point.
2017-10-06 10:15:01 -06:00
Jussi Kivilinna
7fc7cc9f8f drivers/input/cypress_mbr3108: Add missing variable for nxsem_wait return value 2017-10-06 07:30:04 -06:00
Gregory Nutt
7cc63f90d9 sched/semaphore: sem_trywait() modifies the errno value and, hence, should not be used within the OS. Use nxsem_trywait() instead. 2017-10-05 07:59:06 -06:00
Gregory Nutt
29b5b3667f sched/semaphore: sem_timedwait() is a cancellation point and, hence, cannot be called from within the OS. Created nxsem_timedwait() that is equivalent but does not modify the errno and does not cause cancellation. All calls to sem_timedwait() change to calls to nxsem_timedwait() in the OS. 2017-10-05 07:24:54 -06:00
Gregory Nutt
9568600ab1 Squashed commit of the following:
This commit backs out most of commit b4747286b1.  That change was added because sem_wait() would sometimes cause cancellation points inappropriated.  But with these recent changes, nxsem_wait() is used instead and it is not a cancellation point.

    In the OS, all calls to sem_wait() changed to nxsem_wait().  nxsem_wait() does not return errors via errno so each place where nxsem_wait() is now called must not examine the errno variable.

    In all OS functions (not libraries), change sem_wait() to nxsem_wait().  This will prevent the OS from creating bogus cancellation points and from modifying the per-task errno variable.

    sched/semaphore:  Add the function nxsem_wait().  This is a new internal OS interface.  It is functionally equivalent to sem_wait() except that (1) it is not a cancellation point, and (2) it does not set the per-thread errno value on return.
2017-10-04 15:22:27 -06:00
Gregory Nutt
42a0796615 Squashed commit of the following:
sched/semaphore:  Add nxsem_post() which is identical to sem_post() except that it never modifies the errno variable.  Changed all references to sem_post in the OS to nxsem_post().

    sched/semaphore:  Add nxsem_destroy() which is identical to sem_destroy() except that it never modifies the errno variable.  Changed all references to sem_destroy() in the OS to nxsem_destroy().

    libc/semaphore and sched/semaphore:  Add nxsem_getprotocol() and nxsem_setprotocola which are identical to sem_getprotocol() and set_setprotocol() except that they never modifies the errno variable.  Changed all references to sem_setprotocol in the OS to nxsem_setprotocol().  sem_getprotocol() was not used in the OS
2017-10-03 15:35:24 -06:00
Gregory Nutt
83cdb0c552 Squashed commit of the following:
libc/semaphore:  Add nxsem_getvalue() which is identical to sem_getvalue() except that it never modifies the errno variable.  Changed all references to sem_getvalue in the OS to nxsem_getvalue().

    sched/semaphore:  Rename all internal private functions from sem_xyz to nxsem_xyz.  The sem_ prefix is (will be) reserved only for the application semaphore interfaces.

    libc/semaphore:  Add nxsem_init() which is identical to sem_init() except that it never modifies the errno variable.  Changed all references to sem_init in the OS to nxsem_init().

    sched/semaphore:  Rename sem_tickwait() to nxsem_tickwait() so that it is clear this is an internal OS function.

    sched/semaphoate:  Rename sem_reset() to nxsem_reset() so that it is clear this is an internal OS function.
2017-10-03 12:52:31 -06:00
Sebastien Lorquet
9ea215f2e4 Merged in slorquet/nuttx/mt25q (pull request #501)
Add support for Micron MT25Q series MT25Q128

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-10-02 18:33:54 +00:00
Gregory Nutt
8394f9b60f Squashed commit of the following:
configs/z80sim and xtrs:  Serial driver lower halfs ioctl methods should return a negated errno value, not set the errno variable.

    drivers/wireless:  CC1101 driver not permitted to set errno.

    drivers/sensors:  LIS331DL driver not permitted to set errno.

    drivers/lcd: ILI9341 initialize method not permitted to set errno,

    drivers/serial: 16550 UART driver IOCTL method must not set errno; it must return a negated errno value.
2017-09-30 12:59:33 -06:00
Mateusz Szafoni
ad369a0bad Merged in raiden00/nuttx (pull request #499)
syslog_console.c: fix typo

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-09-30 12:24:37 +00:00
raiden00pl
525a180ab5 syslog_console.c: fix typo 2017-09-30 13:34:15 +02:00
Gregory Nutt
44736b721c net/sockets: psock_send() is an internal OS interface an should not set the errno variable. 2017-09-29 17:48:15 -06:00
Gregory Nutt
8a75add6a0 drivers/syslog: syslog internal functions should not set the errno variable: ramlog_putc(), syslog_dev_putc(), syslog_dev_write(), syslog_force(). 2017-09-29 15:24:40 -06:00
Gregory Nutt
f58a68b5c8 drivers/usbdev/cdcacm.c: Change ordering of some operations to avoid races; Add missing uppder watermark logic that is normally in serial_io.c but must be duplicated in cdcacm.c; update comments 2017-09-27 08:46:49 -06:00
Gregory Nutt
8ad1e72536 drivers/usbdev/cdcacm.c: Fix confusion between flow control being enabled and being active. Different things 2017-09-27 06:41:32 -06:00
Gregory Nutt
7ceedd2b52 drivers/usbdev/cdcacm.c: Add some missing logic when flow control is disabled. Also make sure that the flowcontrol and rxint can handle being re-entered when cdcacm_release_rxpending() is called. 2017-09-27 06:09:13 -06:00
Gregory Nutt
4e3c159145 drivers/usbdev/cdcacm.c: Add a failsafe time to assure that the RX pending queue cannot stall indefinitely. I can imagine a corner case where the serial driver's RX buffer is full and it stops accepting data and where all of the read requests are queued and there is not event to restart RX processing. I am not sure that that scenario can really happen, but the failsafe timer gives me peace of mind. 2017-09-26 09:30:54 -06:00
Gregory Nutt
3fd0f67b62 Squashed commit of the following:
drivers/usbdev/cdcacm.c:  Change design for queuing RX packets that cannot be processed.  Previous design had a logic problem that could cause data loss.

    drivers/usbdev/cdcacm:  Fixes one of two know design issues.

    drivers/usbdev/cdcacm:  First attempt to plug data leak in input flow control design.  Still missing a few things.
2017-09-26 08:51:02 -06:00
Juha Niskanen
d141242a25 drivers/usbdev/cdcacm.c: Avoid using priv before checking its validity. 2017-09-26 06:31:30 -06:00
Gregory Nutt
35c97fbf27 drivers/usbdev/Kconfig: Add comments in regard to RNDIS selection. 2017-09-25 12:52:04 -06:00
Gregory Nutt
18376a124a drivers/net/rndis.c: Eliminate a warning when assertions disabled. Consequence of replacing assert() with DEBUGASSERT(). 2017-09-24 17:25:16 -06:00
Gregory Nutt
dbf57fb673 drivers/usbdev/rindis.c: Change some naming to conform with coding standard. Use DEBUGASSERT vs. assert so that the assertions can be disabled. 2017-09-24 11:18:01 -06:00
Sakari Kapanen
67e9e1efb6 drivers/usbdev: Add RNDIS-over-USB driver 2017-09-24 07:24:34 -06:00
Gregory Nutt
3bc21a3973 drivers/usbdev: Fix some bad conditional logic. 2017-09-23 12:57:20 -06:00
Gregory Nutt
2e69e22af3 drivers/usbdev: CDC/ACM should reset all 'irregular' notifications to zero after sending the SerialState packet. 2017-09-23 12:37:57 -06:00
Gregory Nutt
5d02baf205 drivers/usbdev: Add support for flow control TERMIOs in CDC/ACM driver 2017-09-23 11:00:26 -06:00
Gregory Nutt
d2799f0b4e Update a README and some comments 2017-09-23 08:49:58 -06:00
Gregory Nutt
eff026aab8 drivers/usbdev: Cosmetic changes to CDC/ACM driver. 2017-09-22 15:19:43 -06:00
Gregory Nutt
5e38ad28f4 drivers/usbdev: Add support for RX flow control to the CDC/ACM driver. 2017-09-22 14:01:00 -06:00
Jussi Kivilinna
1604ae7ca7 drivers/pipes: pipe_common: fix writing large buffers not triggering POLLIN for reader poll 2017-09-22 06:03:08 -06:00
Gregory Nutt
ae2a1d07b3 Networking: drivers/net/loopback.c: Eliminate a warning. net/netdev/netdev_ifconfig.c: Was not returning all of the address info. 2017-09-19 15:00:46 -06:00
Alan Carvalho de Assis
dca62a68a8 Add driver for APA102 LED controller. These LEDs are used on LED Strips and are controlled over SPI. 2017-09-18 16:48:55 -06:00
Gregory Nutt
725aa4add8 Fix some typos in comments; Fix some bad spacing in fb.h 2017-09-18 09:03:26 -06:00
Gregory Nutt
882adb2c82 drivers/video/fb.c: Fix a typo introduced in previous commit. 2017-09-17 14:07:08 -06:00
Gregory Nutt
cfd44639b2 Fix some cosmetic stuff in the framebuffer character driver and in the LCD framebuffer driver front-end. 2017-09-17 13:48:10 -06:00
Gregory Nutt
0b8730fb8b Squashed commit of the following:
configs/stm3210e-eval: Bring in new stm32_appinit.c, add board_initialize(), add support for FB character driver.
    configs/stm3210e-eval: Rename stm32_appinit.c to stm32_bringup.c so that the start up logic is compatible with other, new boards.
2017-09-17 13:17:06 -06:00
Gregory Nutt
a9c054237a drivers/lcd: Add suppose for a generic front-end that will convert any LCD driver into a framebuffer driver. 2017-09-17 10:39:23 -06:00
Gregory Nutt
b90b4d40b6 Fix typos/spelling. SAMV71-XULT: Update README, add support for fb_driver. 2017-09-17 10:38:34 -06:00
Gregory Nutt
b747192f20 Squashed commit of the following:
drivers/video:     fb driver now clears framebuffer initially.  Eliminates (or minimizes) initial garbage on the display.
    configs/open1788:  Initialization now follows the pattern of other boards.  Add initialization of fb driver.
    configs/open1788:  Add a configuration for testing the framebuffer driver.
2017-09-16 12:49:16 -06:00
Anthony Merlino
046a94e363 Merged in merlin17/nuttx (pull request #485)
drivers/xbee: Fixes a few warnings

* drivers/xbee: Fixes a few warnings

* configs/clicker2-stm32: Updates sections about i8sak usage in the README

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-09-15 19:41:24 +00:00
Anthony Merlino
22754053e8 Merged in merlin17/nuttx/xbee (pull request #484)
drivers/wireless:  Adds XBee S2C (802.15.4 firmware) support. XBee driver emulates mac802154 interface

* drivers/wireless/xbee: Adds xbee_netdev. Very similar to mac802154_netdev

* configs/same70-xplained: Starts adding support for XBee radio

* drivers/wireless/ieee802154/xbee: More structuring of XBee driver

* drivers/wireless/ieee802154/xbee: More Xbee work. Starts adding support on Clicker2

* drivers/wireless/ieee802154/xbee: More XBee MAC code

* configs/clicker2-stm32: More work to add XBee radio support

* drivers/wireless/ieee802154/xbee: Most of driver is now structured. No build errors

* configs/clicker2-stm32: Adjustments to XBee click module support

* drivers/xbee: Changes md_ prefix to xd_ prefix for xbeenet_driver_s fields

* drivers/xbee: XBee network device now passes MAC events via IOCTL

* drivers/xbee: Support querying device for parameters, setting parameters, and structures association/startpan logic

* configs/clicker2-stm32: Fixes Xbee lower half ATTN poll logic

* drivers/xbee: Removes dependce on CONFIG_IEEE802154_NETDEV

* drivers/xbee: Supports MAC RESET.request primitive

* drivers/xbee: Exposes generic AT query to the rest of driver

* drivers/xbee: Sets local values when writing setting change to Xbee device

* drivers/xbee: Finish association logic

* drivers/xbee: Adds xbee_get_mhrlen( ) allocating enough space for API frame header to frame

* drivers/xbee: Finishes transmit/receive logic

* drivers/xbee: Fixes xbee_netdev to match logic in mac802154_netdev.c

* drivers/xbee: Rearranges logic to prevent a loop condition where recursion could potentially occur to the point of deadlocking the system

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-09-15 14:37:55 +00:00
Anthony Merlino
9af6b7cdae Squashed commit of the following:
Merged in merlin17/nuttx/mac802154-sock (pull request #479)

    wireless/ieee802154: Adds support for receiving MAC events via IOCTL through socket interface. Other small fixes and cleanup

    * ioctl: Cleans up MAC802154IOC values
    * wireless/ieee802154: Cleans up MAC802154IOC_NOTIFY_REGISTER logic in character driver
    * wireless/ieee802154/mac802154_netdev:  Adds support for MAC event notification via IOCTL
    * wireless/ieee802154/mac802154: Changes reset logic. No longer reset extended address.
    * wireless/ieee802154: Cleans up MAC802154IOC logic

        Moves MAC802154IOC from ieee802154_ioctl.h and renames ieee802154_ioctl.h to ieee802154_device.h since it only contains types relevant to the MAC char device now.

    * wireless/ieee802154/mac802154_device: Cleans up IOCTL logic for recent changes.
    * drivers/wireless/ieee802154/mrf24j40: Adds missing break in case statement
    * wireless/ieee802154/mac802154_netdev: Starts adding support for passing MAC events via IOCTL
    * wireless/ieee802154/mac802154: Fixes issue with receiver enable logic
    * wireless/ieee802154/mac802154: Fixes issue where extended address is cleared and not rewritten after radio reset
    * configs/clicker2-stm32/mrf24j40-mac: Enables RAMLOG and wireless driver logging
    * wireless/ieee802154/mac802154: Fixes poll logic meant to automatically choose address mode based on short address range.

    Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-09-15 08:04:38 -06:00
Gregory Nutt
0f04816b37 Trivial changes from review of last PR. 2017-09-14 14:55:50 -06:00
Florian Olbrich
6f57d1d472 lis3dsh.c edited to obey the nuttx coding standard. 2017-09-14 20:29:41 +00:00
Florian Olbrich
b1e625eacb Added initialization code and Kconfig entries to set up the LIS3DSH accelerometer
driver on STM32F4Discovery rev. C boards and attach the associated interrupt callback.

Added the argument parameter (FAR void *arg) to the interrupt handler provided by the LIS3DSH
driver to fit the definition for ISRs in xcpt_t.

Changed the check for working queue availability in lis3dsh interrupt handler to use work_available()
and not crash in case of an overrun.
2017-09-14 20:03:28 +02:00
Gregory Nutt
278532eb44 drivers/video/fb.c: File offset is in units of bytes, not pixels. 2017-09-14 08:43:41 -06:00
Gregory Nutt
9b2a8e8c0e Rename CONFIG_AUDIO_DEVICES to CONFIG_DRIVERS_AUDIO to conform better to the evolving configuration naming standard. 2017-09-12 14:10:15 -06:00
Gregory Nutt
831ee3bb72 Rename CONFIG_VIDEO_DEVICES to CONFIG_DRIVERS_VIDEO to conform better to the evolving configuration naming standard. 2017-09-12 14:03:51 -06:00
Gregory Nutt
107866c00e sim/configs/fb: Add a configuration for non-graphical testing of the frambuffer character driver using apps/example/fb
drivers/video/fb.c and include/nuttx/video.fb.h:  Some improvements and fixes from early testing sith the sim/fb cnofiguration.
2017-09-12 09:48:47 -06:00
Gregory Nutt
d76a541a57 Trivial, cosmetic 2017-09-11 19:22:49 -06:00
Gregory Nutt
acfa706df3 drivers/video/fb.c: Remove some logic that is not currently used. 2017-09-11 17:55:04 -06:00
Gregory Nutt
f3fc9c0d03 drivers/video/fb.c: Add support for LCD drivers that use a simulated framebuffer and must receive explicit notification when there is an update to a region in the framebuffer. 2017-09-11 16:43:12 -06:00
Gregory Nutt
bf33f1d63e Squashed commit of the following:
drivers/video/fb.c:  Framebuffer driver is code complete but as of yet untested.
    drivers/video/fb.c:  Add framebuffer character device.  This is basically only the framework for the driver; a lot of logic is still missing.
2017-09-11 16:26:18 -06:00
Gregory Nutt
7fbceacb46 Mark an untested driver as EXPERIMENTAL in its Kconfig; Update some comments. 2017-09-11 09:35:39 -06:00
Mateusz Szafoni
2ffc2ab875 Merged in raiden00/nuttx (pull request #480)
Master

* smps.c: fix error messages

* stm32f33xxx_hrtim.h: fix definition

* stm32_hrtim: fix pclk calculation

* stm32_hrtim.c: cosmetics

* smps.h: cosmetics

* add upper-half driver for high power LED driver (powerled)

* stm32f334-disco: beginning of lower half driver for high power LED (powerled)

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-09-10 17:43:20 +00:00
Gregory Nutt
334d1734dc 6LoWPAN/Radio: Rename radio property sp_pktlen to sp_framelen. Add 6LoWPAN utility to get the max frame length (not yet hooked in) 2017-09-10 10:13:33 -06:00
Gregory Nutt
e7ce9c4a79 sem_open() should return SEM_FAILED on any failures. This is change change in the POSIX specification since the original sem_open() was written so many years ago. 2017-09-08 10:14:51 -06:00
Boris Astardzhiev
b1eceb838b Extend the RTC framework with an alarm read ioctl (RTC_RD_ALARM). Through it consumer could get configuration settings about previously scheduled hardware alarms (active status, hours, minutes, seconds). 2017-09-03 08:39:02 -06:00
Mateusz Szafoni
daac3bd7f8 Merged in raiden00/nuttx (pull request #476)
Master

* stm32_dac.c: fix compilation when DMA disabled for channel

* smps.h: update some comments

* smps.c: more sanity checks

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-09-02 19:52:21 +00:00
Jussi Kivilinna
03a3aca774 drivers/bch: add poll support 2017-09-01 07:54:49 -06:00
Gregory Nutt
8e6c78f425 Fix last commit. It violates the NuttX coding standard because it is not C89 compliant. 2017-08-30 13:44:13 -06:00
Oleg Evseev
18f4dcffa8 Eliminate unused variable warning. 2017-08-30 08:46:48 -06:00
Juha Niskanen
fa5a2035ff drivers: analog: adc: add poll support 2017-08-28 07:05:33 -06:00
Mateusz Szafoni
ea35f31f73 Merged in raiden00/nuttx (pull request #469)
Master

* stm32f0/Kconfig: remove references to HRTIM

* STM32F33: missing SYSCFG CFGR3 definitions

* stm32_hrtim.h: remove redundant definitions

* stm32_hrtim.c: fix DAC triggers configuration

* stm32_hritm.c: warning message when default value selected

* stm32_hrtim.c: missing master timer logic

* stm32_hrtim.c: add more assertions

* stm32_dac.c: fix conditional

* stm32_dac.c: conditional logic for timer triggering

* stm32_dac.c: fix TSEL configuration when HRTIM

* stm32_dac.c: unnecessary condition

* stm32_dac.c: DMA request remapping

* stm32_dac.c: fix commpilation errors

* stm32_dac.c: add DMA buffers initialization logic

* stm32_hrtim.c: enable DAC triggering

* analog/comp.c: fix compilation errors when poll disabled

* stm32_hrtim.c: remove doubled assertions

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-08-27 12:49:53 +00:00
Gregory Nutt
88a87f8e3f 6LoWPAN: The original, Contiki-based design used only a single buffer for reassemblying larger packets. This could be a problem issue for hub configurations which really need the capability concurrently reassemble multiple incoming streams concurrently. These was also a design issue in that the reassembly buffer could be corrupted by outgoing packets. The design was extended to support multiple reassembly buffers, each associated with the reassembly tag and source address. This assures that there can be be no corruption of the reassembly once it has started. 2017-08-26 10:00:47 -06:00
Juha Niskanen
cc1f7a63fa power: add driver for TI bq2429x battery charger. TODO: Untested. Does not have poll() support. 2017-08-25 07:26:00 -06:00
Gregory Nutt
e341c74f06 drivers/audio: Fix naming of configurations to be compliant for vs1053 audio driver. One file was not saved before last commit. 2017-08-24 11:12:10 -06:00
Gregory Nutt
53ef64aae6 drivers/audio: Fix naming of configurations to be compliant for vs1053 audio driver. 2017-08-24 11:11:06 -06:00
Gregory Nutt
5129aeefd5 drivers/sensors: Fix remaining naming of configurations to be compliant for two more drivers. 2017-08-24 10:48:20 -06:00
Gregory Nutt
dc8f3778a9 drivers/sensors: Fix more naming of configurations to be compliant for two more drivers. Still a few more to go. 2017-08-24 10:26:53 -06:00
Gregory Nutt
1f023fa31a drivers/sensors: Fix more naming of configurations to be compliant for two more drivers. Still a few more to go. 2017-08-24 10:10:00 -06:00
Gregory Nutt
269107afc8 drivers/sensors: Make naming configuration compliant for two more drivers. Still several to go. 2017-08-24 09:54:23 -06:00
Gregory Nutt
7f4af7b690 drivrs/sensors: Make a few other configuration settings consistent with the (undocumented) standard. 2017-08-24 09:45:46 -06:00
Gregory Nutt
5dd25bbfde Missed two naming changes in last commit 2017-08-24 09:32:24 -06:00
Gregory Nutt
9e386e3b31 drivrs/sensors/hts221: Fix inconsistent configuration variable naming; Try to bring closer to an as-of-yet undocumented naming convention. 2017-08-24 09:22:36 -06:00
Anthony Merlino
fbf830aef2 drivers/wireless/spirit: Fixes a pre-processor directive 2017-08-22 21:15:22 -04:00
Jussi Kivilinna
a099506b1b drivers/lcd: ssd1306: separate lcd_dev_s setup to separate object. g_oleddev takes 1 KiB because framebuffer and was allocated to .data section because of lcd_dev_s function pointer setup. Move lcd_dev_s setup out, so that g_oleddev goes to .bss and avoid wasting ROM. 2017-08-22 08:46:00 -06:00
ussi Kivilinna
89cc4741ac drivers/lcd: ssd1306: fix memory corruption caused by ssd1306_getrun(). ssd1306_getrun was writing one extra byte (with value 0) past target buffer when pixlen is multiple of 8. When pixlen was not multiple of 8, last byte of buffer was fully cleared, instead of modifying only the (pixlen % 8) bits of last byte. 2017-08-22 08:42:40 -06:00
Jussi Kivilinna
3dfeb9e59f drivers/lcd: ssd1306: add support for board power control. ThingseeOne has regulator for controlling display power on/off. Patch adds support for board based power control to SSD1306 driver. 2017-08-22 08:40:27 -06:00
Jussi Kivilinna
310a29227a drivers/lcd: add DD-12864WO-4A/SSD1309 support to SSD1306 driver 2017-08-22 08:32:52 -06:00
Pekka Ervasti
cc0fea60ad drivers: analog: comp: add poll support 2017-08-22 06:26:57 -06:00