source: rtems/c/src/lib/libbsp/arm/csb337/console/fbcons.c @ 770e379

4.115
Last change on this file since 770e379 was 770e379, checked in by Joel Sherrill <joel.sherrill@…>, on 10/20/14 at 14:15:32

arm/csb337/console/fbcons.c: Fix warning

  • Property mode set to 100644
File size: 3.2 KB
Line 
1/*
2 *  LCD Console Output Driver for CSBx37
3 */
4
5/*
6 *  COPYRIGHT (c) 1989-2014.
7 *  On-Line Applications Research Corporation (OAR).
8 *
9 *  Modified by Fernando Nicodemos <fgnicodemos@terra.com.br>
10 *  from NCB - Sistemas Embarcados Ltda. (Brazil)
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.org/license/LICENSE.
15 */
16
17#include <bsp.h>
18#include <rtems/libio.h>
19#include <termios.h>
20
21#include <rtems/bspIo.h>
22#include <libchip/serial.h>
23#include <libchip/sersupp.h>
24#include "sed1356.h"
25
26/* static function prototypes */
27static int     fbcons_first_open(int major, int minor, void *arg);
28static int     fbcons_last_close(int major, int minor, void *arg);
29static int     fbcons_read(int minor);
30static ssize_t fbcons_write(int minor, const char *buf, size_t len);
31static void    fbcons_init(int minor);
32static void    fbcons_write_polled(int minor, char c);
33static int     fbcons_set_attributes(int minor, const struct termios *t);
34
35/* Pointers to functions for handling the UART. */
36const console_fns fbcons_fns =
37{
38  libchip_serial_default_probe,
39  fbcons_first_open,
40  fbcons_last_close,
41  fbcons_read,
42  fbcons_write,
43  fbcons_init,
44  fbcons_write_polled,   /* not used in this driver */
45  fbcons_set_attributes,
46  FALSE      /* TRUE if interrupt driven, FALSE if not. */
47};
48/*********************************************************************/
49/* Functions called via callbacks (i.e. the ones in uart_fns */
50/*********************************************************************/
51
52/*
53 * This is called the first time each device is opened. Since
54 * the driver is polled, we don't have to do anything. If the driver
55 * were interrupt driven, we'd enable interrupts here.
56 */
57static int fbcons_first_open(int major, int minor, void *arg)
58{
59  /* printk( "Frame buffer -- first open\n" ); */
60  return 0;
61}
62
63
64/*
65 * This is called the last time each device is closed.  Since
66 * the driver is polled, we don't have to do anything. If the driver
67 * were interrupt driven, we'd disable interrupts here.
68 */
69static int fbcons_last_close(int major, int minor, void *arg)
70{
71  /* printk( "Frame buffer -- last close\n" ); */
72  return 0;
73}
74
75
76/*
77 * Read one character from UART.
78 *
79 * return -1 if there's no data, otherwise return
80 * the character in lowest 8 bits of returned int.
81 */
82static int fbcons_read(int minor)
83{
84  /* printk( "Frame buffer -- read\n" ); */
85  return -1;
86}
87
88
89/*
90 * Write buffer to LCD
91 *
92 * return 1 on success, -1 on error
93 */
94static ssize_t fbcons_write(int minor, const char *buf, size_t len)
95{
96  int i;
97
98  /* printk( "Frame buffer -- write\n" ); */
99  for ( i=0 ; i<len ; i++ )
100    sed_putchar( buf[i] );
101
102  return 1;
103}
104
105
106/* Set up the LCD controller. */
107static void fbcons_init(int minor)
108{
109  /* printk( "Initializing frame buffer\n" ); */
110  sed_init();
111}
112
113/* This is used for putchark support */
114static void fbcons_write_polled(int minor, char c)
115{
116  /* printk( "frame buffer -- write polled\n" ); */
117  sed_putchar( c );
118}
119
120/* This is for setting baud rate, bits, etc. */
121static int fbcons_set_attributes(int minor, const struct termios *t)
122{
123  /* printk( "frame buffer -- set attributes\n" ); */
124  return 0;
125}
Note: See TracBrowser for help on using the repository browser.