no-OS
display.h
Go to the documentation of this file.
1 /***************************************************************************/
34 #ifndef DISPLAY_H
35 #define DISPLAY_H
36 
37 /******************************************************************************/
38 /***************************** Include Files **********************************/
39 /******************************************************************************/
40 #include <stdint.h>
41 #include "no_os_gpio.h"
42 #include "no_os_spi.h"
43 
44 /******************************************************************************/
45 /*************************** Types Declarations *******************************/
46 /******************************************************************************/
51 struct display_dev {
53  uint8_t cols_nb;
55  uint8_t rows_nb;
59  void *extra;
60 };
61 
68  uint8_t cols_nb;
70  uint8_t rows_nb;
74  void *extra;
75 };
76 
84  int32_t (*init)(struct display_dev *);
86  int32_t (*display_on_off)(struct display_dev *, uint8_t);
88  int32_t (*move_cursor)(struct display_dev *, uint8_t, uint8_t);
90  int32_t (*print_char)(struct display_dev *, uint8_t, uint8_t,
91  uint8_t);
93  int32_t (*remove)(struct display_dev *);
94 };
95 
96 /******************************************************************************/
97 /************************ Functions Declarations ******************************/
98 /******************************************************************************/
99 
101 int32_t display_init(struct display_dev **device,
102  const struct display_init_param *param);
103 
104 /* Frees the resources allocated by display_init(). */
105 int32_t display_remove(struct display_dev *device);
106 
108 int32_t display_on(struct display_dev *device);
109 
111 int32_t display_off(struct display_dev *device);
112 
114 int32_t display_move_cursor(struct display_dev *device, uint8_t row,
115  uint8_t column);
116 
118 int32_t display_clear(struct display_dev *device);
119 
121 int32_t display_print_string(struct display_dev *device, char *msg,
122  uint8_t row, uint8_t column);
123 
125 int32_t display_print_char(struct display_dev *device, char chr,
126  uint8_t row, uint8_t column);
127 
128 #endif
display_controller_ops::print_char
int32_t(* print_char)(struct display_dev *, uint8_t, uint8_t, uint8_t)
Definition: display.h:90
display_dev::rows_nb
uint8_t rows_nb
Definition: display.h:55
display_controller_ops::move_cursor
int32_t(* move_cursor)(struct display_dev *, uint8_t, uint8_t)
Definition: display.h:88
no_os_alloc.h
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:225
display_clear
int32_t display_clear(struct display_dev *device)
Clears data on display.
Definition: display.c:156
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:141
device
Definition: ad9361_util.h:69
display_controller_ops::remove
int32_t(* remove)(struct display_dev *)
Definition: display.h:93
display_controller_ops
Structure holding display controller function pointers that point to the controller specific function...
Definition: display.h:82
display_init_param::extra
void * extra
Definition: display.h:74
display_init_param::controller_ops
const struct display_controller_ops * controller_ops
Definition: display.h:72
display_init_param::cols_nb
uint8_t cols_nb
Definition: display.h:68
display_off
int32_t display_off(struct display_dev *device)
Turns display off.
Definition: display.c:125
display_dev::extra
void * extra
Definition: display.h:59
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:225
display_controller_ops::init
int32_t(* init)(struct display_dev *)
Definition: display.h:84
display_init_param::rows_nb
uint8_t rows_nb
Definition: display.h:70
display_init
int32_t display_init(struct display_dev **device, const struct display_init_param *param)
Initializes the display peripheral.
Definition: display.c:56
display_dev
Display Device Descriptor.
Definition: display.h:51
display_clear
int32_t display_clear(struct display_dev *device)
Clears data on display.
Definition: display.c:156
no_os_malloc
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:43
display_dev::cols_nb
uint8_t cols_nb
Definition: display.h:53
no_os_free
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
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:56
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:182
display_controller_ops::display_on_off
int32_t(* display_on_off)(struct display_dev *, uint8_t)
Definition: display.h:86
display_remove
int32_t display_remove(struct display_dev *device)
Frees the resources allocated by display_init().
Definition: display.c:90
display_on
int32_t display_on(struct display_dev *device)
Turns display on.
Definition: display.c:111
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:125
display_dev::controller_ops
const struct display_controller_ops * controller_ops
Definition: display.h:57
display_on
int32_t display_on(struct display_dev *device)
Turns display on.
Definition: display.c:111
display_remove
int32_t display_remove(struct display_dev *device)
Frees the resources allocated by display_init().
Definition: display.c:90
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:141
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:182
display_init_param
Display Device Initial Parameters.
Definition: display.h:66