-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update microzig, include lcd * wip * wip * SPI communication with LCD is fixed * increase cart ram allocation * add framebuffer to cart fixed memory
- Loading branch information
Showing
13 changed files
with
507 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const microzig = @import("microzig"); | ||
const board = microzig.board; | ||
const hal = microzig.hal; | ||
const clocks = hal.clocks; | ||
const sercom = hal.sercom; | ||
|
||
pub fn main() void { | ||
clocks.mclk.set_apb_mask(.{ .SERCOM4 = .enabled }); | ||
clocks.gclk.enable_generator(.GCLK1, .DFLL, .{}); | ||
|
||
clocks.gclk.set_peripheral_clk_gen(.GCLK_SERCOM4_CORE, .GCLK1); | ||
|
||
board.TFT_RST.set_dir(.out); | ||
board.TFT_LITE.set_dir(.out); | ||
board.TFT_DC.set_dir(.out); | ||
board.TFT_CS.set_dir(.out); | ||
|
||
board.TFT_SCK.set_mux(.C); | ||
board.TFT_MOSI.set_mux(.C); | ||
|
||
const spi = sercom.spi.Master.init(.SERCOM4, .{ | ||
.cpha = .LEADING_EDGE, | ||
.cpol = .IDLE_LOW, | ||
.dord = .MSB, | ||
.dopo = .PAD2, | ||
.ref_freq_hz = 48_000_000, | ||
.baud_freq_hz = 4_000_000, | ||
}); | ||
|
||
while (true) { | ||
spi.write_blocking(0xAA); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.