Skip to content

Commit

Permalink
Fix documentation examples after 1062=>1060 rename
Browse files Browse the repository at this point in the history
  • Loading branch information
mciantyre committed Oct 24, 2020
1 parent cacb44c commit cab9ddd
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 59 deletions.
4 changes: 2 additions & 2 deletions imxrt1060-hal/src/adc.rs
Expand Up @@ -4,10 +4,10 @@
//!
//! # Example
//! ```no_run
//! use imxrt1062_hal::{self, adc};
//! use imxrt1060_hal::{self, adc};
//! use embedded_hal::adc::OneShot;
//!
//! let mut peripherals = imxrt1062_hal::Peripherals::take().unwrap();
//! let mut peripherals = imxrt1060_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
10 changes: 5 additions & 5 deletions imxrt1060-hal/src/dma.rs
Expand Up @@ -34,7 +34,7 @@
//! handler, since we're enabling an interrupt when the receive completes.
//!
//! ```no_run
//! use imxrt1062_hal::dma::{Circular, Buffer, Linear, Peripheral, bidirectional_u16};
//! use imxrt1060_hal::dma::{Circular, Buffer, Linear, Peripheral, bidirectional_u16};
//!
//! // Circular buffers have alignment requirements
//! #[repr(align(512))]
Expand All @@ -44,16 +44,16 @@
//! static RX_BUFFER: Buffer<[u16; 256]> = Buffer::new([0; 256]);
//! static TX_BUFFER: Align = Align(Buffer::new([0; 256]));
//!
//! let mut peripherals = imxrt1062_hal::Peripherals::take().unwrap();
//! let mut peripherals = imxrt1060_hal::Peripherals::take().unwrap();
//!
//! //
//! // SPI setup...
//! //
//!
//! let (_, _, _, spi4_builder) = peripherals.spi.clock(
//! &mut peripherals.ccm.handle,
//! imxrt1062_hal::ccm::spi::ClockSelect::Pll2,
//! imxrt1062_hal::ccm::spi::PrescalarSelect::LPSPI_PODF_5,
//! imxrt1060_hal::ccm::spi::ClockSelect::Pll2,
//! imxrt1060_hal::ccm::spi::PrescalarSelect::LPSPI_PODF_5,
//! );
//!
//! let mut spi4 = spi4_builder.build(
Expand Down Expand Up @@ -453,7 +453,7 @@ pub enum Error<P> {
/// Use [`clock()`](struct.Unclocked.html#method.clock) to initialize and acquire all DMA channels
///
/// ```no_run
/// let mut peripherals = imxrt1062_hal::Peripherals::take().unwrap();
/// let mut peripherals = imxrt1060_hal::Peripherals::take().unwrap();
///
/// let mut dma_channels = peripherals.dma.clock(&mut peripherals.ccm.handle);
/// let channel_27 = dma_channels[27].take().unwrap();
Expand Down
22 changes: 11 additions & 11 deletions imxrt1060-hal/src/dma/buffer.rs
Expand Up @@ -21,7 +21,7 @@ use core::{
/// `Buffer`s should store arrays of `u8`, `u16`, or `u32` elements.
///
/// ```
/// use imxrt1062_hal::dma;
/// use imxrt1060_hal::dma;
/// static UART2_DMA_RX: dma::Buffer<[u8; 256]> = dma::Buffer::new([0; 256]);
/// ```
///
Expand All @@ -47,7 +47,7 @@ impl<B> Buffer<B> {
/// May be used to allocate a `static` buffer.
///
/// ```
/// use imxrt1062_hal::dma;
/// use imxrt1060_hal::dma;
/// static UART2_DMA_RX: dma::Buffer<[u8; 256]> = dma::Buffer::new([0; 256]);
/// ```
pub const fn new(memory: B) -> Self {
Expand Down Expand Up @@ -75,7 +75,7 @@ impl<B> Buffer<B> {
/// the same buffer.
///
/// ```
/// use imxrt1062_hal::dma;
/// use imxrt1060_hal::dma;
///
/// static DMA1_BUFFER: dma::Buffer<[u8; 256]> = dma::Buffer::new([0; 256]);
///
Expand Down Expand Up @@ -150,7 +150,7 @@ where
/// that there are no other mutable references to this memory.
///
/// ```
/// use imxrt1062_hal::dma;
/// use imxrt1060_hal::dma;
///
/// let mut my_buffer: [u32; 128] = [0; 128];
/// // my_buffer is stack-allocated, so we need to ensure that the lifetime of
Expand Down Expand Up @@ -270,7 +270,7 @@ unsafe impl<E: Element> Send for Linear<E> {}
/// # Example
///
/// ```
/// use imxrt1062_hal::dma;
/// use imxrt1060_hal::dma;
///
/// // A newtype to enforce the required alignment
/// #[repr(align(1024))] // 512 * 2 for size of u16
Expand Down Expand Up @@ -304,7 +304,7 @@ unsafe impl<E: Element> Send for Linear<E> {}
/// circular DMA queue:
///
/// ```
/// # use imxrt1062_hal::dma;
/// # use imxrt1060_hal::dma;
/// #[repr(align(64))]
/// struct Align(dma::Buffer<[u16; 30]>);
/// static BUFFER: Align = Align(dma::Buffer::new([0; 30]));
Expand All @@ -316,7 +316,7 @@ unsafe impl<E: Element> Send for Linear<E> {}
/// If the alignment is not a multiple of the size, we cannot create a circular DMA queue:
///
/// ```no_run
/// # use imxrt1062_hal::dma;
/// # use imxrt1060_hal::dma;
/// #[repr(align(256))] // Should be 1024 to account for u32 size
/// struct Align(dma::Buffer<[u32; 256]>);
/// static BUFFER: Align = Align(dma::Buffer::new([0; 256]));
Expand Down Expand Up @@ -411,7 +411,7 @@ impl<E: Element> Circular<E> {
/// the memory. Caller must ensure that there are no other mutable references to this memory.
///
/// ```
/// use imxrt1062_hal::dma;
/// use imxrt1060_hal::dma;
///
/// #[repr(align(64))]
/// struct Align([u8; 64]);
Expand Down Expand Up @@ -456,7 +456,7 @@ impl<E: Element> Circular<E> {
/// Clears the readable contents from the queue
///
/// ```
/// # use imxrt1062_hal::dma;
/// # use imxrt1060_hal::dma;
/// # #[repr(align(64))]
/// # struct Align(dma::Buffer<[u16; 32]>);
/// # static BUFFER: Align = Align(dma::Buffer::new([0; 32]));
Expand Down Expand Up @@ -504,7 +504,7 @@ impl<E: Element> Circular<E> {
/// `insert` may *not* insert all the elements into the buffer.
///
/// ```
/// use imxrt1062_hal::dma;
/// use imxrt1060_hal::dma;
///
/// #[repr(align(64))]
/// struct Align(dma::Buffer<[u16; 32]>);
Expand Down Expand Up @@ -558,7 +558,7 @@ impl<E: Element> Circular<E> {
/// elements remain in the queue.
///
/// ```
/// # use imxrt1062_hal::dma;
/// # use imxrt1060_hal::dma;
/// # #[repr(align(64))]
/// # struct Align(dma::Buffer<[u16; 32]>);
/// # static BUFFER: Align = Align(dma::Buffer::new([0; 32]));
Expand Down
4 changes: 2 additions & 2 deletions imxrt1060-hal/src/dma/memcpy.rs
Expand Up @@ -18,12 +18,12 @@ use core::{
/// # Example
///
/// ```no_run
/// use imxrt1062_hal::dma;
/// use imxrt1060_hal::dma;
///
/// static SOURCE: dma::Buffer<[u8; 32]> = dma::Buffer::new([0; 32]);
/// static DESTINATION: dma::Buffer<[u8; 64]> = dma::Buffer::new([0; 64]);
///
/// let mut peripherals = imxrt1062_hal::Peripherals::take().unwrap();
/// let mut peripherals = imxrt1060_hal::Peripherals::take().unwrap();
/// let mut dma_channels = peripherals.dma.clock(&mut peripherals.ccm.handle);
/// let mut dma_channel = dma_channels[7].take().unwrap();
/// dma_channel.set_interrupt_on_completion(false);
Expand Down
4 changes: 2 additions & 2 deletions imxrt1060-hal/src/gpio.rs
Expand Up @@ -10,9 +10,9 @@
//! # Example
//!
//! ```no_run
//! use imxrt1062_hal::{self, gpio::GPIO};
//! use imxrt1060_hal::{self, gpio::GPIO};
//!
//! let mut peripherals = imxrt1062_hal::Peripherals::take().unwrap();
//! let mut peripherals = imxrt1060_hal::Peripherals::take().unwrap();
//! let input = GPIO::new(peripherals.iomuxc.ad_b0.p11);
//!
//! assert!(!input.is_set());
Expand Down
16 changes: 8 additions & 8 deletions imxrt1060-hal/src/gpt.rs
Expand Up @@ -87,33 +87,33 @@
//! # Example
//!
//! ```no_run
//! use imxrt1062_hal;
//! use imxrt1060_hal;
//!
//! let mut peripherals = imxrt1062_hal::Peripherals::take().unwrap();
//! let mut peripherals = imxrt1060_hal::Peripherals::take().unwrap();
//!
//! let (_, ipg_hz) = peripherals.ccm.pll1.set_arm_clock(
//! imxrt1062_hal::ccm::PLL1::ARM_HZ,
//! imxrt1060_hal::ccm::PLL1::ARM_HZ,
//! &mut peripherals.ccm.handle,
//! &mut peripherals.dcdc,
//! );
//!
//! let mut cfg = peripherals.ccm.perclk.configure(
//! &mut peripherals.ccm.handle,
//! imxrt1062_hal::ccm::perclk::PODF::DIVIDE_3,
//! imxrt1062_hal::ccm::perclk::CLKSEL::IPG(ipg_hz),
//! imxrt1060_hal::ccm::perclk::PODF::DIVIDE_3,
//! imxrt1060_hal::ccm::perclk::CLKSEL::IPG(ipg_hz),
//! );
//!
//! let mut gpt1 = peripherals.gpt1.clock(&mut cfg);
//!
//! gpt1.set_output_interrupt_on_compare(
//! imxrt1062_hal::gpt::OutputCompareRegister::Three,
//! imxrt1060_hal::gpt::OutputCompareRegister::Three,
//! true,
//! );
//! gpt1.set_wait_mode_enable(true);
//! gpt1.set_mode(imxrt1062_hal::gpt::Mode::FreeRunning);
//! gpt1.set_mode(imxrt1060_hal::gpt::Mode::FreeRunning);
//!
//! gpt1.set_output_compare_duration(
//! imxrt1062_hal::gpt::OutputCompareRegister::Three,
//! imxrt1060_hal::gpt::OutputCompareRegister::Three,
//! core::time::Duration::from_micros(765),
//! );
//! ```
Expand Down
10 changes: 5 additions & 5 deletions imxrt1060-hal/src/i2c.rs
Expand Up @@ -3,16 +3,16 @@
//! # Example
//!
//! ```no_run
//! use imxrt1062_hal;
//! use imxrt1062_hal::i2c::ClockSpeed;
//! use imxrt1060_hal;
//! use imxrt1060_hal::i2c::ClockSpeed;
//! use embedded_hal::blocking::i2c::WriteRead;
//!
//! let mut peripherals = imxrt1062_hal::Peripherals::take().unwrap();
//! let mut peripherals = imxrt1060_hal::Peripherals::take().unwrap();
//!
//! let (_, _, i2c3_builder, _) = peripherals.i2c.clock(
//! &mut peripherals.ccm.handle,
//! imxrt1062_hal::ccm::i2c::ClockSelect::OSC, // 24MHz clock...
//! imxrt1062_hal::ccm::i2c::PrescalarSelect::DIVIDE_3, // Divide by 3
//! imxrt1060_hal::ccm::i2c::ClockSelect::OSC, // 24MHz clock...
//! imxrt1060_hal::ccm::i2c::PrescalarSelect::DIVIDE_3, // Divide by 3
//! );
//!
//! let mut i2c3 = i2c3_builder.build(
Expand Down
10 changes: 5 additions & 5 deletions imxrt1060-hal/src/pit.rs
Expand Up @@ -3,21 +3,21 @@
//! # Example
//!
//! ```no_run
//! use imxrt1062_hal;
//! use imxrt1060_hal;
//! use embedded_hal::timer::CountDown;
//!
//! let mut peripherals = imxrt1062_hal::Peripherals::take().unwrap();
//! let mut peripherals = imxrt1060_hal::Peripherals::take().unwrap();
//!
//! let (_, ipg_hz) = peripherals.ccm.pll1.set_arm_clock(
//! imxrt1062_hal::ccm::PLL1::ARM_HZ,
//! imxrt1060_hal::ccm::PLL1::ARM_HZ,
//! &mut peripherals.ccm.handle,
//! &mut peripherals.dcdc,
//! );
//!
//! let mut cfg = peripherals.ccm.perclk.configure(
//! &mut peripherals.ccm.handle,
//! imxrt1062_hal::ccm::perclk::PODF::DIVIDE_3,
//! imxrt1062_hal::ccm::perclk::CLKSEL::IPG(ipg_hz),
//! imxrt1060_hal::ccm::perclk::PODF::DIVIDE_3,
//! imxrt1060_hal::ccm::perclk::CLKSEL::IPG(ipg_hz),
//! );
//!
//! let (_, _, _, mut timer) = peripherals.pit.clock(&mut cfg);
Expand Down
14 changes: 7 additions & 7 deletions imxrt1060-hal/src/pwm.rs
Expand Up @@ -16,16 +16,16 @@
//! # Example
//!
//! ```no_run
//! use imxrt1062_hal;
//! use imxrt1062_hal::pwm::Channel;
//! use imxrt1060_hal;
//! use imxrt1060_hal::pwm::Channel;
//! use embedded_hal::Pwm;
//!
//! let mut p = imxrt1062_hal::Peripherals::take().unwrap();
//! let mut p = imxrt1060_hal::Peripherals::take().unwrap();
//!
//! let (_, ipg_hz) =
//! p.ccm
//! .pll1
//! .set_arm_clock(imxrt1062_hal::ccm::PLL1::ARM_HZ, &mut p.ccm.handle, &mut p.dcdc);
//! .set_arm_clock(imxrt1060_hal::ccm::PLL1::ARM_HZ, &mut p.ccm.handle, &mut p.dcdc);
//!
//! let mut pwm2 = p.pwm2.clock(&mut p.ccm.handle);
//!
Expand All @@ -35,9 +35,9 @@
//! &mut pwm2.handle,
//! p.iomuxc.b0.p10,
//! p.iomuxc.b0.p11,
//! imxrt1062_hal::pwm::Timing {
//! clock_select: imxrt1062_hal::ccm::pwm::ClockSelect::IPG(ipg_hz),
//! prescalar: imxrt1062_hal::ccm::pwm::Prescalar::PRSC_5,
//! imxrt1060_hal::pwm::Timing {
//! clock_select: imxrt1060_hal::ccm::pwm::ClockSelect::IPG(ipg_hz),
//! prescalar: imxrt1060_hal::ccm::pwm::Prescalar::PRSC_5,
//! switching_period: core::time::Duration::from_micros(1000),
//! },
//! )
Expand Down
10 changes: 5 additions & 5 deletions imxrt1060-hal/src/spi.rs
Expand Up @@ -16,15 +16,15 @@
//! # Example
//!
//! ```no_run
//! use imxrt1062_hal;
//! use imxrt1060_hal;
//! use embedded_hal::blocking::spi::Transfer;
//!
//! let mut peripherals = imxrt1062_hal::Peripherals::take().unwrap();
//! let mut peripherals = imxrt1060_hal::Peripherals::take().unwrap();
//!
//! let (_, _, _, spi4_builder) = peripherals.spi.clock(
//! &mut peripherals.ccm.handle,
//! imxrt1062_hal::ccm::spi::ClockSelect::Pll2,
//! imxrt1062_hal::ccm::spi::PrescalarSelect::LPSPI_PODF_5,
//! imxrt1060_hal::ccm::spi::ClockSelect::Pll2,
//! imxrt1060_hal::ccm::spi::PrescalarSelect::LPSPI_PODF_5,
//! );
//!
//! let mut spi4 = spi4_builder.build(
Expand All @@ -35,7 +35,7 @@
//!
//! spi4.enable_chip_select_0(peripherals.iomuxc.b0.p00);
//!
//! spi4.set_clock_speed(imxrt1062_hal::spi::ClockSpeed(1_000_000)).unwrap();
//! spi4.set_clock_speed(imxrt1060_hal::spi::ClockSpeed(1_000_000)).unwrap();
//!
//! let mut buffer: [u8; 3] = [1, 2, 3];
//! spi4.transfer(&mut buffer).unwrap();
Expand Down
4 changes: 2 additions & 2 deletions imxrt1060-hal/src/srtc.rs
Expand Up @@ -10,9 +10,9 @@
//! # Example
//!
//! ```no_run
//! use imxrt1062_hal;
//! use imxrt1060_hal;
//!
//! let mut peripherals = imxrt1062_hal::Peripherals::take().unwrap();
//! let mut peripherals = imxrt1060_hal::Peripherals::take().unwrap();
//!
//! let mut srtc = peripherals.srtc.enable_and_set(&mut peripherals.ccm.handle, 1600000000, 0);
//! // Interpreted as Unix time: Sep 13 2020 12:26:40.000
Expand Down
10 changes: 5 additions & 5 deletions imxrt1060-hal/src/uart.rs
Expand Up @@ -9,15 +9,15 @@
//! # Example
//!
//! ```no_run
//! use imxrt1062_hal;
//! use imxrt1060_hal;
//! use embedded_hal::serial::{Read, Write};
//!
//! let mut peripherals = imxrt1062_hal::Peripherals::take().unwrap();
//! let mut peripherals = imxrt1060_hal::Peripherals::take().unwrap();
//!
//! let uarts = peripherals.uart.clock(
//! &mut peripherals.ccm.handle,
//! imxrt1062_hal::ccm::uart::ClockSelect::OSC,
//! imxrt1062_hal::ccm::uart::PrescalarSelect::DIVIDE_1,
//! imxrt1060_hal::ccm::uart::ClockSelect::OSC,
//! imxrt1060_hal::ccm::uart::PrescalarSelect::DIVIDE_1,
//! );
//!
//! let mut uart = uarts
Expand All @@ -31,7 +31,7 @@
//!
//! uart.set_tx_fifo(core::num::NonZeroU8::new(3));
//! uart.set_rx_fifo(true);
//! uart.set_parity(Some(imxrt1062_hal::uart::Parity::Even));
//! uart.set_parity(Some(imxrt1060_hal::uart::Parity::Even));
//! uart.set_rx_inversion(true);
//! uart.set_tx_inversion(false);
//!
Expand Down

0 comments on commit cab9ddd

Please sign in to comment.