Squashed commit of the following:

drivers/lcd:  Add an IOcTL to FT80x driver to write to FIFO CMD RAM.
This commit is contained in:
Gregory Nutt 2018-02-20 15:24:52 -06:00
parent a8c58607e9
commit 02df81bc5f
4 changed files with 43 additions and 12 deletions

View file

@ -682,6 +682,31 @@ static int ft80x_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
}
break;
/* FT80X_IOC_PUTRAMCMD
* Description: Write 32-bit aligned data to FT80x FIFO (RAM_CMD)
* Argument: A reference to an instance of struct ft80x_relmem_s below.
* Returns: None.
*/
case FT80X_IOC_PUTRAMCMD:
{
FAR struct ft80x_relmem_s *ramcmd =
(FAR struct ft80x_relmem_s *)((uintptr_t)arg);
if (ramcmd == NULL || ((uintptr_t)&ramcmd->offset & 3) != 0 /* ||
ramcmd->offset >= FT80X_CMDFIFO_SIZE */ )
{
ret = -EINVAL;
}
else
{
ft80x_write_memory(priv, FT80X_RAM_CMD + ramcmd->offset,
ramcmd->value, ramcmd->nbytes);
ret = OK;
}
}
break;
/* FT80X_IOC_GETREG8:
* Description: Read an 8-bit register value from the FT80x.
* Argument: A reference to an instance of struct ft80x_register_s.

View file

@ -127,7 +127,7 @@
* either case but must be subsequently obtained using FT80X_IOC_GETRAMDL.
*
* FT80X_IOC_GETRAMDL:
* Description: Read a 32-bit value from the display list.
* Description: Read a 32-bit aligned data from the display list.
* Argument: A reference to an instance of struct ft80x_relmem_s below.
* Returns: The 32-bit value read from the display list.
*
@ -136,6 +136,11 @@
* Argument: A reference to an instance of struct ft80x_relmem_s below.
* Returns: None.
*
* FT80X_IOC_PUTRAMCMD
* Description: Write 32-bit aligned data to FT80x FIFO (RAM_CMD)
* Argument: A reference to an instance of struct ft80x_relmem_s below.
* Returns: None.
*
* FT80X_IOC_GETREG8:
* Description: Read an 8-bit register value from the FT80x.
* Argument: A reference to an instance of struct ft80x_register_s below.
@ -182,13 +187,14 @@
#define FT80X_IOC_APPENDDL _LCDIOC(FT80X_NIOCTL_BASE + 1)
#define FT80X_IOC_GETRAMDL _LCDIOC(FT80X_NIOCTL_BASE + 2)
#define FT80X_IOC_PUTRAMG _LCDIOC(FT80X_NIOCTL_BASE + 3)
#define FT80X_IOC_GETREG8 _LCDIOC(FT80X_NIOCTL_BASE + 4)
#define FT80X_IOC_GETREG16 _LCDIOC(FT80X_NIOCTL_BASE + 5)
#define FT80X_IOC_GETREG32 _LCDIOC(FT80X_NIOCTL_BASE + 6)
#define FT80X_IOC_PUTREG8 _LCDIOC(FT80X_NIOCTL_BASE + 7)
#define FT80X_IOC_PUTREG16 _LCDIOC(FT80X_NIOCTL_BASE + 8)
#define FT80X_IOC_PUTREG32 _LCDIOC(FT80X_NIOCTL_BASE + 9)
#define FT80X_IOC_EVENTNOTIFY _LCDIOC(FT80X_NIOCTL_BASE + 10)
#define FT80X_IOC_PUTRAMCMD _LCDIOC(FT80X_NIOCTL_BASE + 4)
#define FT80X_IOC_GETREG8 _LCDIOC(FT80X_NIOCTL_BASE + 5)
#define FT80X_IOC_GETREG16 _LCDIOC(FT80X_NIOCTL_BASE + 6)
#define FT80X_IOC_GETREG32 _LCDIOC(FT80X_NIOCTL_BASE + 7)
#define FT80X_IOC_PUTREG8 _LCDIOC(FT80X_NIOCTL_BASE + 8)
#define FT80X_IOC_PUTREG16 _LCDIOC(FT80X_NIOCTL_BASE + 9)
#define FT80X_IOC_PUTREG32 _LCDIOC(FT80X_NIOCTL_BASE + 10)
#define FT80X_IOC_EVENTNOTIFY _LCDIOC(FT80X_NIOCTL_BASE + 11)
/* FT80x Memory Map *************************************************************************/
@ -1353,8 +1359,8 @@ struct ft80x_displaylist_s
struct ft80x_dlcmd_s cmd; /* First command in the display list */
};
/* This structure is used with the FT80X_IOC_GETRAMDL and FT80X_IOC_PUTRAMG IOCTL commands to
* access particular memory regions via an offset.
/* This structure is used with the FT80X_IOC_GETRAMDL, FT80X_IOC_PUTRAMG, and
* FT80X_IOC_PUTRAMCMD IOCTL commands to access particular memory regions via an offset.
*
* NOTES:
* - For FT80X_IOC_GET* commands, the value is an output; for FT80X_IOC_PUT* command, the

View file

@ -50,7 +50,7 @@
/* IOCTL commands set aside for FT80x character driver */
#define FT80X_NIOCTL_CMDS 11
#define FT80X_NIOCTL_CMDS 12
#define FT80X_NIOCTL_BASE 0x0001
#endif /* __INCLUDE_NUTTX_INPUT_LCD_IOCTL_H */

View file

@ -113,7 +113,7 @@ int nxsig_procmask(int how, FAR const sigset_t *set, FAR sigset_t *oset)
/* Return the old signal mask if requested */
oldsigprocmask = rtcb->sigprocmask;
if (oset)
if (oset != NULL)
{
*oset = oldsigprocmask;
}