Basic Z16F serial driver functionality
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@577 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
4b07e6ffa4
commit
16aff5292e
@ -355,7 +355,7 @@ static inline void up_setrate(struct up_dev_s *priv, unsigned int rate)
|
|||||||
|
|
||||||
static int up_setup(struct uart_dev_s *dev)
|
static int up_setup(struct uart_dev_s *dev)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_SUPPRESS_UART_CONFIG
|
#ifndef CONFIG_SUPPRESS_UART_CONFIG
|
||||||
struct up_dev_s *priv = dev->priv;
|
struct up_dev_s *priv = dev->priv;
|
||||||
unsigned int cval;
|
unsigned int cval;
|
||||||
|
|
||||||
|
@ -286,7 +286,7 @@ static inline void up_enablebreaks(struct up_dev_s *priv, boolean enable)
|
|||||||
|
|
||||||
static int up_setup(struct uart_dev_s *dev)
|
static int up_setup(struct uart_dev_s *dev)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_SUPPRESS_UART_CONFIG
|
#ifndef CONFIG_SUPPRESS_UART_CONFIG
|
||||||
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
|
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
|
||||||
uint16 brsr;
|
uint16 brsr;
|
||||||
|
|
||||||
|
@ -352,7 +352,7 @@ static inline void up_setrate(struct up_dev_s *priv, unsigned int rate)
|
|||||||
|
|
||||||
static int up_setup(struct uart_dev_s *dev)
|
static int up_setup(struct uart_dev_s *dev)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_SUPPRESS_UART_CONFIG
|
#ifndef CONFIG_SUPPRESS_UART_CONFIG
|
||||||
struct up_dev_s *priv = dev->priv;
|
struct up_dev_s *priv = dev->priv;
|
||||||
unsigned int cval;
|
unsigned int cval;
|
||||||
|
|
||||||
|
@ -281,7 +281,7 @@ static inline void up_enablebreaks(struct up_dev_s *priv, boolean enable)
|
|||||||
|
|
||||||
static int up_setup(struct uart_dev_s *dev)
|
static int up_setup(struct uart_dev_s *dev)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_SUPPRESS_UART_CONFIG
|
#ifndef CONFIG_SUPPRESS_UART_CONFIG
|
||||||
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
|
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
|
||||||
uint16 brsr;
|
uint16 brsr;
|
||||||
|
|
||||||
|
@ -517,12 +517,12 @@
|
|||||||
/* Register access macros ***********************************************************/
|
/* Register access macros ***********************************************************/
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
# define getreg8(a) (*(ubyte volatile _Near*)((a) & 0xffff))
|
# define getreg8(a) (*(ubyte volatile _Near*)(a))
|
||||||
# define putreg8(v,a) (*(ubyte volatile _Near*)((a) & 0xffff) = (v))
|
# define putreg8(v,a) (*(ubyte volatile _Near*)(a) = (v))
|
||||||
# define getreg16(a) (*(uint16 volatile _Near*)((a) & 0xffff))
|
# define getreg16(a) (*(uint16 volatile _Near*)(a))
|
||||||
# define putreg16(v,a) (*(uint16 volatile _Near*)((a) & 0xffff) = (v))
|
# define putreg16(v,a) (*(uint16 volatile _Near*)(a) = (v))
|
||||||
# define getreg32(a) (*(uint32 volatile _Near*)((a) & 0xffff))
|
# define getreg32(a) (*(uint32 volatile _Near*)(a))
|
||||||
# define putreg32(v,a) (*(uint32 volatile _Near*)((a) & 0xffff) = (v))
|
# define putreg32(v,a) (*(uint32 volatile _Near*)(a) = (v))
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLY__ */
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
|
@ -50,14 +50,11 @@
|
|||||||
#ifdef CONFIG_ARCH_LEDS
|
#ifdef CONFIG_ARCH_LEDS
|
||||||
xref _up_ledinit:EROM
|
xref _up_ledinit:EROM
|
||||||
#endif
|
#endif
|
||||||
#if defined(CONFIG_DEV_CONSOLE) && CONFIG_NFILE_DESCRIPTORS > 0
|
#if defined(CONFIG_ARCH_LOWPUTC) || defined(CONFIG_ARCH_LOWGETC) || CONFIG_NFILE_DESCRIPTORS == 0
|
||||||
xref _up_earlyserialinit:EROM
|
|
||||||
#endif
|
|
||||||
#if defined(CONFIG_ARCH_LOWPUTC) || defined(CONFIG_ARCH_LOWGETC)
|
|
||||||
xref _z16f_lowuartinit:EROM
|
xref _z16f_lowuartinit:EROM
|
||||||
#endif
|
#endif
|
||||||
#if defined(CONFIG_DEV_CONSOLE) && CONFIG_NFILE_DESCRIPTORS > 0
|
#if defined(CONFIG_DEV_CONSOLE) && CONFIG_NFILE_DESCRIPTORS > 0
|
||||||
xref up_earlyserialinit:EROM
|
xref _up_earlyserialinit:EROM
|
||||||
#endif
|
#endif
|
||||||
xref _os_start:EROM
|
xref _os_start:EROM
|
||||||
xref _up_doirq:EROM
|
xref _up_doirq:EROM
|
||||||
|
@ -298,7 +298,7 @@ static void z16f_waittx(struct uart_dev_s *dev, boolean (*status)(struct uart_de
|
|||||||
|
|
||||||
static int z16f_setup(struct uart_dev_s *dev)
|
static int z16f_setup(struct uart_dev_s *dev)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_SUPPRESS_UART_CONFIG
|
#ifndef CONFIG_SUPPRESS_UART_CONFIG
|
||||||
struct z16f_uart_s *priv = (struct z16f_uart_s*)dev->priv;
|
struct z16f_uart_s *priv = (struct z16f_uart_s*)dev->priv;
|
||||||
uint32 brg;
|
uint32 brg;
|
||||||
ubyte ctl0;
|
ubyte ctl0;
|
||||||
|
@ -177,6 +177,19 @@ struct mountpt_operations
|
|||||||
};
|
};
|
||||||
#endif /* CONFIG_DISABLE_MOUNTPOUNT */
|
#endif /* CONFIG_DISABLE_MOUNTPOUNT */
|
||||||
|
|
||||||
|
/* These are the various kinds of operations that can be associated with
|
||||||
|
* an inode.
|
||||||
|
*/
|
||||||
|
|
||||||
|
union inode_ops_u
|
||||||
|
{
|
||||||
|
FAR const struct file_operations *i_ops; /* Driver operations for inode */
|
||||||
|
#ifndef CONFIG_DISABLE_MOUNTPOUNT
|
||||||
|
FAR const struct block_operations *i_bops; /* Block driver operations */
|
||||||
|
FAR const struct mountpt_operations *i_mops; /* Operations on a mountpoint */
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
/* This structure represents one inode in the Nuttx psuedo-file system */
|
/* This structure represents one inode in the Nuttx psuedo-file system */
|
||||||
|
|
||||||
struct inode
|
struct inode
|
||||||
@ -184,15 +197,8 @@ struct inode
|
|||||||
FAR struct inode *i_peer; /* Pointer to same level inode */
|
FAR struct inode *i_peer; /* Pointer to same level inode */
|
||||||
FAR struct inode *i_child; /* Pointer to lower level inode */
|
FAR struct inode *i_child; /* Pointer to lower level inode */
|
||||||
sint16 i_crefs; /* References to inode */
|
sint16 i_crefs; /* References to inode */
|
||||||
uint16 i_flags; /* flags for inode */
|
uint16 i_flags; /* Flags for inode */
|
||||||
union
|
union inode_ops_u u; /* Inode operations */
|
||||||
{
|
|
||||||
const struct file_operations *i_ops; /* Driver operations for inode */
|
|
||||||
#ifndef CONFIG_DISABLE_MOUNTPOUNT
|
|
||||||
const struct block_operations *i_bops; /* Block driver operations */
|
|
||||||
const struct mountpt_operations *i_mops; /* Operations on a mountpoint */
|
|
||||||
#endif
|
|
||||||
} u;
|
|
||||||
#ifdef CONFIG_FILE_MODE
|
#ifdef CONFIG_FILE_MODE
|
||||||
mode_t i_mode; /* Access mode flags */
|
mode_t i_mode; /* Access mode flags */
|
||||||
#endif
|
#endif
|
||||||
|
@ -194,8 +194,8 @@ struct uart_dev_s
|
|||||||
* for sapce in recv.buffer */
|
* for sapce in recv.buffer */
|
||||||
struct uart_buffer_s xmit; /* Describes transmit buffer */
|
struct uart_buffer_s xmit; /* Describes transmit buffer */
|
||||||
struct uart_buffer_s recv; /* Describes receive buffer */
|
struct uart_buffer_s recv; /* Describes receive buffer */
|
||||||
const struct uart_ops_s *ops; /* Arch-specifics operations */
|
FAR const struct uart_ops_s *ops; /* Arch-specific operations */
|
||||||
void *priv; /* Used by the arch-specific logic */
|
FAR void *priv; /* Used by the arch-specific logic */
|
||||||
};
|
};
|
||||||
typedef struct uart_dev_s uart_dev_t;
|
typedef struct uart_dev_s uart_dev_t;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user