Replies: 3 comments 2 replies
-
Hii, For testing i have used name as examplesensor examplesensor.c #define DT_DRV_COMPAT zephyr_examplesensor #include <zephyr/logging/log.h> #include <string.h> #define ST7305_PANEL_WIDTH DT_INST_PROP(0, width) #define ST7305_PIXELS_PER_BYTE 8U
// #if DT_INST_NODE_HAS_PROP(0, disp_miso_en_gpios) struct ST7305_config { static int ST7305_blanking_off(const struct device *dev)
} static int ST7305_blanking_on(const struct device *dev)
} // ST7305_CMD COMMAND static int ST7305_cmd(const struct device *dev, uint8_t *buf, uint8_t len) static int ST7305_data(const struct device *dev, uint8_t *buf, uint8_t len) static int ST7305_clear(const struct device *dev)
} static int ST7305_update_display(const struct device *dev,
} static int ST7305_write(const struct device *dev, const uint16_t x,
} static void ST7305_get_capabilities(const struct device *dev,
} static int ST7305_set_pixel_format(const struct device *dev,
} // LET'S SEE IF WORK
} static const struct ST7305_config ST7305_config = { static const struct display_driver_api ST7305_driver_api = { DEVICE_DT_INST_DEFINE(0, ST7305_init, NULL, NULL, &ST7305_config, POST_KERNEL, Zephyr,examplesensor.yaml description: | Example definition in devicetree:
compatible: "zephyr,examplesensor" include: [spi-device.yaml, display-controller.yaml] properties: spi-max-frequency: display-type: status: height: width: disp_miso_en_gpios: Kconfig for examplesensor Copyright (c) 2021 Nordic Semiconductor ASASPDX-License-Identifier: Apache-2.0menu "Sensor Drivers" config SENSOR_EXAMPLESENSOR if SENSOR_EXAMPLESENSOR endmenu dts file /dts-v1/; / {
}; &flash0 {
}; &pinctrl { &spi0 { &gpio0 { &gpiote0 { &spi1 {
}; &pinctrl { main.c /*
#include <zephyr/device.h> #define LOG_LEVEL CONFIG_LOG_DEFAULT_LEVEL static uint32_t count; // #ifdef CONFIG_GPIO // static void button_isr_callback(const struct device *port, // count = 0; // count = 0; int main(void) // const struct pwm_dt_spec EXTCOMIN = PWM_DT_SPEC_GET(DT_NODELABEL(pwm_led1));
// #ifdef CONFIG_GPIO // err = gpio_pin_configure_dt(&button_gpio, GPIO_INPUT); // gpio_init_callback(&button_callback, button_isr_callback, // err = gpio_add_callback(button_gpio.port, &button_callback); // err = gpio_pin_interrupt_configure_dt(&button_gpio, #ifdef CONFIG_LV_Z_ENCODER_INPUT
#endif /* CONFIG_LV_Z_ENCODER_INPUT */
} CMakeLists.txt (TOP Level) cmake_minimum_required(VERSION 3.20.0) Find and include Zephyrfind_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) Include application source filestarget_sources(app PRIVATE src/main.c drivers/sensor/examplesensor/examplesensor.c) Add subdirectory for custom drivers if they existif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/drivers) Include directories for custom driverszephyr_include_directories(drivers/sensor/examplesensor) Link application to Zephyrtarget_link_libraries(app PRIVATE zephyr) Optional: Suppress regeneration messagesset(CMAKE_SUPPRESS_REGENERATION TRUE) CMakeLists.txt (examplesensor) add_subdirectory_ifdef(CONFIG_EXAMPLESENSOR examplesensor) Hoping to get help fast as my project is much delayed. |
Beta Was this translation helpful? Give feedback.
-
Hi @dkjLC Contributions are always welcome, but please open a pull request. If you want to a new driver you do not need to create an issue beforehand. Issues are for RFCs and bugreports primarily. If you are not sure how to do that (saw that you do not have any repo on your profile) I'd suggest on reading and practicing git. Happy hacking :^) |
Beta Was this translation helpful? Give feedback.
-
Can anyone help i have developed it but its not compiling showing "_device_dts_ord_19" error due to which i cannot test on my device. I have attached the zip file which contain whole my project. Thanks in advance!! |
Beta Was this translation helpful? Give feedback.
-
I am currently working on the project where in I require the Zephyr driver for the Sitronix ST7305 Monochromic display.
Link to Datasheet : https://v4.cecdn.yun300.cn/100001_1909185148/ST_7305_V0_2.pdf
It will be Very helpful for me if you can help me with drivers.
Beta Was this translation helpful? Give feedback.
All reactions