update README

This commit is contained in:
Shuanglei Tao
2024-11-11 18:35:06 +08:00
parent f3748b472c
commit 65a9f3c469
2 changed files with 48 additions and 41 deletions

View File

@@ -10,25 +10,6 @@
*
*/
/**@file
*
* @defgroup ble_sdk_srv_nus Nordic UART Service
* @{
* @ingroup ble_sdk_srv
* @brief Nordic UART Service implementation.
*
* @details The Nordic UART Service is a simple GATT-based service with TX and RX characteristics.
* Data received from the peer is passed to the application, and the data received
* from the application of this service is sent to the peer as Handle Value
* Notifications. This module demonstrates how to implement a custom GATT-based
* service and characteristics using the S110 SoftDevice. The service
* is used by the application to send and receive ASCII text strings to and from the
* peer.
*
* @note The application must propagate S110 SoftDevice events to the Nordic UART Service module
* by calling the ble_nus_on_ble_evt() function from the ble_stack_handler callback.
*/
#ifndef EPD_BLE_H__
#define EPD_BLE_H__
@@ -42,13 +23,13 @@
enum EPD_CMDS
{
EPD_CMD_SET_PINS,
EPD_CMD_INIT,
EPD_CMD_CLEAR,
EPD_CMD_SEND_COMMAND,
EPD_CMD_SEND_DATA,
EPD_CMD_DISPLAY,
EPD_CMD_SLEEP,
EPD_CMD_SET_PINS,
EPD_CMD_INIT,
EPD_CMD_CLEAR,
EPD_CMD_SEND_COMMAND,
EPD_CMD_SEND_DATA,
EPD_CMD_DISPLAY,
EPD_CMD_SLEEP,
};
/* Forward declaration of the epd_driver_t type. */
@@ -57,9 +38,9 @@ typedef struct epd_driver_s epd_driver_t;
/**< epd driver DIs. */
enum EPD_DRIVER_IDS
{
EPD_DRIVER_4IN2 = 1,
EPD_DRIVER_4IN2_V2,
EPD_DRIVER_4IN2B_V2,
EPD_DRIVER_4IN2 = 1,
EPD_DRIVER_4IN2_V2,
EPD_DRIVER_4IN2B_V2,
};
/**@brief EPD driver structure.
@@ -68,13 +49,13 @@ enum EPD_DRIVER_IDS
*/
struct epd_driver_s
{
uint8_t id; /**< driver ID. */
void (*init)(void); /**< Initialize the e-Paper register */
void (*clear)(void); /**< Clear screen */
void (*send_command)(UBYTE Reg); /**< send command */
void (*send_data)(UBYTE Data); /**< send data */
void (*display)(void); /**< Sends the image buffer in RAM to e-Paper and displays */
void (*sleep)(void); /**< Enter sleep mode */
uint8_t id; /**< driver ID. */
void (*init)(void); /**< Initialize the e-Paper register */
void (*clear)(void); /**< Clear screen */
void (*send_command)(UBYTE Reg); /**< send command */
void (*send_data)(UBYTE Data); /**< send data */
void (*display)(void); /**< Sends the image buffer in RAM to e-Paper and displays */
void (*sleep)(void); /**< Enter sleep mode */
};
/* Forward declaration of the ble_epd_t type. */
@@ -91,7 +72,7 @@ struct ble_epd_s
ble_gatts_char_handles_t char_handles; /**< Handles related to the EPD characteristic (as provided by the S110 SoftDevice). */
uint16_t conn_handle; /**< Handle of the current connection (as provided by the S110 SoftDevice). BLE_CONN_HANDLE_INVALID if not in a connection. */
bool is_notification_enabled; /**< Variable to indicate if the peer has enabled notification of the RX characteristic.*/
epd_driver_t *driver; /**< current EPD driver */
epd_driver_t *driver; /**< current EPD driver */
};
/**@brief Function for initializing the EPD Service.

View File

@@ -1,11 +1,9 @@
# EPD-nRF51
4.2 寸电子墨水屏固件,带有一个网页版上位机,可以通过蓝牙传输图像到墨水屏。
4.2 寸电子墨水屏固件,带有一个[网页版上位机](https://tsl0922.github.io/EPD-nRF51/),可以通过蓝牙传输图像到墨水屏。
理论上支持所有 nRF51 系列 MCU内置 3 个微雪 4.2 寸墨水屏驱动(可切换),同时还支持自定义墨水屏到 MCU 的引脚映射。
![](docs/images/0.jpg)
## 支持设备
- 老五 4.2 寸价签,黑白双色版本
@@ -32,7 +30,35 @@
引脚映射0A0B0C0D0E0F10
```
默认驱动和引脚映射为黑白双色版本,其它版本需要切换驱动并修改引脚映射。
## 上位机
地址https://tsl0922.github.io/EPD-nRF51/
![](docs/images/0.jpg)
本项目自带一个基于浏览器蓝牙接口实现的网页版上位机,可通过上面网址访问,或者在本地直接双击打开 `docs/index.html` 来使用。
至于能不能使用,要看你打开这个页面的设备是否带有蓝牙硬件,还有使用的浏览器是否支持蓝牙接口。
## 开发
> **注意:**
> - 必须使用 [Keil 5.36](https://img.anfulai.cn/bbs/96992/MDK536.EXE) 或以下版本nRF51 SDK 只支持 V5 版本的 ARM 编译器,从 5.37 版本开始 Keil 已经不再内置 V5 版本编译器。
> - 默认的 `IRAM`/`IROM` 配置是 `16K`/`128K` 版本芯片的,其它容量的芯片需要做相应修改,如果你用得到那么多容量的话。
项目配置有 3 个 `Target`
- `EPD`: 用于编译正式版固件
- `EPD-Debug`: 开发用,开启了日志和 RTT
- `flash_softdevice`: 刷蓝牙协议栈用
**刷机流程:**
先擦除,再切换到 `flash_softdevice` 刷蓝牙协议栈(不要编译直接下载,只需刷一次),最后切换到 `EPD` 编译后再下载。
## 致谢
- 屏幕驱动代码来自微雪 [E-Paper Shield](https://www.waveshare.net/wiki/E-Paper_Shield)
- 网页版上位机代码来自 [atc1441/ATC_TLSR_Paper](https://github.com/atc1441/ATC_TLSR_Paper)
- 网页版上位机代码来自 [atc1441/ATC_TLSR_Paper](https://github.com/atc1441/ATC_TLSR_Paper)