├── .github ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── Release_Notes.html ├── SECURITY.md ├── _htmresc ├── favicon.png ├── mini-st_2020.css └── st_logo_2020.png ├── ssd1315.c ├── ssd1315.h ├── ssd1315_reg.c └── ssd1315_reg.h /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 'Bug report' 3 | about: 'Create a report to help us improve the quality of our software' 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | --- 8 | 9 | **Caution** 10 | 11 | The Issues are strictly limited for the reporting of problem encountered with the software provided in this project. 12 | For any other problem related to the STM32 product, the performance, the hardware characteristics and boards, the tools the environment in general, please post your report to the **ST Community** in the STM32 MCUs dedicated [page](https://community.st.com/s/group/0F90X000000AXsASAW/stm32-mcus). 13 | 14 | **Describe the set-up** 15 | 16 | * The board (either ST RPN reference or your custom board) 17 | * IDE or at least the compiler and its version 18 | 19 | **Describe the bug (skip if none)** 20 | 21 | A clear and concise description of what the bug is. 22 | 23 | **How to reproduce the bug (skip if none)** 24 | 25 | 1. Indicate the global behavior of your application project 26 | 2. List the modules that you suspect to be the cause of the problem (Drivers, BSP, MW...) 27 | 3. Describe the use case that generates the problem 28 | 4. How we can reproduce the problem 29 | 30 | 31 | **Additional context** 32 | 33 | If you have a first analysis, an enhancement, a fix or a patch, thank you to share your proposal. 34 | 35 | **Screenshots** 36 | 37 | If applicable, add screenshots to help explain your problem. 38 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## IMPORTANT INFORMATION 2 | 3 | Pull-requests are **not** accepted on this repository. Please use issues to report any bug or request. 4 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team via this [link](https://www.st.com/content/st_com/en/contact-us.html). 59 | All complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 1.4, 71 | available [here](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html). 72 | 73 | For answers to common questions about this code of conduct, see the [FAQ section](https://www.contributor-covenant.org/faq). 74 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing guide 2 | 3 | This guide serves as a checklist before contributing to this repository. It mainly focuses on the steps to follow to submit an issue or a pull-request. 4 | 5 | ## 1. Issues 6 | 7 | ### 1.1 Before opening an issue 8 | 9 | Please check the following points before posting an issue: 10 | * Make sure you are using the latest commit (major releases are tagged, but corrections are available as new commits). 11 | * Make sure your issue is a question/feedback/suggestions **related to** the software provided in this repository. Otherwise, please refer to section [3](CONTRIBUTING.md#3-support-requests-and-questions) below. 12 | * Make sure your issue is not already reported/fixed on GitHub or discussed on a previous issue. Do not forget to browse into the **closed** issues. 13 | 14 | ### 1.2 Posting the issue 15 | 16 | When you have checked the previous points, create a new report from the **Issues** tab of this repository. A template is available [here](../../issues/new/choose) to help you report the issue you are facing or the enhancement you would like to propose. 17 | 18 | ## 2. Pull Requests 19 | 20 | ### 2.1 Before opening a pull-request 21 | 22 | STMicrolectronics is happy to receive contributions from the community, based on an initial Contributor License Agreement (CLA) procedure. 23 | 24 | * If you are an individual writing original source code and you are sure **you own the intellectual property**, then you need to sign an Individual [CLA](https://cla.st.com). 25 | * If you work for a company that wants also to allow you to contribute with your work, your company needs to provide a Corporate [CLA](https://cla.st.com) mentioning your GitHub account name. 26 | * If you are not sure that a CLA (Individual or Corporate) has been signed for your GitHub account you can check the [CLA](https://cla.st.com) dedicated page. 27 | 28 | Please note that: 29 | * The Corporate CLA will always take precedence over the Individual CLA. 30 | * One CLA submission is sufficient, for any project proposed by STMicroelectronics. 31 | 32 | ### 2.2 How to proceed 33 | 34 | * We recommend to engage first a communication thru an issue, in order to present your proposal, just to confirm that it corresponds to STMicroelectronics' domain or scope. 35 | * Then fork the project to your GitHub account to further develop your contribution. Please use the latest commit version. 36 | * Please, submit one pull-request per new feature or proposal. This will ease the analysis and the final merge if accepted. 37 | 38 | ## 3. Support requests and questions 39 | 40 | For support requests or any other question related to the product, the tools, the environment, you can submit a post to the **ST Community** on the appropriate topic [page](https://community.st.com/s/topiccatalog). 41 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright 2021 STMicroelectronics. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation and/or 12 | other materials provided with the distribution. 13 | 14 | 3. Neither the name of the copyright holder nor the names of its contributors 15 | may be used to endorse or promote products derived from this software without 16 | specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 22 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 25 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BSP SSD1315 LCD Component 2 | 3 | ![latest tag](https://img.shields.io/github/v/tag/STMicroelectronics/stm32-ssd1315.svg?color=brightgreen) 4 | 5 | ## Overview 6 | 7 | **STM32Cube** is an STMicroelectronics original initiative to ease the developers life by reducing efforts, time and cost. 8 | 9 | **STM32Cube** covers the overall STM32 products portfolio. It includes a comprehensive embedded software platform delivered for each STM32 series. 10 | * The CMSIS modules (core and device) corresponding to the ARM(tm) core implemented in this STM32 product. 11 | * The STM32 HAL-LL drivers, an abstraction layer offering a set of APIs ensuring maximized portability across the STM32 portfolio. 12 | * The BSP drivers of each evaluation, discovery, or nucleo board provided for this STM32 series. 13 | * A consistent set of middleware components such as RTOS, USB, FatFS, graphics, touch sensing library... 14 | * A full set of software projects (basic examples, applications, and demonstrations) for each board provided for this STM32 series. 15 | 16 | Two models of publication are proposed for the STM32Cube embedded software: 17 | * The monolithic **MCU Package**: all STM32Cube software modules of one STM32 series are present (Drivers, Middleware, Projects, Utilities) in the repository (usual name **STM32Cubexx**, xx corresponding to the STM32 series). 18 | * The **MCU component**: each STM32Cube software module being part of the STM32Cube MCU Package, is delivered as an individual repository, allowing the user to select and get only the required software functions. 19 | 20 | ## Description 21 | 22 | This **ssd1315** MCU component repository is one element **common to all** STM32Cube MCU embedded software packages, providing the **SSD1315** BSP LCD component part. 23 | 24 | ## Release note 25 | 26 | Details about the content of this release are available in the release note [here](https://htmlpreview.github.io/?https://github.com/STMicroelectronics/ssd1315/blob/main/Release_Notes.html). 27 | 28 | ## Compatibility information 29 | 30 | Please refer to the repository of the BSP **board** driver you are using to know which version of this BSP component driver to use. It is **crucial** that you use a consistent set of versions. 31 | 32 | ## Troubleshooting 33 | 34 | Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) guide. 35 | -------------------------------------------------------------------------------- /Release_Notes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Release Notes for SSD1315 Component Drivers 8 | 14 | 15 | 18 | 19 | 20 | 21 |
22 |
23 |
24 |

Release Notes for

25 |

SSD1315 LCD Component Drivers

26 |

Copyright © 2019-2023 STMicroelectronics
27 |

28 | 29 |
30 |

Purpose

31 |

This driver provides a set of functions for SSD1315 LCD component

32 |
33 |
34 |

Update History

35 |
36 | 37 |
38 |

Main Changes

39 |
    40 |
  • Review Scrolling Frequency definitions to follow SSD1315 specification 41 |
      42 |
    • Remove not supported SSD1315_SCROLL_FREQ_25FRAMES/SSD1315_SCROLL_FREQ_256FRAMES
    • 43 |
    • Update SSD1315_SCROLL_FREQ_5FRAMES/SSD1315_SCROLL_FREQ_64FRAMES/SSD1315_SCROLL_FREQ_128FRAMES with correct value
    • 44 |
    • Add SSD1315_SCROLL_FREQ_6FRAMES/SSD1315_SCROLL_FREQ_32FRAMES definitions
    • 45 |
  • 46 |
  • Update SSD1315_DrawBitmap() and SSD1315_ShiftBitmap() functions to avoid size divided by 2
  • 47 |
48 |
49 |
50 |
51 | 52 |
53 |

Main Changes

54 |
    55 |
  • Update disclaimer to add reference to the new license agreement
  • 56 |
57 |
58 |
59 |
60 | 61 |
62 |

Main Changes

63 |
    64 |
  • First official release of SSD1315 LCD Component Drivers in line with STM32Cube BSP drivers development guidelines (UM2298)
  • 65 |
  • The component drivers are composed of 66 |
      67 |
    • component core drivers files: ssd1315.h/.c
    • 68 |
    • component register drivers files: ssd1315_reg.h/.c
    • 69 |
  • 70 |
71 |

Backward Compatibility

72 |
    73 |
  • This version breaks the compatibility with previous versions
  • 74 |
75 |

Dependencies

76 |

This software release is compatible with:

77 |
    78 |
  • BSP Common v6.0.0 or above
  • 79 |
80 |
81 |
82 |
83 | 84 |
85 |

Main Changes

86 |
    87 |
  • Ticket 74733 - Correct typo in test to check if bitmap covers whole screen
  • 88 |
89 |
90 |
91 |
92 | 93 |
94 |

Main Changes

95 |
    96 |
  • First official release of SSD1315 LCD Component drivers
  • 97 |
98 |
99 |
100 |
101 |
102 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Report potential product security vulnerabilities 2 | 3 | ST places a high priority on security, and our Product Security Incident 4 | Response Team (PSIRT) is committed to rapidly addressing potential security 5 | vulnerabilities affecting our products. PSIRT's long history and vast experience 6 | in security allows ST to perform clear analyses and provide appropriate guidance 7 | on mitigations and solutions when applicable. 8 | 9 | If you wish to report potential security vulnerabilities regarding our products, 10 | **please do not report them through public GitHub issues.** Instead, we 11 | encourage you to report them to our ST PSIRT following the process described at: 12 | **https://www.st.com/content/st_com/en/security/report-vulnerabilities.html** 13 | 14 | ### IMPORTANT - READ CAREFULLY: 15 | 16 | STMicroelectronics International N.V., on behalf of itself, its affiliates and 17 | subsidiaries, (collectively “ST”) takes all potential security vulnerability 18 | reports or other related communications (“Report(s)”) seriously. In order to 19 | review Your Report (the terms “You” and “Yours” include your employer, and all 20 | affiliates, subsidiaries and related persons or entities) and take actions as 21 | deemed appropriate, ST requires that we have the rights and Your permission to 22 | do so. 23 | 24 | As such, by submitting Your Report to ST, You agree that You have the right to 25 | do so, and You grant to ST the rights to use the Report for purposes related to 26 | security vulnerability analysis, testing, correction, patching, reporting and 27 | any other related purpose or function. 28 | 29 | By submitting Your Report, You agree that ST’s 30 | [Privacy Policy](https://www.st.com/content/st_com/en/common/privacy-portal.html) 31 | applies to all related communications. 32 | -------------------------------------------------------------------------------- /_htmresc/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/STMicroelectronics/stm32-ssd1315/090ef0e0ed4cf0437d85a1eb1c4d311ab11c47d7/_htmresc/favicon.png -------------------------------------------------------------------------------- /_htmresc/mini-st_2020.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | /* 3 | Flavor name: Custom (mini-custom) 4 | Generated online - https://minicss.org/flavors 5 | mini.css version: v3.0.1 6 | */ 7 | /* 8 | Browsers resets and base typography. 9 | */ 10 | /* Core module CSS variable definitions */ 11 | :root { 12 | --fore-color: #03234b; 13 | --secondary-fore-color: #03234b; 14 | --back-color: #ffffff; 15 | --secondary-back-color: #ffffff; 16 | --blockquote-color: #e6007e; 17 | --pre-color: #e6007e; 18 | --border-color: #3cb4e6; 19 | --secondary-border-color: #3cb4e6; 20 | --heading-ratio: 1.2; 21 | --universal-margin: 0.5rem; 22 | --universal-padding: 0.25rem; 23 | --universal-border-radius: 0.075rem; 24 | --background-margin: 1.5%; 25 | --a-link-color: #3cb4e6; 26 | --a-visited-color: #8c0078; } 27 | 28 | html { 29 | font-size: 13.5px; } 30 | 31 | a, b, del, em, i, ins, q, span, strong, u { 32 | font-size: 1em; } 33 | 34 | html, * { 35 | font-family: -apple-system, BlinkMacSystemFont, Helvetica, arial, sans-serif; 36 | line-height: 1.25; 37 | -webkit-text-size-adjust: 100%; } 38 | 39 | * { 40 | font-size: 1rem; } 41 | 42 | body { 43 | margin: 0; 44 | color: var(--fore-color); 45 | @background: var(--back-color); 46 | background: var(--back-color) linear-gradient(#ffd200, #ffd200) repeat-y left top; 47 | background-size: var(--background-margin); 48 | } 49 | 50 | details { 51 | display: block; } 52 | 53 | summary { 54 | display: list-item; } 55 | 56 | abbr[title] { 57 | border-bottom: none; 58 | text-decoration: underline dotted; } 59 | 60 | input { 61 | overflow: visible; } 62 | 63 | img { 64 | max-width: 100%; 65 | height: auto; } 66 | 67 | h1, h2, h3, h4, h5, h6 { 68 | line-height: 1.25; 69 | margin: calc(1.5 * var(--universal-margin)) var(--universal-margin); 70 | font-weight: 400; } 71 | h1 small, h2 small, h3 small, h4 small, h5 small, h6 small { 72 | color: var(--secondary-fore-color); 73 | display: block; 74 | margin-top: -0.25rem; } 75 | 76 | h1 { 77 | font-size: calc(1rem * var(--heading-ratio) * var(--heading-ratio) * var(--heading-ratio)); } 78 | 79 | h2 { 80 | font-size: calc(1rem * var(--heading-ratio) * var(--heading-ratio) ); 81 | border-style: none none solid none ; 82 | border-width: thin; 83 | border-color: var(--border-color); } 84 | h3 { 85 | font-size: calc(1rem * var(--heading-ratio) ); } 86 | 87 | h4 { 88 | font-size: calc(1rem * var(--heading-ratio)); } 89 | 90 | h5 { 91 | font-size: 1rem; } 92 | 93 | h6 { 94 | font-size: calc(1rem / var(--heading-ratio)); } 95 | 96 | p { 97 | margin: var(--universal-margin); } 98 | 99 | ol, ul { 100 | margin: var(--universal-margin); 101 | padding-left: calc(3 * var(--universal-margin)); } 102 | 103 | b, strong { 104 | font-weight: 700; } 105 | 106 | hr { 107 | box-sizing: content-box; 108 | border: 0; 109 | line-height: 1.25em; 110 | margin: var(--universal-margin); 111 | height: 0.0714285714rem; 112 | background: linear-gradient(to right, transparent, var(--border-color) 20%, var(--border-color) 80%, transparent); } 113 | 114 | blockquote { 115 | display: block; 116 | position: relative; 117 | font-style: italic; 118 | color: var(--secondary-fore-color); 119 | margin: var(--universal-margin); 120 | padding: calc(3 * var(--universal-padding)); 121 | border: 0.0714285714rem solid var(--secondary-border-color); 122 | border-left: 0.3rem solid var(--blockquote-color); 123 | border-radius: 0 var(--universal-border-radius) var(--universal-border-radius) 0; } 124 | blockquote:before { 125 | position: absolute; 126 | top: calc(0rem - var(--universal-padding)); 127 | left: 0; 128 | font-family: sans-serif; 129 | font-size: 2rem; 130 | font-weight: 800; 131 | content: "\201c"; 132 | color: var(--blockquote-color); } 133 | blockquote[cite]:after { 134 | font-style: normal; 135 | font-size: 0.75em; 136 | font-weight: 700; 137 | content: "\a— " attr(cite); 138 | white-space: pre; } 139 | 140 | code, kbd, pre, samp { 141 | font-family: Menlo, Consolas, monospace; 142 | font-size: 0.85em; } 143 | 144 | code { 145 | background: var(--secondary-back-color); 146 | border-radius: var(--universal-border-radius); 147 | padding: calc(var(--universal-padding) / 4) calc(var(--universal-padding) / 2); } 148 | 149 | kbd { 150 | background: var(--fore-color); 151 | color: var(--back-color); 152 | border-radius: var(--universal-border-radius); 153 | padding: calc(var(--universal-padding) / 4) calc(var(--universal-padding) / 2); } 154 | 155 | pre { 156 | overflow: auto; 157 | background: var(--secondary-back-color); 158 | padding: calc(1.5 * var(--universal-padding)); 159 | margin: var(--universal-margin); 160 | border: 0.0714285714rem solid var(--secondary-border-color); 161 | border-left: 0.2857142857rem solid var(--pre-color); 162 | border-radius: 0 var(--universal-border-radius) var(--universal-border-radius) 0; } 163 | 164 | sup, sub, code, kbd { 165 | line-height: 0; 166 | position: relative; 167 | vertical-align: baseline; } 168 | 169 | small, sup, sub, figcaption { 170 | font-size: 0.75em; } 171 | 172 | sup { 173 | top: -0.5em; } 174 | 175 | sub { 176 | bottom: -0.25em; } 177 | 178 | figure { 179 | margin: var(--universal-margin); } 180 | 181 | figcaption { 182 | color: var(--secondary-fore-color); } 183 | 184 | a { 185 | text-decoration: none; } 186 | a:link { 187 | color: var(--a-link-color); } 188 | a:visited { 189 | color: var(--a-visited-color); } 190 | a:hover, a:focus { 191 | text-decoration: underline; } 192 | 193 | /* 194 | Definitions for the grid system, cards and containers. 195 | */ 196 | .container { 197 | margin: 0 auto; 198 | padding: 0 calc(1.5 * var(--universal-padding)); } 199 | 200 | .row { 201 | box-sizing: border-box; 202 | display: flex; 203 | flex: 0 1 auto; 204 | flex-flow: row wrap; 205 | margin: 0 0 0 var(--background-margin); } 206 | 207 | .col-sm, 208 | [class^='col-sm-'], 209 | [class^='col-sm-offset-'], 210 | .row[class*='cols-sm-'] > * { 211 | box-sizing: border-box; 212 | flex: 0 0 auto; 213 | padding: 0 calc(var(--universal-padding) / 2); } 214 | 215 | .col-sm, 216 | .row.cols-sm > * { 217 | max-width: 100%; 218 | flex-grow: 1; 219 | flex-basis: 0; } 220 | 221 | .col-sm-1, 222 | .row.cols-sm-1 > * { 223 | max-width: 8.3333333333%; 224 | flex-basis: 8.3333333333%; } 225 | 226 | .col-sm-offset-0 { 227 | margin-left: 0; } 228 | 229 | .col-sm-2, 230 | .row.cols-sm-2 > * { 231 | max-width: 16.6666666667%; 232 | flex-basis: 16.6666666667%; } 233 | 234 | .col-sm-offset-1 { 235 | margin-left: 8.3333333333%; } 236 | 237 | .col-sm-3, 238 | .row.cols-sm-3 > * { 239 | max-width: 25%; 240 | flex-basis: 25%; } 241 | 242 | .col-sm-offset-2 { 243 | margin-left: 16.6666666667%; } 244 | 245 | .col-sm-4, 246 | .row.cols-sm-4 > * { 247 | max-width: 33.3333333333%; 248 | flex-basis: 33.3333333333%; } 249 | 250 | .col-sm-offset-3 { 251 | margin-left: 25%; } 252 | 253 | .col-sm-5, 254 | .row.cols-sm-5 > * { 255 | max-width: 41.6666666667%; 256 | flex-basis: 41.6666666667%; } 257 | 258 | .col-sm-offset-4 { 259 | margin-left: 33.3333333333%; } 260 | 261 | .col-sm-6, 262 | .row.cols-sm-6 > * { 263 | max-width: 50%; 264 | flex-basis: 50%; } 265 | 266 | .col-sm-offset-5 { 267 | margin-left: 41.6666666667%; } 268 | 269 | .col-sm-7, 270 | .row.cols-sm-7 > * { 271 | max-width: 58.3333333333%; 272 | flex-basis: 58.3333333333%; } 273 | 274 | .col-sm-offset-6 { 275 | margin-left: 50%; } 276 | 277 | .col-sm-8, 278 | .row.cols-sm-8 > * { 279 | max-width: 66.6666666667%; 280 | flex-basis: 66.6666666667%; } 281 | 282 | .col-sm-offset-7 { 283 | margin-left: 58.3333333333%; } 284 | 285 | .col-sm-9, 286 | .row.cols-sm-9 > * { 287 | max-width: 75%; 288 | flex-basis: 75%; } 289 | 290 | .col-sm-offset-8 { 291 | margin-left: 66.6666666667%; } 292 | 293 | .col-sm-10, 294 | .row.cols-sm-10 > * { 295 | max-width: 83.3333333333%; 296 | flex-basis: 83.3333333333%; } 297 | 298 | .col-sm-offset-9 { 299 | margin-left: 75%; } 300 | 301 | .col-sm-11, 302 | .row.cols-sm-11 > * { 303 | max-width: 91.6666666667%; 304 | flex-basis: 91.6666666667%; } 305 | 306 | .col-sm-offset-10 { 307 | margin-left: 83.3333333333%; } 308 | 309 | .col-sm-12, 310 | .row.cols-sm-12 > * { 311 | max-width: 100%; 312 | flex-basis: 100%; } 313 | 314 | .col-sm-offset-11 { 315 | margin-left: 91.6666666667%; } 316 | 317 | .col-sm-normal { 318 | order: initial; } 319 | 320 | .col-sm-first { 321 | order: -999; } 322 | 323 | .col-sm-last { 324 | order: 999; } 325 | 326 | @media screen and (min-width: 500px) { 327 | .col-md, 328 | [class^='col-md-'], 329 | [class^='col-md-offset-'], 330 | .row[class*='cols-md-'] > * { 331 | box-sizing: border-box; 332 | flex: 0 0 auto; 333 | padding: 0 calc(var(--universal-padding) / 2); } 334 | 335 | .col-md, 336 | .row.cols-md > * { 337 | max-width: 100%; 338 | flex-grow: 1; 339 | flex-basis: 0; } 340 | 341 | .col-md-1, 342 | .row.cols-md-1 > * { 343 | max-width: 8.3333333333%; 344 | flex-basis: 8.3333333333%; } 345 | 346 | .col-md-offset-0 { 347 | margin-left: 0; } 348 | 349 | .col-md-2, 350 | .row.cols-md-2 > * { 351 | max-width: 16.6666666667%; 352 | flex-basis: 16.6666666667%; } 353 | 354 | .col-md-offset-1 { 355 | margin-left: 8.3333333333%; } 356 | 357 | .col-md-3, 358 | .row.cols-md-3 > * { 359 | max-width: 25%; 360 | flex-basis: 25%; } 361 | 362 | .col-md-offset-2 { 363 | margin-left: 16.6666666667%; } 364 | 365 | .col-md-4, 366 | .row.cols-md-4 > * { 367 | max-width: 33.3333333333%; 368 | flex-basis: 33.3333333333%; } 369 | 370 | .col-md-offset-3 { 371 | margin-left: 25%; } 372 | 373 | .col-md-5, 374 | .row.cols-md-5 > * { 375 | max-width: 41.6666666667%; 376 | flex-basis: 41.6666666667%; } 377 | 378 | .col-md-offset-4 { 379 | margin-left: 33.3333333333%; } 380 | 381 | .col-md-6, 382 | .row.cols-md-6 > * { 383 | max-width: 50%; 384 | flex-basis: 50%; } 385 | 386 | .col-md-offset-5 { 387 | margin-left: 41.6666666667%; } 388 | 389 | .col-md-7, 390 | .row.cols-md-7 > * { 391 | max-width: 58.3333333333%; 392 | flex-basis: 58.3333333333%; } 393 | 394 | .col-md-offset-6 { 395 | margin-left: 50%; } 396 | 397 | .col-md-8, 398 | .row.cols-md-8 > * { 399 | max-width: 66.6666666667%; 400 | flex-basis: 66.6666666667%; } 401 | 402 | .col-md-offset-7 { 403 | margin-left: 58.3333333333%; } 404 | 405 | .col-md-9, 406 | .row.cols-md-9 > * { 407 | max-width: 75%; 408 | flex-basis: 75%; } 409 | 410 | .col-md-offset-8 { 411 | margin-left: 66.6666666667%; } 412 | 413 | .col-md-10, 414 | .row.cols-md-10 > * { 415 | max-width: 83.3333333333%; 416 | flex-basis: 83.3333333333%; } 417 | 418 | .col-md-offset-9 { 419 | margin-left: 75%; } 420 | 421 | .col-md-11, 422 | .row.cols-md-11 > * { 423 | max-width: 91.6666666667%; 424 | flex-basis: 91.6666666667%; } 425 | 426 | .col-md-offset-10 { 427 | margin-left: 83.3333333333%; } 428 | 429 | .col-md-12, 430 | .row.cols-md-12 > * { 431 | max-width: 100%; 432 | flex-basis: 100%; } 433 | 434 | .col-md-offset-11 { 435 | margin-left: 91.6666666667%; } 436 | 437 | .col-md-normal { 438 | order: initial; } 439 | 440 | .col-md-first { 441 | order: -999; } 442 | 443 | .col-md-last { 444 | order: 999; } } 445 | @media screen and (min-width: 1280px) { 446 | .col-lg, 447 | [class^='col-lg-'], 448 | [class^='col-lg-offset-'], 449 | .row[class*='cols-lg-'] > * { 450 | box-sizing: border-box; 451 | flex: 0 0 auto; 452 | padding: 0 calc(var(--universal-padding) / 2); } 453 | 454 | .col-lg, 455 | .row.cols-lg > * { 456 | max-width: 100%; 457 | flex-grow: 1; 458 | flex-basis: 0; } 459 | 460 | .col-lg-1, 461 | .row.cols-lg-1 > * { 462 | max-width: 8.3333333333%; 463 | flex-basis: 8.3333333333%; } 464 | 465 | .col-lg-offset-0 { 466 | margin-left: 0; } 467 | 468 | .col-lg-2, 469 | .row.cols-lg-2 > * { 470 | max-width: 16.6666666667%; 471 | flex-basis: 16.6666666667%; } 472 | 473 | .col-lg-offset-1 { 474 | margin-left: 8.3333333333%; } 475 | 476 | .col-lg-3, 477 | .row.cols-lg-3 > * { 478 | max-width: 25%; 479 | flex-basis: 25%; } 480 | 481 | .col-lg-offset-2 { 482 | margin-left: 16.6666666667%; } 483 | 484 | .col-lg-4, 485 | .row.cols-lg-4 > * { 486 | max-width: 33.3333333333%; 487 | flex-basis: 33.3333333333%; } 488 | 489 | .col-lg-offset-3 { 490 | margin-left: 25%; } 491 | 492 | .col-lg-5, 493 | .row.cols-lg-5 > * { 494 | max-width: 41.6666666667%; 495 | flex-basis: 41.6666666667%; } 496 | 497 | .col-lg-offset-4 { 498 | margin-left: 33.3333333333%; } 499 | 500 | .col-lg-6, 501 | .row.cols-lg-6 > * { 502 | max-width: 50%; 503 | flex-basis: 50%; } 504 | 505 | .col-lg-offset-5 { 506 | margin-left: 41.6666666667%; } 507 | 508 | .col-lg-7, 509 | .row.cols-lg-7 > * { 510 | max-width: 58.3333333333%; 511 | flex-basis: 58.3333333333%; } 512 | 513 | .col-lg-offset-6 { 514 | margin-left: 50%; } 515 | 516 | .col-lg-8, 517 | .row.cols-lg-8 > * { 518 | max-width: 66.6666666667%; 519 | flex-basis: 66.6666666667%; } 520 | 521 | .col-lg-offset-7 { 522 | margin-left: 58.3333333333%; } 523 | 524 | .col-lg-9, 525 | .row.cols-lg-9 > * { 526 | max-width: 75%; 527 | flex-basis: 75%; } 528 | 529 | .col-lg-offset-8 { 530 | margin-left: 66.6666666667%; } 531 | 532 | .col-lg-10, 533 | .row.cols-lg-10 > * { 534 | max-width: 83.3333333333%; 535 | flex-basis: 83.3333333333%; } 536 | 537 | .col-lg-offset-9 { 538 | margin-left: 75%; } 539 | 540 | .col-lg-11, 541 | .row.cols-lg-11 > * { 542 | max-width: 91.6666666667%; 543 | flex-basis: 91.6666666667%; } 544 | 545 | .col-lg-offset-10 { 546 | margin-left: 83.3333333333%; } 547 | 548 | .col-lg-12, 549 | .row.cols-lg-12 > * { 550 | max-width: 100%; 551 | flex-basis: 100%; } 552 | 553 | .col-lg-offset-11 { 554 | margin-left: 91.6666666667%; } 555 | 556 | .col-lg-normal { 557 | order: initial; } 558 | 559 | .col-lg-first { 560 | order: -999; } 561 | 562 | .col-lg-last { 563 | order: 999; } } 564 | /* Card component CSS variable definitions */ 565 | :root { 566 | --card-back-color: #3cb4e6; 567 | --card-fore-color: #03234b; 568 | --card-border-color: #03234b; } 569 | 570 | .card { 571 | display: flex; 572 | flex-direction: column; 573 | justify-content: space-between; 574 | align-self: center; 575 | position: relative; 576 | width: 100%; 577 | background: var(--card-back-color); 578 | color: var(--card-fore-color); 579 | border: 0.0714285714rem solid var(--card-border-color); 580 | border-radius: var(--universal-border-radius); 581 | margin: var(--universal-margin); 582 | overflow: hidden; } 583 | @media screen and (min-width: 320px) { 584 | .card { 585 | max-width: 320px; } } 586 | .card > .sectione { 587 | background: var(--card-back-color); 588 | color: var(--card-fore-color); 589 | box-sizing: border-box; 590 | margin: 0; 591 | border: 0; 592 | border-radius: 0; 593 | border-bottom: 0.0714285714rem solid var(--card-border-color); 594 | padding: var(--universal-padding); 595 | width: 100%; } 596 | .card > .sectione.media { 597 | height: 200px; 598 | padding: 0; 599 | -o-object-fit: cover; 600 | object-fit: cover; } 601 | .card > .sectione:last-child { 602 | border-bottom: 0; } 603 | 604 | /* 605 | Custom elements for card elements. 606 | */ 607 | @media screen and (min-width: 240px) { 608 | .card.small { 609 | max-width: 240px; } } 610 | @media screen and (min-width: 480px) { 611 | .card.large { 612 | max-width: 480px; } } 613 | .card.fluid { 614 | max-width: 100%; 615 | width: auto; } 616 | 617 | .card.warning { 618 | --card-back-color: #e5b8b7; 619 | --card-fore-color: #3b234b; 620 | --card-border-color: #8c0078; } 621 | 622 | .card.error { 623 | --card-back-color: #464650; 624 | --card-fore-color: #ffffff; 625 | --card-border-color: #8c0078; } 626 | 627 | .card > .sectione.dark { 628 | --card-back-color: #3b234b; 629 | --card-fore-color: #ffffff; } 630 | 631 | .card > .sectione.double-padded { 632 | padding: calc(1.5 * var(--universal-padding)); } 633 | 634 | /* 635 | Definitions for forms and input elements. 636 | */ 637 | /* Input_control module CSS variable definitions */ 638 | :root { 639 | --form-back-color: #ffe97f; 640 | --form-fore-color: #03234b; 641 | --form-border-color: #3cb4e6; 642 | --input-back-color: #ffffff; 643 | --input-fore-color: #03234b; 644 | --input-border-color: #3cb4e6; 645 | --input-focus-color: #0288d1; 646 | --input-invalid-color: #d32f2f; 647 | --button-back-color: #e2e2e2; 648 | --button-hover-back-color: #dcdcdc; 649 | --button-fore-color: #212121; 650 | --button-border-color: transparent; 651 | --button-hover-border-color: transparent; 652 | --button-group-border-color: rgba(124, 124, 124, 0.54); } 653 | 654 | form { 655 | background: var(--form-back-color); 656 | color: var(--form-fore-color); 657 | border: 0.0714285714rem solid var(--form-border-color); 658 | border-radius: var(--universal-border-radius); 659 | margin: var(--universal-margin); 660 | padding: calc(2 * var(--universal-padding)) var(--universal-padding); } 661 | 662 | fieldset { 663 | border: 0.0714285714rem solid var(--form-border-color); 664 | border-radius: var(--universal-border-radius); 665 | margin: calc(var(--universal-margin) / 4); 666 | padding: var(--universal-padding); } 667 | 668 | legend { 669 | box-sizing: border-box; 670 | display: table; 671 | max-width: 100%; 672 | white-space: normal; 673 | font-weight: 500; 674 | padding: calc(var(--universal-padding) / 2); } 675 | 676 | label { 677 | padding: calc(var(--universal-padding) / 2) var(--universal-padding); } 678 | 679 | .input-group { 680 | display: inline-block; } 681 | .input-group.fluid { 682 | display: flex; 683 | align-items: center; 684 | justify-content: center; } 685 | .input-group.fluid > input { 686 | max-width: 100%; 687 | flex-grow: 1; 688 | flex-basis: 0px; } 689 | @media screen and (max-width: 499px) { 690 | .input-group.fluid { 691 | align-items: stretch; 692 | flex-direction: column; } } 693 | .input-group.vertical { 694 | display: flex; 695 | align-items: stretch; 696 | flex-direction: column; } 697 | .input-group.vertical > input { 698 | max-width: 100%; 699 | flex-grow: 1; 700 | flex-basis: 0px; } 701 | 702 | [type="number"]::-webkit-inner-spin-button, [type="number"]::-webkit-outer-spin-button { 703 | height: auto; } 704 | 705 | [type="search"] { 706 | -webkit-appearance: textfield; 707 | outline-offset: -2px; } 708 | 709 | [type="search"]::-webkit-search-cancel-button, 710 | [type="search"]::-webkit-search-decoration { 711 | -webkit-appearance: none; } 712 | 713 | input:not([type]), [type="text"], [type="email"], [type="number"], [type="search"], 714 | [type="password"], [type="url"], [type="tel"], [type="checkbox"], [type="radio"], textarea, select { 715 | box-sizing: border-box; 716 | background: var(--input-back-color); 717 | color: var(--input-fore-color); 718 | border: 0.0714285714rem solid var(--input-border-color); 719 | border-radius: var(--universal-border-radius); 720 | margin: calc(var(--universal-margin) / 2); 721 | padding: var(--universal-padding) calc(1.5 * var(--universal-padding)); } 722 | 723 | input:not([type="button"]):not([type="submit"]):not([type="reset"]):hover, input:not([type="button"]):not([type="submit"]):not([type="reset"]):focus, textarea:hover, textarea:focus, select:hover, select:focus { 724 | border-color: var(--input-focus-color); 725 | box-shadow: none; } 726 | input:not([type="button"]):not([type="submit"]):not([type="reset"]):invalid, input:not([type="button"]):not([type="submit"]):not([type="reset"]):focus:invalid, textarea:invalid, textarea:focus:invalid, select:invalid, select:focus:invalid { 727 | border-color: var(--input-invalid-color); 728 | box-shadow: none; } 729 | input:not([type="button"]):not([type="submit"]):not([type="reset"])[readonly], textarea[readonly], select[readonly] { 730 | background: var(--secondary-back-color); } 731 | 732 | select { 733 | max-width: 100%; } 734 | 735 | option { 736 | overflow: hidden; 737 | text-overflow: ellipsis; } 738 | 739 | [type="checkbox"], [type="radio"] { 740 | -webkit-appearance: none; 741 | -moz-appearance: none; 742 | appearance: none; 743 | position: relative; 744 | height: calc(1rem + var(--universal-padding) / 2); 745 | width: calc(1rem + var(--universal-padding) / 2); 746 | vertical-align: text-bottom; 747 | padding: 0; 748 | flex-basis: calc(1rem + var(--universal-padding) / 2) !important; 749 | flex-grow: 0 !important; } 750 | [type="checkbox"]:checked:before, [type="radio"]:checked:before { 751 | position: absolute; } 752 | 753 | [type="checkbox"]:checked:before { 754 | content: '\2713'; 755 | font-family: sans-serif; 756 | font-size: calc(1rem + var(--universal-padding) / 2); 757 | top: calc(0rem - var(--universal-padding)); 758 | left: calc(var(--universal-padding) / 4); } 759 | 760 | [type="radio"] { 761 | border-radius: 100%; } 762 | [type="radio"]:checked:before { 763 | border-radius: 100%; 764 | content: ''; 765 | top: calc(0.0714285714rem + var(--universal-padding) / 2); 766 | left: calc(0.0714285714rem + var(--universal-padding) / 2); 767 | background: var(--input-fore-color); 768 | width: 0.5rem; 769 | height: 0.5rem; } 770 | 771 | :placeholder-shown { 772 | color: var(--input-fore-color); } 773 | 774 | ::-ms-placeholder { 775 | color: var(--input-fore-color); 776 | opacity: 0.54; } 777 | 778 | button::-moz-focus-inner, [type="button"]::-moz-focus-inner, [type="reset"]::-moz-focus-inner, [type="submit"]::-moz-focus-inner { 779 | border-style: none; 780 | padding: 0; } 781 | 782 | button, html [type="button"], [type="reset"], [type="submit"] { 783 | -webkit-appearance: button; } 784 | 785 | button { 786 | overflow: visible; 787 | text-transform: none; } 788 | 789 | button, [type="button"], [type="submit"], [type="reset"], 790 | a.button, label.button, .button, 791 | a[role="button"], label[role="button"], [role="button"] { 792 | display: inline-block; 793 | background: var(--button-back-color); 794 | color: var(--button-fore-color); 795 | border: 0.0714285714rem solid var(--button-border-color); 796 | border-radius: var(--universal-border-radius); 797 | padding: var(--universal-padding) calc(1.5 * var(--universal-padding)); 798 | margin: var(--universal-margin); 799 | text-decoration: none; 800 | cursor: pointer; 801 | transition: background 0.3s; } 802 | button:hover, button:focus, [type="button"]:hover, [type="button"]:focus, [type="submit"]:hover, [type="submit"]:focus, [type="reset"]:hover, [type="reset"]:focus, 803 | a.button:hover, 804 | a.button:focus, label.button:hover, label.button:focus, .button:hover, .button:focus, 805 | a[role="button"]:hover, 806 | a[role="button"]:focus, label[role="button"]:hover, label[role="button"]:focus, [role="button"]:hover, [role="button"]:focus { 807 | background: var(--button-hover-back-color); 808 | border-color: var(--button-hover-border-color); } 809 | 810 | input:disabled, input[disabled], textarea:disabled, textarea[disabled], select:disabled, select[disabled], button:disabled, button[disabled], .button:disabled, .button[disabled], [role="button"]:disabled, [role="button"][disabled] { 811 | cursor: not-allowed; 812 | opacity: 0.75; } 813 | 814 | .button-group { 815 | display: flex; 816 | border: 0.0714285714rem solid var(--button-group-border-color); 817 | border-radius: var(--universal-border-radius); 818 | margin: var(--universal-margin); } 819 | .button-group > button, .button-group [type="button"], .button-group > [type="submit"], .button-group > [type="reset"], .button-group > .button, .button-group > [role="button"] { 820 | margin: 0; 821 | max-width: 100%; 822 | flex: 1 1 auto; 823 | text-align: center; 824 | border: 0; 825 | border-radius: 0; 826 | box-shadow: none; } 827 | .button-group > :not(:first-child) { 828 | border-left: 0.0714285714rem solid var(--button-group-border-color); } 829 | @media screen and (max-width: 499px) { 830 | .button-group { 831 | flex-direction: column; } 832 | .button-group > :not(:first-child) { 833 | border: 0; 834 | border-top: 0.0714285714rem solid var(--button-group-border-color); } } 835 | 836 | /* 837 | Custom elements for forms and input elements. 838 | */ 839 | button.primary, [type="button"].primary, [type="submit"].primary, [type="reset"].primary, .button.primary, [role="button"].primary { 840 | --button-back-color: #1976d2; 841 | --button-fore-color: #f8f8f8; } 842 | button.primary:hover, button.primary:focus, [type="button"].primary:hover, [type="button"].primary:focus, [type="submit"].primary:hover, [type="submit"].primary:focus, [type="reset"].primary:hover, [type="reset"].primary:focus, .button.primary:hover, .button.primary:focus, [role="button"].primary:hover, [role="button"].primary:focus { 843 | --button-hover-back-color: #1565c0; } 844 | 845 | button.secondary, [type="button"].secondary, [type="submit"].secondary, [type="reset"].secondary, .button.secondary, [role="button"].secondary { 846 | --button-back-color: #d32f2f; 847 | --button-fore-color: #f8f8f8; } 848 | button.secondary:hover, button.secondary:focus, [type="button"].secondary:hover, [type="button"].secondary:focus, [type="submit"].secondary:hover, [type="submit"].secondary:focus, [type="reset"].secondary:hover, [type="reset"].secondary:focus, .button.secondary:hover, .button.secondary:focus, [role="button"].secondary:hover, [role="button"].secondary:focus { 849 | --button-hover-back-color: #c62828; } 850 | 851 | button.tertiary, [type="button"].tertiary, [type="submit"].tertiary, [type="reset"].tertiary, .button.tertiary, [role="button"].tertiary { 852 | --button-back-color: #308732; 853 | --button-fore-color: #f8f8f8; } 854 | button.tertiary:hover, button.tertiary:focus, [type="button"].tertiary:hover, [type="button"].tertiary:focus, [type="submit"].tertiary:hover, [type="submit"].tertiary:focus, [type="reset"].tertiary:hover, [type="reset"].tertiary:focus, .button.tertiary:hover, .button.tertiary:focus, [role="button"].tertiary:hover, [role="button"].tertiary:focus { 855 | --button-hover-back-color: #277529; } 856 | 857 | button.inverse, [type="button"].inverse, [type="submit"].inverse, [type="reset"].inverse, .button.inverse, [role="button"].inverse { 858 | --button-back-color: #212121; 859 | --button-fore-color: #f8f8f8; } 860 | button.inverse:hover, button.inverse:focus, [type="button"].inverse:hover, [type="button"].inverse:focus, [type="submit"].inverse:hover, [type="submit"].inverse:focus, [type="reset"].inverse:hover, [type="reset"].inverse:focus, .button.inverse:hover, .button.inverse:focus, [role="button"].inverse:hover, [role="button"].inverse:focus { 861 | --button-hover-back-color: #111; } 862 | 863 | button.small, [type="button"].small, [type="submit"].small, [type="reset"].small, .button.small, [role="button"].small { 864 | padding: calc(0.5 * var(--universal-padding)) calc(0.75 * var(--universal-padding)); 865 | margin: var(--universal-margin); } 866 | 867 | button.large, [type="button"].large, [type="submit"].large, [type="reset"].large, .button.large, [role="button"].large { 868 | padding: calc(1.5 * var(--universal-padding)) calc(2 * var(--universal-padding)); 869 | margin: var(--universal-margin); } 870 | 871 | /* 872 | Definitions for navigation elements. 873 | */ 874 | /* Navigation module CSS variable definitions */ 875 | :root { 876 | --header-back-color: #03234b; 877 | --header-hover-back-color: #ffd200; 878 | --header-fore-color: #ffffff; 879 | --header-border-color: #3cb4e6; 880 | --nav-back-color: #ffffff; 881 | --nav-hover-back-color: #ffe97f; 882 | --nav-fore-color: #e6007e; 883 | --nav-border-color: #3cb4e6; 884 | --nav-link-color: #3cb4e6; 885 | --footer-fore-color: #ffffff; 886 | --footer-back-color: #03234b; 887 | --footer-border-color: #3cb4e6; 888 | --footer-link-color: #3cb4e6; 889 | --drawer-back-color: #ffffff; 890 | --drawer-hover-back-color: #ffe97f; 891 | --drawer-border-color: #3cb4e6; 892 | --drawer-close-color: #e6007e; } 893 | 894 | header { 895 | height: 2.75rem; 896 | background: var(--header-back-color); 897 | color: var(--header-fore-color); 898 | border-bottom: 0.0714285714rem solid var(--header-border-color); 899 | padding: calc(var(--universal-padding) / 4) 0; 900 | white-space: nowrap; 901 | overflow-x: auto; 902 | overflow-y: hidden; } 903 | header.row { 904 | box-sizing: content-box; } 905 | header .logo { 906 | color: var(--header-fore-color); 907 | font-size: 1.75rem; 908 | padding: var(--universal-padding) calc(2 * var(--universal-padding)); 909 | text-decoration: none; } 910 | header button, header [type="button"], header .button, header [role="button"] { 911 | box-sizing: border-box; 912 | position: relative; 913 | top: calc(0rem - var(--universal-padding) / 4); 914 | height: calc(3.1875rem + var(--universal-padding) / 2); 915 | background: var(--header-back-color); 916 | line-height: calc(3.1875rem - var(--universal-padding) * 1.5); 917 | text-align: center; 918 | color: var(--header-fore-color); 919 | border: 0; 920 | border-radius: 0; 921 | margin: 0; 922 | text-transform: uppercase; } 923 | header button:hover, header button:focus, header [type="button"]:hover, header [type="button"]:focus, header .button:hover, header .button:focus, header [role="button"]:hover, header [role="button"]:focus { 924 | background: var(--header-hover-back-color); } 925 | 926 | nav { 927 | background: var(--nav-back-color); 928 | color: var(--nav-fore-color); 929 | border: 0.0714285714rem solid var(--nav-border-color); 930 | border-radius: var(--universal-border-radius); 931 | margin: var(--universal-margin); } 932 | nav * { 933 | padding: var(--universal-padding) calc(1.5 * var(--universal-padding)); } 934 | nav a, nav a:visited { 935 | display: block; 936 | color: var(--nav-link-color); 937 | border-radius: var(--universal-border-radius); 938 | transition: background 0.3s; } 939 | nav a:hover, nav a:focus, nav a:visited:hover, nav a:visited:focus { 940 | text-decoration: none; 941 | background: var(--nav-hover-back-color); } 942 | nav .sublink-1 { 943 | position: relative; 944 | margin-left: calc(2 * var(--universal-padding)); } 945 | nav .sublink-1:before { 946 | position: absolute; 947 | left: calc(var(--universal-padding) - 1 * var(--universal-padding)); 948 | top: -0.0714285714rem; 949 | content: ''; 950 | height: 100%; 951 | border: 0.0714285714rem solid var(--nav-border-color); 952 | border-left: 0; } 953 | nav .sublink-2 { 954 | position: relative; 955 | margin-left: calc(4 * var(--universal-padding)); } 956 | nav .sublink-2:before { 957 | position: absolute; 958 | left: calc(var(--universal-padding) - 3 * var(--universal-padding)); 959 | top: -0.0714285714rem; 960 | content: ''; 961 | height: 100%; 962 | border: 0.0714285714rem solid var(--nav-border-color); 963 | border-left: 0; } 964 | 965 | footer { 966 | background: var(--footer-back-color); 967 | color: var(--footer-fore-color); 968 | border-top: 0.0714285714rem solid var(--footer-border-color); 969 | padding: calc(2 * var(--universal-padding)) var(--universal-padding); 970 | font-size: 0.875rem; } 971 | footer a, footer a:visited { 972 | color: var(--footer-link-color); } 973 | 974 | header.sticky { 975 | position: -webkit-sticky; 976 | position: sticky; 977 | z-index: 1101; 978 | top: 0; } 979 | 980 | footer.sticky { 981 | position: -webkit-sticky; 982 | position: sticky; 983 | z-index: 1101; 984 | bottom: 0; } 985 | 986 | .drawer-toggle:before { 987 | display: inline-block; 988 | position: relative; 989 | vertical-align: bottom; 990 | content: '\00a0\2261\00a0'; 991 | font-family: sans-serif; 992 | font-size: 1.5em; } 993 | @media screen and (min-width: 500px) { 994 | .drawer-toggle:not(.persistent) { 995 | display: none; } } 996 | 997 | [type="checkbox"].drawer { 998 | height: 1px; 999 | width: 1px; 1000 | margin: -1px; 1001 | overflow: hidden; 1002 | position: absolute; 1003 | clip: rect(0 0 0 0); 1004 | -webkit-clip-path: inset(100%); 1005 | clip-path: inset(100%); } 1006 | [type="checkbox"].drawer + * { 1007 | display: block; 1008 | box-sizing: border-box; 1009 | position: fixed; 1010 | top: 0; 1011 | width: 320px; 1012 | height: 100vh; 1013 | overflow-y: auto; 1014 | background: var(--drawer-back-color); 1015 | border: 0.0714285714rem solid var(--drawer-border-color); 1016 | border-radius: 0; 1017 | margin: 0; 1018 | z-index: 1110; 1019 | right: -320px; 1020 | transition: right 0.3s; } 1021 | [type="checkbox"].drawer + * .drawer-close { 1022 | position: absolute; 1023 | top: var(--universal-margin); 1024 | right: var(--universal-margin); 1025 | z-index: 1111; 1026 | width: 2rem; 1027 | height: 2rem; 1028 | border-radius: var(--universal-border-radius); 1029 | padding: var(--universal-padding); 1030 | margin: 0; 1031 | cursor: pointer; 1032 | transition: background 0.3s; } 1033 | [type="checkbox"].drawer + * .drawer-close:before { 1034 | display: block; 1035 | content: '\00D7'; 1036 | color: var(--drawer-close-color); 1037 | position: relative; 1038 | font-family: sans-serif; 1039 | font-size: 2rem; 1040 | line-height: 1; 1041 | text-align: center; } 1042 | [type="checkbox"].drawer + * .drawer-close:hover, [type="checkbox"].drawer + * .drawer-close:focus { 1043 | background: var(--drawer-hover-back-color); } 1044 | @media screen and (max-width: 320px) { 1045 | [type="checkbox"].drawer + * { 1046 | width: 100%; } } 1047 | [type="checkbox"].drawer:checked + * { 1048 | right: 0; } 1049 | @media screen and (min-width: 500px) { 1050 | [type="checkbox"].drawer:not(.persistent) + * { 1051 | position: static; 1052 | height: 100%; 1053 | z-index: 1100; } 1054 | [type="checkbox"].drawer:not(.persistent) + * .drawer-close { 1055 | display: none; } } 1056 | 1057 | /* 1058 | Definitions for the responsive table component. 1059 | */ 1060 | /* Table module CSS variable definitions. */ 1061 | :root { 1062 | --table-border-color: #03234b; 1063 | --table-border-separator-color: #03234b; 1064 | --table-head-back-color: #03234b; 1065 | --table-head-fore-color: #ffffff; 1066 | --table-body-back-color: #ffffff; 1067 | --table-body-fore-color: #03234b; 1068 | --table-body-alt-back-color: #f4f4f4; } 1069 | 1070 | table { 1071 | border-collapse: separate; 1072 | border-spacing: 0; 1073 | margin: 0; 1074 | display: flex; 1075 | flex: 0 1 auto; 1076 | flex-flow: row wrap; 1077 | padding: var(--universal-padding); 1078 | padding-top: 0; } 1079 | table caption { 1080 | font-size: 1rem; 1081 | margin: calc(2 * var(--universal-margin)) 0; 1082 | max-width: 100%; 1083 | flex: 0 0 100%; } 1084 | table thead, table tbody { 1085 | display: flex; 1086 | flex-flow: row wrap; 1087 | border: 0.0714285714rem solid var(--table-border-color); } 1088 | table thead { 1089 | z-index: 999; 1090 | border-radius: var(--universal-border-radius) var(--universal-border-radius) 0 0; 1091 | border-bottom: 0.0714285714rem solid var(--table-border-separator-color); } 1092 | table tbody { 1093 | border-top: 0; 1094 | margin-top: calc(0 - var(--universal-margin)); 1095 | border-radius: 0 0 var(--universal-border-radius) var(--universal-border-radius); } 1096 | table tr { 1097 | display: flex; 1098 | padding: 0; } 1099 | table th, table td { 1100 | padding: calc(0.5 * var(--universal-padding)); 1101 | font-size: 0.9rem; } 1102 | table th { 1103 | text-align: left; 1104 | background: var(--table-head-back-color); 1105 | color: var(--table-head-fore-color); } 1106 | table td { 1107 | background: var(--table-body-back-color); 1108 | color: var(--table-body-fore-color); 1109 | border-top: 0.0714285714rem solid var(--table-border-color); } 1110 | 1111 | table:not(.horizontal) { 1112 | overflow: auto; 1113 | max-height: 100%; } 1114 | table:not(.horizontal) thead, table:not(.horizontal) tbody { 1115 | max-width: 100%; 1116 | flex: 0 0 100%; } 1117 | table:not(.horizontal) tr { 1118 | flex-flow: row wrap; 1119 | flex: 0 0 100%; } 1120 | table:not(.horizontal) th, table:not(.horizontal) td { 1121 | flex: 1 0 0%; 1122 | overflow: hidden; 1123 | text-overflow: ellipsis; } 1124 | table:not(.horizontal) thead { 1125 | position: sticky; 1126 | top: 0; } 1127 | table:not(.horizontal) tbody tr:first-child td { 1128 | border-top: 0; } 1129 | 1130 | table.horizontal { 1131 | border: 0; } 1132 | table.horizontal thead, table.horizontal tbody { 1133 | border: 0; 1134 | flex: .2 0 0; 1135 | flex-flow: row nowrap; } 1136 | table.horizontal tbody { 1137 | overflow: auto; 1138 | justify-content: space-between; 1139 | flex: .8 0 0; 1140 | margin-left: 0; 1141 | padding-bottom: calc(var(--universal-padding) / 4); } 1142 | table.horizontal tr { 1143 | flex-direction: column; 1144 | flex: 1 0 auto; } 1145 | table.horizontal th, table.horizontal td { 1146 | width: auto; 1147 | border: 0; 1148 | border-bottom: 0.0714285714rem solid var(--table-border-color); } 1149 | table.horizontal th:not(:first-child), table.horizontal td:not(:first-child) { 1150 | border-top: 0; } 1151 | table.horizontal th { 1152 | text-align: right; 1153 | border-left: 0.0714285714rem solid var(--table-border-color); 1154 | border-right: 0.0714285714rem solid var(--table-border-separator-color); } 1155 | table.horizontal thead tr:first-child { 1156 | padding-left: 0; } 1157 | table.horizontal th:first-child, table.horizontal td:first-child { 1158 | border-top: 0.0714285714rem solid var(--table-border-color); } 1159 | table.horizontal tbody tr:last-child td { 1160 | border-right: 0.0714285714rem solid var(--table-border-color); } 1161 | table.horizontal tbody tr:last-child td:first-child { 1162 | border-top-right-radius: 0.25rem; } 1163 | table.horizontal tbody tr:last-child td:last-child { 1164 | border-bottom-right-radius: 0.25rem; } 1165 | table.horizontal thead tr:first-child th:first-child { 1166 | border-top-left-radius: 0.25rem; } 1167 | table.horizontal thead tr:first-child th:last-child { 1168 | border-bottom-left-radius: 0.25rem; } 1169 | 1170 | @media screen and (max-width: 499px) { 1171 | table, table.horizontal { 1172 | border-collapse: collapse; 1173 | border: 0; 1174 | width: 100%; 1175 | display: table; } 1176 | table thead, table th, table.horizontal thead, table.horizontal th { 1177 | border: 0; 1178 | height: 1px; 1179 | width: 1px; 1180 | margin: -1px; 1181 | overflow: hidden; 1182 | padding: 0; 1183 | position: absolute; 1184 | clip: rect(0 0 0 0); 1185 | -webkit-clip-path: inset(100%); 1186 | clip-path: inset(100%); } 1187 | table tbody, table.horizontal tbody { 1188 | border: 0; 1189 | display: table-row-group; } 1190 | table tr, table.horizontal tr { 1191 | display: block; 1192 | border: 0.0714285714rem solid var(--table-border-color); 1193 | border-radius: var(--universal-border-radius); 1194 | background: #ffffff; 1195 | padding: var(--universal-padding); 1196 | margin: var(--universal-margin); 1197 | margin-bottom: calc(1 * var(--universal-margin)); } 1198 | table th, table td, table.horizontal th, table.horizontal td { 1199 | width: auto; } 1200 | table td, table.horizontal td { 1201 | display: block; 1202 | border: 0; 1203 | text-align: right; } 1204 | table td:before, table.horizontal td:before { 1205 | content: attr(data-label); 1206 | float: left; 1207 | font-weight: 600; } 1208 | table th:first-child, table td:first-child, table.horizontal th:first-child, table.horizontal td:first-child { 1209 | border-top: 0; } 1210 | table tbody tr:last-child td, table.horizontal tbody tr:last-child td { 1211 | border-right: 0; } } 1212 | table tr:nth-of-type(2n) > td { 1213 | background: var(--table-body-alt-back-color); } 1214 | 1215 | @media screen and (max-width: 500px) { 1216 | table tr:nth-of-type(2n) { 1217 | background: var(--table-body-alt-back-color); } } 1218 | :root { 1219 | --table-body-hover-back-color: #90caf9; } 1220 | 1221 | table.hoverable tr:hover, table.hoverable tr:hover > td, table.hoverable tr:focus, table.hoverable tr:focus > td { 1222 | background: var(--table-body-hover-back-color); } 1223 | 1224 | @media screen and (max-width: 500px) { 1225 | table.hoverable tr:hover, table.hoverable tr:hover > td, table.hoverable tr:focus, table.hoverable tr:focus > td { 1226 | background: var(--table-body-hover-back-color); } } 1227 | /* 1228 | Definitions for contextual background elements, toasts and tooltips. 1229 | */ 1230 | /* Contextual module CSS variable definitions */ 1231 | :root { 1232 | --mark-back-color: #3cb4e6; 1233 | --mark-fore-color: #ffffff; } 1234 | 1235 | mark { 1236 | background: var(--mark-back-color); 1237 | color: var(--mark-fore-color); 1238 | font-size: 0.95em; 1239 | line-height: 1em; 1240 | border-radius: var(--universal-border-radius); 1241 | padding: calc(var(--universal-padding) / 4) var(--universal-padding); } 1242 | mark.inline-block { 1243 | display: inline-block; 1244 | font-size: 1em; 1245 | line-height: 1.4; 1246 | padding: calc(var(--universal-padding) / 2) var(--universal-padding); } 1247 | 1248 | :root { 1249 | --toast-back-color: #424242; 1250 | --toast-fore-color: #fafafa; } 1251 | 1252 | .toast { 1253 | position: fixed; 1254 | bottom: calc(var(--universal-margin) * 3); 1255 | left: 50%; 1256 | transform: translate(-50%, -50%); 1257 | z-index: 1111; 1258 | color: var(--toast-fore-color); 1259 | background: var(--toast-back-color); 1260 | border-radius: calc(var(--universal-border-radius) * 16); 1261 | padding: var(--universal-padding) calc(var(--universal-padding) * 3); } 1262 | 1263 | :root { 1264 | --tooltip-back-color: #212121; 1265 | --tooltip-fore-color: #fafafa; } 1266 | 1267 | .tooltip { 1268 | position: relative; 1269 | display: inline-block; } 1270 | .tooltip:before, .tooltip:after { 1271 | position: absolute; 1272 | opacity: 0; 1273 | clip: rect(0 0 0 0); 1274 | -webkit-clip-path: inset(100%); 1275 | clip-path: inset(100%); 1276 | transition: all 0.3s; 1277 | z-index: 1010; 1278 | left: 50%; } 1279 | .tooltip:not(.bottom):before, .tooltip:not(.bottom):after { 1280 | bottom: 75%; } 1281 | .tooltip.bottom:before, .tooltip.bottom:after { 1282 | top: 75%; } 1283 | .tooltip:hover:before, .tooltip:hover:after, .tooltip:focus:before, .tooltip:focus:after { 1284 | opacity: 1; 1285 | clip: auto; 1286 | -webkit-clip-path: inset(0%); 1287 | clip-path: inset(0%); } 1288 | .tooltip:before { 1289 | content: ''; 1290 | background: transparent; 1291 | border: var(--universal-margin) solid transparent; 1292 | left: calc(50% - var(--universal-margin)); } 1293 | .tooltip:not(.bottom):before { 1294 | border-top-color: #212121; } 1295 | .tooltip.bottom:before { 1296 | border-bottom-color: #212121; } 1297 | .tooltip:after { 1298 | content: attr(aria-label); 1299 | color: var(--tooltip-fore-color); 1300 | background: var(--tooltip-back-color); 1301 | border-radius: var(--universal-border-radius); 1302 | padding: var(--universal-padding); 1303 | white-space: nowrap; 1304 | transform: translateX(-50%); } 1305 | .tooltip:not(.bottom):after { 1306 | margin-bottom: calc(2 * var(--universal-margin)); } 1307 | .tooltip.bottom:after { 1308 | margin-top: calc(2 * var(--universal-margin)); } 1309 | 1310 | :root { 1311 | --modal-overlay-color: rgba(0, 0, 0, 0.45); 1312 | --modal-close-color: #e6007e; 1313 | --modal-close-hover-color: #ffe97f; } 1314 | 1315 | [type="checkbox"].modal { 1316 | height: 1px; 1317 | width: 1px; 1318 | margin: -1px; 1319 | overflow: hidden; 1320 | position: absolute; 1321 | clip: rect(0 0 0 0); 1322 | -webkit-clip-path: inset(100%); 1323 | clip-path: inset(100%); } 1324 | [type="checkbox"].modal + div { 1325 | position: fixed; 1326 | top: 0; 1327 | left: 0; 1328 | display: none; 1329 | width: 100vw; 1330 | height: 100vh; 1331 | background: var(--modal-overlay-color); } 1332 | [type="checkbox"].modal + div .card { 1333 | margin: 0 auto; 1334 | max-height: 50vh; 1335 | overflow: auto; } 1336 | [type="checkbox"].modal + div .card .modal-close { 1337 | position: absolute; 1338 | top: 0; 1339 | right: 0; 1340 | width: 1.75rem; 1341 | height: 1.75rem; 1342 | border-radius: var(--universal-border-radius); 1343 | padding: var(--universal-padding); 1344 | margin: 0; 1345 | cursor: pointer; 1346 | transition: background 0.3s; } 1347 | [type="checkbox"].modal + div .card .modal-close:before { 1348 | display: block; 1349 | content: '\00D7'; 1350 | color: var(--modal-close-color); 1351 | position: relative; 1352 | font-family: sans-serif; 1353 | font-size: 1.75rem; 1354 | line-height: 1; 1355 | text-align: center; } 1356 | [type="checkbox"].modal + div .card .modal-close:hover, [type="checkbox"].modal + div .card .modal-close:focus { 1357 | background: var(--modal-close-hover-color); } 1358 | [type="checkbox"].modal:checked + div { 1359 | display: flex; 1360 | flex: 0 1 auto; 1361 | z-index: 1200; } 1362 | [type="checkbox"].modal:checked + div .card .modal-close { 1363 | z-index: 1211; } 1364 | 1365 | :root { 1366 | --collapse-label-back-color: #03234b; 1367 | --collapse-label-fore-color: #ffffff; 1368 | --collapse-label-hover-back-color: #3cb4e6; 1369 | --collapse-selected-label-back-color: #3cb4e6; 1370 | --collapse-border-color: var(--collapse-label-back-color); 1371 | --collapse-selected-border-color: #ceecf8; 1372 | --collapse-content-back-color: #ffffff; 1373 | --collapse-selected-label-border-color: #3cb4e6; } 1374 | 1375 | .collapse { 1376 | width: calc(100% - 2 * var(--universal-margin)); 1377 | opacity: 1; 1378 | display: flex; 1379 | flex-direction: column; 1380 | margin: var(--universal-margin); 1381 | border-radius: var(--universal-border-radius); } 1382 | .collapse > [type="radio"], .collapse > [type="checkbox"] { 1383 | height: 1px; 1384 | width: 1px; 1385 | margin: -1px; 1386 | overflow: hidden; 1387 | position: absolute; 1388 | clip: rect(0 0 0 0); 1389 | -webkit-clip-path: inset(100%); 1390 | clip-path: inset(100%); } 1391 | .collapse > label { 1392 | flex-grow: 1; 1393 | display: inline-block; 1394 | height: 1.25rem; 1395 | cursor: pointer; 1396 | transition: background 0.2s; 1397 | color: var(--collapse-label-fore-color); 1398 | background: var(--collapse-label-back-color); 1399 | border: 0.0714285714rem solid var(--collapse-selected-border-color); 1400 | padding: calc(1.25 * var(--universal-padding)); } 1401 | .collapse > label:hover, .collapse > label:focus { 1402 | background: var(--collapse-label-hover-back-color); } 1403 | .collapse > label + div { 1404 | flex-basis: auto; 1405 | height: 1px; 1406 | width: 1px; 1407 | margin: -1px; 1408 | overflow: hidden; 1409 | position: absolute; 1410 | clip: rect(0 0 0 0); 1411 | -webkit-clip-path: inset(100%); 1412 | clip-path: inset(100%); 1413 | transition: max-height 0.3s; 1414 | max-height: 1px; } 1415 | .collapse > :checked + label { 1416 | background: var(--collapse-selected-label-back-color); 1417 | border-color: var(--collapse-selected-label-border-color); } 1418 | .collapse > :checked + label + div { 1419 | box-sizing: border-box; 1420 | position: relative; 1421 | width: 100%; 1422 | height: auto; 1423 | overflow: auto; 1424 | margin: 0; 1425 | background: var(--collapse-content-back-color); 1426 | border: 0.0714285714rem solid var(--collapse-selected-border-color); 1427 | border-top: 0; 1428 | padding: var(--universal-padding); 1429 | clip: auto; 1430 | -webkit-clip-path: inset(0%); 1431 | clip-path: inset(0%); 1432 | max-height: 100%; } 1433 | .collapse > label:not(:first-of-type) { 1434 | border-top: 0; } 1435 | .collapse > label:first-of-type { 1436 | border-radius: var(--universal-border-radius) var(--universal-border-radius) 0 0; } 1437 | .collapse > label:last-of-type:not(:first-of-type) { 1438 | border-radius: 0 0 var(--universal-border-radius) var(--universal-border-radius); } 1439 | .collapse > label:last-of-type:first-of-type { 1440 | border-radius: var(--universal-border-radius); } 1441 | .collapse > :checked:last-of-type:not(:first-of-type) + label { 1442 | border-radius: 0; } 1443 | .collapse > :checked:last-of-type + label + div { 1444 | border-radius: 0 0 var(--universal-border-radius) var(--universal-border-radius); } 1445 | 1446 | /* 1447 | Custom elements for contextual background elements, toasts and tooltips. 1448 | */ 1449 | mark.tertiary { 1450 | --mark-back-color: #3cb4e6; } 1451 | 1452 | mark.tag { 1453 | padding: calc(var(--universal-padding)/2) var(--universal-padding); 1454 | border-radius: 1em; } 1455 | 1456 | /* 1457 | Definitions for progress elements and spinners. 1458 | */ 1459 | /* Progress module CSS variable definitions */ 1460 | :root { 1461 | --progress-back-color: #3cb4e6; 1462 | --progress-fore-color: #555; } 1463 | 1464 | progress { 1465 | display: block; 1466 | vertical-align: baseline; 1467 | -webkit-appearance: none; 1468 | -moz-appearance: none; 1469 | appearance: none; 1470 | height: 0.75rem; 1471 | width: calc(100% - 2 * var(--universal-margin)); 1472 | margin: var(--universal-margin); 1473 | border: 0; 1474 | border-radius: calc(2 * var(--universal-border-radius)); 1475 | background: var(--progress-back-color); 1476 | color: var(--progress-fore-color); } 1477 | progress::-webkit-progress-value { 1478 | background: var(--progress-fore-color); 1479 | border-top-left-radius: calc(2 * var(--universal-border-radius)); 1480 | border-bottom-left-radius: calc(2 * var(--universal-border-radius)); } 1481 | progress::-webkit-progress-bar { 1482 | background: var(--progress-back-color); } 1483 | progress::-moz-progress-bar { 1484 | background: var(--progress-fore-color); 1485 | border-top-left-radius: calc(2 * var(--universal-border-radius)); 1486 | border-bottom-left-radius: calc(2 * var(--universal-border-radius)); } 1487 | progress[value="1000"]::-webkit-progress-value { 1488 | border-radius: calc(2 * var(--universal-border-radius)); } 1489 | progress[value="1000"]::-moz-progress-bar { 1490 | border-radius: calc(2 * var(--universal-border-radius)); } 1491 | progress.inline { 1492 | display: inline-block; 1493 | vertical-align: middle; 1494 | width: 60%; } 1495 | 1496 | :root { 1497 | --spinner-back-color: #ddd; 1498 | --spinner-fore-color: #555; } 1499 | 1500 | @keyframes spinner-donut-anim { 1501 | 0% { 1502 | transform: rotate(0deg); } 1503 | 100% { 1504 | transform: rotate(360deg); } } 1505 | .spinner { 1506 | display: inline-block; 1507 | margin: var(--universal-margin); 1508 | border: 0.25rem solid var(--spinner-back-color); 1509 | border-left: 0.25rem solid var(--spinner-fore-color); 1510 | border-radius: 50%; 1511 | width: 1.25rem; 1512 | height: 1.25rem; 1513 | animation: spinner-donut-anim 1.2s linear infinite; } 1514 | 1515 | /* 1516 | Custom elements for progress bars and spinners. 1517 | */ 1518 | progress.primary { 1519 | --progress-fore-color: #1976d2; } 1520 | 1521 | progress.secondary { 1522 | --progress-fore-color: #d32f2f; } 1523 | 1524 | progress.tertiary { 1525 | --progress-fore-color: #308732; } 1526 | 1527 | .spinner.primary { 1528 | --spinner-fore-color: #1976d2; } 1529 | 1530 | .spinner.secondary { 1531 | --spinner-fore-color: #d32f2f; } 1532 | 1533 | .spinner.tertiary { 1534 | --spinner-fore-color: #308732; } 1535 | 1536 | /* 1537 | Definitions for icons - powered by Feather (https://feathericons.com/). 1538 | */ 1539 | span[class^='icon-'] { 1540 | display: inline-block; 1541 | height: 1em; 1542 | width: 1em; 1543 | vertical-align: -0.125em; 1544 | background-size: contain; 1545 | margin: 0 calc(var(--universal-margin) / 4); } 1546 | span[class^='icon-'].secondary { 1547 | -webkit-filter: invert(25%); 1548 | filter: invert(25%); } 1549 | span[class^='icon-'].inverse { 1550 | -webkit-filter: invert(100%); 1551 | filter: invert(100%); } 1552 | 1553 | span.icon-alert { 1554 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12' y2='16'%3E%3C/line%3E%3C/svg%3E"); } 1555 | span.icon-bookmark { 1556 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z'%3E%3C/path%3E%3C/svg%3E"); } 1557 | span.icon-calendar { 1558 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E"); } 1559 | span.icon-credit { 1560 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='1' y='4' width='22' height='16' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='1' y1='10' x2='23' y2='10'%3E%3C/line%3E%3C/svg%3E"); } 1561 | span.icon-edit { 1562 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 14.66V20a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h5.34'%3E%3C/path%3E%3Cpolygon points='18 2 22 6 12 16 8 16 8 12 18 2'%3E%3C/polygon%3E%3C/svg%3E"); } 1563 | span.icon-link { 1564 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'%3E%3C/path%3E%3Cpolyline points='15 3 21 3 21 9'%3E%3C/polyline%3E%3Cline x1='10' y1='14' x2='21' y2='3'%3E%3C/line%3E%3C/svg%3E"); } 1565 | span.icon-help { 1566 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3'%3E%3C/path%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='17' x2='12' y2='17'%3E%3C/line%3E%3C/svg%3E"); } 1567 | span.icon-home { 1568 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'%3E%3C/path%3E%3Cpolyline points='9 22 9 12 15 12 15 22'%3E%3C/polyline%3E%3C/svg%3E"); } 1569 | span.icon-info { 1570 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='16' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='8' x2='12' y2='8'%3E%3C/line%3E%3C/svg%3E"); } 1571 | span.icon-lock { 1572 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'%3E%3C/rect%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'%3E%3C/path%3E%3C/svg%3E"); } 1573 | span.icon-mail { 1574 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z'%3E%3C/path%3E%3Cpolyline points='22,6 12,13 2,6'%3E%3C/polyline%3E%3C/svg%3E"); } 1575 | span.icon-location { 1576 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'%3E%3C/path%3E%3Ccircle cx='12' cy='10' r='3'%3E%3C/circle%3E%3C/svg%3E"); } 1577 | span.icon-phone { 1578 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'%3E%3C/path%3E%3C/svg%3E"); } 1579 | span.icon-rss { 1580 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 11a9 9 0 0 1 9 9'%3E%3C/path%3E%3Cpath d='M4 4a16 16 0 0 1 16 16'%3E%3C/path%3E%3Ccircle cx='5' cy='19' r='1'%3E%3C/circle%3E%3C/svg%3E"); } 1581 | span.icon-search { 1582 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E"); } 1583 | span.icon-settings { 1584 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'%3E%3C/circle%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z'%3E%3C/path%3E%3C/svg%3E"); } 1585 | span.icon-share { 1586 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='18' cy='5' r='3'%3E%3C/circle%3E%3Ccircle cx='6' cy='12' r='3'%3E%3C/circle%3E%3Ccircle cx='18' cy='19' r='3'%3E%3C/circle%3E%3Cline x1='8.59' y1='13.51' x2='15.42' y2='17.49'%3E%3C/line%3E%3Cline x1='15.41' y1='6.51' x2='8.59' y2='10.49'%3E%3C/line%3E%3C/svg%3E"); } 1587 | span.icon-cart { 1588 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'%3E%3C/circle%3E%3Ccircle cx='20' cy='21' r='1'%3E%3C/circle%3E%3Cpath d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'%3E%3C/path%3E%3C/svg%3E"); } 1589 | span.icon-upload { 1590 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'%3E%3C/path%3E%3Cpolyline points='17 8 12 3 7 8'%3E%3C/polyline%3E%3Cline x1='12' y1='3' x2='12' y2='15'%3E%3C/line%3E%3C/svg%3E"); } 1591 | span.icon-user { 1592 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2303234b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'%3E%3C/path%3E%3Ccircle cx='12' cy='7' r='4'%3E%3C/circle%3E%3C/svg%3E"); } 1593 | 1594 | /* 1595 | Definitions for STMicroelectronics icons (https://brandportal.st.com/document/26). 1596 | */ 1597 | span.icon-st-update { 1598 | background-image: url("Update.svg"); } 1599 | span.icon-st-add { 1600 | background-image: url("Add button.svg"); } 1601 | 1602 | /* 1603 | Definitions for utilities and helper classes. 1604 | */ 1605 | /* Utility module CSS variable definitions */ 1606 | :root { 1607 | --generic-border-color: rgba(0, 0, 0, 0.3); 1608 | --generic-box-shadow: 0 0.2857142857rem 0.2857142857rem 0 rgba(0, 0, 0, 0.125), 0 0.1428571429rem 0.1428571429rem -0.1428571429rem rgba(0, 0, 0, 0.125); } 1609 | 1610 | .hidden { 1611 | display: none !important; } 1612 | 1613 | .visually-hidden { 1614 | position: absolute !important; 1615 | width: 1px !important; 1616 | height: 1px !important; 1617 | margin: -1px !important; 1618 | border: 0 !important; 1619 | padding: 0 !important; 1620 | clip: rect(0 0 0 0) !important; 1621 | -webkit-clip-path: inset(100%) !important; 1622 | clip-path: inset(100%) !important; 1623 | overflow: hidden !important; } 1624 | 1625 | .bordered { 1626 | border: 0.0714285714rem solid var(--generic-border-color) !important; } 1627 | 1628 | .rounded { 1629 | border-radius: var(--universal-border-radius) !important; } 1630 | 1631 | .circular { 1632 | border-radius: 50% !important; } 1633 | 1634 | .shadowed { 1635 | box-shadow: var(--generic-box-shadow) !important; } 1636 | 1637 | .responsive-margin { 1638 | margin: calc(var(--universal-margin) / 4) !important; } 1639 | @media screen and (min-width: 500px) { 1640 | .responsive-margin { 1641 | margin: calc(var(--universal-margin) / 2) !important; } } 1642 | @media screen and (min-width: 1280px) { 1643 | .responsive-margin { 1644 | margin: var(--universal-margin) !important; } } 1645 | 1646 | .responsive-padding { 1647 | padding: calc(var(--universal-padding) / 4) !important; } 1648 | @media screen and (min-width: 500px) { 1649 | .responsive-padding { 1650 | padding: calc(var(--universal-padding) / 2) !important; } } 1651 | @media screen and (min-width: 1280px) { 1652 | .responsive-padding { 1653 | padding: var(--universal-padding) !important; } } 1654 | 1655 | @media screen and (max-width: 499px) { 1656 | .hidden-sm { 1657 | display: none !important; } } 1658 | @media screen and (min-width: 500px) and (max-width: 1279px) { 1659 | .hidden-md { 1660 | display: none !important; } } 1661 | @media screen and (min-width: 1280px) { 1662 | .hidden-lg { 1663 | display: none !important; } } 1664 | @media screen and (max-width: 499px) { 1665 | .visually-hidden-sm { 1666 | position: absolute !important; 1667 | width: 1px !important; 1668 | height: 1px !important; 1669 | margin: -1px !important; 1670 | border: 0 !important; 1671 | padding: 0 !important; 1672 | clip: rect(0 0 0 0) !important; 1673 | -webkit-clip-path: inset(100%) !important; 1674 | clip-path: inset(100%) !important; 1675 | overflow: hidden !important; } } 1676 | @media screen and (min-width: 500px) and (max-width: 1279px) { 1677 | .visually-hidden-md { 1678 | position: absolute !important; 1679 | width: 1px !important; 1680 | height: 1px !important; 1681 | margin: -1px !important; 1682 | border: 0 !important; 1683 | padding: 0 !important; 1684 | clip: rect(0 0 0 0) !important; 1685 | -webkit-clip-path: inset(100%) !important; 1686 | clip-path: inset(100%) !important; 1687 | overflow: hidden !important; } } 1688 | @media screen and (min-width: 1280px) { 1689 | .visually-hidden-lg { 1690 | position: absolute !important; 1691 | width: 1px !important; 1692 | height: 1px !important; 1693 | margin: -1px !important; 1694 | border: 0 !important; 1695 | padding: 0 !important; 1696 | clip: rect(0 0 0 0) !important; 1697 | -webkit-clip-path: inset(100%) !important; 1698 | clip-path: inset(100%) !important; 1699 | overflow: hidden !important; } } 1700 | 1701 | /*# sourceMappingURL=mini-custom.css.map */ 1702 | 1703 | img[alt="ST logo"] { display: block; margin: auto; width: 75%; max-width: 250px; min-width: 71px; } 1704 | img[alt="Cube logo"] { float: right; width: 30%; max-width: 10rem; min-width: 8rem; padding-right: 1rem;} 1705 | 1706 | .figure { 1707 | display: block; 1708 | margin-left: auto; 1709 | margin-right: auto; 1710 | text-align: center; 1711 | } -------------------------------------------------------------------------------- /_htmresc/st_logo_2020.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/STMicroelectronics/stm32-ssd1315/090ef0e0ed4cf0437d85a1eb1c4d311ab11c47d7/_htmresc/st_logo_2020.png -------------------------------------------------------------------------------- /ssd1315.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file ssd1315.c 4 | * @author MCD Application Team 5 | * @brief This file includes the LCD driver for SSD1315 LCD. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | * Copyright (c) 2020 STMicroelectronics. 10 | * All rights reserved. 11 | * 12 | * This software is licensed under terms that can be found in the LICENSE file 13 | * in the root directory of this software component. 14 | * If no LICENSE file comes with this software, it is provided AS-IS. 15 | * 16 | ****************************************************************************** 17 | */ 18 | 19 | /* Includes ------------------------------------------------------------------*/ 20 | #include "ssd1315.h" 21 | #include 22 | #include 23 | /** @addtogroup BSP 24 | * @{ 25 | */ 26 | 27 | /** @addtogroup Components 28 | * @{ 29 | */ 30 | 31 | /** @addtogroup SSD1315 32 | * @brief This file provides a set of functions needed to drive the 33 | * SSD1315 LCD. 34 | * @{ 35 | */ 36 | 37 | /** @defgroup SSD1315_Private_TypesDefinitions 38 | * @{ 39 | */ 40 | 41 | /** 42 | * @} 43 | */ 44 | 45 | /** @defgroup SSD1315_Private_Defines 46 | * @{ 47 | */ 48 | 49 | /** 50 | * @} 51 | */ 52 | 53 | /** @defgroup SSD1315_Private_Macros 54 | * @{ 55 | */ 56 | 57 | /** 58 | * @} 59 | */ 60 | 61 | /** @defgroup SSD1315_Private_Variables 62 | * @{ 63 | */ 64 | SSD1315_Drv_t SSD1315_Driver = 65 | { 66 | SSD1315_Init, 67 | SSD1315_DeInit, 68 | SSD1315_ReadID, 69 | SSD1315_DisplayOn, 70 | SSD1315_DisplayOff, 71 | SSD1315_SetBrightness, 72 | SSD1315_GetBrightness, 73 | SSD1315_SetOrientation, 74 | SSD1315_GetOrientation, 75 | SSD1315_Refresh, 76 | SSD1315_SetPage, 77 | SSD1315_SetColumn, 78 | SSD1315_ScrollingSetup, 79 | SSD1315_ScrollingStart, 80 | SSD1315_ScrollingStop, 81 | SSD1315_SetCursor, 82 | SSD1315_DrawBitmap, 83 | SSD1315_ShiftBitmap, 84 | SSD1315_FillRGBRect, 85 | SSD1315_DrawHLine, 86 | SSD1315_DrawVLine, 87 | SSD1315_FillRect, 88 | SSD1315_GetPixel, 89 | SSD1315_SetPixel, 90 | SSD1315_GetXSize, 91 | SSD1315_GetYSize, 92 | }; 93 | 94 | #if defined ( __ICCARM__ ) /* IAR Compiler */ 95 | #pragma data_alignment = 16 96 | uint8_t PhysFrameBuffer[SSD1315_LCD_COLUMN_NUMBER*SSD1315_LCD_PAGE_NUMBER]; 97 | #elif defined (__GNUC__) /* GNU Compiler */ 98 | uint8_t PhysFrameBuffer[SSD1315_LCD_COLUMN_NUMBER*SSD1315_LCD_PAGE_NUMBER] __attribute__ ((aligned (16))); 99 | #else /* ARM Compiler */ 100 | __align(16) uint8_t PhysFrameBuffer[SSD1315_LCD_COLUMN_NUMBER*SSD1315_LCD_PAGE_NUMBER]; 101 | #endif /* __ICCARM__ */ 102 | /* The below table handle the different values to be set to Memory Data Access Control 103 | depending on the orientation and pbm image writing where the data order is inverted 104 | */ 105 | 106 | /** 107 | * @} 108 | */ 109 | 110 | /** @defgroup SSD1315_Private_FunctionPrototypes Private Functions Prototypes 111 | * @{ 112 | */ 113 | static int32_t SSD1315_ReadRegWrap(void *handle, uint16_t Reg, uint8_t* pData, uint16_t Length); 114 | static int32_t SSD1315_WriteRegWrap(void *handle, uint16_t Reg, uint8_t* pData, uint16_t Length); 115 | static int32_t SSD1315_IO_Delay(SSD1315_Object_t *pObj, uint32_t Delay); 116 | static void ssd1315_Clear(uint16_t ColorCode); 117 | /** 118 | * @} 119 | */ 120 | 121 | /** @addtogroup SSD1315_Exported_Functions 122 | * @{ 123 | */ 124 | 125 | /** 126 | * @brief Register component IO bus. 127 | * @param pObj Component object pointer. 128 | * @param pIO Component IO structure pointer. 129 | * @retval Component status. 130 | */ 131 | int32_t SSD1315_RegisterBusIO(SSD1315_Object_t *pObj, SSD1315_IO_t *pIO) 132 | { 133 | int32_t ret; 134 | 135 | if(pObj == NULL) 136 | { 137 | ret = SSD1315_ERROR; 138 | } 139 | else 140 | { 141 | pObj->IO.Init = pIO->Init; 142 | pObj->IO.DeInit = pIO->DeInit; 143 | pObj->IO.WriteReg = pIO->WriteReg; 144 | pObj->IO.ReadReg = pIO->ReadReg; 145 | pObj->IO.GetTick = pIO->GetTick; 146 | 147 | pObj->Ctx.ReadReg = SSD1315_ReadRegWrap; 148 | pObj->Ctx.WriteReg = SSD1315_WriteRegWrap; 149 | pObj->Ctx.handle = pObj; 150 | } 151 | 152 | if (pObj->IO.Init != NULL) 153 | { 154 | ret = pObj->IO.Init(); 155 | } 156 | else 157 | { 158 | ret = SSD1315_ERROR; 159 | } 160 | return ret; 161 | } 162 | 163 | /** 164 | * @brief Initialize the SSD1315 LCD Component. 165 | * @param pObj Component object. 166 | * @param ColorCoding RGB mode. 167 | * @param Orientation Display orientation. 168 | * @retval Component status. 169 | */ 170 | int32_t SSD1315_Init(SSD1315_Object_t *pObj, uint32_t ColorCoding, uint32_t Orientation) 171 | { 172 | int32_t ret = SSD1315_OK; 173 | uint8_t data; 174 | 175 | if((pObj == NULL) || (Orientation > SSD1315_ORIENTATION_LANDSCAPE)) 176 | { 177 | ret = SSD1315_ERROR; 178 | } 179 | else 180 | { 181 | if (pObj->IsInitialized == 0) 182 | { 183 | pObj->IsInitialized = 1; 184 | pObj->Orientation = Orientation; 185 | (void)SSD1315_IO_Delay(pObj, 100); 186 | /* Driving ability setting */ 187 | data = SSD1315_READWRITE_CMD; 188 | ret += ssd1315_write_reg(&pObj->Ctx, 1,&data, 1); 189 | data = SSD1315_CHARGE_PUMP_SETTING; 190 | ret += ssd1315_write_reg(&pObj->Ctx, 1,&data, 1); 191 | data = SSD1315_HIGHER_COLUMN_START_ADRESS_5; 192 | ret += ssd1315_write_reg(&pObj->Ctx, 1,&data, 1); 193 | data = SSD1315_MEMORY_ADRESS_MODE; 194 | ret += ssd1315_write_reg(&pObj->Ctx, 1,&data, 1); 195 | data = SSD1315_LOWER_COLUMN_START_ADRESS; 196 | ret += ssd1315_write_reg(&pObj->Ctx, 1,&data, 1); 197 | data = SSD1315_DISPLAY_START_LINE_1; 198 | ret += ssd1315_write_reg(&pObj->Ctx, 1,&data, 1); 199 | data = SSD1315_REMAPPED_MODE; 200 | ret += ssd1315_write_reg(&pObj->Ctx, 1,&data, 1); 201 | data = SSD1315_CONTRAST_CONTROL; 202 | ret += ssd1315_write_reg(&pObj->Ctx, 1,&data, 1); 203 | data = SSD1315_DISPLAY_ON; 204 | ret += ssd1315_write_reg(&pObj->Ctx, 1,&data, 1); 205 | ssd1315_Clear(SSD1315_COLOR_BLACK); 206 | ret += ssd1315_write_reg(&pObj->Ctx, 1, PhysFrameBuffer, SSD1315_LCD_COLUMN_NUMBER*SSD1315_LCD_PAGE_NUMBER); 207 | } 208 | else 209 | { 210 | ret = SSD1315_ERROR; 211 | } 212 | } 213 | if(ret != SSD1315_OK) 214 | { 215 | ret = SSD1315_ERROR; 216 | } 217 | return ret; 218 | } 219 | 220 | /** 221 | * @brief De-Initialize the ssd1315 LCD Component. 222 | * @param pObj Component object. 223 | * @retval Component status. 224 | */ 225 | int32_t SSD1315_DeInit(SSD1315_Object_t *pObj) 226 | { 227 | int32_t ret = SSD1315_OK; 228 | 229 | if(pObj->IsInitialized != 0U) 230 | { 231 | ret += SSD1315_DisplayOff(pObj); 232 | 233 | pObj->IsInitialized = 0; 234 | } 235 | 236 | if(ret != SSD1315_OK) 237 | { 238 | ret = SSD1315_ERROR; 239 | } 240 | 241 | return ret; 242 | } 243 | 244 | /** 245 | * @brief Get the SSD1315 ID. 246 | * @param pObj Component object. 247 | * @param Id Component ID. 248 | * @retval The component status. 249 | */ 250 | int32_t SSD1315_ReadID(SSD1315_Object_t *pObj, uint32_t *Id) 251 | { 252 | /* Feature not supported */ 253 | (void)pObj; 254 | (void)Id; 255 | return SSD1315_ERROR; 256 | } 257 | 258 | /** 259 | * @brief Enables the Display. 260 | * @param pObj Component object. 261 | * @retval The component status. 262 | */ 263 | int32_t SSD1315_DisplayOn(SSD1315_Object_t *pObj) 264 | { 265 | int32_t ret = SSD1315_OK; 266 | uint8_t data; 267 | data = SSD1315_CHARGE_PUMP_SETTING; 268 | ret += ssd1315_write_reg(&pObj->Ctx, 1, &data, 1); 269 | data = SSD1315_HIGHER_COLUMN_START_ADRESS_5; 270 | ret += ssd1315_write_reg(&pObj->Ctx, 1, &data, 1); 271 | data = SSD1315_DISPLAY_ON; 272 | ret += ssd1315_write_reg(&pObj->Ctx, 1, &data, 1); 273 | 274 | if (ret != SSD1315_OK) 275 | { 276 | ret = SSD1315_ERROR; 277 | } 278 | return ret; 279 | } 280 | 281 | /** 282 | * @brief Disables the Display. 283 | * @param pObj Component object. 284 | * @retval The component status. 285 | */ 286 | int32_t SSD1315_DisplayOff(SSD1315_Object_t *pObj) 287 | { 288 | int32_t ret = SSD1315_OK; 289 | uint8_t data; 290 | 291 | data = SSD1315_CHARGE_PUMP_SETTING; 292 | ret += ssd1315_write_reg(&pObj->Ctx, 1, &data, 1); 293 | data = SSD1315_HIGHER_COLUMN_START_ADRESS_1; 294 | ret += ssd1315_write_reg(&pObj->Ctx, 1, &data, 1); 295 | data = SSD1315_DISPLAY_OFF; 296 | ret += ssd1315_write_reg(&pObj->Ctx, 1, &data, 1); 297 | 298 | if (ret != SSD1315_OK) 299 | { 300 | ret = SSD1315_ERROR; 301 | } 302 | return ret; 303 | } 304 | 305 | /** 306 | * @brief Set the display brightness. 307 | * @param pObj Component object. 308 | * @param Brightness display brightness to be set. 309 | * @retval Component status. 310 | */ 311 | int32_t SSD1315_SetBrightness(SSD1315_Object_t *pObj, uint32_t Brightness) 312 | { 313 | /* Feature not supported */ 314 | (void)pObj; 315 | (void)Brightness; 316 | return SSD1315_ERROR; 317 | } 318 | 319 | /** 320 | * @brief Get the display brightness. 321 | * @param pObj Component object. 322 | * @param Brightness display brightness to be returned. 323 | * @retval Component status. 324 | */ 325 | int32_t SSD1315_GetBrightness(SSD1315_Object_t *pObj, uint32_t *Brightness) 326 | { 327 | /* Feature not supported */ 328 | (void)pObj; 329 | (void)Brightness; 330 | return SSD1315_ERROR; 331 | } 332 | 333 | /** 334 | * @brief Set the Display Orientation. 335 | * @param pObj Component object. 336 | * @param Orientation SSSD1315_ORIENTATION_LANDSCAPE. 337 | * @retval The component status. 338 | */ 339 | int32_t SSD1315_SetOrientation(SSD1315_Object_t *pObj, uint32_t Orientation) 340 | { 341 | /* Feature not supported */ 342 | (void)pObj; 343 | (void)Orientation; 344 | return SSD1315_ERROR; 345 | } 346 | 347 | /** 348 | * @brief Set the Display Orientation. 349 | * @param pObj Component object. 350 | * @param Orientation SSD1315_ORIENTATION_LANDSCAPE. 351 | * @retval The component status. 352 | */ 353 | int32_t SSD1315_GetOrientation(SSD1315_Object_t *pObj, uint32_t *Orientation) 354 | { 355 | /* Feature not supported */ 356 | (void)pObj; 357 | (void)Orientation; 358 | return SSD1315_ERROR; 359 | } 360 | 361 | /** 362 | * @brief Set Cursor position. 363 | * @param pObj Component object. 364 | * @param Xpos specifies the X position. 365 | * @param Ypos specifies the Y position. 366 | * @retval The component status. 367 | */ 368 | int32_t SSD1315_SetCursor(SSD1315_Object_t *pObj, uint32_t Xpos, uint32_t Ypos) 369 | { 370 | /* Feature not supported */ 371 | (void)pObj; 372 | (void)Xpos; 373 | (void)Ypos; 374 | return SSD1315_ERROR; 375 | } 376 | 377 | /** 378 | * @brief Refresh Display. 379 | * @param pObj Component object. 380 | * @retval The component status. 381 | */ 382 | 383 | int32_t SSD1315_Refresh(SSD1315_Object_t *pObj) 384 | { 385 | int32_t ret = SSD1315_OK; 386 | uint8_t data; 387 | 388 | data = SSD1315_DISPLAY_START_LINE_1; 389 | ret += ssd1315_write_reg(&pObj->Ctx, 1,&data, 1); 390 | data = SSD1315_SET_COLUMN_ADRESS; 391 | ret += ssd1315_write_reg(&pObj->Ctx, 1,&data, 1); 392 | data = SSD1315_LOWER_COLUMN_START_ADRESS; 393 | ret += ssd1315_write_reg(&pObj->Ctx, 1,&data, 1); 394 | data = SSD1315_DISPLAY_START_LINE_64; 395 | ret += ssd1315_write_reg(&pObj->Ctx, 1,&data, 1); 396 | data = SSD1315_SET_PAGE_ADRESS; 397 | ret += ssd1315_write_reg(&pObj->Ctx, 1,&data, 1); 398 | data = SSD1315_LOWER_COLUMN_START_ADRESS; 399 | ret += ssd1315_write_reg(&pObj->Ctx, 1,&data, 1); 400 | data = SSD1315_LOWER_COLUMN_START_ADRESS_15; 401 | ret += ssd1315_write_reg(&pObj->Ctx, 1,&data, 1); 402 | ret += ssd1315_write_reg(&pObj->Ctx, 1,PhysFrameBuffer, SSD1315_LCD_COLUMN_NUMBER*SSD1315_LCD_PAGE_NUMBER); 403 | 404 | if (ret != SSD1315_OK) 405 | { 406 | ret = SSD1315_ERROR; 407 | } 408 | return ret; 409 | } 410 | /** 411 | * @brief Displays a bitmap picture. 412 | * @param pObj Component object. 413 | * @param Xpos Bmp X position in the LCD. 414 | * @param Ypos Bmp Y position in the LCD. 415 | * @param pBmp Bmp picture address. 416 | * @retval The component status. 417 | */ 418 | 419 | int32_t SSD1315_DrawBitmap(SSD1315_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint8_t *pBmp) 420 | { 421 | int32_t ret = SSD1315_OK; 422 | uint32_t index = 0, size = 0; 423 | uint32_t height = 0, width = 0; 424 | uint32_t x = 0, y = 0, y0 = 0; 425 | uint32_t XposBMP = 0, YposBMP = 0; 426 | 427 | /* Read bitmap size */ 428 | size = pBmp[2] + (pBmp[3] << 8) + (pBmp[4] << 16) + (pBmp[5] << 24); 429 | 430 | /* Get bitmap data address offset */ 431 | index = pBmp[10] + (pBmp[11] << 8) + (pBmp[12] << 16) + (pBmp[13] << 24); 432 | 433 | /* Read bitmap width */ 434 | width = pBmp[18] + (pBmp[19] << 8) + (pBmp[20] << 16) + (pBmp[21] << 24); 435 | 436 | /* Read bitmap height */ 437 | height = pBmp[22] + (pBmp[23] << 8) + (pBmp[24] << 16) + (pBmp[25] << 24); 438 | 439 | /* Size conversion */ 440 | size = (size - index); 441 | 442 | /* Apply offset to bypass header */ 443 | pBmp += index; 444 | 445 | /* if bitmap cover whole screen */ 446 | if((Xpos == 0) && (Xpos == 0) & (size == (SSD1315_LCD_PIXEL_WIDTH * SSD1315_LCD_PIXEL_HEIGHT/8))) 447 | { 448 | memcpy(PhysFrameBuffer, pBmp, size); 449 | } 450 | else 451 | { 452 | x=Xpos+width; 453 | y=Ypos+height; 454 | y0 = Ypos; 455 | 456 | for(; Xpos < x; Xpos++, XposBMP++) 457 | { 458 | for(Ypos = y0, YposBMP = 0; Ypos < y; Ypos++, YposBMP++) 459 | { 460 | /* if bitmap and screen are aligned on a Page */ 461 | if(((Ypos%8) == 0) && (y-Ypos >= 8) && ((YposBMP%8) == 0)) 462 | { 463 | PhysFrameBuffer[Xpos+ (Ypos/8)*SSD1315_LCD_PIXEL_WIDTH] = pBmp[XposBMP+((YposBMP/8)*width)]; 464 | Ypos+=7; 465 | YposBMP+=7; 466 | } 467 | else 468 | { 469 | /* Draw bitmap pixel per pixel */ 470 | if( (pBmp[XposBMP+((YposBMP/8)*width)]&(1<<(YposBMP%8))) != 0) 471 | { 472 | if (SSD1315_SetPixel(pObj, Xpos, Ypos, SSD1315_COLOR_WHITE) != SSD1315_OK) 473 | { 474 | ret = SSD1315_ERROR; 475 | break; 476 | } 477 | } 478 | else 479 | { 480 | if (SSD1315_SetPixel(pObj, Xpos, Ypos, SSD1315_COLOR_BLACK) != SSD1315_OK) 481 | { 482 | ret = SSD1315_ERROR; 483 | break; 484 | } 485 | } 486 | } 487 | } 488 | } 489 | } 490 | if(ret != SSD1315_OK) 491 | { 492 | ret = SSD1315_ERROR; 493 | } 494 | return ret; 495 | } 496 | 497 | /** 498 | * @brief Shift and Displays a bitmap picture loaded in the internal Flash. 499 | * @param pObj Component object. 500 | * @param Xpos specifies the X position. 501 | * @param Ypos specifies the Y position. 502 | * @param Xshift specifies number of pixel to shift on X position. 503 | * @param Yshift specifies number of pixel to shift on Y position. 504 | * @param pbmp Bmp picture address in the internal Flash. 505 | * @retval The component status. 506 | */ 507 | int32_t SSD1315_ShiftBitmap(SSD1315_Object_t *pObj,uint16_t Xpos, uint16_t Ypos, int16_t Xshift, int16_t Yshift, uint8_t *pbmp) 508 | { 509 | int32_t ret = SSD1315_OK; 510 | uint32_t index = 0, size = 0; 511 | uint32_t height = 0, width = 0, original_width = 0; 512 | uint32_t x = 0, y = 0, y0 = 0; 513 | uint32_t XposBMP = 0, YposBMP = 0, original_YposBMP = 0; 514 | 515 | /* Read bitmap size */ 516 | size = *(volatile uint16_t *) (pbmp + 2); 517 | size |= (*(volatile uint16_t *) (pbmp + 4)) << 16; 518 | 519 | /* Get bitmap data address offset */ 520 | index = *(volatile uint16_t *) (pbmp + 10); 521 | index |= (*(volatile uint16_t *) (pbmp + 12)) << 16; 522 | 523 | /* Read bitmap width */ 524 | width = *(uint16_t *) (pbmp + 18); 525 | width |= (*(uint16_t *) (pbmp + 20)) << 16; 526 | original_width = width; 527 | if( Xshift>=0) 528 | { 529 | Xpos = Xpos + Xshift; 530 | width = width - Xshift; 531 | } 532 | else 533 | { 534 | width = width + Xshift; 535 | XposBMP = -Xshift; 536 | } 537 | 538 | /* Read bitmap height */ 539 | height = *(uint16_t *) (pbmp + 22); 540 | height |= (*(uint16_t *) (pbmp + 24)) << 16; 541 | if( Yshift>=0) 542 | { 543 | height = height - Yshift; 544 | Ypos = Ypos + Yshift; 545 | } 546 | else 547 | { 548 | height = height + Yshift; 549 | YposBMP = -Yshift; 550 | } 551 | original_YposBMP = YposBMP; 552 | 553 | /* Size conversion */ 554 | size = (size - index); 555 | size = size - ((Xshift*height/8)+(Yshift*width/8 )); 556 | 557 | /* Apply offset to bypass header */ 558 | pbmp += index; 559 | 560 | /* if bitmap cover whole screen */ 561 | if((Xpos == 0) && (Xpos == 0) & (size == (SSD1315_LCD_PIXEL_WIDTH * SSD1315_LCD_PIXEL_HEIGHT/8))) 562 | { 563 | memcpy(PhysFrameBuffer, pbmp, size); 564 | } 565 | else 566 | { 567 | x=Xpos+width; 568 | y=Ypos+height; 569 | y0 = Ypos; 570 | 571 | for(; Xpos < x; Xpos++, XposBMP++) 572 | { 573 | for(Ypos = y0, YposBMP = original_YposBMP; Ypos < y; Ypos++, YposBMP++) 574 | { 575 | /* if bitmap and screen are aligned on a Page */ 576 | if(((Ypos%8) == 0) && (y-Ypos >= 8) && ((YposBMP%8) == 0)) 577 | { 578 | PhysFrameBuffer[Xpos+ (Ypos/8)*SSD1315_LCD_PIXEL_WIDTH] = pbmp[XposBMP+((YposBMP/8)*original_width)]; 579 | Ypos+=7; 580 | YposBMP+=7; 581 | } 582 | else 583 | { 584 | /* Draw bitmap pixel per pixel */ 585 | if( (pbmp[XposBMP+((YposBMP/8)*original_width)]&(1<<(YposBMP%8))) != 0) 586 | { 587 | if (SSD1315_SetPixel(pObj, Xpos, Ypos, SSD1315_COLOR_WHITE) != SSD1315_OK) 588 | { 589 | ret = SSD1315_ERROR; 590 | break; 591 | } 592 | } 593 | else 594 | { 595 | if (SSD1315_SetPixel(pObj, Xpos, Ypos, SSD1315_COLOR_BLACK) != SSD1315_OK) 596 | { 597 | ret = SSD1315_ERROR; 598 | break; 599 | } 600 | } 601 | } 602 | } 603 | } 604 | } 605 | if(ret != SSD1315_OK) 606 | { 607 | ret = SSD1315_ERROR; 608 | } 609 | return ret; 610 | } 611 | 612 | /** 613 | * @brief Fill RGB Rectangle. 614 | * @param pObj Component object. 615 | * @param Xpos specifies the X position. 616 | * @param Ypos specifies the Y position. 617 | * @param pData Pointer to the character data. 618 | * @param Width Rectangle width. 619 | * @param Height Rectangle height. 620 | * @retval The component status. 621 | */ 622 | int32_t SSD1315_FillRGBRect(SSD1315_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint8_t *pData, uint32_t Width, uint32_t Height) 623 | { 624 | int32_t ret = SSD1315_OK; 625 | uint32_t i; 626 | uint32_t color, j; 627 | for(i = 0; i < Height; i++) 628 | { 629 | for(j = 0; j < Width; j++) 630 | { 631 | color = *pData | (*(pData + 1) << 8) | (*(pData + 2) << 16) | (*(pData + 3) << 24); 632 | if(SSD1315_SetPixel (pObj, Xpos + j, Ypos + i, color)!= SSD1315_OK) 633 | { 634 | ret = SSD1315_ERROR; 635 | } 636 | pData += 4; 637 | } 638 | } 639 | 640 | return ret; 641 | } 642 | 643 | 644 | /** 645 | * @brief Draw horizontal line. 646 | * @param pObj Component object. 647 | * @param Xpos specifies the X position. 648 | * @param Ypos specifies the Y position. 649 | * @param Length specifies the Line length. 650 | * @param Color Specifies the RGB color. 651 | * @retval The component status. 652 | */ 653 | int32_t SSD1315_DrawHLine(SSD1315_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color) 654 | { 655 | int32_t ret = SSD1315_OK; 656 | uint32_t i = 0; 657 | 658 | /* Sent a complete horizontal line */ 659 | for (i = Xpos; i < (Xpos+Length); i++) 660 | { 661 | SSD1315_SetPixel(pObj,i, Ypos, Color); 662 | } 663 | if(ret != SSD1315_OK) 664 | { 665 | ret = SSD1315_ERROR; 666 | } 667 | return ret; 668 | } 669 | 670 | /** 671 | * @brief Draw vertical line. 672 | * @param pObj Component object. 673 | * @param Xpos specifies the X position. 674 | * @param Ypos specifies the Y position. 675 | * @param Length specifies the Line length. 676 | * @param Color Specifies the RGB color. 677 | * @retval The component status. 678 | */ 679 | int32_t SSD1315_DrawVLine(SSD1315_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color) 680 | { 681 | int32_t ret = SSD1315_OK; 682 | uint32_t i = 0; 683 | 684 | for (i = Ypos; i < (Ypos+Length); i++) 685 | { 686 | SSD1315_SetPixel(pObj,Xpos, i, Color); 687 | } 688 | if(ret != SSD1315_OK) 689 | { 690 | ret = SSD1315_ERROR; 691 | } 692 | return ret; 693 | } 694 | 695 | /** 696 | * @brief Fill rectangle. 697 | * @param pObj Component object. 698 | * @param Xpos X position. 699 | * @param Ypos Y position. 700 | * @param Width Rectangle width. 701 | * @param Height Rectangle height. 702 | * @param Color Draw color. 703 | * @retval Component status. 704 | */ 705 | int32_t SSD1315_FillRect(SSD1315_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Width, uint32_t Height, uint32_t Color) 706 | { 707 | int32_t ret = SSD1315_OK; 708 | uint32_t i; 709 | 710 | for(i = 0U; i < Height; i++) 711 | { 712 | if (SSD1315_DrawHLine(pObj, Xpos, (i + Ypos), Width, Color) != SSD1315_OK) 713 | { 714 | ret = SSD1315_ERROR; 715 | break; 716 | } 717 | } 718 | 719 | return ret; 720 | } 721 | 722 | /** 723 | * @brief Write pixel. 724 | * @param pObj Component object. 725 | * @param Xpos specifies the X position. 726 | * @param Ypos specifies the Y position. 727 | * @param Color the RGB pixel color. 728 | * @retval The component status. 729 | */ 730 | int32_t SSD1315_SetPixel(SSD1315_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Color) 731 | { 732 | int32_t ret = SSD1315_OK; 733 | /* Prevent unused argument(s) compilation warning */ 734 | (void)(pObj); 735 | /* Set color */ 736 | if (Color == SSD1315_COLOR_WHITE) 737 | { 738 | PhysFrameBuffer[Xpos + (Ypos / 8) * SSD1315_LCD_PIXEL_WIDTH] |= 1 << (Ypos % 8); 739 | } 740 | else 741 | { 742 | PhysFrameBuffer[Xpos + (Ypos / 8) * SSD1315_LCD_PIXEL_WIDTH] &= ~(1 << (Ypos % 8)); 743 | } 744 | if(ret != SSD1315_OK) 745 | { 746 | ret = SSD1315_ERROR; 747 | } 748 | 749 | return ret; 750 | } 751 | 752 | /** 753 | * @brief Read pixel. 754 | * @param pObj Component object. 755 | * @param Xpos specifies the X position. 756 | * @param Ypos specifies the Y position. 757 | * @param Color the LCD pixel color. 758 | * @retval The component status. 759 | */ 760 | int32_t SSD1315_GetPixel(SSD1315_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t *Color) 761 | { 762 | int32_t ret = SSD1315_OK; 763 | /* Prevent unused argument(s) compilation warning */ 764 | (void)(pObj); 765 | 766 | if ((Xpos >= SSD1315_LCD_PIXEL_WIDTH) || (Ypos >= SSD1315_LCD_PIXEL_HEIGHT)) 767 | { 768 | *Color = 0; 769 | } 770 | else 771 | { 772 | *Color = PhysFrameBuffer[Xpos+ (Ypos/8)*SSD1315_LCD_PIXEL_WIDTH] & (1 << Ypos%8); 773 | if (*Color != 0) 774 | { 775 | *Color = 1; 776 | } 777 | else 778 | { 779 | *Color = 0; 780 | } 781 | } 782 | 783 | return ret; 784 | } 785 | 786 | /** 787 | * @brief Get the LCD pixel Width. 788 | * @param pObj Component object. 789 | * @param The Lcd Pixel Width. 790 | * @retval The component status. 791 | */ 792 | int32_t SSD1315_GetXSize(SSD1315_Object_t *pObj, uint32_t *XSize) 793 | { 794 | int32_t ret = SSD1315_OK; 795 | 796 | if (pObj->Orientation == SSD1315_ORIENTATION_LANDSCAPE) 797 | { 798 | *XSize = 128; 799 | } 800 | else 801 | { 802 | ret = SSD1315_ERROR; 803 | } 804 | 805 | return ret; 806 | } 807 | 808 | /** 809 | * @brief Get the LCD pixel Height. 810 | * @param pObj Component object. 811 | * @param The Lcd Pixel Height. 812 | * @retval The component status. 813 | */ 814 | int32_t SSD1315_GetYSize(SSD1315_Object_t *pObj, uint32_t *YSize) 815 | { 816 | int32_t ret = SSD1315_OK; 817 | 818 | if (pObj->Orientation == SSD1315_ORIENTATION_LANDSCAPE) 819 | { 820 | *YSize = 64; 821 | } 822 | else 823 | { 824 | ret = SSD1315_ERROR; 825 | } 826 | 827 | return ret; 828 | } 829 | 830 | /** @defgroup ST7735_Private_Functions Private Functions 831 | * @{ 832 | */ 833 | 834 | /** 835 | * @brief Set Page position. 836 | * @param pObj Component object. 837 | * @param Page specifies the Page position (0-7). 838 | * @retval The component status. 839 | */ 840 | int32_t SSD1315_SetPage(SSD1315_Object_t *pObj, uint16_t Page) 841 | { 842 | int32_t ret = SSD1315_OK; 843 | uint8_t data; 844 | 845 | /* Set Page position */ 846 | data = (SSD1315_SET_PAGE_START_ADRESS | Page); 847 | ret += ssd1315_write_reg(&pObj->Ctx, 1, &data, 1); 848 | 849 | if (ret != SSD1315_OK) 850 | { 851 | ret = SSD1315_ERROR; 852 | } 853 | return ret; 854 | } 855 | 856 | /** 857 | * @brief Set Column position. 858 | * @param pObj Component object. 859 | * @param Column specifies the Column position (0-127). 860 | * @retval The component status. 861 | */ 862 | int32_t SSD1315_SetColumn(SSD1315_Object_t *pObj, uint16_t Column) 863 | { 864 | int32_t ret = SSD1315_OK; 865 | uint8_t data; 866 | /* Set Column position */ 867 | 868 | data = SSD1315_LOWER_COLUMN_START_ADRESS; 869 | ret += ssd1315_write_reg(&pObj->Ctx, 1, &data, 1); 870 | data = (SSD1315_LOWER_COLUMN_START_ADRESS | Column); 871 | ret += ssd1315_write_reg(&pObj->Ctx, 1, &data, 1); 872 | data = SSD1315_DISPLAY_START_LINE_32; 873 | ret += ssd1315_write_reg(&pObj->Ctx, 1, &data, 1); 874 | 875 | if (ret != SSD1315_OK) 876 | { 877 | ret = SSD1315_ERROR; 878 | } 879 | return ret; 880 | } 881 | 882 | /** 883 | * @brief Scrolling Display Page. 884 | * @param pObj Component object. 885 | * @param ScrollMode SSD1315_SCROLL_RIGHT or SSD1315_SCROLL_LEFT 886 | * @param StartPage Start page for scrolling: 887 | @arg 0..7 888 | * @param EndPage End page for scrolling: 889 | This must be larger or equal to StartLine 890 | @arg 0..7 891 | * @param Frequency SSD1315_SCROLL_FREQ_2FRAMES to SSD1315_SCROLL_FREQ_256FRAMES 892 | * @retval The component status. 893 | */ 894 | int32_t SSD1315_ScrollingSetup(SSD1315_Object_t *pObj, uint16_t ScrollMode, uint16_t StartPage, uint16_t EndPage, uint16_t Frequency) 895 | { 896 | int32_t ret = SSD1315_OK; 897 | uint8_t data; 898 | 899 | /* Scrolling setup sequence */ 900 | data = ScrollMode; /* Right/Left Horizontal Scroll */ 901 | ret += ssd1315_write_reg(&pObj->Ctx, 1, &data, 1); 902 | data = SSD1315_LOWER_COLUMN_START_ADRESS; 903 | ret += ssd1315_write_reg(&pObj->Ctx, 1, &data, 1); 904 | data = StartPage; /* start page address*/ 905 | ret += ssd1315_write_reg(&pObj->Ctx, 1, &data, 1); 906 | data = Frequency; /* Frequency*/ 907 | ret += ssd1315_write_reg(&pObj->Ctx, 1, &data, 1); 908 | data = EndPage; /* End page address*/ 909 | ret += ssd1315_write_reg(&pObj->Ctx, 1, &data, 1); 910 | data = SSD1315_LOWER_COLUMN_START_ADRESS; 911 | ret += ssd1315_write_reg(&pObj->Ctx, 1, &data, 1); 912 | data = SSD1315_CONTRAST_CONTROL_2; 913 | ret += ssd1315_write_reg(&pObj->Ctx, 1, &data, 1); 914 | 915 | if (ret != SSD1315_OK) 916 | { 917 | ret = SSD1315_ERROR; 918 | } 919 | return ret; 920 | } 921 | 922 | /** 923 | * @brief Start Display Scrolling. 924 | * @param pObj Component object. 925 | * @retval The component status. 926 | */ 927 | int32_t SSD1315_ScrollingStart(SSD1315_Object_t *pObj) 928 | { 929 | int32_t ret = SSD1315_OK; 930 | uint8_t data; 931 | 932 | /* Start scrolling sequence */ 933 | data = SSD1315_ACTIVATE_SCROLL; 934 | ret += ssd1315_write_reg(&pObj->Ctx, 1, &data, 1); 935 | 936 | if (ret != SSD1315_OK) 937 | { 938 | ret = SSD1315_ERROR; 939 | } 940 | return ret; 941 | } 942 | 943 | /** 944 | * @brief Stop Display Scrolling. 945 | * @param pObj Component object. 946 | * @retval The component status. 947 | */ 948 | int32_t SSD1315_ScrollingStop(SSD1315_Object_t *pObj) 949 | { 950 | int32_t ret = SSD1315_OK; 951 | uint8_t data; 952 | 953 | /* Stop scrolling sequence */ 954 | data = SSD1315_DESACTIVATE_SCROLL; 955 | ret += ssd1315_write_reg(&pObj->Ctx, 1, &data, 1); 956 | 957 | if (ret != SSD1315_OK) 958 | { 959 | ret = SSD1315_ERROR; 960 | } 961 | return ret; 962 | } 963 | 964 | /** 965 | * @brief Read register wrapped function. 966 | * @param handle Component object handle. 967 | * @param Reg The target register address to read. 968 | * @param pData The target register value to be red. 969 | * @param Length Buffer size to be red. 970 | * @retval error status. 971 | */ 972 | static int32_t SSD1315_ReadRegWrap(void *handle, uint16_t Reg, uint8_t* pData, uint16_t Length) 973 | { 974 | SSD1315_Object_t *pObj = (SSD1315_Object_t *)handle; 975 | 976 | return pObj->IO.ReadReg(Reg, pData, Length); 977 | } 978 | 979 | /** 980 | * @brief Write register wrapped function. 981 | * @param handle Component object handle. 982 | * @param Reg The target register address to write. 983 | * @param pData The target register value to be written. 984 | * @param Length Buffer size to be written. 985 | * @retval error status. 986 | */ 987 | static int32_t SSD1315_WriteRegWrap(void *handle, uint16_t Reg, uint8_t* pData, uint16_t Length) 988 | { 989 | SSD1315_Object_t *pObj = (SSD1315_Object_t *)handle; 990 | 991 | return pObj->IO.WriteReg(Reg, pData, Length); 992 | } 993 | 994 | /** 995 | * @brief Clear Display screen. 996 | * @param ColorCode the color use to clear the screen (SSD1315_COLOR_WHITE or SSD1315_COLOR_BLACK). 997 | * @retval None 998 | */ 999 | static void ssd1315_Clear(uint16_t ColorCode) 1000 | { 1001 | /* Check color */ 1002 | if (ColorCode == SSD1315_COLOR_WHITE) 1003 | { 1004 | memset(PhysFrameBuffer, SSD1315_COLOR_WHITE, SSD1315_LCD_COLUMN_NUMBER*SSD1315_LCD_PAGE_NUMBER); 1005 | } 1006 | else 1007 | { 1008 | memset(PhysFrameBuffer, SSD1315_COLOR_BLACK, SSD1315_LCD_COLUMN_NUMBER*SSD1315_LCD_PAGE_NUMBER); 1009 | } 1010 | } 1011 | 1012 | /** 1013 | * @brief SSD1315 delay. 1014 | * @param Delay Delay in ms. 1015 | * @retval Component error status. 1016 | */ 1017 | static int32_t SSD1315_IO_Delay(SSD1315_Object_t *pObj, uint32_t Delay) 1018 | { 1019 | uint32_t tickstart; 1020 | tickstart = pObj->IO.GetTick(); 1021 | while((pObj->IO.GetTick() - tickstart) < Delay) 1022 | { 1023 | } 1024 | return SSD1315_OK; 1025 | } 1026 | 1027 | /** 1028 | * @} 1029 | */ 1030 | 1031 | /** 1032 | * @} 1033 | */ 1034 | 1035 | /** 1036 | * @} 1037 | */ 1038 | 1039 | /** 1040 | * @} 1041 | */ 1042 | -------------------------------------------------------------------------------- /ssd1315.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file ssd1315.h 4 | * @author MCD Application Team 5 | * @brief This file contains all the functions prototypes for the ssd1315.c 6 | * driver. 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2020 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef SSD1315_H 22 | #define SSD1315_H 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "ssd1315_reg.h" 30 | #include 31 | 32 | /** @addtogroup BSP 33 | * @{ 34 | */ 35 | 36 | /** @addtogroup Components 37 | * @{ 38 | */ 39 | 40 | /** @addtogroup SSD1315 41 | * @{ 42 | */ 43 | 44 | /** @defgroup SSD1315_Exported_Types SSD1315 Exported Types 45 | * @{ 46 | */ 47 | typedef int32_t (*SSD1315_Init_Func) (void); 48 | typedef int32_t (*SSD1315_DeInit_Func) (void); 49 | typedef int32_t (*SSD1315_GetTick_Func) (void); 50 | typedef int32_t (*SSD1315_Delay_Func) (uint32_t); 51 | typedef int32_t (*SSD1315_WriteReg_Func)(uint16_t, uint8_t*, uint16_t); 52 | typedef int32_t (*SSD1315_ReadReg_Func) (uint16_t, uint8_t*, uint16_t); 53 | 54 | typedef struct 55 | { 56 | SSD1315_Init_Func Init; 57 | SSD1315_DeInit_Func DeInit; 58 | SSD1315_WriteReg_Func WriteReg; 59 | SSD1315_ReadReg_Func ReadReg; 60 | SSD1315_GetTick_Func GetTick; 61 | } SSD1315_IO_t; 62 | 63 | 64 | typedef struct 65 | { 66 | SSD1315_IO_t IO; 67 | ssd1315_ctx_t Ctx; 68 | uint8_t IsInitialized; 69 | uint32_t Orientation; 70 | } SSD1315_Object_t; 71 | 72 | typedef struct 73 | { 74 | /* Control functions */ 75 | int32_t (*Init )(SSD1315_Object_t*, uint32_t, uint32_t); 76 | int32_t (*DeInit )(SSD1315_Object_t*); 77 | int32_t (*ReadID )(SSD1315_Object_t*, uint32_t*); 78 | int32_t (*DisplayOn )(SSD1315_Object_t*); 79 | int32_t (*DisplayOff )(SSD1315_Object_t*); 80 | int32_t (*SetBrightness )(SSD1315_Object_t*, uint32_t); 81 | int32_t (*GetBrightness )(SSD1315_Object_t*, uint32_t*); 82 | int32_t (*SetOrientation )(SSD1315_Object_t*, uint32_t); 83 | int32_t (*GetOrientation )(SSD1315_Object_t*, uint32_t*); 84 | int32_t (*Refresh )(SSD1315_Object_t*); 85 | int32_t (*SetPage )(SSD1315_Object_t*, uint16_t); 86 | int32_t (*SetColumn )(SSD1315_Object_t*, uint16_t); 87 | int32_t (*ScrollingSetup )(SSD1315_Object_t*, uint16_t, uint16_t, uint16_t, uint16_t); 88 | int32_t (*ScrollingStart )(SSD1315_Object_t*); 89 | int32_t (*ScrollingStop )(SSD1315_Object_t*); 90 | 91 | /* Drawing functions*/ 92 | int32_t ( *SetCursor ) (SSD1315_Object_t*, uint32_t, uint32_t); 93 | int32_t ( *DrawBitmap ) (SSD1315_Object_t*, uint32_t, uint32_t, uint8_t *); 94 | int32_t ( *ShiftBitmap ) (SSD1315_Object_t*,uint16_t, uint16_t, int16_t, int16_t, uint8_t*); 95 | int32_t ( *FillRGBRect ) (SSD1315_Object_t*, uint32_t, uint32_t, uint8_t*, uint32_t, uint32_t); 96 | int32_t ( *DrawHLine ) (SSD1315_Object_t*, uint32_t, uint32_t, uint32_t, uint32_t); 97 | int32_t ( *DrawVLine ) (SSD1315_Object_t*, uint32_t, uint32_t, uint32_t, uint32_t); 98 | int32_t ( *FillRect ) (SSD1315_Object_t*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); 99 | int32_t ( *GetPixel ) (SSD1315_Object_t*, uint32_t, uint32_t, uint32_t*); 100 | int32_t ( *SetPixel ) (SSD1315_Object_t*, uint32_t, uint32_t, uint32_t); 101 | int32_t ( *GetXSize ) (SSD1315_Object_t*, uint32_t *); 102 | int32_t ( *GetYSize ) (SSD1315_Object_t*, uint32_t *); 103 | }SSD1315_Drv_t; 104 | 105 | /** 106 | * @} 107 | */ 108 | 109 | /** @defgroup SSD1315_Exported_Constants SSD1315 Exported Constants 110 | * @{ 111 | */ 112 | 113 | /** 114 | * @brief SSD1315 return code 115 | */ 116 | #define SSD1315_OK (0) 117 | #define SSD1315_ERROR (-1) 118 | 119 | /** 120 | * @brief SSD1315 Size 121 | */ 122 | #define SSD1315_LCD_PIXEL_WIDTH ((uint16_t)128) 123 | #define SSD1315_LCD_PIXEL_HEIGHT ((uint16_t)64) 124 | 125 | #define SSD1315_LCD_COLUMN_NUMBER ((uint16_t)128) 126 | #define SSD1315_LCD_PAGE_NUMBER ((uint16_t)8) 127 | 128 | /** 129 | * @brief LCD_Orientation 130 | * Possible values of Display Orientation 131 | */ 132 | #define SSD1315_ORIENTATION_LANDSCAPE 0x00U /* Landscape orientation choice of LCD screen */ 133 | 134 | /** 135 | * @brief LCD_Format 136 | * Possible values of Display format 137 | */ 138 | #define SSD1315_FORMAT_DEFAULT 0x00U 139 | 140 | /** 141 | * @} 142 | */ 143 | 144 | /** @defgroup SSD1315_Exported_Functions SSD1315 Exported Functions 145 | * @{ 146 | */ 147 | int32_t SSD1315_RegisterBusIO(SSD1315_Object_t *pObj, SSD1315_IO_t *pIO); 148 | int32_t SSD1315_Init(SSD1315_Object_t *pObj, uint32_t ColorCoding, uint32_t Orientation); 149 | int32_t SSD1315_DeInit(SSD1315_Object_t *pObj); 150 | int32_t SSD1315_ReadID(SSD1315_Object_t *pObj, uint32_t *Id); 151 | int32_t SSD1315_DisplayOn(SSD1315_Object_t *pObj); 152 | int32_t SSD1315_DisplayOff(SSD1315_Object_t *pObj); 153 | int32_t SSD1315_SetBrightness(SSD1315_Object_t *pObj, uint32_t Brightness); 154 | int32_t SSD1315_GetBrightness(SSD1315_Object_t *pObj, uint32_t *Brightness); 155 | int32_t SSD1315_SetOrientation(SSD1315_Object_t *pObj, uint32_t Orientation); 156 | int32_t SSD1315_GetOrientation(SSD1315_Object_t *pObj, uint32_t *Orientation); 157 | int32_t SSD1315_Refresh(SSD1315_Object_t *pObj); 158 | 159 | int32_t SSD1315_SetPage(SSD1315_Object_t *pObj, uint16_t Page); 160 | int32_t SSD1315_SetColumn(SSD1315_Object_t *pObj, uint16_t Column); 161 | int32_t SSD1315_ScrollingSetup(SSD1315_Object_t *pObj, uint16_t ScrollMode, uint16_t StartPage, uint16_t EndPage, uint16_t Frequency); 162 | int32_t SSD1315_ScrollingStart(SSD1315_Object_t *pObj); 163 | int32_t SSD1315_ScrollingStop(SSD1315_Object_t *pObj); 164 | 165 | int32_t SSD1315_SetCursor(SSD1315_Object_t *pObj, uint32_t Xpos, uint32_t Ypos); 166 | int32_t SSD1315_DrawBitmap(SSD1315_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint8_t *pBmp); 167 | int32_t SSD1315_ShiftBitmap(SSD1315_Object_t *pObj,uint16_t Xpos, uint16_t Ypos, int16_t Xshift, int16_t Yshift, uint8_t *pbmp); 168 | int32_t SSD1315_FillRGBRect(SSD1315_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint8_t *pData, uint32_t Width, uint32_t Height); 169 | int32_t SSD1315_DrawHLine(SSD1315_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color); 170 | int32_t SSD1315_DrawVLine(SSD1315_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color); 171 | int32_t SSD1315_DrawLine(SSD1315_Object_t *pObj, uint32_t X1pos, uint32_t Y1pos, uint32_t X2pos, uint32_t Y2pos, uint32_t Color); 172 | int32_t SSD1315_FillRect(SSD1315_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Width, uint32_t Height, uint32_t Color); 173 | int32_t SSD1315_SetPixel(SSD1315_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Color); 174 | int32_t SSD1315_GetPixel(SSD1315_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t *Color); 175 | int32_t SSD1315_GetXSize(SSD1315_Object_t *pObj, uint32_t *XSize); 176 | int32_t SSD1315_GetYSize(SSD1315_Object_t *pObj, uint32_t *YSize); 177 | 178 | /** 179 | * @} 180 | */ 181 | 182 | /** @addtogroup SSD1315_Exported_Variables SSD1315 Exported Variables 183 | * @{ 184 | */ 185 | /* LCD driver structure */ 186 | extern SSD1315_Drv_t SSD1315_Driver; 187 | /** 188 | * @} 189 | */ 190 | 191 | /** 192 | * @} 193 | */ 194 | 195 | /** 196 | * @} 197 | */ 198 | 199 | /** 200 | * @} 201 | */ 202 | 203 | #ifdef __cplusplus 204 | } 205 | #endif 206 | 207 | #endif /* SSD1315_H */ 208 | -------------------------------------------------------------------------------- /ssd1315_reg.c: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************* 3 | * @file ssd1315_reg.c 4 | * @author LCD Software Solution Team 5 | * @brief This file provides unitary register function to control the SSD1315 6 | * LCD driver 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2020 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | 20 | #include "ssd1315_reg.h" 21 | 22 | /** @addtogroup BSP 23 | * @{ 24 | */ 25 | 26 | /** @addtogroup Components 27 | * @{ 28 | */ 29 | 30 | /** @addtogroup SSD1315 31 | * @{ 32 | */ 33 | 34 | /** @addtogroup SSD1315_REG_Exported_Functions 35 | * @{ 36 | */ 37 | 38 | /** 39 | * @brief Read generic device register 40 | * 41 | * @param ssd1315_ctx_t* ctx: read / write interface definitions 42 | * @param uint8_t reg: register to read 43 | * @param uint8_t* data: pointer to buffer that store the data read 44 | * @param uint16_t len: number of consecutive register to read 45 | * 46 | */ 47 | int32_t ssd1315_read_reg(ssd1315_ctx_t *ctx, uint16_t reg, uint8_t* data, uint16_t length) 48 | { 49 | return ctx->ReadReg(ctx->handle, reg, data, length); 50 | } 51 | 52 | /** 53 | * @brief Write generic device register 54 | * 55 | * @param ssd1315_ctx_t *ctx: read / write interface definitions 56 | * @param uint8_t reg: register to write 57 | * @param uint8_t* data: pointer to data to write in register reg 58 | * 59 | */ 60 | int32_t ssd1315_write_reg(ssd1315_ctx_t *ctx, uint16_t reg, uint8_t *data, uint16_t length) 61 | { 62 | return ctx->WriteReg(ctx->handle, reg, data, length); 63 | } 64 | 65 | /** 66 | * @} 67 | */ 68 | 69 | /** 70 | * @} 71 | */ 72 | 73 | /** 74 | * @} 75 | */ 76 | 77 | /** 78 | * @} 79 | */ 80 | -------------------------------------------------------------------------------- /ssd1315_reg.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file ssd1315_reg.h 4 | * @author MCD Application Team 5 | * @brief This file contains all the functions prototypes for the 6 | * ssd1315_reg.c driver. 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2020 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef SSD1315_REG_H 22 | #define SSD1315_REG_H 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include 30 | 31 | /** @addtogroup BSP 32 | * @{ 33 | */ 34 | 35 | /** @addtogroup Components 36 | * @{ 37 | */ 38 | 39 | /** @addtogroup SSD1315 40 | * @{ 41 | */ 42 | 43 | /** @defgroup SSD1315_REG_Exported_Constants SSD1315 REG Exported Constants 44 | * @{ 45 | */ 46 | 47 | /** 48 | * @brief SSD1315 Colors 49 | */ 50 | #define SSD1315_COLOR_WHITE 0xFF 51 | #define SSD1315_COLOR_BLACK 0x00 52 | 53 | /** 54 | * @brief SSD1315 Scrolling 55 | */ 56 | #define SSD1315_SCROLL_RIGHT 0x26 57 | #define SSD1315_SCROLL_LEFT 0x27 58 | #define SSD1315_ACTIVATE_SCROLL 0x2F 59 | #define SSD1315_DESACTIVATE_SCROLL 0x2E 60 | 61 | #define SSD1315_SCROLL_FREQ_2FRAMES 0x07 62 | #define SSD1315_SCROLL_FREQ_3FRAMES 0x04 63 | #define SSD1315_SCROLL_FREQ_4FRAMES 0x05 64 | #define SSD1315_SCROLL_FREQ_5FRAMES 0x06 65 | #define SSD1315_SCROLL_FREQ_6FRAMES 0x00 66 | #define SSD1315_SCROLL_FREQ_32FRAMES 0x01 67 | #define SSD1315_SCROLL_FREQ_64FRAMES 0x02 68 | #define SSD1315_SCROLL_FREQ_128FRAMES 0x03 69 | 70 | /** 71 | * @brief SSD1315 Commands 72 | */ 73 | #define SSD1315_CHARGE_PUMP_SETTING 0x8D 74 | #define SSD1315_READWRITE_CMD 0x80 75 | #define SSD1315_HIGHER_COLUMN_START_ADRESS_1 0x10 76 | #define SSD1315_HIGHER_COLUMN_START_ADRESS_2 0x11 77 | #define SSD1315_HIGHER_COLUMN_START_ADRESS_3 0x12 78 | #define SSD1315_HIGHER_COLUMN_START_ADRESS_4 0x13 79 | #define SSD1315_HIGHER_COLUMN_START_ADRESS_5 0x14 80 | #define SSD1315_HIGHER_COLUMN_START_ADRESS_6 0x15 81 | #define SSD1315_HIGHER_COLUMN_START_ADRESS_7 0x16 82 | #define SSD1315_HIGHER_COLUMN_START_ADRESS_8 0x17 83 | #define SSD1315_LOWER_COLUMN_START_ADRESS 0x00 84 | #define SSD1315_LOWER_COLUMN_START_ADRESS_15 0x0F 85 | #define SSD1315_MEMORY_ADRESS_MODE 0x20 86 | #define SSD1315_SET_COLUMN_ADRESS 0x21 87 | #define SSD1315_SET_PAGE_ADRESS 0x22 88 | #define SSD1315_DISPLAY_START_LINE_1 0x40 89 | #define SSD1315_DISPLAY_START_LINE_32 0x1F 90 | #define SSD1315_DISPLAY_START_LINE_64 0x7F 91 | #define SSD1315_REMAPPED_MODE 0xC8 92 | #define SSD1315_CONTRAST_CONTROL 0xA1 93 | #define SSD1315_CONTRAST_CONTROL_2 0xFF 94 | #define SSD1315_DISPLAY_ON 0xAF 95 | #define SSD1315_DISPLAY_OFF 0xAE 96 | #define SSD1315_SET_PAGE_START_ADRESS 0xB0 97 | 98 | /** 99 | * @} 100 | */ 101 | 102 | /** @defgroup SSD1315_REG_Exported_Types SSD1315 REG Exported Types 103 | * @{ 104 | */ 105 | typedef int32_t (*SSD1315_Write_Func) (void *, uint16_t, uint8_t*, uint16_t); /* this will connect to the LCD_IO_WriteData */ 106 | typedef int32_t (*SSD1315_Read_Func) (void *, uint16_t, uint8_t*, uint16_t); /* this will connect to the LCD_IO_ReadData */ 107 | 108 | typedef struct 109 | { 110 | SSD1315_Write_Func WriteReg; 111 | SSD1315_Read_Func ReadReg; 112 | void *handle; 113 | } ssd1315_ctx_t; 114 | /** 115 | * @} 116 | */ 117 | 118 | /** @defgroup SSD1315_REG_Exported_Functions SSD1315 REG Exported Functions 119 | * @{ 120 | */ 121 | int32_t ssd1315_write_reg(ssd1315_ctx_t *ctx, uint16_t reg, uint8_t *pdata, uint16_t length); 122 | int32_t ssd1315_read_reg(ssd1315_ctx_t *ctx, uint16_t reg, uint8_t *pdata, uint16_t length); 123 | /** 124 | * @} 125 | */ 126 | 127 | /** 128 | * @} 129 | */ 130 | 131 | /** 132 | * @} 133 | */ 134 | 135 | /** 136 | * @} 137 | */ 138 | 139 | #ifdef __cplusplus 140 | } 141 | #endif 142 | 143 | #endif /* SSD1315_REG_H */ 144 | --------------------------------------------------------------------------------