Fix control function in I2C driver.

This commit is contained in:
Wayne Lin 2022-01-11 10:58:37 +08:00
parent f28619fde6
commit 0b99eee439
8 changed files with 13 additions and 11 deletions

View File

@ -90,7 +90,7 @@ static rt_err_t nu_i2c_bus_control(struct rt_i2c_bus_device *bus, rt_uint32_t u3
RT_ASSERT(bus != RT_NULL);
nu_i2c = (nu_i2c_bus_t *) bus;
switch (RT_I2C_DEV_CTRL_CLK)
switch (u32Cmd)
{
case RT_I2C_DEV_CTRL_CLK:
I2C_SetBusClockFreq(nu_i2c->I2C, u32Value);

View File

@ -99,7 +99,7 @@ static rt_err_t nu_i2c_bus_control(struct rt_i2c_bus_device *bus, rt_uint32_t u3
RT_ASSERT(bus != RT_NULL);
nu_i2c = (nu_i2c_bus_t *) bus;
switch (RT_I2C_DEV_CTRL_CLK)
switch (u32Cmd)
{
case RT_I2C_DEV_CTRL_CLK:
I2C_SetBusClockFreq(nu_i2c->I2C, u32Value);

View File

@ -99,7 +99,7 @@ static rt_err_t nu_i2c_bus_control(struct rt_i2c_bus_device *bus, rt_uint32_t u3
RT_ASSERT(bus != RT_NULL);
nu_i2c = (nu_i2c_bus_t *) bus;
switch (RT_I2C_DEV_CTRL_CLK)
switch (u32Cmd)
{
case RT_I2C_DEV_CTRL_CLK:
I2C_SetBusClockFreq(nu_i2c->I2C, u32Value);

View File

@ -770,4 +770,8 @@ void UART_SetLineConfig(UART_T *uart, uint32_t u32baudrate, uint32_t u32data_wid
/*@}*/ /* end of group N9H30_Device_Driver */
#ifdef __cplusplus
}
#endif
#endif

View File

@ -516,7 +516,7 @@ static rt_err_t nu_i2c_bus_control(struct rt_i2c_bus_device *bus, rt_uint32_t u3
psNuI2cBus = (nu_i2c_bus_t) bus;
psNuI2cDev = &psNuI2cBus->dev;
switch (RT_I2C_DEV_CTRL_CLK)
switch (u32Cmd)
{
case RT_I2C_DEV_CTRL_CLK:
nu_i2c_set_speed(psNuI2cDev, (int32_t)u32Value);

View File

@ -49,10 +49,6 @@ typedef struct nu_vpost *nu_vpost_t;
static volatile uint32_t g_u32VSyncBlank = 0;
static struct rt_completion vsync_wq;
RT_WEAK void nu_lcd_backlight_on(void) { }
RT_WEAK void nu_lcd_backlight_off(void) { }
static struct nu_vpost nu_fbdev[eVpost_Cnt] =
{
{
@ -73,6 +69,9 @@ static struct nu_vpost nu_fbdev[eVpost_Cnt] =
#endif
};
RT_WEAK void nu_lcd_backlight_on(void) { }
RT_WEAK void nu_lcd_backlight_off(void) { }
static rt_err_t vpost_layer_open(rt_device_t dev, rt_uint16_t oflag)
{
nu_vpost_t psVpost = (nu_vpost_t)dev;

View File

@ -118,7 +118,7 @@ static rt_err_t nu_i2c_bus_control(struct rt_i2c_bus_device *bus, rt_uint32_t u3
RT_ASSERT(bus != RT_NULL);
nu_i2c = (nu_i2c_bus_t *) bus;
switch (RT_I2C_DEV_CTRL_CLK)
switch (u32Cmd)
{
case RT_I2C_DEV_CTRL_CLK:
I2C_SetBusClockFreq(nu_i2c->I2C, u32Value);

View File

@ -252,12 +252,11 @@ static void PlayRingTone(void)
#include <drv_gpio.h>
/* defined the LCM_BLEN pin: PH3 */
#define LCM_BLEN NU_GET_PININDEX(NU_PH, 3)
#define LCM_BACKLIGHT_CTRL NU_GET_PININDEX(NU_PH, 3)
#endif
#define PWM_DEV_NAME "pwm0"
#define LCM_PWM_CHANNEL (0)
#define LCM_BACKLIGHT_CTRL NU_GET_PININDEX(NU_PH, 3)
void nu_lcd_backlight_on(void)
{