Skip to content

Commit 49340ce

Browse files
committed
qspi example
1 parent 9e74676 commit 49340ce

File tree

6 files changed

+9
-18
lines changed

6 files changed

+9
-18
lines changed

bsp/phytium/libraries/drivers/drv_dc.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ static rt_err_t rt_dc_init(struct phytium_dc_bus *device)
8888
_dc_info.pixel_format = RTGRAPHIC_PIXEL_FORMAT_RGB565P;
8989
_dc_info.width = FB_XSIZE;
9090
_dc_info.height = FB_YSIZE;
91-
9291
rt_hw_dc_register(device, device->name, RT_DEVICE_FLAG_RDWR, NULL);
9392
dc_config(device);
9493
ret = FDcDpInitial(instance_p, device->fdc_id, user_cfg.width, user_cfg.height);

bsp/phytium/libraries/drivers/drv_i2s.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,11 @@ static void FDdmaSetupInterrupt(FDdma *const instance)
6262

6363
rt_uint32_t cpu_id = rt_hw_cpu_id();
6464
rt_hw_interrupt_set_target_cpus(config->irq_num, cpu_id);
65-
6665
rt_hw_interrupt_set_priority(config->irq_num, 16);
6766
/* register intr callback */
68-
rt_hw_interrupt_install(config->irq_num,
69-
FDdmaIrqHandler,
70-
instance,
67+
rt_hw_interrupt_install(config->irq_num,
68+
FDdmaIrqHandler,
69+
instance,
7170
NULL);
7271

7372
/* enable ddma0 irq */
@@ -136,7 +135,6 @@ static FError FI2sEs8336Init(u32 word_length)
136135
FError ret = FT_SUCCESS;
137136

138137
FIOPadSetI2sMux();
139-
140138
ret = RtEs8336Init(); /* es8336初始化,i2s slave设置 */
141139
if (FT_SUCCESS != ret)
142140
{
@@ -176,7 +174,7 @@ static FError FI2sRxInit(struct phytium_i2s_device *i2s_dev, u32 word_length)
176174
return ret;
177175
}
178176

179-
FI2sClkOutDiv(&i2s_dev->i2s_ctrl, i2s_dev->config.samplerate);
177+
FI2sClkOutDiv(&i2s_dev->i2s_ctrl, i2s_dev->config.samplerate);
180178
FI2sTxRxEnable(&i2s_dev->i2s_ctrl, TRUE); /* 模块使能 */
181179
return ret;
182180
}
@@ -471,11 +469,9 @@ static int i2s_controller_init(struct phytium_i2s_device *i2s_dev)
471469
}
472470

473471
i2s_dev->audio.ops = &i2s_ops;
474-
475472
int ret = rt_audio_register(audio, i2s_dev->name, RT_DEVICE_FLAG_RDONLY, (void *)i2s_dev);
476473
RT_ASSERT(RT_EOK == ret);
477474
LOG_D("i2s_controller_init i2s bus reg success. \n");
478-
479475
return ret;
480476
}
481477

bsp/phytium/libraries/drivers/drv_qspi.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,6 @@ static rt_ssize_t phytium_qspi_xfer(struct rt_spi_device *device, struct rt_spi_
411411
}
412412

413413
LOG_E("cmd not found!!!\r\n");
414-
415414
return -RT_ERROR;
416415
}
417416

bsp/phytium/libraries/drivers_example/can_sample.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ int can_sample(int argc, char *argv[])
6565
if (!can_dev)
6666
{
6767
rt_kprintf("Find %s failed.\n", can_name);
68-
return RT_ERROR;
68+
return -RT_ERROR;
6969
}
7070

7171
/* Initialize CAN receive signal quantity */

bsp/phytium/libraries/drivers_example/gpio_sample.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*
66
7-
*
7+
*
88
* Change Logs:
99
* Date Author Notes
10-
* 2022-12-10 liqiaozhong first commit
11-
* 2025-04-08 liqiaozhong
10+
* 2022-12-10 liqiaozhong first commit
11+
* 2025-04-08 liqiaozhong
1212
*
1313
*/
1414

@@ -58,7 +58,6 @@ static int gpio_toggle_sample(uint8_t argc, char **argv)
5858
input_pin_index = FGPIO_ID(FGPIO_CTRL_0, FGPIO_PIN_0);
5959
rt_pin_mode(input_pin_index, PIN_MODE_INPUT);
6060
rt_pin_attach_irq(input_pin_index, PIN_IRQ_MODE_RISING, gpio_irq_test, RT_NULL);
61-
6261
output_pin_index = FGPIO_ID(FGPIO_CTRL_4, FGPIO_PIN_13);
6362
rt_pin_mode(output_pin_index, PIN_MODE_OUTPUT);
6463
#endif
@@ -68,11 +67,9 @@ static int gpio_toggle_sample(uint8_t argc, char **argv)
6867
input_pin_index = FGPIO_ID(FGPIO_CTRL_4, FGPIO_PIN_13);
6968
rt_pin_mode(input_pin_index, PIN_MODE_INPUT);
7069
rt_pin_attach_irq(input_pin_index, PIN_IRQ_MODE_RISING, gpio_irq_test, RT_NULL);
71-
7270
output_pin_index = FGPIO_ID(FGPIO_CTRL_4, FGPIO_PIN_10);
7371
rt_pin_mode(output_pin_index, PIN_MODE_OUTPUT);
7472
#endif
75-
7673
/* toggle operation */
7774
rt_pin_write(output_pin_index, set_level);
7875
set_level = (FGPIO_OPS_LEVEL_LOW == set_level) ? FGPIO_OPS_LEVEL_HIGH : FGPIO_OPS_LEVEL_LOW;

bsp/phytium/libraries/drivers_example/i2c_sample.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include "fmio.h"
1111
#include "fparameters.h"
1212

13-
static struct rt_i2c_bus_device *i2c_test_bus = RT_NULL;
13+
static struct rt_i2c_bus_device *i2c_test_bus = RT_NULL;
1414
int i2c_sample(int argc, char *argv[])
1515
{
1616
char name[RT_NAME_MAX];

0 commit comments

Comments
 (0)