1.更新内置命令名。2.移除驱动类型。3.设备回调支持每个设备描述符独立挂载,不限上限。4.offset修改为position,更强调写入位置概念。5.设备中断概念修正,父系设备中断不仅唤起自身的回调函数,同时也将递归唤醒子设备回调函数(更强调依赖关系)。6.增强doxygen规范,生成文档更完整。

This commit is contained in:
MacRsh
2024-01-31 22:39:30 +08:00
parent 26197d3b0d
commit de64eb3ead
30 changed files with 740 additions and 745 deletions

View File

@@ -83,7 +83,7 @@ Example:
int main(void)
{
/* Open SPI10 device under SPI1 bus line */
int ds = mr_dev_open("spi1/spi10", MR_OFLAG_RDWR);
int ds = mr_dev_open("spi1/spi10", MR_O_RDWR);
/* Send data */
uint8_t wr_buf[] = {0x01, 0x02, 0x03, 0x04};
@@ -196,7 +196,7 @@ Versions later than `3.11.7` are not supported).
Note:
- Supports `MDK5` and `Eclipse`.
- If the `MDK` version is too early, the `GNU` configuration may fail.
- `MDK` uncompiled or too low a version can cause the 'GNU' configuration to fail.
## Configure Menu Options
@@ -239,11 +239,11 @@ int main(void)
mr_auto_init();
/* Open the PIN device */
int ds = mr_dev_open("pin", MR_OFLAG_RDWR);
int ds = mr_dev_open("pin", MR_O_WRONLY);
/* Set to the LED pin */
mr_dev_ioctl(ds, MR_CTL_PIN_SET_NUMBER, MR_MAKE_LOCAL(int, LED_PIN_NUMBER));
mr_dev_ioctl(ds, MR_IOC_PIN_SET_NUMBER, MR_MAKE_LOCAL(int, LED_PIN_NUMBER));
/* Set the LED pin to push-pull output mode */
mr_dev_ioctl(ds, MR_CTL_PIN_SET_MODE, MR_MAKE_LOCAL(int, MR_PIN_MODE_OUTPUT));
mr_dev_ioctl(ds, MR_IOC_PIN_SET_MODE, MR_MAKE_LOCAL(int, MR_PIN_MODE_OUTPUT));
while(1)
{
@@ -267,7 +267,7 @@ int main(void)
mr_auto_init();
/* Open the Serial-1 device */
int ds = mr_dev_open("serial1", MR_OFLAG_RDWR);
int ds = mr_dev_open("serial1", MR_O_RDWR);
/* Output Hello World */
mr_dev_write(ds, "Hello World\r\n", sizeof("Hello World\r\n"));