Skip to content

Commit

Permalink
Update mod.rs
Browse files Browse the repository at this point in the history
remove const def of base registers

fix to hard code Can clock source to OSC

see: #122 (comment)

Squashed commit of the following:

commit 68677eb
Author: djstrickland <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Mon Dec 12 16:21:30 2022 -0500

    resolve PR Issues

    artifacts of non-existent feature: #122 (comment)

    remove constrain function and use core::cmp::Ordering::clamp trait: #122 (comment)

commit 081d027
Merge: 2ab80a7 6da6c97
Author: djstrickland <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Mon Dec 12 16:00:55 2022 -0500

    Merge branch 'dev/can' into maint-v0.4

commit 6da6c97
Author: djstrickland <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Mon Dec 12 10:03:39 2022 -0500

    package update

commit 111f429
Author: djstrickland <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Mon Dec 12 09:59:11 2022 -0500

    rename package

commit e071a4d
Author: djstrickland <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Mon Dec 12 07:28:15 2022 -0500

    update

commit 13b396c
Author: djstrickland <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Sat Dec 10 13:12:28 2022 -0500

    Update frame.rs

commit 118d51e
Author: djstrickland <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Sat Dec 10 11:53:47 2022 -0500

    update

commit e51d7dc
Author: dstric-aqueduct <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Fri Dec 9 13:24:22 2022 -0500

    updates

commit e9d8df8
Author: djstrickland <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Thu Dec 8 07:34:16 2022 -0500

    init refactor

commit 8831af2
Author: djstrickland <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Wed Dec 7 14:40:45 2022 -0500

    update

commit b4b52d1
Author: djstrickland <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Wed Dec 7 07:03:21 2022 -0500

    mask update

commit fef5223
Author: djstrickland <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Tue Dec 6 20:04:47 2022 -0500

    update

commit bc428c0
Author: djstrickland <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Tue Dec 6 05:39:18 2022 -0500

    Update mod.rs

commit adbd1bd
Author: djstrickland <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Fri Dec 2 07:48:31 2022 -0500

    update

commit 4ab5ee0
Author: djstrickland <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Thu Dec 1 16:07:04 2022 -0500

    Update mod.rs

commit 8026f2a
Author: djstrickland <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Thu Dec 1 12:14:10 2022 -0500

    update

commit 588ac9b
Author: djstrickland <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Thu Dec 1 08:35:08 2022 -0500

    update

commit 486a7c4
Author: djstrickland <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Wed Nov 30 13:22:08 2022 -0500

    Update id.rs

commit b0e15d7
Merge: 687af5b 0ec2e73
Author: djstrickland <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Wed Nov 30 06:43:22 2022 -0500

    Merge branch 'dev/can' of https://github.com/dstric-aqueduct/imxrt-hal into dev/can

commit 687af5b
Author: djstrickland <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Wed Nov 30 06:43:20 2022 -0500

    update

commit 0ec2e73
Author: dstric-aqueduct <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Wed Nov 30 06:41:53 2022 -0500

    update

commit a12871c
Author: dstric-aqueduct <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Mon Nov 28 10:21:22 2022 -0500

    Update isotp.rs

commit 52934a6
Author: dstric-aqueduct <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Sun Nov 27 08:02:55 2022 -0500

    update

commit 78183fc
Author: dstric-aqueduct <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Sun Nov 27 07:09:41 2022 -0500

    Update mod.rs

commit c367a4e
Author: dstric-aqueduct <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Sun Nov 27 06:53:55 2022 -0500

    Update mod.rs

commit ff22943
Author: dstric-aqueduct <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Sat Nov 26 18:41:20 2022 -0500

    update

commit 037b404
Author: dstric-aqueduct <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Sat Nov 26 07:11:48 2022 -0500

    update

commit ae00b21
Author: dstric-aqueduct <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Sat Nov 26 06:08:08 2022 -0500

    Update mod.rs

commit a9e80e8
Author: dstric-aqueduct <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Fri Nov 25 06:03:13 2022 -0500

    Update mod.rs

commit 284997f
Author: dstric-aqueduct <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Thu Nov 24 10:51:20 2022 -0500

    Update mod.rs

commit ecca971
Author: dstric-aqueduct <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Wed Nov 23 18:25:35 2022 -0500

    Update mod.rs

commit 1de0d0c
Author: dstric-aqueduct <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Wed Nov 23 18:23:39 2022 -0500

    Update mod.rs

commit 5bf1d98
Merge: 1ebb9e6 0ef6987
Author: dstric-aqueduct <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Wed Nov 23 05:51:14 2022 -0500

    Merge branch 'dev/can' of https://github.com/dstric-aqueduct/imxrt-hal into dev/can

commit 1ebb9e6
Author: dstric-aqueduct <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Wed Nov 23 05:48:57 2022 -0500

    Update mod.rs

commit 0ef6987
Author: djstrickland <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Mon Nov 21 19:22:07 2022 -0500

    Update mod.rs

commit 83c0c2a
Author: djstrickland <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Mon Nov 21 15:43:32 2022 -0500

    Update mod.rs

commit 6e16125
Author: djstrickland <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Mon Nov 21 14:24:56 2022 -0500

    Update mod.rs

commit e27f4d5
Author: djstrickland <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Mon Nov 21 10:04:34 2022 -0500

    Update mod.rs

commit 10a66d2
Author: djstrickland <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Mon Nov 21 07:23:49 2022 -0500

    updates

commit 6362ad6
Author: djstrickland <96876452+dstric-aqueduct@users.noreply.github.com>
Date:   Thu Nov 17 13:52:52 2022 -0500

    init

commit 2ab80a7
Author: Alex Halemba <alex-halemba@gmx.de>
Date:   Sun Jan 9 23:21:22 2022 +0100

    impr. docs

commit 90f36ef
Author: Alex Halemba <alex-halemba@gmx.de>
Date:   Sat Jan 8 23:03:38 2022 +0100

    review

commit 1322f91
Author: Alex Halemba <alex-halemba@gmx.de>
Date:   Thu Jan 6 20:02:23 2022 +0100

    use modify_reg

commit 386b680
Author: Alex Halemba <alex-halemba@gmx.de>
Date:   Thu Jan 6 18:07:02 2022 +0100

    review fixes

commit 229d3ae
Author: Alex Halemba <alex-halemba@gmx.de>
Date:   Wed Jan 5 21:27:43 2022 +0100

    figuring out that ```ignore fixed the pipeline

commit be68c9c
Author: Alex Halemba <alex-halemba@gmx.de>
Date:   Wed Jan 5 11:16:16 2022 +0100

    fixing documentation

commit 173b525
Author: Alex Halemba <alex-halemba@gmx.de>
Date:   Wed Jan 5 11:08:00 2022 +0100

    changing to mC to avoid f32

commit 5daf3cc
Author: Alex Halemba <alex-halemba@gmx.de>
Date:   Tue Jan 4 19:52:55 2022 +0100

    add tempmon support

commit 9b85614
Author: Alex Halemba <alex-halemba@gmx.de>
Date:   Tue Jan 4 19:00:32 2022 +0100

    add tempmon

commit 08aa861
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Thu Dec 2 19:15:32 2021 -0500

    Bump HAL version to 0.4.5

commit 7437482
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Thu Dec 2 19:11:59 2021 -0500

    Document 0.4.5 release in CHANGELOG

commit 50d3677
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Thu Dec 2 19:04:01 2021 -0500

    Update CHANGELOG with TRNG error code fix

commit 18fabf3
Author: Malloc Voidstar <1284317+AlyoshaVasilieva@users.noreply.github.com>
Date:   Thu Dec 2 00:08:59 2021 -0800

    Follow rand_core API

commit 9a3727f
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Sat Sep 18 13:24:38 2021 -0400

    Add GPIO interrupt documentation, code snippet

    Documentation and examples came from development discussions. See
    discussions on #109 for details.

commit 7121735
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Sat Sep 18 12:40:25 2021 -0400

    Update CHANGELOG

commit 44c76a7
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Sat Sep 18 11:10:37 2021 -0400

    Implement icr_mask for GPIO inputs

commit f69bd80
Author: Martin Algesten <martin@algesten.se>
Date:   Mon Jul 12 22:51:50 2021 +0200

    Update imxrt1060-hal/src/gpio.rs

    Co-authored-by: Ian McIntyre <ianpmcintyre@gmail.com>

commit 7218aa2
Author: Martin Algesten <martin@algesten.se>
Date:   Mon Jul 5 22:37:45 2021 +0200

    Fix error 032 vs 0u32

commit 87bc829
Author: Martin Algesten <martin@algesten.se>
Date:   Sun Jul 4 11:13:08 2021 +0200

    Clear out interrupt config when transitioning to output

commit 7259132
Author: Martin Algesten <martin@algesten.se>
Date:   Sun Jul 4 11:12:45 2021 +0200

    Preserve interrupt config on set_fast()

commit 5a158ff
Author: Martin Algesten <martin@algesten.se>
Date:   Sun Jul 4 10:50:35 2021 +0200

    Amends after PR feedback

commit 1703b81
Author: Martin Algesten <martin@algesten.se>
Date:   Sun Jul 4 10:43:24 2021 +0200

    Update imxrt1060-hal/src/gpio.rs

    Co-authored-by: Ian McIntyre <ianpmcintyre@gmail.com>

commit 9bab8d3
Author: Martin Algesten <martin@algesten.se>
Date:   Wed Jun 30 17:22:02 2021 +0200

    GPIO functions to enable / configure interrupts

    cortex_m_rt provides the hook for the ISR and the `NVIC::unmask`,
    however to configure a GPIO interrupt there are some additional
    steps needed.

    This commit provides set_interrupt_enable, set_interrupt_configuration
    and clear_interrupt_status (and some additional query functions).

commit e6e9e47
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Mon Jun 28 22:11:08 2021 -0400

    Isolate fast / normal GPIO configuration copy

    The new implementation is consistent with the previous behavior. We're
    setting the stage for copying over interrupt settings.

commit b79b4de
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Mon Jun 28 21:57:31 2021 -0400

    Rename GPIO "offset" to "mask"

    The usage resembles a bitmask with a single set bit. The name is easier
    to reason about.

commit cd6e3f5
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Fri Apr 23 18:42:43 2021 -0400

    Bump imxrt-ral to 0.4.4

commit f9c58fe
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Fri Apr 23 18:41:09 2021 -0400

    Document 0.4.4 release date in CHANGELOG

    Fix 0.4.3 release date (wrong year).

commit 418e97c
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Thu Apr 22 20:33:53 2021 -0400

    Update CHANGELOG with PWM fix

commit 29cc21a
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Thu Apr 22 20:25:23 2021 -0400

    Prepare PWM pins when constructing outputs

    In the 0.3 HAL, we relied on the user to set the pin alternate
    settings. But after introducing the IOMUXC crate in 0.4, we made pin
    muxing part of the driver's responsibility, and added calls to prepare
    pins. We missed the requirement in the PWM driver. This commit
    corrects the PWM driver, which has been broken since the 0.4 release.

    Tested in the teensy4-rs repo. Users who are not able to adopt the
    next patch release could add equivalent iomuxc calls before
    constructing their PWM driver.

commit 124a811
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Mon Apr 5 20:20:00 2021 -0400

    Bump imxrt-hal to 0.4.3

commit 98c8cbd
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Mon Apr 5 20:19:35 2021 -0400

    Add 0.4.3 CHANGELOG entry

commit 2a97740
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Wed Mar 31 22:50:56 2021 -0400

    Update CHANGELOG

commit 4935e6a
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Wed Mar 31 22:21:23 2021 -0400

    Allow deprecated atomic::spin_loop_hint()

    Clippy suggests that we start using core::hint::spin_loop(). This new
    function was introduced in Rust 1.49, and replaces spin_loop_hint().
    We're not going to issue that breaking change right now. So, we'll
    mark the existing usages as OK.

    TODO:

    - Pin a clippy, compiler, toolchain version in CI
    - Figure out a MSRV, maybe

commit 27d8518
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Wed Mar 31 22:18:32 2021 -0400

    Allow upper case names, acronyms

    New clippy is very aggressive about proper naming. We're not
    following proper naming in the 0.4 HAL. Disable the warnings for
    now.

commit 2658b74
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Wed Mar 31 21:33:38 2021 -0400

    Address clippy warnings in AdcSource

commit be6006e
Author: Lane Kolbly <lane@rscheme.org>
Date:   Sun Mar 28 10:15:10 2021 -0500

    Implement ADC DMA source

    This commit makes the ADCs a possible source for DMA operations.

commit 8f457ed
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Mon Mar 22 20:10:44 2021 -0400

    Update CHANGELOG

commit 227f375
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Mon Mar 22 20:06:14 2021 -0400

    Add CI for 1061, 1064 features

commit e3c77a0
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Mon Mar 22 19:59:05 2021 -0400

    Add support for the 1061

    See the data sheet for differences. One notable change is that the
    1061 doesn't have the graphics features (LCD, CSI, pixel pipeline).
    We don't have drivers for these peripherals today, so the HAL can
    support these features without issue.

commit 5256dd9
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Sat Mar 20 19:46:39 2021 -0400

    Enable the imxrt1064 feature

    The HAL builds with the `imxrt1064` feature:

      cd imxrt-hal
      cargo build --features imxrt1064

    It has not been tested on hardware. Only thing that seems to change
    is the FlexSPI2 IOMUXC registers are reserved. Everything else is the
    same.

commit 357a71a
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Tue Nov 17 19:36:06 2020 -0500

    Bump imxrt-hal to 0.4.2

commit f8514f9
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Tue Nov 17 19:40:10 2020 -0500

    Update CHANGELOG

commit 61dccd9
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Tue Nov 17 19:33:40 2020 -0500

    Explicitly depend on imxrt-iomuxc 0.1.2

    That release introduces the ADC pins, which are required for the
    current HAL.

commit c4a4111
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Tue Nov 17 19:30:58 2020 -0500

    Update README and release docs

    The documentation in this branch should still be useful. This commit
    revises our documentation to reflect the broader imxrt-rs org.

commit 0567ab4
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Tue Nov 17 19:08:25 2020 -0500

    Remove iomuxc crate from 0.4 branch

    It's been moved to a separate repo. This change is to prevent someone
    from accidentally releasing the iomuxc crate from this repo.

commit 8efe35c
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Mon Nov 16 20:44:37 2020 -0500

    Remove RAL from 0.4 branch

    Manually removing the RAL, since it's already been removed in master.
    This is to ensure that we don't accidentally depend on something in
    this 0.4 maintenance branch that isn't correctly reflected in our RAL
    repo.

commit bf0bbfa
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Mon Nov 16 19:39:22 2020 -0500

    Fix CHANGELOG entrie for unreleased fixes

    Added the error correction to the wrong "Fix" header

commit f1301cc
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Mon Nov 16 19:27:38 2020 -0500

    Update CHANGELOG describing fix for errors

commit 429b9fa
Author: Malloc Voidstar <1284317+AlyoshaVasilieva@users.noreply.github.com>
Date:   Sun Nov 15 08:41:46 2020 -0800

    Only allow HAL to create I2C/SPI config errors

commit 0878f7a
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Mon Nov 16 19:34:32 2020 -0500

    Update CHANGELOG with TRNG addition

commit c697e69
Author: Malloc Voidstar <1284317+AlyoshaVasilieva@users.noreply.github.com>
Date:   Tue Nov 17 11:43:32 2020 -0800

    Fix comment, don't preserve bad value

commit 7470642
Author: Malloc Voidstar <1284317+AlyoshaVasilieva@users.noreply.github.com>
Date:   Sun Nov 15 08:33:16 2020 -0800

    Preserve settings, fix error privacy

commit 12dba78
Author: Malloc Voidstar <1284317+AlyoshaVasilieva@users.noreply.github.com>
Date:   Sat Nov 14 06:05:44 2020 -0800

    Add optional RngCore impl

commit 51f4644
Author: Malloc Voidstar <1284317+AlyoshaVasilieva@users.noreply.github.com>
Date:   Fri Oct 9 03:23:32 2020 -0700

    Implement basic support for the TRNG

    Limited configurability but it works.

commit f819cc5
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Thu Oct 15 18:52:25 2020 -0400

    hal: add CHANGELOG entry for ADC feature

commit de9cdca
Author: DavidTheFighter <19dallen@gmail.com>
Date:   Wed Oct 14 21:46:21 2020 -0400

    (Hopefully) removed Cargo.toml from changes

commit 93bb6cd
Author: DavidTheFighter <19dallen@gmail.com>
Date:   Wed Oct 14 20:40:34 2020 -0400

    Implemented suggestions

commit fdae6ed
Author: DavidTheFighter <19dallen@gmail.com>
Date:   Wed Oct 7 13:06:54 2020 -0400

    3rd time's a charm, fix CI issues

commit b2335df
Author: DavidTheFighter <19dallen@gmail.com>
Date:   Wed Oct 7 12:41:52 2020 -0400

    Hopefully actually fixed build issues

commit 8a966bc
Author: DavidTheFighter <19dallen@gmail.com>
Date:   Tue Oct 6 22:54:22 2020 -0400

    Fixed issues from checks

commit 88d02cd
Author: DavidTheFighter <19dallen@gmail.com>
Date:   Tue Oct 6 22:36:58 2020 -0400

    Finished up comments & example

commit 1f6aa15
Author: DavidTheFighter <19dallen@gmail.com>
Date:   Tue Oct 6 00:16:22 2020 -0400

    Changed AnalogPin creation

commit 22ac89b
Author: DavidTheFighter <19dallen@gmail.com>
Date:   Mon Oct 5 21:12:12 2020 -0400

    Added adc to peripherals

commit 684592e
Author: DavidTheFighter <19dallen@gmail.com>
Date:   Mon Oct 5 21:05:44 2020 -0400

    Added input data for all IMXRT106x pins

commit 744ce70
Author: DavidTheFighter <19dallen@gmail.com>
Date:   Mon Oct 5 20:58:36 2020 -0400

    Potential ADC implementation take 1

commit 3f98a20
Author: DavidTheFighter <19dallen@gmail.com>
Date:   Sun Oct 4 23:54:02 2020 -0400

    Transfer work to fork

commit b7a1a56
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Sat Oct 10 20:58:36 2020 -0400

    imxrt-hal: add CHANGELOG entry for SRTC

commit 24b73db
Author: Malloc Voidstar <1284317+AlyoshaVasilieva@users.noreply.github.com>
Date:   Thu Oct 8 22:32:09 2020 -0700

    Update following review

commit f9b71bd
Author: Malloc Voidstar <1284317+AlyoshaVasilieva@users.noreply.github.com>
Date:   Tue Oct 6 17:00:38 2020 -0700

    Use microseconds, add get_with_micros

commit 0bea36d
Author: Malloc Voidstar <1284317+AlyoshaVasilieva@users.noreply.github.com>
Date:   Tue Oct 6 14:02:07 2020 -0700

    Revert "Add get_f64"

    This reverts commit aec0ed6.

commit 597a113
Author: Malloc Voidstar <1284317+AlyoshaVasilieva@users.noreply.github.com>
Date:   Sun Oct 4 22:37:34 2020 -0700

    Add get_f64

commit 665e1c8
Author: Malloc Voidstar <1284317+AlyoshaVasilieva@users.noreply.github.com>
Date:   Sun Oct 4 21:28:19 2020 -0700

    Update for review and sub-second times

    Now exclusively enables and uses the SRTC.

commit 72f57aa
Author: Malloc Voidstar <1284317+AlyoshaVasilieva@users.noreply.github.com>
Date:   Fri Oct 2 17:04:38 2020 -0700

    Implement basic RTC support

    Supports enabling and setting the clocks.

commit f77c16a
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Sun Sep 13 08:01:34 2020 -0400

    hal: Prepare release 0.4.1

commit c1a7d32
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Sun Sep 13 07:51:33 2020 -0400

    hal: Add CHANGELOG entry for GPIO fast mode fix

commit c8ff33f
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Sun Sep 13 07:48:16 2020 -0400

    gpio: Clarify 'state' in set_fast() documentation

commit 887a8e1
Author: Ian McIntyre <ianpmcintyre@gmail.com>
Date:   Sun Sep 13 07:33:48 2020 -0400

    gpio: Fix GPIO high-speed state inconsistency

    There are two valid ways to prepare a high-speed GPIO output:

    ```rust
    pub fn configure_led(pad: LedPadType) -> LED {
        let mut led = hal::gpio::GPIO::new(pad);
        led.set_fast(true);
        led.output()
    }
    ```

    and

    ```rust
    pub fn configure_led(pad: LedPadType) -> LED {
        let mut led = hal::gpio::GPIO::new(pad).output();
        led.set_fast(true);
        led
    }
    ```

    the former will put the GPIO into high-speed, or 'fast,' mode before
    setting 'output mode.' The latter will put the GPIO into output mode
    before fast mode.

    After transitioning into fast mode, the GPIO will start to reference
    a different GPIO register block. The issue is that, after entering
    fast mode, the output / input state of the pin is not maintained. In
    the second snippet, the set_fast(true) call ends up reverting the
    GPIO state back to 'input,' since the newly-referenced register block
    does not maintain the same GPIO input / output configuration.

    This commit updates the set_fast() method to maintain the GPIO I/O
    state for the new register block. It makes it so that either of the
    above patterns work.
  • Loading branch information
dstric-aqueduct committed Dec 14, 2022
1 parent 5aad21d commit dd5bdec
Show file tree
Hide file tree
Showing 16 changed files with 721 additions and 578 deletions.
44 changes: 10 additions & 34 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,18 @@ name: All Checks
on: [push, pull_request]

jobs:
build-hals:
build-hal:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build HAL(s)
run: cargo build --verbose
- name: Run HAL(s) tests
run: cargo test --verbose
- name: Check format for HAL(s)
run: cargo fmt --all -- --check
- name: Run clippy for HAL(s)
run: cargo clippy -- -D warnings

# imxrt1060-hal feature checks
imxrt1060-features:
strategy:
matrix:
features: ["rand_core", "rtic", "rt", "rand_core,rtic,rt"]
env:
RUSTFLAGS: -D warnings
runs-on: ubuntu-latest
feature: ["imxrt1061", "imxrt1062", "imxrt1064"]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: thumbv7em-none-eabihf
override: true
profile: minimal
- name: Check imxrt-hal with features '${{ matrix.features }}'
uses: actions-rs/cargo@v1
with:
command: check
args: >
--features=${{ matrix.features }}
--manifest-path=imxrt-hal/Cargo.toml
--target=thumbv7em-none-eabihf
--verbose
- name: Build imxrt-hal for (${{ matrix.feature }}) HAL
run: cd imxrt-hal && cargo build --verbose --features ${{ matrix.feature }}
- name: Run tests (${{ matrix.feature }}) for HAL
run: cd imxrt-hal && cargo test --verbose --features ${{ matrix.feature }}
- name: Check format (${{ matrix.feature }}) for HAL
run: cd imxrt-hal && cargo fmt --all -- --check
- name: Run clippy (${{ matrix.feature }}) for HAL
run: cd imxrt-hal && cargo clippy --features ${{ matrix.feature }} -- -D warnings
24 changes: 3 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# imxrt-hal
# imxrt-rs

A Rust hardware abstraction layer (HAL) for NXP i.MX RT processors.

Expand All @@ -9,19 +9,6 @@ A Rust hardware abstraction layer (HAL) for NXP i.MX RT processors.
[imxrt-hal-badge]: https://img.shields.io/crates/v/imxrt-hal
[imxrt-hal-url]: https://crates.io/crates/imxrt-hal

[matrix-chat](https://matrix.to/#/#imxrt-rs:matrix.org)

## Goals

- Create *the* collaborative group to support using Rust on NXP's i.MX RT series.
- Simple but useful register level access. It compiles quickly, and it's intuitive for existing embedded developers. Every hal republishes the RAL.
- Embedded HAL support.
- RTIC support.
- NXP EVK board support
- Supporting popular boards such as the Teensy 4.

## Getting Started

### HAL

If you want to develop Rust libraries and applications for an i.MX RT-based system, use the `imxrt-hal` crate. The `imxrt-hal` crate provides implementations of the [`embedded-hal` traits](https://crates.io/crates/embedded-hal) specific to i.MX RT processors. Use the HAL if you want to
Expand All @@ -33,7 +20,7 @@ If you want to develop Rust libraries and applications for an i.MX RT-based syst
- read and write serial data (UART)
- send and receive data over SPI

The publicly-supported HAL is on [crates.io](https://crates.io/crates/imxrt-hal). Include the HAL in your Rust library or binary:
The HAL is on [crates.io](https://crates.io/crates/imxrt-hal). Include the HAL in your Rust library or binary:

```toml
[dependencies.imxrt-hal]
Expand All @@ -52,11 +39,6 @@ The `"rt"` feature flag is recommended for users who are

Enabling the `"rt"` feature-flag will link in the i.MX RT interrupt table. If you're familiar with crates that are generated from `svd2rust`, [the `"rt"` feature](https://docs.rs/svd2rust/0.17.0/svd2rust/#the-rt-feature) has the same behaviors in the `imxrt-hal` as it does in `svd2rust`-generated crates.

#### Future of the HAL

Follow #56 to understand how we're breaking `imxrt-hal` into separate crates. If you'd like to try the new HAL crate(s), depend on `imxrt1060-hal`, and skip the feature flag that describes your i.MX RT variant.


## Q/A

#### *Are there any board support packages (BSP) that use the `imxrt-hal` crate?*
Expand Down Expand Up @@ -94,4 +76,4 @@ Licensed under either of
http://www.apache.org/licenses/LICENSE-2.0)
- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)

at your option.
at your option.
17 changes: 6 additions & 11 deletions docs/RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
## Publish a release

From a clean repository, at the root:
Ensure that all other imxrt-rs dependencies, like `imxrt-ral` and
`imxrt-iomuxc`, are already published. Then, publish the HAL:

1. If needed, publish a new imxrt-ral following instructions there for release.
2. In each HAL such as imxrt1060-hal/Cargo.toml`, update both
- the version of the HAL
- the HAL's dependency of the RAL
3. Commit the changes, and create a tag.
4. Publish the HAL(s):
```
cargo publish --manifest-path imxrt1060-hal/Cargo.toml
```
```
cargo publish --manifest-path imxrt-hal/Cargo.toml --features imxrt1062
```

## Maintaining older releases

This section describes how imxrt-rs project maintainers support older releases.
If there is a bug fix that you would like to apply to an older version of the
RAL or HAL crates, follow the process below to create a new patch
RAL, HAL, or IOMUXC crates, follow the process below to create a new patch
release.

- Integrate bug fixes on the main branch.
Expand Down
5 changes: 5 additions & 0 deletions imxrt-hal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## [Unreleased]

### Added

Abstraction layer for `tempmon` module. Incl. auto measurement and
alarm interrupts (only available for `"imxrt106x"`)

## [0.4.5] 2021-12-02

### Added
Expand Down
4 changes: 2 additions & 2 deletions imxrt-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ rand_core = { version = "0.5", default-features = false, optional = true }

[dependencies.imxrt-iomuxc]
version = "0.1.2"
git = "https://github.com/dstric-aqueduct/imxrt-iomuxc.git"
branch = "v0.1.2/can"
git = "https://github.com/imxrt-rs/imxrt-iomuxc.git"
branch = "v0.1"

[dev-dependencies.cortex-m-rt]
version = "0.6"
Expand Down
28 changes: 12 additions & 16 deletions imxrt-hal/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
# imxrt-hal
# imxrt1060-hal

This project provides a Rust HAL (hardware abstraction layer) for all NXP i.MX RT
microcontrollers based on the imxrt-ral crate.
`imxrt1060-hal` is a Rust hardware abstraction layer that's specific to i.MX
RT 1060 processors. This includes some of the following processor parts:

A feature flag needs to be set for any of the supported i.MX RT SoC.
- i.MX RT 1061
- i.MX RT 1062

## What is it?
It is the successor to `imxrt-hal`, version 0.4, with `feature = "imxrt1062"`.

imxrt-hal is an experiment into a lightweight hardware abstraction layer. It
provides access to some of the peripherals of the i.MX RT series processors
from NXP using embedded-hal and other community driven hardware APIs.
## Features

The main aims are fast compilation, compactness, and simplicity.
The table below describes the optional features supported by `imxrt1060-hal`.

Please consider trying it out and contributing or leaving feedback!

## Goals

* Simple to use and hard to use incorrectly
* All peripherals and busses supported
* Support the entire i.MX RT Series with a single crate to maximize code reuse
| Feature | Description |
| -------- | ---------------------------------- |
| `"rt"` | Runtime support with `cortex-m-rt` |
| `"rtic"` | Support for RTIC |
17 changes: 9 additions & 8 deletions imxrt-hal/src/adc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
//!
//! # Example
//! ```no_run
//! use imxrt1060_hal::{self, adc};
//! use imxrt_hal::{self, adc};
//! use embedded_hal::adc::OneShot;
//!
//! let mut peripherals = imxrt1060_hal::Peripherals::take().unwrap();
//! let mut peripherals = imxrt_hal::Peripherals::take().unwrap();
//! let (adc1_builder, _) = peripherals.adc.clock(&mut peripherals.ccm.handle);
//!
//! let mut adc1 = adc1_builder.build(adc::ClockSelect::default(), adc::ClockDivision::default());
Expand Down Expand Up @@ -258,26 +258,27 @@ where
}
}

unsafe impl<ADCx, P> crate::dma::peripheral::Source<u16> for AdcSource<ADCx, P>
impl<ADCx, P> crate::dma::peripheral::Source<u16> for AdcSource<ADCx, P>
where
ADCx: adc::ADC + AdcDmaSource,
P: Pin<ADCx>,
{
fn source_signal(&self) -> u32 {
ADCx::SOURCE_REQUEST_SIGNAL
}
type Error = ();

const SOURCE_REQUEST_SIGNAL: u32 = ADCx::SOURCE_REQUEST_SIGNAL;

fn source(&self) -> *const u16 {
&self.adc.reg.R0 as *const _ as *const u16
}

fn enable_source(&self) {
fn enable_source(&mut self) -> Result<(), Self::Error> {
let channel = <P as Pin<ADCx>>::Input::U32;
ral::modify_reg!(ral::adc, self.adc.reg, GC, ADCO: 1, DMAEN: 1);
ral::modify_reg!(ral::adc, self.adc.reg, HC0, |_| channel);
Ok(())
}

fn disable_source(&self) {
fn disable_source(&mut self) {
ral::modify_reg!(ral::adc, self.adc.reg, GC, ADCO: 0, DMAEN: 0);
}
}
Expand Down
120 changes: 111 additions & 9 deletions imxrt-hal/src/can/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use ral::{modify_reg, read_reg, write_reg};

use crate::ccm;
use crate::iomuxc::consts::{Unsigned, U1, U2};
use crate::iomuxc::can;
use crate::ral;

use core::convert::Infallible;
Expand Down Expand Up @@ -104,14 +103,7 @@ where

/// Builds a Can peripheral. The return
/// is a configured FlexCan peripheral running at 24MHz.
pub fn build<TX, RX>(self, mut tx: TX, mut rx: RX) -> CAN<M>
where
TX: can::Pin<Module = M, Signal = can::Tx>,
RX: can::Pin<Module = M, Signal = can::Rx>,
{
crate::iomuxc::can::prepare(&mut tx);
crate::iomuxc::can::prepare(&mut rx);

pub fn build(self) -> CAN<M> {
CAN::new(self.source_clock, self.reg)
}
}
Expand Down Expand Up @@ -193,6 +185,8 @@ where

pub fn begin(&mut self) {
self.set_ccm_ccg();
self.set_tx();
self.set_rx();

ral::modify_reg!(ral::can, self.reg, MCR, MDIS: MDIS_0);

Expand Down Expand Up @@ -294,6 +288,114 @@ where
}
}

fn set_tx(&mut self) {
match self.instance_number() {
1 => {
unsafe {
modify_reg!(
ral::iomuxc,
IOMUXC,
SW_MUX_CTL_PAD_GPIO_AD_B1_08,
MUX_MODE: ALT2,
SION: ENABLED
)
};
unsafe {
write_reg!(
ral::iomuxc,
IOMUXC,
SW_PAD_CTL_PAD_GPIO_AD_B1_08,
0x10B0_u32
)
};
}
2 => {
unsafe {
modify_reg!(
ral::iomuxc,
IOMUXC,
SW_MUX_CTL_PAD_GPIO_AD_B0_02,
MUX_MODE: ALT0,
SION: ENABLED
)
};
unsafe {
write_reg!(
ral::iomuxc,
IOMUXC,
SW_PAD_CTL_PAD_GPIO_AD_B0_02,
0x10B0_u32
)
};
}
u => {
log::error!("Invalid Can instance (set_tx): {:?}", u);
}
}
}

fn set_rx(&mut self) {
match self.instance_number() {
1 => {
unsafe {
modify_reg!(
ral::iomuxc,
IOMUXC,
FLEXCAN1_RX_SELECT_INPUT,
DAISY: GPIO_AD_B1_09_ALT2
)
};
unsafe {
modify_reg!(
ral::iomuxc,
IOMUXC,
SW_MUX_CTL_PAD_GPIO_AD_B1_09,
MUX_MODE: ALT2,
SION: ENABLED
)
};
unsafe {
write_reg!(
ral::iomuxc,
IOMUXC,
SW_PAD_CTL_PAD_GPIO_AD_B1_09,
0x10B0_u32
)
};
}
2 => {
unsafe {
modify_reg!(
ral::iomuxc,
IOMUXC,
FLEXCAN2_RX_SELECT_INPUT,
DAISY: GPIO_AD_B0_03_ALT0
)
};
unsafe {
modify_reg!(
ral::iomuxc,
IOMUXC,
SW_MUX_CTL_PAD_GPIO_AD_B0_03,
MUX_MODE: ALT0,
SION: ENABLED
)
};
unsafe {
write_reg!(
ral::iomuxc,
IOMUXC,
SW_PAD_CTL_PAD_GPIO_AD_B0_03,
0x10B0_u32
)
};
}
u => {
log::error!("Invalid Can instance (set_rx): {:?}", u);
}
}
}

pub fn get_clock(&self) -> u32 {
self.source_clock.0
}
Expand Down

0 comments on commit dd5bdec

Please sign in to comment.