You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

240 lines
12 KiB

  1. # group `hd44780`
  2. HD44780 Character LCD Driver
  3. ## Summary
  4. Members | Descriptions
  5. --------------------------------|---------------------------------------------
  6. `define `[`HD44780_CMD_CLEAR_DISPLAY`](#group__hd44780_1ga317a0fa779dcbd40d04095e1c3b16447) |
  7. `define `[`HD44780_CMD_RETURN_HOME`](#group__hd44780_1ga64cd4e167d1a9cd65b32d5dcd7ac1bb8) |
  8. `define `[`HD44780_CMD_ENTRY_MODE`](#group__hd44780_1ga6a4bd39ff528e4b7c7cc556095466158) |
  9. `define `[`HD44780_ENTRY_MODE_INC`](#group__hd44780_1ga8def8b2eb6120f932fc5831e3fbb3377) |
  10. `define `[`HD44780_ENTRY_MODE_SHIFT`](#group__hd44780_1gac58c05aa3eae28e88272bfb7ee7f5c40) |
  11. `define `[`HD44780_CMD_DISPLAY`](#group__hd44780_1gafb9f17134eb0765671ea8f43b188ae1e) |
  12. `define `[`HD44780_DISPLAY_ON`](#group__hd44780_1gaefd6f75e3454ecbe00950c818e9e9420) |
  13. `define `[`HD44780_DISPLAY_CURSOR`](#group__hd44780_1gad125b60be30b2cd0e0bfb23f949238ec) |
  14. `define `[`HD44780_DISPLAY_BLINK`](#group__hd44780_1gadb288f3996fafc6537c5e413eff39df8) |
  15. `define `[`HD44780_CMD_MOVE`](#group__hd44780_1gac1f843079f60718d770b34b1d9e080a1) |
  16. `define `[`HD44780_MOVE_DISPLAY`](#group__hd44780_1ga7f5aead3ce92c0bb8eef4afb6ec03fdc) |
  17. `define `[`HD44780_MOVE_RIGHT`](#group__hd44780_1ga5b8911c499925d126afd681d19e16985) |
  18. `define `[`HD44780_CMD_FUNCTION`](#group__hd44780_1ga66e53be765239225f30b35689edcc7f1) |
  19. `define `[`HD44780_FUNCTION_8_BIT`](#group__hd44780_1gab4760a025661db140bd7df635bbd67e7) |
  20. `define `[`HD44780_FUNCTION_2_LINES`](#group__hd44780_1ga88dbd8646d5fad0456e4685239404da3) |
  21. `define `[`HD44780_FUNCTION_5X10_DOTS`](#group__hd44780_1ga66002af4238dd0830e3dbe7780143492) |
  22. `define `[`HD44780_CMD_SET_CGRAM_ADDRESS`](#group__hd44780_1ga73397fed8f690a6508fb5967a76bcd3f) |
  23. `define `[`HD44780_CMD_SET_DDRAM_ADDRESS`](#group__hd44780_1ga32d29769e79b9843c284f98a9bc6ad2a) |
  24. `define `[`HD44780_BUSY_FLAG`](#group__hd44780_1gae22e5ab2bb9069fb265a6ff8ca5d0254) |
  25. `public void `[`hd44780_write`](#group__hd44780_1ga3a41d7df58b5856c629f8181e93b7c00)`(uint8_t data,bool isData)` | Write a byte to the display.
  26. `public uint8_t `[`hd44780_read`](#group__hd44780_1ga855e31aeb778f32efbd75be995797d1b)`(bool isData)` | Read a byte from the display.
  27. `public bool `[`hd44780_busy`](#group__hd44780_1gadcb1634221c116247735e3312637edc1)`(void)` | Indicates whether the display is currently processing, and cannot accept instructions.
  28. `public void `[`hd44780_command`](#group__hd44780_1gacd6ba5f8ecc8e6776e6617312b60d28e)`(uint8_t command)` | Send a command to the display. Refer to the datasheet for the valid commands.
  29. `public void `[`hd44780_data`](#group__hd44780_1ga8bc010c20fd8026b0d98bce13066b049)`(uint8_t data)` | Send a byte of data to the display.
  30. `public void `[`hd44780_clear`](#group__hd44780_1gaa358b83b37987e488b8f47d48a896ef8)`(void)` | Clear the display.
  31. `public void `[`hd44780_home`](#group__hd44780_1gac59e0708629529fee41ae215abd1e954)`(void)` | Move the cursor to the home position.
  32. `public void `[`hd44780_on`](#group__hd44780_1ga86f7413fd10963734e7d00cc475a8aba)`(bool cursor,bool blink)` | Turn the display on, and/or set the cursor position.
  33. `public void `[`hd44780_off`](#group__hd44780_1gaa236bcd35da58b8d3a9c5347358d3560)`(void)` | Turn the display off.
  34. `public void `[`hd44780_set_cgram_address`](#group__hd44780_1gacd561522fddf2ec8833325fd10e3a924)`(uint8_t address)` | Set the CGRAM address.
  35. `public void `[`hd44780_set_ddram_address`](#group__hd44780_1ga8de3a1df53c6481652683d1a6df31948)`(uint8_t address)` | Set the DDRAM address.
  36. `public void `[`hd44780_init`](#group__hd44780_1ga16611b90107639921a68efd503949db8)`(bool cursor,bool blink)` | Initialize the display.
  37. `public void `[`hd44780_set_cursor`](#group__hd44780_1ga0144f1c7e1de7745862f991451efa614)`(uint8_t col,uint8_t line)` | Move the cursor to the specified position on the display.
  38. `public void `[`hd44780_define_char`](#group__hd44780_1gaa167a2e4398a665658597f328ea08736)`(uint8_t index,uint8_t * data)` | Define a custom character.
  39. `public void `[`hd44780_putc`](#group__hd44780_1gaf9578702c16938a2abbb8c6becc9915f)`(char c)` | Print a character to the display. The newline character will move the cursor to the start of the next line.
  40. `public void `[`hd44780_puts`](#group__hd44780_1gaefe6076f55a4619cd8279765e125e513)`(const char * s)` | Print a string of characters to the display.
  41. `public void `[`hd44780_define_char_P`](#group__hd44780_1ga8d31109c8c7ef295511145c490cdba7d)`(uint8_t index,const uint8_t * data)` | Define a custom character from PROGMEM.
  42. `public void `[`hd44780_puts_P`](#group__hd44780_1gad999de4c8c443783542aece3c5ffaefc)`(const char * s)` | Print a string of characters from PROGMEM to the display.
  43. ## Members
  44. #### `define `[`HD44780_CMD_CLEAR_DISPLAY`](#group__hd44780_1ga317a0fa779dcbd40d04095e1c3b16447)
  45. #### `define `[`HD44780_CMD_RETURN_HOME`](#group__hd44780_1ga64cd4e167d1a9cd65b32d5dcd7ac1bb8)
  46. #### `define `[`HD44780_CMD_ENTRY_MODE`](#group__hd44780_1ga6a4bd39ff528e4b7c7cc556095466158)
  47. #### `define `[`HD44780_ENTRY_MODE_INC`](#group__hd44780_1ga8def8b2eb6120f932fc5831e3fbb3377)
  48. #### `define `[`HD44780_ENTRY_MODE_SHIFT`](#group__hd44780_1gac58c05aa3eae28e88272bfb7ee7f5c40)
  49. #### `define `[`HD44780_CMD_DISPLAY`](#group__hd44780_1gafb9f17134eb0765671ea8f43b188ae1e)
  50. #### `define `[`HD44780_DISPLAY_ON`](#group__hd44780_1gaefd6f75e3454ecbe00950c818e9e9420)
  51. #### `define `[`HD44780_DISPLAY_CURSOR`](#group__hd44780_1gad125b60be30b2cd0e0bfb23f949238ec)
  52. #### `define `[`HD44780_DISPLAY_BLINK`](#group__hd44780_1gadb288f3996fafc6537c5e413eff39df8)
  53. #### `define `[`HD44780_CMD_MOVE`](#group__hd44780_1gac1f843079f60718d770b34b1d9e080a1)
  54. #### `define `[`HD44780_MOVE_DISPLAY`](#group__hd44780_1ga7f5aead3ce92c0bb8eef4afb6ec03fdc)
  55. #### `define `[`HD44780_MOVE_RIGHT`](#group__hd44780_1ga5b8911c499925d126afd681d19e16985)
  56. #### `define `[`HD44780_CMD_FUNCTION`](#group__hd44780_1ga66e53be765239225f30b35689edcc7f1)
  57. #### `define `[`HD44780_FUNCTION_8_BIT`](#group__hd44780_1gab4760a025661db140bd7df635bbd67e7)
  58. #### `define `[`HD44780_FUNCTION_2_LINES`](#group__hd44780_1ga88dbd8646d5fad0456e4685239404da3)
  59. #### `define `[`HD44780_FUNCTION_5X10_DOTS`](#group__hd44780_1ga66002af4238dd0830e3dbe7780143492)
  60. #### `define `[`HD44780_CMD_SET_CGRAM_ADDRESS`](#group__hd44780_1ga73397fed8f690a6508fb5967a76bcd3f)
  61. #### `define `[`HD44780_CMD_SET_DDRAM_ADDRESS`](#group__hd44780_1ga32d29769e79b9843c284f98a9bc6ad2a)
  62. #### `define `[`HD44780_BUSY_FLAG`](#group__hd44780_1gae22e5ab2bb9069fb265a6ff8ca5d0254)
  63. #### `public void `[`hd44780_write`](#group__hd44780_1ga3a41d7df58b5856c629f8181e93b7c00)`(uint8_t data,bool isData)`
  64. Write a byte to the display.
  65. #### Parameters
  66. * `data` The byte to send to the display.
  67. * `isData` Whether the byte is an instruction or character data.
  68. #### `public uint8_t `[`hd44780_read`](#group__hd44780_1ga855e31aeb778f32efbd75be995797d1b)`(bool isData)`
  69. Read a byte from the display.
  70. #### Parameters
  71. * `isData` Whether to read the current cursor position, or the character at the cursor.
  72. #### Returns
  73. If `isData` is `true`, the returned byte will be the character at the current DDRAM address. Otherwise, it will be the current DDRAM address and the busy flag.
  74. #### `public bool `[`hd44780_busy`](#group__hd44780_1gadcb1634221c116247735e3312637edc1)`(void)`
  75. Indicates whether the display is currently processing, and cannot accept instructions.
  76. #### Returns
  77. `true` if the display is busy.
  78. #### `public void `[`hd44780_command`](#group__hd44780_1gacd6ba5f8ecc8e6776e6617312b60d28e)`(uint8_t command)`
  79. Send a command to the display. Refer to the datasheet for the valid commands.
  80. This function waits for the display to clear the busy flag before sending the command.
  81. #### Parameters
  82. * `command` The command to send.
  83. #### `public void `[`hd44780_data`](#group__hd44780_1ga8bc010c20fd8026b0d98bce13066b049)`(uint8_t data)`
  84. Send a byte of data to the display.
  85. This function waits for the display to clear the busy flag before sending the data.
  86. #### Parameters
  87. * `data` The byte of data to send.
  88. #### `public void `[`hd44780_clear`](#group__hd44780_1gaa358b83b37987e488b8f47d48a896ef8)`(void)`
  89. Clear the display.
  90. This function is called on init.
  91. #### `public void `[`hd44780_home`](#group__hd44780_1gac59e0708629529fee41ae215abd1e954)`(void)`
  92. Move the cursor to the home position.
  93. This function is called on init.
  94. #### `public void `[`hd44780_on`](#group__hd44780_1ga86f7413fd10963734e7d00cc475a8aba)`(bool cursor,bool blink)`
  95. Turn the display on, and/or set the cursor position.
  96. This function is called on init.
  97. #### Parameters
  98. * `cursor` Whether to show the cursor.
  99. * `blink` Whether to blink the cursor, if shown.
  100. #### `public void `[`hd44780_off`](#group__hd44780_1gaa236bcd35da58b8d3a9c5347358d3560)`(void)`
  101. Turn the display off.
  102. #### `public void `[`hd44780_set_cgram_address`](#group__hd44780_1gacd561522fddf2ec8833325fd10e3a924)`(uint8_t address)`
  103. Set the CGRAM address.
  104. This function is used when defining custom characters.
  105. #### Parameters
  106. * `address` The CGRAM address to move to, from `0x00` to `0x3F`.
  107. #### `public void `[`hd44780_set_ddram_address`](#group__hd44780_1ga8de3a1df53c6481652683d1a6df31948)`(uint8_t address)`
  108. Set the DDRAM address.
  109. This function is used when printing characters to the display, and setting the cursor.
  110. #### Parameters
  111. * `address` The DDRAM address to move to, from `0x00` to `0x7F`.
  112. #### `public void `[`hd44780_init`](#group__hd44780_1ga16611b90107639921a68efd503949db8)`(bool cursor,bool blink)`
  113. Initialize the display.
  114. This function should be called only once, before any of the other functions can be called.
  115. #### Parameters
  116. * `cursor` Whether to show the cursor.
  117. * `blink` Whether to blink the cursor, if shown.
  118. #### `public void `[`hd44780_set_cursor`](#group__hd44780_1ga0144f1c7e1de7745862f991451efa614)`(uint8_t col,uint8_t line)`
  119. Move the cursor to the specified position on the display.
  120. #### Parameters
  121. * `col` The column number to move to, from 0 to 15 on 16x2 displays.
  122. * `line` The line number to move to, either 0 or 1 on 16x2 displays.
  123. #### `public void `[`hd44780_define_char`](#group__hd44780_1gaa167a2e4398a665658597f328ea08736)`(uint8_t index,uint8_t * data)`
  124. Define a custom character.
  125. #### Parameters
  126. * `index` The index of the custom character to define, from 0 to 7.
  127. * `data` An array of 8 bytes containing the 5-bit row data of the character, where the first byte is the topmost row, and the least significant bit of each byte is the rightmost column.
  128. #### `public void `[`hd44780_putc`](#group__hd44780_1gaf9578702c16938a2abbb8c6becc9915f)`(char c)`
  129. Print a character to the display. The newline character will move the cursor to the start of the next line.
  130. The exact character shown may depend on the ROM code of your particular display - refer to the datasheet for the full character set.
  131. #### Parameters
  132. * `c` The character to print.
  133. #### `public void `[`hd44780_puts`](#group__hd44780_1gaefe6076f55a4619cd8279765e125e513)`(const char * s)`
  134. Print a string of characters to the display.
  135. #### Parameters
  136. * `s` The string to print.
  137. #### `public void `[`hd44780_define_char_P`](#group__hd44780_1ga8d31109c8c7ef295511145c490cdba7d)`(uint8_t index,const uint8_t * data)`
  138. Define a custom character from PROGMEM.
  139. On ARM devices, this function is simply an alias of [hd44780_define_char()](.build/docs/internals/undefined.md#group__hd44780_1gaa167a2e4398a665658597f328ea08736).
  140. #### Parameters
  141. * `index` The index of the custom character to define, from 0 to 7.
  142. * `data` A PROGMEM array of 8 bytes containing the 5-bit row data of the character, where the first byte is the topmost row, and the least significant bit of each byte is the rightmost column.
  143. #### `public void `[`hd44780_puts_P`](#group__hd44780_1gad999de4c8c443783542aece3c5ffaefc)`(const char * s)`
  144. Print a string of characters from PROGMEM to the display.
  145. On ARM devices, this function is simply an alias of [hd44780_puts()](.build/docs/internals/undefined.md#group__hd44780_1gaefe6076f55a4619cd8279765e125e513).
  146. #### Parameters
  147. * `s` The PROGMEM string to print.