To be compatible with the previous method, add a buf between cdcacm
and serial. Because when using usbreqbuf directly as the buf of serial,
the amount of data sent may be insufficient due to the limit of the
number of reqs. For example, when the number of reqs is 4, the number
of data send through cdcacm is 5, and each data is a separate USB
packet, if the host does not read in time, resulting in blocking send.
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
To be compatible with the previous method, add a buf between cdcacm
and serial. Because when using usbreqbuf directly as the buf of serial,
the amount of data received may be insufficient due to the limit of the
number of reqs. For example, when the number of reqs is 4, the number
of data received through cdcacm is 5, and each data is a separate USB
packet, which should require 5 reqs, resulting in the last number not
being received. If the application always waits for 5 numbers before
performing an operation, this will cause problems.
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
Adds a device ID to ramtron_initialize, which is stored in the ramtron_dev_s structure.
This ID is used when calling SPI_SELECT to board specific logic to allow chip select on the SPI bus.
This change is NOT backwards compatible, as it changes the function signature of ramtron_initialize.
This implementation is based on the handling of chip select in nuttx/drivers/mtd/sst26.c:sst26_initialize_spi().
Additional Changes:
- Add MB85RS64V to ramtron supported parts list.
Using the FTL driver over a MTD flash device, when writing to flash, eventually the ftl_flush function is called and it does an erase (MTD_ERASE) and then the write (MTD_BWRITE). Currently, the at45db driver (at45db.c), uses a write command 0x82 ("Main Memory Page Program through Buffer 1 with Built-In Erase") that also performs a built-in erase before the write. In summary, each time a write to flash is performed, the page is erased twice before it is written, first in the FTL driver and then in the MTD driver.
This PR is to change the page writes to not use that built-in command.
Signed-off-by: Javier Casas <javiercasas@geotab.com>
This patch adds initial support for the Texas Instruments ADS1115 ADC.
Please read the documentation for more details.
Signed-off-by: Tony Lin <99093620+justapotato213@users.noreply.github.com>
In cdcacm, USB req buf is directly used as serial buf, so the getting
buf status operation in ioctl is different from the original serial.
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
Add a function `fakesensor_read_baro` that allows barometric data to be
read and published by fakesensor
Signed-off-by: Angus Jull <angusjull1@gmail.com>
Replace get current tcb method from nxsched_get_tcb(nxsched_gettid()) to this_task(),
change two function calls with inline function to improve performance:
FAR struct tcb_s *tcb = nxsched_get_tcb(nxsched_gettid());
FAR struct tcb_s *tcb = this_task();
Signed-off-by: chao an <anchao.archer@bytedance.com>
examples:
There are two threads involved: thread A with a priority of 100 and
thread B with a priority of 101. Here's how they interact:
When thread A releases a semaphore, thread B is scheduled to execute
some code and may reacquire the semaphore. If no other tasks are ready,
thread A will be scheduled to run.
This continuous process can lead to a busy loop.
Thread A: Thread B:
while (nxsem_get_value(&priv->wait, &semcount) >= 0 && <---
semcount <= 0) | 2)context switch
{ 1)contex switch |
nxsem_post(&priv->wait); -------------> run some code and nxsem_wait again
}
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
Fix cooling state not decreasing error when the temperature is kept at low trip(stable, not dropping).
Test on "sim:thermal", log is from /proc/thermal/cpu-thermal and see thermal/thermal_dummy.c for trip point details.
e.g. The temperature decreasing from 71 to 65 and then kept.
z:cpu-thermal t:71 t:1 h:16 l:0 c:fan0 s:16|16
a. Without this patch, the cooling state of "fan0" will be kept at 15, even if the temperature is at a lower trip:
z:cpu-thermal t:65 t:1 h:16 l:0 c:fan0 s:15|15
... ...
z:cpu-thermal t:65 t:1 h:16 l:0 c:fan0 s:15|15
b. With this patch, the cooling state of "fan0" was continually decreasing to zero according to current trip point:
z:cpu-thermal t:65 t:1 h:16 l:0 c:fan0 s:15|15
... ...
z:cpu-thermal t:65 t:1 h:16 l:0 c:fan0 s:0|0
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Use the CDCACM as a SYSLOG output device, send message to remote proc.
If there are more than one CDCACM devices, then a device minor number
may also need to be provided. Default: 0
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
radio transceivers. This initial support includes transmit and receive
functionality and configuration and reading of radio parameters like
frequency and bandwidth.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Data form serial framework will be written to usb reqbuf directly,
and data form cdcacm will be read form reqbuf directly.
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
In the USB interface descriptor of the cdcacm device, class:2 (CDC)
subclass:2 (ACM) protocol:0 (NONE) may appear. At this time, the
usb host does not match the correct protocol byte, which will cause
the device identification to fail.
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
It is now possible to configure SPI delays for st7789 controller if
CONFIG_SPI_DELAY_CONTROL is set. Default values for SPI peripheral
may be too long or too short, therefore the display controller set
its own values as required. The default values in configuration
are taken from the reference manual, but it is possible they may
require tuning for different revisions or temperatures for
example.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
The alloctab can be looped, if the first check the corresponding
bit is set, it will not continue to loop
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
misc/rpmsgblk_server.c:135:16: warning: format '%d' expects argument of type 'int', but argument 3 has type 'int32_t' {aka 'long int'} [-Wformat=]
135 | ferr("block device open failed, ret=%d\n", msg->header.result);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
| |
| int32_t {aka long int}
misc/rpmsgblk_server.c:135:48: note: format string is defined here
135 | ferr("block device open failed, ret=%d\n", msg->header.result);
| ~^
| |
| int
| %ld
misc/rpmsgblk_server.c: In function 'rpmsgblk_close_handler':
misc/rpmsgblk_server.c:170:16: warning: format '%d' expects argument of type 'int', but argument 3 has type 'int32_t' {aka 'long int'} [-Wformat=]
170 | ferr("block device close failed, ret=%d\n", msg->header.result);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
| |
| int32_t {aka long int}
misc/rpmsgblk_server.c:170:49: note: format string is defined here
170 | ferr("block device close failed, ret=%d\n", msg->header.result);
| ~^
| |
| int
| %ld
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
Use PRIu32 instead of %d/%u for uint32_t to avoid build warnings on different architectures.
Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
[Experimental]
This adds a driver for the SX126x (SX1261 and SX1262) LoRa chips.
All functions and definitions are coming directly from the DS SX1261-2 V2.1 datasheet.
Signed-off-by: Kevin Witteveen (MartiniMarter) <kevinwit1999@gmail.com>
If st7789_wrram is called with count = 1, then the entire buffer should
be sent. However, in 3 wire mode, the driver has to send the buffer
row by row because of additional data flag. The number of rows (count)
can't be ST7789_YRES in this case, but only the number of rows in
the buffer (this is write size / row size , where row size is
ST7789_XRES * ST7789_BYTESPP). This also applies only if we want to
write size larger than row size, because st7789_putrun allows to
write just a part of a row.
This fixes the incorrect behavior of the display in 3 wire mode if
the display is split into more buffer writes (as in LCD driver for
example, FB driver did not face this issue).
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
Co-authored-by: Martin Krasula <krasula@atlas.cz>
This is required to meet the communication requirements as per the
LSM6DSO32 datasheet. It doesn't cause issues on some MCUs (RP2040), but
prevents successful reads on others (STM32).
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
If SPI dependency is not set, the following warning will be generated during compilation:
[109/1450] Building C object drivers/CMakeFiles/drivers.dir/rpmsg/rpmsg_port_spi.c.o
/data/code/nuttxspace/nuttx/drivers/rpmsg/rpmsg_port_spi.c: In function ‘rpmsg_port_spi_exchange’:
/data/code/nuttxspace/nuttx/drivers/rpmsg/rpmsg_port_spi.c:233:3: warning: implicit declaration of function ‘SPI_EXCHANGE’ [-Wimplicit-function-declaration]
233 | SPI_EXCHANGE(rpspi->spi, txhdr, rpspi->rxhdr,
| ^~~~~~~~~~~~
[1450/1450] Pac SIM with dynamic libs in nuttx.tgz
Signed-off-by: lijing.ly <lijing.ly@bytedance.com>
Spliting `THERMAL_NORMAL` to `THERMAL_ACTIVE` and `THERMAL_PASSIVE`,
to support different update intervals for thermal zone.
Active/Passive from [kernel.org](https://www.kernel.org/doc/Documentation/devicetree/bindings/thermal/thermal.txt):
* Cooling device nodes
Cooling devices are nodes providing control on power dissipation. There
are essentially two ways to provide control on power dissipation. First
is by means of regulating device performance, which is known as passive
cooling. A typical passive cooling is a CPU that has dynamic voltage and
frequency scaling (DVFS), and uses lower frequencies as cooling states.
Second is by means of activating devices in order to remove
the dissipated heat, which is known as active cooling, e.g. regulating
fan speeds. In both cases, cooling devices shall have a way to determine
the state of cooling in which the device is.
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit add support to the serial_icounter_s struct used with
TIOCGICOUNT to report U[S]ART errors such as frame, parity, overrun,
etc.
Signed-off-by: Alan C. Assis <acassis@gmail.com>
The valid addresses should be 0x6a and 0x6b, not 0x6c. Now the device
can be registered with the correct addresses without failing the
assertion.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Function w25qxxxjv_erase wasn't correctly handling an error in
w25qxxxjv_erase_sector call and was returning success even on failure.
Moreover this change does not immediately return EBUSY but waits for
the previous operation to finish. If the timeout is significant (more
than erase time of the entire flash), then it returns EBUSY.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
Adds support for the LSM6DSO32 IMU by STM using the uORB framework. This
only contains limited support for the I2C interface, interrupt and
polling driven measurement and standard modes of operation (high
performance ODRs). Features like interrupts besides DRDY, filtering,
gesture recognition and acting as a bus master are not implemented.
For clearing some variables corresponding with the pollfds of the felip in can_close API, we modify poll logic by binding can_reader_s and pollfd.
Signed-off-by: zhaohaiyang1 <zhaohaiyang1@xiaomi.com>
search the device tree and register cfi flash
test flowchart:
mount -t littlefs -o autoformat /dev/cfi-flash1 /data
fstest -m /data
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
Realization of cfi-flash driver.
Add the interfaces of intel and amd command sets.
Signed-off-by: zhengyu9 <zhengyu9@xiaomi.com>
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
fix build break:
ld: drivers/libdrivers.a(rptun_ivshmem.c.obj): in function `rptun_ivshmem_get_resource':
nuttx/drivers/rptun/rptun_ivshmem.c:215:(.text.rptun_ivshmem_get_resource+0xfc): undefined reference to `simple_addrenv_initialize'
ld: openamp/libmetal/lib/libmetal.a(io.c.obj): in function `metal_io_phys_to_offset_':
nuttx/openamp/libmetal/lib/system/nuttx/io.c:112:(.text.metal_io_phys_to_offset_+0xc): undefined reference to `up_addrenv_pa_to_va'
Signed-off-by: chao an <anchao.archer@bytedance.com>
There was a missing QSPI locking for w25qxxxjv_get_die_from_addr
function. We can't have the lock directly in w25qxxxjv_get_die_from_addr
because the function is called from already locked function
w25qxxxjv_erase_sector.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>