Commit Graph

432 Commits

Author SHA1 Message Date
lipengfei28 b18262d78f bits:rename __set_bit to set_bit __clear_bit to clear_bit
This used for add pci ep drver framework

Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-23 10:03:54 +02:00
liaoao d8d7f3c38e bits.h: replace all inline defination of __set_bit/__clear_bit
Signed-off-by: liaoao <liaoao@xiaomi.com>
2024-09-13 09:09:19 +08:00
Petro Karashchenko 1528b8dcca nuttx: resolve various 'FAR' and 'CODE' issues
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-08-26 10:21:03 +08:00
Petro Karashchenko d499ac9d58 nuttx: fix multiple 'FAR', 'CODE' and style issues
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-08-25 19:22:15 +08:00
Huang Qi e09a79ece9 driver/ssd1680: Add support for 1.54 inch e-paper display
Add configuration and driver support for the SSD1681 1.54 inch e-paper display,
including the necessary waveforms and settings for proper operation. This extends
the existing SSD1680 e-paper driver to accommodate the new display module.

The changes involve updates to the Kconfig file for additional configuration options,
modifications to the driver implementation in ssd1680.c to include SSD1681 specific
logic, and updates to the header file ssd1680.h to reflect the added support.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-08-04 23:14:55 +08:00
jianglianfang f4c8a17837 sim_lcd: add open & close
The opening and closing of the window has been associated with the opening and closing of fb, but the LCD has not yet been optimized. The window will only open when sim_x11openwindow is called, and similarly, the window will only close when sim_x11closewindow is called.

Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2023-12-18 09:06:29 -08:00
Xiang Xiao eddd90de78 poll: pollsetup should notify only one fd passd by caller
since it's redundant to iterate the whole fds array in setup

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-11-21 09:07:17 +01:00
rongyichang 52d516ab46 drivers/lcd: change lcd stride from pixel to bytes
In order to achieve better scalability, change the stride
from pixel mode to byte mode.For example, in the case of RGB888
mode with 466 pixels in width and a 4-byte aligned buffer,it is
only necessary to extend the buffer of one line from 1398 bytes
to 1400 bytes, instead of extending it to 1404 bytes.

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-11-14 07:30:29 -08:00
rongyichang bc43c419f2 drivers/lcd: add stride support for LCD driver
support LCD stride for GET_AREA and PUT_AREA operation

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-11-09 09:52:00 +08:00
raiden00pl 5b87fdfb9d Documentation: remove all migrated READMEs 2023-10-29 21:03:54 -03:00
hujun5 061be5f18e refine: move BIT Macro to nuttx/bits.h
The BIT macro is widely used in NuttX,
and to achieve a unified strategy,
we have placed the implementation of the BIT macro
in bits.h to simplify code implementation.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-10-12 14:52:56 +08:00
Dong Heng ca03a92327 drivers/lcd/st7789: Add option to support set BGR mode 2023-09-25 12:51:43 +08:00
chao an 5026a96cfa nxstyle: cleanup UTF-8 Unicode to ASCII
Signed-off-by: chao an <anchao@xiaomi.com>
2023-09-18 11:54:17 -04:00
Daniel Appiagyei 5bfda12634 c++ compatibility: rename reserved c++ keywords 'public' and 'this' 2023-09-16 19:45:02 +08:00
jturnsek 4407aa148e Fixing row_size calculation when bpp is equal 1 2023-09-16 14:37:19 +08:00
jturnsek 6840b4444b Adding Byte-Per-Pixel Memory model option to memlcd 2023-09-16 14:34:32 +08:00
chao an 664927c86e mm/alloc: remove all unnecessary cast for alloc
Fix the minor style issue and remove unnecessary cast

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-30 14:34:20 +08:00
chao an b60f01a55b inode/i_private: remove all unnecessary cast for i_private
Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-29 08:58:07 +02:00
chao an 7aa45305b7 fs/inode: remove all unnecessary check for filep/inode
Since VFS layer already contains sanity checks, so remove unnecessary lower half checks

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-29 09:47:11 +08:00
rongyichang 917634446e drivers/lcd : add ioctl passthrough for LCD driver
Some LCD vendors support unit test commands, we should passthrough the ioctl
commands to drivers.

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-08-19 01:50:41 +08:00
xuxin19 f2f0d7fbad cmake:fix drivers build block during cmake reforming
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-16 22:38:52 +08:00
Xiang Xiao abfe082a6f Kconfig: Simplify the conditional default statement
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-16 14:39:20 -03:00
Michal Lenc 548f4b652c st7789: add support for 3 wire interface
3 wire interface for ST7789 LCD controller does not use  CMD/DATA pin to
specify whether data  or command is send but uses 9th bit of SPI transfer.

This commit adds support for 3 wire interface to ST7789 controller.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-07-15 00:08:43 +08:00
rongyichang 6902ed9516 drivers/lcd: add area alignment ioctl for lcd driver
Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-07-13 01:03:18 +08:00
chao an 6ee9ec7656 build: add initial cmake build system
1. Update all CMakeLists.txt to adapt to new layout
2. Fix cmake build break
3. Update all new file license
4. Fully compatible with current compilation environment(use configure.sh or cmake as you choose)

------------------

How to test

From within nuttx/. Configure:

cmake -B build -DBOARD_CONFIG=sim/nsh -GNinja
cmake -B build -DBOARD_CONFIG=sim:nsh -GNinja
cmake -B build -DBOARD_CONFIG=sabre-6quad/smp -GNinja
cmake -B build -DBOARD_CONFIG=lm3s6965-ek/qemu-flat -GNinja

(or full path in custom board) :
cmake -B build -DBOARD_CONFIG=$PWD/boards/sim/sim/sim/configs/nsh -GNinja

This uses ninja generator (install with sudo apt install ninja-build). To build:

$ cmake --build build

menuconfig:

$ cmake --build build -t menuconfig

--------------------------

2. cmake/build: reformat the cmake style by cmake-format

https://github.com/cheshirekow/cmake_format

$ pip install cmakelang

$ for i in `find -name CMakeLists.txt`;do cmake-format $i -o $i;done
$ for i in `find -name *\.cmake`;do cmake-format $i -o $i;done

Co-authored-by: Matias N <matias@protobits.dev>
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-08 13:50:48 +08:00
Mingjie Shen 1d6e51220d cxd56_dmac, lcd_dev: fix null pointer dereference
Check return values of following functions for null:
   - board_lcd_getdev
   - get_device

Signed-off-by: Mingjie Shen <shen497@purdue.edu>
2023-06-28 10:16:38 +03:00
simbit18 a4398b50c8 drivers/lcd/Kconfig: Fix Kconfig style
Remove TABs from Kconfig file
Add comments
2023-06-19 23:06:48 +08:00
Simon Filgis 04f8bab063 Dynamic adjustment of the orientation, switch orientation on the fly:
1. orientation is a parameter of initialize
2. y and x offset need to be adjusted with the orientaiton
3. bpp must be changed no matter what
2023-06-15 10:15:11 -03:00
fangpeina 0b8d5e993d drivers/lcd: Add JD9851 driver
Added support for the JD9851 TFT controller based on ST7789

Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2023-05-26 02:21:25 +08:00
simbit18 e4ffce3355 Fix Kconfig style
Remove spaces from Kconfig files
2023-05-23 00:03:25 +08:00
Xiang Xiao 7990f90915 Indent the define statement by two spaces
follow the code style convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-21 09:52:08 -03:00
Petro Karashchenko c70b7f6b3d nuttx: improve C89 compatibility in common code
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-05-19 02:40:38 +08:00
Lucas Saavedra Vaz 506b57eebf drivers/lcd/st7789: Add color inversion 2023-04-27 02:18:32 +08:00
Xiang Xiao 51dc67ad5f fs: Add g_ prefix for all global file_operations instances
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-24 16:13:29 +02:00
Huang Qi c623a7b731 drivers/lcd/st7789: Support mirror X/Y
Support mirror display by X/Y axis, it's useful for
single portrait/landscape but need to mirror specific direction.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-27 17:55:49 -03:00
jturnsek 4c2edece50 Adding support for LS027B7DH01A display and MEMLCD_EXTCOMIN_MODE_HW 2023-03-06 16:23:15 +02:00
Xiang Xiao 2c5f653bfd Remove the tail spaces from all files except Documentation
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-26 13:24:24 -08:00
Michal Lenc 824e6b3271 lcd/st7789: raise compilation error when CONFIG_SPI_CMDDATA is not set
CONFIG_SPI_CMDDATA is required for correct functionality of the display.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-02-11 20:32:20 +08:00
Xiang Xiao 09841300b0 Remove the remain MIN/MAX like macro
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-03 20:42:57 +08:00
Gustavo Henrique Nihei e6b204f438 nuttx: Use MIN/MAX definitions from "sys/param.h"
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-02-01 23:47:44 +08:00
Xiang Xiao b0a0ba3ad7 fs: Move mmap callback before truncate in [file|mountpt]_operations
since mmap may exist in block_operations, but truncate may not,
moving mmap beforee truncate could make three struct more compatible

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-04 17:43:59 +02:00
Xiang Xiao 779a610ca3 Remove the unnecessary NULL fields in global instance definition of file_operations
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-04 00:32:13 +02:00
Jukka Laitinen f33dc4df3f Change FIOC_MMAP into file operation call
- Add mmap into file_operations and remove it from ioctl definitions.
- Add mm_map structure definitions to support future unmapping
- Modify all drivers to initialize the operations struct accordingly

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-01-02 11:23:20 -03:00
Jukka Laitinen 41e9df2f3e Add ftruncate into file operation calls
- Add truncate into file_operations
- Move truncate to be common for mountpt_operations and file_operations
- Modify all drivers to initialize the operations struct accordingly

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-01-02 11:23:20 -03:00
Petro Karashchenko b107e4f417 nuttx: unify MIN, MAX and ABS macro definition across the code
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-12-21 09:31:28 +08:00
Xiang Xiao b526e06de1 drivers/lcd: Reuse lib_meminstream_s as much as possible
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-05 14:27:55 +01:00
Xiang Xiao 055f1f33eb libc/stream: Rename [lib_stream_](put|get) to [lib_stream_](putc|getc)
to make the naming style consistent with each other

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-05 14:27:55 +01:00
Xiang Xiao 6d30726a1b Remove the unnecessary "return;" at the end of function
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-27 22:23:50 +01:00
Karel Kočí 221b098846 drivers/lcd/st7789: fix invalid displayed color
The write has to be in number of bytes per pixel as single SPI exchange
is used to identify single pixel write by the ST7789 driver. By issuing
only byte writes the displayed color is corrupted as it is stripped.

This fix consist of setting SPI to correct number of exchanged bytes and
then passing correctly number of words to the SPI exchange.

This also covers usage of st7789_wrram in st7789_putrun as that one was
passing just number of pixels as size but the correct is now number of
bytes.
2022-11-21 14:43:12 -03:00
chao an 6950ea4646 drivers/lcd/pcf8574: driver lock should in pairs
Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-03 14:43:12 +01:00