no-OS
display.h
Go to the documentation of this file.
1 /***************************************************************************/
40 #ifndef DISPLAY_H
41 #define DISPLAY_H
42 
43 /******************************************************************************/
44 /***************************** Include Files **********************************/
45 /******************************************************************************/
46 #include <stdint.h>
47 #include "no_os_gpio.h"
48 #include "no_os_spi.h"
49 
50 /******************************************************************************/
51 /*************************** Types Declarations *******************************/
52 /******************************************************************************/
57 struct display_dev {
59  uint8_t cols_nb;
61  uint8_t rows_nb;
65  void *extra;
66 };
67 
74  uint8_t cols_nb;
76  uint8_t rows_nb;
80  void *extra;
81 };
82 
90  int32_t (*init)(struct display_dev *);
92  int32_t (*display_on_off)(struct display_dev *, uint8_t);
94  int32_t (*move_cursor)(struct display_dev *, uint8_t, uint8_t);
96  int32_t (*print_char)(struct display_dev *, uint8_t, uint8_t,
97  uint8_t);
99  int32_t (*remove)(struct display_dev *);
100 };
101 
102 /******************************************************************************/
103 /************************ Functions Declarations ******************************/
104 /******************************************************************************/
105 
107 int32_t display_init(struct display_dev **device,
108  const struct display_init_param *param);
109 
110 /* Frees the resources allocated by display_init(). */
111 int32_t display_remove(struct display_dev *device);
112 
114 int32_t display_on(struct display_dev *device);
115 
117 int32_t display_off(struct display_dev *device);
118 
120 int32_t display_move_cursor(struct display_dev *device, uint8_t row,
121  uint8_t column);
122 
124 int32_t display_clear(struct display_dev *device);
125 
127 int32_t display_print_string(struct display_dev *device, char *msg,
128  uint8_t row, uint8_t column);
129 
131 int32_t display_print_char(struct display_dev *device, char chr,
132  uint8_t row, uint8_t column);
133 
134 #endif
display_controller_ops::print_char
int32_t(* print_char)(struct display_dev *, uint8_t, uint8_t, uint8_t)
Definition: display.h:96
display_dev::rows_nb
uint8_t rows_nb
Definition: display.h:61
display_controller_ops::move_cursor
int32_t(* move_cursor)(struct display_dev *, uint8_t, uint8_t)
Definition: display.h:94
display_print_char
int32_t display_print_char(struct display_dev *device, char chr, uint8_t row, uint8_t column)
Prints single char at selected position.
Definition: display.c:230
display_clear
int32_t display_clear(struct display_dev *device)
Clears data on display.
Definition: display.c:161
no_os_spi.h
Header file of SPI Interface.
display_move_cursor
int32_t display_move_cursor(struct display_dev *device, uint8_t row, uint8_t column)
Moves cursor to desired position.
Definition: display.c:146
device
Definition: ad9361_util.h:75
display_controller_ops::remove
int32_t(* remove)(struct display_dev *)
Definition: display.h:99
display_controller_ops
Structure holding display controller function pointers that point to the controller specific function...
Definition: display.h:88
display_init_param::extra
void * extra
Definition: display.h:80
display_init_param::controller_ops
const struct display_controller_ops * controller_ops
Definition: display.h:78
display_init_param::cols_nb
uint8_t cols_nb
Definition: display.h:74
display_off
int32_t display_off(struct display_dev *device)
Turns display off.
Definition: display.c:130
display_dev::extra
void * extra
Definition: display.h:65
no_os_error.h
Error codes definition.
display_print_char
int32_t display_print_char(struct display_dev *device, char chr, uint8_t row, uint8_t column)
Prints single char at selected position.
Definition: display.c:230
display_controller_ops::init
int32_t(* init)(struct display_dev *)
Definition: display.h:90
display_init_param::rows_nb
uint8_t rows_nb
Definition: display.h:76
display_init
int32_t display_init(struct display_dev **device, const struct display_init_param *param)
Initializes the display peripheral.
Definition: display.c:61
display_dev
Display Device Descriptor.
Definition: display.h:57
display_clear
int32_t display_clear(struct display_dev *device)
Clears data on display.
Definition: display.c:161
display_dev::cols_nb
uint8_t cols_nb
Definition: display.h:59
display.h
Header file for display Driver.
display_init
int32_t display_init(struct display_dev **device, const struct display_init_param *param)
Initializes the display peripheral.
Definition: display.c:61
display_print_string
int32_t display_print_string(struct display_dev *device, char *msg, uint8_t row, uint8_t column)
Prints char string at selected position.
Definition: display.c:187
display_controller_ops::display_on_off
int32_t(* display_on_off)(struct display_dev *, uint8_t)
Definition: display.h:92
display_remove
int32_t display_remove(struct display_dev *device)
Frees the resources allocated by display_init().
Definition: display.c:95
display_on
int32_t display_on(struct display_dev *device)
Turns display on.
Definition: display.c:116
no_os_gpio.h
Header file of GPIO Interface.
display_off
int32_t display_off(struct display_dev *device)
Turns display off.
Definition: display.c:130
display_dev::controller_ops
const struct display_controller_ops * controller_ops
Definition: display.h:63
display_on
int32_t display_on(struct display_dev *device)
Turns display on.
Definition: display.c:116
display_remove
int32_t display_remove(struct display_dev *device)
Frees the resources allocated by display_init().
Definition: display.c:95
display_move_cursor
int32_t display_move_cursor(struct display_dev *device, uint8_t row, uint8_t column)
Moves cursor to desired position.
Definition: display.c:146
display_print_string
int32_t display_print_string(struct display_dev *device, char *msg, uint8_t row, uint8_t column)
Prints char string at selected position.
Definition: display.c:187
display_init_param
Display Device Initial Parameters.
Definition: display.h:72