Commit graph

62 commits

Author SHA1 Message Date
0003717408 fw-rust: Refactor home screen
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Add new function for easier instantiation and refactor the input
function.
2022-03-15 19:03:36 +01:00
2ec8d1aeb9 fw-rust: Handle screens differently, use encoder
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Handle the screens differently and implement rotary encoder support.
2022-03-15 00:17:54 +01:00
4a33986e8d fw-rust: Improve URL asset
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2022-03-14 22:54:07 +01:00
1688bb868e fw-rust: Add symbols and screens
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Add several symbols and a symbol table in an ascii order. Add the
`print()` and `print_inverted()` functions to be able to draw strings,
"black on white" as well as "white on black" onto the display. Add a
`HomeScreen` which also saves the state of which selection is
active. To save the screen state and also make it accessible globally
use a `RefCell` contained in a `Mutex`.

Also update the build dependencies.
2022-03-14 22:54:07 +01:00
de8f789e63 fw-rust: Create Lcd struct to handle the screen
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
To improve screen handling create the `Lcd` struct and implement some
first helper functions.
2022-03-12 19:20:28 +01:00
518f113cc0 fw-rust: Use avr-eeprom create to read from EEPROM
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Use the `avr-eeprom` crate when reading from EEPROM.
2022-03-12 17:20:53 +01:00
9425093391 fw-rust: Draw the splash screen via function
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Make the splash screen assets `const` and draw the splash screen with
the new `draw_splash()` function.
2022-03-11 02:35:57 +01:00
36be6d27bc fw-rust: Create a function to clear the screen
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Create a utility function to clear the complete screen.
2022-03-09 19:42:10 +01:00
8b9d21a012 fw-rust: Start to use the avr-eeprom crate
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Start to use the avr-eeprom crate to handle values residing inside the
EEPROM.
2022-03-08 19:05:40 +01:00
b34b2810db fw-rust: Handle data residing in the EEPROM
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2022-03-08 14:42:04 +01:00
8315560daa fw-rust: Use chip-generic interrupt utilities
Instead of manually enabling and disabling interrupts use the
chip-generic interrupt utilities.
2022-03-07 18:30:33 +01:00
a688d4c5ed fw-rust: Show splash screen
Put assets for the splash screen into the data segment and print it.
2022-03-07 18:30:33 +01:00
c42b4595c7 fw-rust: Clear the screen
After initializing the LCD display, clear the screen.
2022-03-06 19:20:49 +01:00
817776d735 fw-rust: Initialize the LCD display
Send commands via SPI to the LCD display to initialize and configure
it.
2022-03-06 19:20:49 +01:00
643e5f1af4 fw-rust: Create a SPI interface for the display
In order to, later on, send data to the display create a SPI
interface.
2022-03-06 19:20:49 +01:00
aa59bc302d fw-rust: Create a PWM signal for the backlight
To have a dimmable backlight, generate a variable duty-cycle PWM
signal which is consumed by the backlight driver circuit.
2022-03-06 19:20:49 +01:00
d2772291bf fw-rust: Add a makefile for cargo-make
It has to be decided what kind of tooling should be used, for now
cargo-make is used. This will probably be changed to use the tools
provided by [probe.rs](https://probe.rs).
2022-03-06 19:20:49 +01:00
aa75712418 fw-rust: Minimal hello world 2022-03-06 19:20:49 +01:00
af3790be0d Rename folder of firmware written in c
To establish a better naming convention for firmwares written in other
languages.
2021-10-25 15:26:04 +02:00
ba6fff941e Add possibility to set PLL in gui
- Add registers where PLL_A (MSNA) and PLL_B (MSNB) start.
- Create screens to edit the PLLs and add their entries to the home
  screen.
- Use a struct for keeping the PLL configs.
- For editing such big numbers make the digits selctable.
- Create utility function for calculating 10 to the power of `n`.
2021-10-25 15:22:19 +02:00
73efd9348c First steps toward custom clocking
Figuring out how to configure the clocks.
2021-10-24 13:33:13 +02:00
c4272c5230 Improve lcd_write_integer_page()
The procedure `lcd_write_integer_page()` is improved by increasing the
possible values of the `comperator` variable and adding comments.
2021-09-27 21:31:12 +02:00
0395da78de Generate default clock signals
The "demo" from Adafruits Si5351 library is used to produce a working
proof of concept which sets PLLA to 720MHz, PLLB to 705MHz and then
Multisynth0, Multisynth1 and Multisynth2 to 120MHz, 12MHz and 13.56MHz
respectively.
2021-09-27 21:29:11 +02:00
953649725b Remove colon from "BACK" setup menu entry
Rename "BACK:" to "BACK" in setup menu.
2021-09-24 23:41:21 +02:00
dada6fe5d4 Allow to print larger integers
Use `uint32_t` instead of `uint8_t` when printing integers with
`lcd_write_integer_page()`.
2021-09-24 23:39:56 +02:00
22095d6e78 Pass kerning when writing string
In order to be able to print more compact strings also pass the
kerning parameter to `lcd_write_string_page()`.
2021-09-24 23:39:27 +02:00
a34a58535b Improve and add symbols
Add symbols for `D` and `M` and improve `U`.
2021-09-24 23:19:02 +02:00
45bfe04537 Also move and rename drawing the splash screen
For consistency `lcd_splash()` was moved before `draw_home()` and
renamed to `draw_splash()`.
2021-09-24 12:29:35 +02:00
144da8d7f2 Add flag to invert output of twi_error()
This is only for convinience for the eye to be able to print
"debugging" information not inverted.
2021-09-24 12:27:53 +02:00
2beecbe722 Move shifting of TWI slave address
As this may be obscure the shifting of the TWI slave address is moved
to where it is used instead of where it is set.
2021-09-24 12:25:47 +02:00
c0f8cac065 Proper debouncing and dechattering
Move debouncing and dechattering to the beginning of the interrupt
service routines to handle them properly.
2021-09-23 23:42:20 +02:00
3aa458c4bc Furbish code and comments
Add `TODO` comment to optimize waiting times, fix capitalization in
comments, add blank line and break up long lines. To improve code
semantics `lcd_home()` and `lcd_setup()` were renamed to `draw_home()`
and `draw_setup()` respectively. Improve ordering of function calls in
`main()`.
2021-09-23 22:52:54 +02:00
2579ae3686 Print actual status and data on TWI error
The contents of `TWSR` (TWI Status Register) and `TWDR` (TWI Data
Register) are printed when an error occured.
2021-09-23 22:47:17 +02:00
664aa4bad5 Add underscore and extend symbol lookup table
To be able to print the underscore symbol `_` the symbol is added and
the symbol lookup table is extended.
2021-09-23 22:45:46 +02:00
99175efc8c Add basic TWI support
To support basic TWI support some defines are created to keep track of
port, pins and address. Fundamental procedures such as:
- `twi_error()`
- `twi_start()`
- `twi_transmit()`
- `twi_receive()`
- `twi_stop()`
are created. Those procedures are used in `twi_read_register()` and
`twi_write_register()` which read and write data from and to registers
respectively. Lastly the TWI bit rate is set to 200kHz.
2021-09-23 21:26:59 +02:00
52e161f43b Create an invalid character
This character is used for invalid characters.
2021-09-21 19:43:22 +02:00
bd217ce6e7 Disable CKDIV8 and adapt to clock div. factor
Configure fuses for the `fuses` target in Makefile to disable
`CKDIV8`. Adapt PWM generation in `lcd_update_backlight()` to new
clock division factor, as well as interrupt handling, debouncing and
dechattering.

This also enables partially lower PWM frequencies (between off and
former lowest PWM setting) for a dimmer lcd backlight.
2021-09-21 19:10:46 +02:00
c48e4a31ab Use NULL instead of strlen for printing strings
This makes more sense and also removes the dependency for `string.h`.
2021-09-21 18:55:53 +02:00
47bd5e45f7 Create a function to move the cursor
Create a function (`lcs_move_cursor()`) to move the cursor in order to
reduce code repetition.
2021-09-14 23:54:19 +02:00
cc105aa9c9 Enable pedantic warnings
Enable all the warnings demanded by strict ISO C.
2021-09-14 00:27:09 +02:00
c53ccba034 Use symbol table for symbol parsing
Store read-only graphics and symbols in flash and use a symbol lookup
table which somehow fits to the ASCII character set. A macro is used
to make the creation of the symbol lookup table shorter. A function to
print strings enables the use of strings.
2021-09-14 00:25:43 +02:00
f9f131a6da Add static and const declarations and spaces
Add `static` keyword for consistency and `const` where it makes
sense. Also add spaces when declaring enums.
2021-09-12 15:37:01 +02:00
a5d88e879c Furbish code and comment
Remove unneeded brackets and improve comment.
2021-09-12 01:05:33 +02:00
14dd301657 Fix kerning in setup screen for backlight
This fixes the inverting of the first two pixel on the setup screen
when the backlight setting is selected.
2021-09-12 01:04:10 +02:00
d75d230541 Implement contrast and backlight handling
The default values for the contrast and backlight are set when writing
to eeprom. Use the values stored in eeprom for contrast and
backlight. Update the contrast and backlight when changing their
values.
2021-09-12 00:59:22 +02:00
05c9888a75 Store setup settings in eeprom
To have the values of `value_contrast` and `value_backlight` persist
over turn offs they are loaded and stored from and in the eeprom.

For preventing the flash target from earasing the eeprom the `EESAVE`
high fuse byte is set to 0 (programmed).

The values are now loaded when booted and stored when a new value is
set in the setup menu.
2021-09-11 15:44:11 +02:00
acf4bc5754 Editable setup settings
In order to be able to change the setup settings two new setup states
are introduced `change_contrast` and `change_backlight`. All
procedures that handle the setup states are adapted to handle those
new states correct. To keep track of their values the global variables
`value_contrast` and `value_backlight` are introduced.
2021-09-11 15:36:02 +02:00
0acd0bd98b Iterable setup settings with encoder
To make setup settings configurable make it possible to select them
first. Therefore the `setup_state` enum is created to keep track of
the currently selected setting state.
2021-09-11 11:13:15 +02:00
e2d30d7050 Fix indents and switch syntax
Fix indentions in `spi_byte()` and add missing space after `switch`
keywords.
2021-09-11 00:21:01 +02:00
6eb515e2d4 Display digits and integers
Display digits and integers, for the later displaying leading zeroes
is supported via parameter. Demo integers are displayed in the setup
screen.
2021-09-11 00:19:59 +02:00