Commit Graph

2825 Commits

Author SHA1 Message Date
Mateusz Szafoni
8416d9a966 Merged in raiden00/nuttx (pull request #668)
Master

* libdsp: initial commit

* libdsp: cosmetics

* stm32f334-disco/buckboost: use a PID controller from libdsp

* stm32_adc.h: fix typo

* stm32_dac.c: set OUTEN bit for DAC1CH2 and DAC2CH1

* stm32_hrtim: cosmetic changes

* power/motor: direction parameter is now int8 + add overload fault

* libdsp: all floats with f-sufix

    libdsp: add precision option for library

    libdsp: add debug option for library and assertions in functions

    libdsp: add current samples correction for SVM3

    libds: add some motor control specific functions

    libdsp: add basic speed observer

    libdsp: fix phase shift in SMO observer

    libdsp: add more logic to FOC

    config/sim/dsptest: add dsptest configuration

* libdsp/lib_motor.c: remove unused comparation

* libdsp/lib_observer.c: update some comments

Approved-by: GregoryN <gnutt@nuttx.org>
2018-07-07 17:04:57 +00:00
Gregory Nutt
22cd0d47fa This commit attempts remove some long standard confusion in naming and some actual problems that result from the naming confusion. The basic problem is the standard MTU does not include the size of the Ethernet header. For clarity, I changed the naming of most things called MTU to PKTSIZE. For example, CONFIG_NET_ETH_MTU is now CONFIG_NET_ETH_PKTSIZE.
This makes the user interface a little hostile.  People thing of an MTU of 1500 bytes, but the corresponding packet is really 1514 bytes (including the 14 byte Ethernet header).  A more friendly solution would configure the MTU (as before), but then derive the packet buffer size by adding the MAC header length.  Instead, we define the packet buffer size then derive the MTU.

The MTU is not common currency in networking.  On the wire, the only real issue is the MSS which is derived from MTU by subtracting the IP header and TCP header sizes (for the case of TCP).  Now it is derived for the PKTSIZE by subtracting the IP header, the TCP header, and the MAC header sizes.  So we should be all good and without the recurring 14 byte error in MTU's and MSS's.

Squashed commit of the following:

    Trivial update to fix some spacing issues.
    net/: Rename several macros containing _MTU to _PKTSIZE.
    net/: Rename CONFIG_NET_SLIP_MTU to CONFIG_NET_SLIP_PKTSIZE and similarly for CONFIG_NET_TUN_MTU.  These are not the MTU which does not include the size of the link layer header.  These are the full size of the packet buffer memory (minus any GUARD bytes).
    net/: Rename CONFIG_NET_6LOWPAN_MTU to CONFIG_NET_6LOWPAN_PKTSIZE and similarly for CONFIG_NET_TUN_MTU.  These are not the MTU which does not include the size of the link layer header.  These are the full size of the packet buffer memory (minus any GUARD bytes).
    net/: Rename CONFIG_NET_ETH_MTU to CONFIG_NET_ETH_PKTSIZE.  This is not the MTU which does not include the size of the link layer header.  This is the full size of the packet buffer memory (minus any GUARD bytes).
    net/: Rename the file d_mtu in the network driver structure to d_pktsize.  That value saved there is not the MTU.  The packetsize is the memory large enough to hold the maximum packet PLUS the size of the link layer header.  The MTU does not include the link layer header.
2018-07-04 14:10:40 -06:00
Gregory Nutt
daa3fcc781 include/nuttx/spi/spi.h: Add a definition for a USBHOST SPI device. drivers/usbhost/usbhost_max3421e.c: Review and correct SPI locking usage. 2018-07-04 08:55:43 -06:00
Gregory Nutt
75f7663427 This commit adds support for the Maxim M3421E USB host driver.
Squashed commit of the following:

    drivers/usbhost/usbhost_max3421e.c:  Add USB tracing support.  Fix compilation errors when assertions and debug is enabled.
    drivers/usbhost/usbhost_max3421e.c:  Fixes to get a clean compilation.
    drivers/usbhost/usbhost_max3421e.c:  Drivers is basically code complete.
    drivers/usbhost/usbhost_max3421e.c:  Missed a little bit of logic in the last commit.
    drivers/usbhost/usbhost_max3421e.c:  Completes implementatin of control transfers.
    drivers/usbhost/usbhost_max3421e.c:  Implements low-level part of packet receive.
    drivers/usbhost/usbhost_max3421e.c:  Reorder some functions add a little more transfer-related logic.
    drivers/usbhost/usbhost_max3421e.c:  Completes basic logic path for sending normal packets.
    drivers/usbhost/usbhost_max3421e.c:  Correct handling of SNDFIFO double buffering.
    drivers/usbhost/usbhost_max3421e.c:  Not necessary to set the ACKSTAT bit in host mode.  Clean up some comments.
    drivers/usbhost/usbhost_max3421e.c:  Mostly cosmetic cleanup
    drivers/usbhost/usbhost_max3421e.c:  Revise some previous logic.  Looks like the MAX3421E can handle 16 channels in host mode.  A little bit of work on packet transfer logic.
    Copy paste error fix
    drivers/usbhost/usbhost_max3421e.c:  Add some channel allocation logic.
    drivers/usbhost/usbhost_max3421e.c:  Add some initialization logic.
    drivers/usbhost/usbhost_max3421e.c:  Add logic to determine if a full or low speed device has been connected.
    drivers/usbhost/usbhost_max3421e.c:  Add interrupt handling and bus reset logic.
    drivers/usbhost/usbhost_max3421e.c:  Add framework for an MAX3421E host driver.  Initial commit is just the STM32 OTGFS host driver with a few new SPI-related functions.
2018-07-03 18:49:51 -06:00
Gregory Nutt
3e9ba72441 net/sixlowpan: Fix typo uint16->uint16_t. Also picks up some cosmetic USB host changes. 2018-07-01 10:05:15 -06:00
Gregory Nutt
7dec38b18f drivers/Kconfig: Global configuration variable CONFIG_FB_TRANSPARENCY is only defined in architecture-specific Kconfig files and then multiple times. Add the single global definition in drivers/Kconfig. arch/arm/src/stm32, stm32f7, and same5: Rename the architecture-specific variables appropriately. Selecting the architecture-specific version will also select the global version. 2018-06-28 12:31:51 -06:00
Gregory Nutt
ba53219821 drivers/Kconfig: Global configuration variable CONFIG_FB_CMAP is only defined in architecture-specific Kconfig files and then multiple times. Add the single global definition in drivers/Kconfig. arch/arm/src/stm32 and stm32f7: Rename the architecture-specific variables appropriately. Selecting the architecture-specific version will also select the global version. 2018-06-28 12:01:55 -06:00
Gregory Nutt
a0e169ad7b net/: Fix a sixlowpan typo bug recently introduced; Rename g_ipv6_allzeroaddre with the more meaning g_ipv6_unspecaddr since the all-zero address is the IPv6 unspecified address (sometime IN6_ADDR_ANY). Remove more inline tests for IPv6 multicast with tcommint net_is_addr_mcast() macro. Update some comments. 2018-06-23 12:53:27 -06:00
Gregory Nutt
cb374e6e62 arch/: Clean up some naming and spacing. 2018-06-20 15:38:06 -06:00
Gregory Nutt
01b740c66b arch/arm/src/efm32: Support for common vector handling is forced for all EFM32 chips. Yes the architecture provides support for the old-style dedicated vector handling which can never be compiled. Furthermore, the old-style dedicated vector handling is deprecated in favor of common vector handling. The commit resolves this inconsistency be removing support for the dedicated vector handling from the EFM32 architecture support. 2018-06-19 13:37:00 -06:00
Gregory Nutt
691676ac6b Eliminate some new warnings found in build testing. 2018-06-17 15:26:18 -06:00
Alan Carvalho de Assis
5fb988bdc8 ~configs/xmc4500-relax: Add support to MAX6675 on XMC4500-Relax board. drivers/sensors/max6675.c: Increases SPI frequency from 400Khz to 4MHz. 2018-06-16 13:48:19 -06:00
Gregory Nutt
8fdbb1e0a4 Elimate use of the non-standard type systime_t and replace it the equivalent, standard type clock_t
Squashed commit of the following:

    sched:  Rename all use of system_t to clock_t.
    syscall:  Rename all use of system_t to clock_t.
    net:  Rename all use of system_t to clock_t.
    libs:  Rename all use of system_t to clock_t.
    fs:  Rename all use of system_t to clock_t.
    drivers:  Rename all use of system_t to clock_t.
    arch:  Rename all use of system_t to clock_t.
    include:  Remove definition of systime_t; rename all use of system_t to clock_t.
2018-06-16 12:16:13 -06:00
Juha Niskanen
5b899b76c4 drivers/sensors: Add support for Telair T6713 carbon dioxide sensor 2018-06-15 06:52:16 -06:00
Anthony Merlino
2f921fbe8e Merged in antmerlino/nuttx/xbee-timeout-fix (pull request #656)
drivers/xbee: Fixes issue with timeouts.  Timeouts were in ticks but should have been in ms.  This caused false triggers of timeout causing redundant packets, etc.

Approved-by: GregoryN <gnutt@nuttx.org>
2018-06-13 03:21:45 +00:00
Juha Niskanen
083c1ae639 drivers/audio: Fix some DEBUGASSERTs and compile failures. 2018-06-11 07:00:27 -06:00
Gregory Nutt
a94e3284b3 syslog: Enable is partial, crippled version of syslog_flush(); arch/: Call syslog_flush() from assertion handling logic. 2018-06-07 16:29:16 -06:00
Masayuki Ishikawa
fb07bd7e27 Adds loopback test for digital MIC on lc823450 via i2schar driver.
Squashed commit of:

  configs/lc823450-xgevk: Enable DMDIN0 (Digital MIC)
  I2S: Add ioctl interface to i2s_ops_s and i2schar driver
  arch/arm/src/lc823450: Add DGMIC in lc823450_i2s.c
  configs/lc823450-xgevk: Add i2schar driver to lc823450_wm8776.c
  configs/lc824350-xgevk: Enable AUDIO_I2SCHAR in audio/defconfig
  configs/lc823450-xgevk: Update README.txt
2018-06-05 10:34:22 -06:00
Gregory Nutt
c74e9fd6da Update a readme and some comments. 2018-05-27 15:13:54 -06:00
Gregory Nutt
f3392e0a6c drivers/serial: Add a timeout to uart_tcdrain(). Even if tcflush() is used to discard buffered data, the close() can still hang if (a) hardware flow control is enabled, (b) CTS == 1, and (c) there is data stuck in the hardware Tx FIFO. tcflush() does not currently clear the MCU serial drivers' hardware Tx FIFOs. This is a workaround for that. 2018-05-27 11:39:34 -06:00
Gregory Nutt
548cd2892a arch/arm/src/imxrt and configs/imxrt1050-evk: Add PHY access support needed to support the network monitor. Cannot enable it yet... I am getting hardfaults when I enable the PHY interrupt. 2018-05-25 13:02:41 -06:00
Gregory Nutt
9da3d4a2a9 drivers/lcd and configs/olimex-lpc1766stk: Remove support for the Nokia6100 LCD. That LCD uses a 9-bit SPI interface (the 9th bit being the command/data bit that is normally a discrete). That communication was never successfully integrated. I now believe that it would would require some special support from the low-level, MCU SPI driver to manage that 9th bit. The deleted code is still available in the Obsoleted repository in the nuttx/drivers/lcd, nuttx/configs/olimex-lpc1766stk, and Patches directories. 2018-05-19 16:46:21 -06:00
Gregory Nutt
af8b1abf73 Merged fboverlay into master 2018-05-17 16:11:09 -06:00
Gregory Nutt
3a34b29f76 arch/arm/src/imxrt/chip: Add pin multiplexing header files. 2018-05-14 13:29:53 -06:00
Anthony Merlino
addf7f1a4c Merged in antmerlino/nuttx/multichan_rgbled_fix (pull request #641)
rgbled: Fixes led issues caused by uninitialized memory with CONFIG_RGBLED_MULTICHAN.

The uninitialized pwm_info_s struct caused a rogue channel to be started causing errros in the pwm driver

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-05-14 17:57:03 +00:00
Michał Łyszczek
249d7e0d84 drivers/mtd/mtd_config.c: mtdconfig_register() returned OK intead of -ENOMEM on failed malloc 2018-05-08 06:48:00 -06:00
Gregory Nutt
ec7c4020f9 drivers/leds/rgbled.c: Fix a compilation error introduced with a recent change to add multi-channel operation to RGB LED driver. 2018-05-05 12:26:45 -06:00
Gregory Nutt
96b6bf92a3 Cosmetic changes from review of last 2 PRs. 2018-05-02 16:46:12 -06:00
Anthony Merlino
b1275abd4b Merged in antmerlino/nuttx/ina3221 (pull request #636)
drivers/sensors: Adds support for INA3221 power sensor. This has a 3 channel bus/shunt voltage pairs.

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-05-02 22:29:59 +00:00
Gregory Nutt
cd12ea7788 Costmetic changes from review of last PR. 2018-05-02 16:29:22 -06:00
Anthony Merlino
385d4a9108 Merged in antmerlino/nuttx/rgb_multichan (pull request #635)
drivers/rgbled: Adds support for multichannel PWM (multiple PWM channels on a single timer)

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-05-02 22:21:49 +00:00
Michael Jung
121211f096 progmem interface: Discern r/w and erase page sizes. Introduce new up_progmem_erasesize architecture API to be able to communicate the read/write page size independently from erase page size. Implement up_progmem_erasesize for all architectures that already support progmem, assuming that for those architectures the sizes of both read/write and erase pages are identical. 2018-05-01 06:23:52 -06:00
Gregory Nutt
fd844f8eac include/nuttx/wireless/bluetooth: Move Bluetooth header files from include/nuttx/wireless to include/nuttx/wireless/bluetooth for symmetry with other wireless technologies. 2018-04-29 12:43:09 -06:00
hhuysqt
144e335b85 drivers/wiresless/ieee80211: Correct some initialization problems with BCM43362 chip. Adds BCM43428 support. arch/arm/src: Add support for SDIO card to SDIO driver.
Squashed commit of the following:

Author: Gregory Nutt <gnutt@nuttx.org>
    include/nuttx/wireless/ieee80211:  Cosmetic, coding standard changes from review of last merge.
    drivers/wireless/ieee80211:  Cosmetic, coding standard changes from review of last merge.
    configs/photon:  Cosmetic, coding standard changes from review of last merge.
    arch/arm/src/stm32:  SDIO changes from last review:  Fix a few long lines and other coding standard issues; Make additions for SDIO card support dependent on a configuration option.

Author: hhuysqt <hyq9606@126.com>
    Return IEEE 802.11 MAC address just as ethernet does
    Modifyed bcmf_board_setup_oob_irq declaration
    Modified OOB ISR function types
    Add some logic according to WICED SDK
    Bug fixed: data_offset counts in 4-bytes
    Add BCM43438 logic for future developement
    Add tips on using telnet
    Use SDIO in-band interrupt instead of OOB interrupt, because Photon seems to unconnect the OOB interrupt line...
    add SDIO in-band interrupt logic
2018-04-26 08:10:23 -06:00
Juha Niskanen
3cf830bd67 Merged in juniskane/nuttx_stm32l4/1wire_sht21_changes_pr (pull request #631)
drivers/1wire: add PM hooks and unlink support to sht21 sensor (allowing hot-swappable I2C bus from 1-wire converter)

* drivers/1wire: add PM hook to 1wire bus

* drivers/1wire/ds28e17.c: i2c instance must be zeroed

* drivers/sht21: add unlink support

    Unlike most other unlink implementations in NuttX drivers, this one
    does not allow any I2C operations after unlink, making it possible to
    deallocate the I2C bus.

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-04-24 13:21:02 +00:00
Michał Łyszczek
8de51543a4 Fix a few compilation errors. 2018-04-20 15:55:16 -06:00
Gregory Nutt
fec79394f3 Some trivial, cosmetic changes from review of last PR. 2018-04-20 06:57:00 -06:00
Masayuki Ishikawa
b29e7a37b2 Merged in masayuki2009/nuttx.nuttx/network_bridge (pull request #630)
drivers/net: Add TAP (network bridge) mode to tun.c

In previous implementation, TAP mode did not handle a packet
correctly. Also, the driver did not set the link layer type and
could not assign the interface name. This PR changes fix such
issues and supports TAP mode correctly.

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

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-04-20 12:52:49 +00:00
Gregory Nutt
9b83737821 drivers/wireless/bluetooth: Partition bt_uart.c adding bt_uart.h and bt_uart_generic.c. This will now permit adding HCI UART drivers that have custom initialization requirements.. such as parts the need to download a configuration file to the HCI UART before they are usable. 2018-04-19 17:48:04 -06:00
Anthony Merlino
7061d02f0f Merged in antmerlino/nuttx/xbee_timeout (pull request #629)
Xbee: Adds a timeout to send logic to handle case where XBee module fails to respond to a Transmit request with a Transmit Status

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-04-19 04:08:13 +00:00
Gregory Nutt
8ab2eb55d6 drivers/wireless: Add option to dump I/O buffers. Fix calculation of response length. 2018-04-18 12:46:47 -06:00
Gregory Nutt
1224db454b arch/arm/src/stm32 and drivers/wireless/bluetooth: Fix some buffer management errors in HCI UART upper and lower halves. 2018-04-18 08:17:15 -06:00
Gregory Nutt
27f624d881 drivers/wireless/bluetooth: Default BAUD must be 115200, Fix logic in Rx callback, Rx callback must execute on work queue. Now sends and receives one command and response. But hangs on the next. 2018-04-17 13:07:28 -06:00
Gregory Nutt
0271a6a5e9 drivers/wireless/bluetooth: Fix error in testing if interrupts enabled. 2018-04-17 07:13:03 -06:00
Gregory Nutt
5d2c226675 wireless/bluetooth and drivers/wireless/bluetooth: Simply the driver registration/initialization interface. 2018-04-14 11:33:29 -06:00
Gregory Nutt
fa287e8863 Various fixes/changes from intial testing of the HCI UART on the STM32F4-Discovery board. Re-organized how the Blutetooth network driver is initialized. Added lots of new debug output. Add a new STM32 F4 Discovery configuration for testing the HCI UART. Various fixes to get through initialization (still does not). 2018-04-14 09:23:08 -06:00
Gregory Nutt
d25549ac54 This commit adds a Bluetooth HCI UART lower half driver for the STM32
Squashed commit of the following:

    arch/arm/src/stm32:  Add Kconfig options needed by the HCI UART.  Various fixes to finally get a clean error free compile with no unexpected warnings.
    arch/arm/src/stm32:  In HCI UART, use spin_lock_irqsave() instead of enter_critical_section() whenever possible.
    arch/arm/src/stm32:  In HCI UART, fix up naming of configurations so that they are unique.  Still needs Kconfig settings.  Modify logic so that there can be multiple HCI UARTs, some supporting DMA and some not.
    arch/arm/src/stm32:  Integrate watermarks and software Rx flow control into the HCI UART driver.
    arch/arm/src/stm32:  Eliminate some HCI UART UART configuration options.  Per the HCI UART spec, the link will b 8 data bits, no parity, 1 stop bit... Always.
    arch/arm/src/stm32:  Trivial cleanup
    arch/arm/src/stm32:  Fixes most initial compilation issues STM32 HCI UART driver.  Still need to set up USART configuration parmeters for HCI UART
    arch/arm/src/stm32:  Completes first cut at STM32 HCI UART driver.
    arch/arm/src/stm32:  Completes most of read logic for HCI UART.  Still needs to be able to block if no read data is available.  Still missing write and flush logic.
    drivers/wireless:    Remove txenable from HCI UART methods.  arch/arm/src/stm32:  Reorganize some structures in HCI UART.
    arch/arm/src/stm32:  Still messaging the HCI uart driver.
    arch/arm/src/stm32:  Some trivial renaming.
    arch/arm/src/stm32:  A little more HCI-UART logic.
    arch/arm/src/stm32:  Initial setup to support HCI-UART.  Little more than the serial driver with some name changes and a few things removed.
2018-04-13 10:36:23 -06:00
Alan Carvalho de Assis
2dfea90198 drivers/sensors/apds9960.c: Fix APDS9960 work queue BUG found by Kyle Lei 2018-04-10 06:53:11 -06:00
Tiago Almeida
a482867c00 drivers/sensors/max31855: Add multiple max31855 sensors feature and support for bambino-200e and stm32f4discovery 2018-04-09 15:36:27 -06:00
Mateusz Szafoni
195c210535 Merged in raiden00/nuttx (pull request #626)
add generic upper-half motor driver

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-04-09 12:59:28 +00:00