This file contains hidden or 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
| //! Show ferris on the Pimoroni Pico Display pack | |
| #![no_std] | |
| #![no_main] | |
| use cortex_m_rt::entry; | |
| use defmt::*; | |
| use defmt_rtt as _; | |
| use embedded_hal::digital::v2::OutputPin; | |
| use embedded_time::{fixed_point::FixedPoint, rate::Extensions}; |
This file contains hidden or 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
| #![no_std] | |
| #![no_main] | |
| use panic_halt as _; | |
| use cortex_m_rt::entry; | |
| use tm4c123x_hal::{self as hal, prelude::*, delay::Delay}; | |
| #[entry] | |
| fn main() -> ! { | |
| let p = hal::Peripherals::take().unwrap(); |
This file contains hidden or 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
| #![no_std] | |
| #![no_main] | |
| use panic_halt as _; | |
| use bl602_hal as hal; | |
| use hal::{ | |
| clock::{self, SysclkFreq, UART_PLL_FREQ}, | |
| serial::{Serial, Config}, | |
| pac, | |
| prelude::*, |
This file contains hidden or 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
| # memory mapped register for gpio0/1 cfg. used as base for other registers | |
| .set GPIO_CFGCTL0, 0x40000100 | |
| # memory mapped register for gpio10/11 cfg | |
| .set GPIO_CFGCTL5_OFS, 0x14 | |
| # memory mapped register for GPIO output (whether GPIO is high or low) | |
| .set GPIO_CFGCTL32_OFS, 0x88 | |
| # memory mapped register for GPIO output-enable (whether GPIO gets driven) | |
| .set GPIO_CFGCTL34_OFS, 0x90 | |
| # config for two GPIO is stored in each CFG register, choose the appropriate one | |
| # based on your GPIO number (ie GPIO11 is ODD, GPIO2 is EVEN) |
This file contains hidden or 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
| .set GPIO_CFGCTL2, 0x40000108 | |
| .set GPIO_CFGCTL32, 0x40000188 | |
| .set GPIO_CFGCTL34, 0x40000190 | |
| .set GPIO_CFG_GPIO5, 0b00001011001000000000000000000000 | |
| .set GPIO_BITSET_GPIO5, 0b00000000000000000000000000100000 | |
| .section .text | |
| main: | |
| la t1, GPIO_CFGCTL2 | |
| la t2, GPIO_CFG_GPIO5 |
NewerOlder