#![feature(abi_msp430_interrupt)]
#![doc = "Peripheral access API for MSP430F249 microcontrollers (generated using svd2rust v0.29.0 ( ))\n\nYou can find an overview of the generated API [here].\n\nAPI features to be included in the [next]
svd2rust release can be generated by cloning the svd2rust [repository], checking out the above commit, and running `cargo doc --open`.\n\n[here]: https://docs.rs/svd2rust/0.29.0/svd2rust/#peripheral-api\n[next]: https://github.com/rust-embedded/svd2rust/blob/master/CHANGELOG.md#unreleased\n[repository]: https://github.com/rust-embedded/svd2rust"]
#![deny(dead_code)]
#![deny(improper_ctypes)]
#![deny(missing_docs)]
#![deny(no_mangle_generic_items)]
#![deny(non_shorthand_field_patterns)]
#![deny(overflowing_literals)]
#![deny(path_statements)]
#![deny(patterns_in_fns_without_body)]
#![deny(private_in_public)]
#![deny(unconditional_recursion)]
#![deny(unused_allocation)]
#![deny(unused_comparisons)]
#![deny(unused_parens)]
#![deny(while_true)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![no_std]
#[cfg(feature = "rt")]
pub use self::Interrupt as interrupt;
use core::marker::PhantomData;
use core::ops::Deref;
#[allow(unused_imports)]
use generic::*;
#[cfg(feature = "rt")]
pub use msp430_rt::interrupt;
#[doc = "Common register and bit access and modify traits"]
pub mod generic;
#[cfg(feature = "rt")]
extern "msp430-interrupt" {
fn RESERVED0();
fn RESERVED1();
fn RESERVED2();
fn RESERVED3();
fn RESERVED4();
fn RESERVED5();
fn RESERVED6();
fn RESERVED7();
fn RESERVED8();
fn RESERVED9();
fn RESERVED10();
fn RESERVED11();
fn RESERVED12();
fn RESERVED13();
fn RESERVED14();
fn RESERVED15();
fn USCIAB1TX();
fn USCIAB1RX();
fn PORT1();
fn PORT2();
fn RESERVED20();
fn ADC12();
fn USCIAB0TX();
fn USCIAB0RX();
fn TIMERA1();
fn TIMERA0();
fn WDT();
fn COMPARATORA();
fn TIMERB1();
fn TIMERB0();
fn NMI();
}
#[doc(hidden)]
pub union Vector {
_handler: unsafe extern "msp430-interrupt" fn(),
_reserved: u16,
}
#[cfg(feature = "rt")]
#[doc(hidden)]
#[link_section = ".vector_table.interrupts"]
#[no_mangle]
#[used]
pub static __INTERRUPTS: [Vector; 31] = [
Vector {
_handler: RESERVED0,
},
Vector {
_handler: RESERVED1,
},
Vector {
_handler: RESERVED2,
},
Vector {
_handler: RESERVED3,
},
Vector {
_handler: RESERVED4,
},
Vector {
_handler: RESERVED5,
},
Vector {
_handler: RESERVED6,
},
Vector {
_handler: RESERVED7,
},
Vector {
_handler: RESERVED8,
},
Vector {
_handler: RESERVED9,
},
Vector {
_handler: RESERVED10,
},
Vector {
_handler: RESERVED11,
},
Vector {
_handler: RESERVED12,
},
Vector {
_handler: RESERVED13,
},
Vector {
_handler: RESERVED14,
},
Vector {
_handler: RESERVED15,
},
Vector {
_handler: USCIAB1TX,
},
Vector {
_handler: USCIAB1RX,
},
Vector { _handler: PORT1 },
Vector { _handler: PORT2 },
Vector {
_handler: RESERVED20,
},
Vector { _handler: ADC12 },
Vector {
_handler: USCIAB0TX,
},
Vector {
_handler: USCIAB0RX,
},
Vector { _handler: TIMERA1 },
Vector { _handler: TIMERA0 },
Vector { _handler: WDT },
Vector {
_handler: COMPARATORA,
},
Vector { _handler: TIMERB1 },
Vector { _handler: TIMERB0 },
Vector { _handler: NMI },
];
#[doc = r"Enumeration of all the interrupts. This enum is seldom used in application or library crates. It is present primarily for documenting the device's implemented interrupts."]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[repr(u16)]
pub enum Interrupt {
#[doc = "0 - 0xFFC0 Reserved Int. Vector 0"]
RESERVED0 = 0,
#[doc = "1 - 0xFFC2 Reserved Int. Vector 1"]
RESERVED1 = 1,
#[doc = "2 - 0xFFC4 Reserved Int. Vector 2"]
RESERVED2 = 2,
#[doc = "3 - 0xFFC6 Reserved Int. Vector 3"]
RESERVED3 = 3,
#[doc = "4 - 0xFFC8 Reserved Int. Vector 4"]
RESERVED4 = 4,
#[doc = "5 - 0xFFCA Reserved Int. Vector 5"]
RESERVED5 = 5,
#[doc = "6 - 0xFFCC Reserved Int. Vector 6"]
RESERVED6 = 6,
#[doc = "7 - 0xFFCE Reserved Int. Vector 7"]
RESERVED7 = 7,
#[doc = "8 - 0xFFD0 Reserved Int. Vector 8"]
RESERVED8 = 8,
#[doc = "9 - 0xFFD2 Reserved Int. Vector 9"]
RESERVED9 = 9,
#[doc = "10 - 0xFFD4 Reserved Int. Vector 10"]
RESERVED10 = 10,
#[doc = "11 - 0xFFD6 Reserved Int. Vector 11"]
RESERVED11 = 11,
#[doc = "12 - 0xFFD8 Reserved Int. Vector 12"]
RESERVED12 = 12,
#[doc = "13 - 0xFFDA Reserved Int. Vector 13"]
RESERVED13 = 13,
#[doc = "14 - 0xFFDC Reserved Int. Vector 14"]
RESERVED14 = 14,
#[doc = "15 - 0xFFDE Reserved Int. Vector 15"]
RESERVED15 = 15,
#[doc = "16 - 0xFFE0 USCI A1/B1 Transmit"]
USCIAB1TX = 16,
#[doc = "17 - 0xFFE2 USCI A1/B1 Receive"]
USCIAB1RX = 17,
#[doc = "18 - 0xFFE4 Port 1"]
PORT1 = 18,
#[doc = "19 - 0xFFE6 Port 2"]
PORT2 = 19,
#[doc = "20 - 0xFFE8 Reserved Int. Vector 20"]
RESERVED20 = 20,
#[doc = "21 - 0xFFEA ADC"]
ADC12 = 21,
#[doc = "22 - 0xFFEC USCI A0/B0 Transmit"]
USCIAB0TX = 22,
#[doc = "23 - 0xFFEE USCI A0/B0 Receive"]
USCIAB0RX = 23,
#[doc = "24 - 0xFFF0 Timer A CC1-2, TA"]
TIMERA1 = 24,
#[doc = "25 - 0xFFF2 Timer A CC0"]
TIMERA0 = 25,
#[doc = "26 - 0xFFF4 Watchdog Timer"]
WDT = 26,
#[doc = "27 - 0xFFF6 Comparator A"]
COMPARATORA = 27,
#[doc = "28 - 0xFFF8 Timer B CC1-6, TB"]
TIMERB1 = 28,
#[doc = "29 - 0xFFFA Timer B CC0"]
TIMERB0 = 29,
#[doc = "30 - 0xFFFC Non-maskable"]
NMI = 30,
}
#[doc = "Special Function"]
pub struct SPECIAL_FUNCTION {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for SPECIAL_FUNCTION {}
impl SPECIAL_FUNCTION {
#[doc = r"Pointer to the register block"]
pub const PTR: *const special_function::RegisterBlock = 0 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const special_function::RegisterBlock {
Self::PTR
}
}
impl Deref for SPECIAL_FUNCTION {
type Target = special_function::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for SPECIAL_FUNCTION {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SPECIAL_FUNCTION").finish()
}
}
#[doc = "Special Function"]
pub mod special_function;
#[doc = "Port 3/4"]
pub struct PORT_3_4 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for PORT_3_4 {}
impl PORT_3_4 {
#[doc = r"Pointer to the register block"]
pub const PTR: *const port_3_4::RegisterBlock = 0x10 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const port_3_4::RegisterBlock {
Self::PTR
}
}
impl Deref for PORT_3_4 {
type Target = port_3_4::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for PORT_3_4 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("PORT_3_4").finish()
}
}
#[doc = "Port 3/4"]
pub mod port_3_4;
#[doc = "Port 5/6"]
pub struct PORT_5_6 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for PORT_5_6 {}
impl PORT_5_6 {
#[doc = r"Pointer to the register block"]
pub const PTR: *const port_5_6::RegisterBlock = 0x12 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const port_5_6::RegisterBlock {
Self::PTR
}
}
impl Deref for PORT_5_6 {
type Target = port_5_6::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for PORT_5_6 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("PORT_5_6").finish()
}
}
#[doc = "Port 5/6"]
pub mod port_5_6;
#[doc = "Port 1/2"]
pub struct PORT_1_2 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for PORT_1_2 {}
impl PORT_1_2 {
#[doc = r"Pointer to the register block"]
pub const PTR: *const port_1_2::RegisterBlock = 0x20 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const port_1_2::RegisterBlock {
Self::PTR
}
}
impl Deref for PORT_1_2 {
type Target = port_1_2::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for PORT_1_2 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("PORT_1_2").finish()
}
}
#[doc = "Port 1/2"]
pub mod port_1_2;
#[doc = "System Clock"]
pub struct SYSTEM_CLOCK {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for SYSTEM_CLOCK {}
impl SYSTEM_CLOCK {
#[doc = r"Pointer to the register block"]
pub const PTR: *const system_clock::RegisterBlock = 0x52 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const system_clock::RegisterBlock {
Self::PTR
}
}
impl Deref for SYSTEM_CLOCK {
type Target = system_clock::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for SYSTEM_CLOCK {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SYSTEM_CLOCK").finish()
}
}
#[doc = "System Clock"]
pub mod system_clock;
#[doc = "Supply Voltage Supervisor"]
pub struct SUPPLY_VOLTAGE_SUPERVISOR {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for SUPPLY_VOLTAGE_SUPERVISOR {}
impl SUPPLY_VOLTAGE_SUPERVISOR {
#[doc = r"Pointer to the register block"]
pub const PTR: *const supply_voltage_supervisor::RegisterBlock = 0x54 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const supply_voltage_supervisor::RegisterBlock {
Self::PTR
}
}
impl Deref for SUPPLY_VOLTAGE_SUPERVISOR {
type Target = supply_voltage_supervisor::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for SUPPLY_VOLTAGE_SUPERVISOR {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("SUPPLY_VOLTAGE_SUPERVISOR").finish()
}
}
#[doc = "Supply Voltage Supervisor"]
pub mod supply_voltage_supervisor;
#[doc = "Comparator A"]
pub struct COMPARATOR_A {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for COMPARATOR_A {}
impl COMPARATOR_A {
#[doc = r"Pointer to the register block"]
pub const PTR: *const comparator_a::RegisterBlock = 0x58 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const comparator_a::RegisterBlock {
Self::PTR
}
}
impl Deref for COMPARATOR_A {
type Target = comparator_a::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for COMPARATOR_A {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("COMPARATOR_A").finish()
}
}
#[doc = "Comparator A"]
pub mod comparator_a;
#[doc = "USCI_A0 UART Mode"]
pub struct USCI_A0_UART_MODE {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for USCI_A0_UART_MODE {}
impl USCI_A0_UART_MODE {
#[doc = r"Pointer to the register block"]
pub const PTR: *const usci_a0_uart_mode::RegisterBlock = 0x5c as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const usci_a0_uart_mode::RegisterBlock {
Self::PTR
}
}
impl Deref for USCI_A0_UART_MODE {
type Target = usci_a0_uart_mode::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for USCI_A0_UART_MODE {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("USCI_A0_UART_MODE").finish()
}
}
#[doc = "USCI_A0 UART Mode"]
pub mod usci_a0_uart_mode;
#[doc = "USCI_A0 SPI Mode"]
pub struct USCI_A0_SPI_MODE {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for USCI_A0_SPI_MODE {}
impl USCI_A0_SPI_MODE {
#[doc = r"Pointer to the register block"]
pub const PTR: *const usci_a0_spi_mode::RegisterBlock = 0x60 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const usci_a0_spi_mode::RegisterBlock {
Self::PTR
}
}
impl Deref for USCI_A0_SPI_MODE {
type Target = usci_a0_spi_mode::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for USCI_A0_SPI_MODE {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("USCI_A0_SPI_MODE").finish()
}
}
#[doc = "USCI_A0 SPI Mode"]
pub mod usci_a0_spi_mode;
#[doc = "USCI_B0 I2C Mode"]
pub struct USCI_B0_I2C_MODE {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for USCI_B0_I2C_MODE {}
impl USCI_B0_I2C_MODE {
#[doc = r"Pointer to the register block"]
pub const PTR: *const usci_b0_i2c_mode::RegisterBlock = 0x68 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const usci_b0_i2c_mode::RegisterBlock {
Self::PTR
}
}
impl Deref for USCI_B0_I2C_MODE {
type Target = usci_b0_i2c_mode::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for USCI_B0_I2C_MODE {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("USCI_B0_I2C_MODE").finish()
}
}
#[doc = "USCI_B0 I2C Mode"]
pub mod usci_b0_i2c_mode;
#[doc = "USCI_B0 SPI Mode"]
pub struct USCI_B0_SPI_MODE {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for USCI_B0_SPI_MODE {}
impl USCI_B0_SPI_MODE {
#[doc = r"Pointer to the register block"]
pub const PTR: *const usci_b0_spi_mode::RegisterBlock = 0x68 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const usci_b0_spi_mode::RegisterBlock {
Self::PTR
}
}
impl Deref for USCI_B0_SPI_MODE {
type Target = usci_b0_spi_mode::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for USCI_B0_SPI_MODE {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("USCI_B0_SPI_MODE").finish()
}
}
#[doc = "USCI_B0 SPI Mode"]
pub mod usci_b0_spi_mode;
#[doc = "ADC12"]
pub struct ADC12 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for ADC12 {}
impl ADC12 {
#[doc = r"Pointer to the register block"]
pub const PTR: *const adc12::RegisterBlock = 0x80 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const adc12::RegisterBlock {
Self::PTR
}
}
impl Deref for ADC12 {
type Target = adc12::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for ADC12 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("ADC12").finish()
}
}
#[doc = "ADC12"]
pub mod adc12;
#[doc = "USCI_A1 UART Mode"]
pub struct USCI_A1_UART_MODE {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for USCI_A1_UART_MODE {}
impl USCI_A1_UART_MODE {
#[doc = r"Pointer to the register block"]
pub const PTR: *const usci_a1_uart_mode::RegisterBlock = 0xcc as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const usci_a1_uart_mode::RegisterBlock {
Self::PTR
}
}
impl Deref for USCI_A1_UART_MODE {
type Target = usci_a1_uart_mode::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for USCI_A1_UART_MODE {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("USCI_A1_UART_MODE").finish()
}
}
#[doc = "USCI_A1 UART Mode"]
pub mod usci_a1_uart_mode;
#[doc = "USCI_A1 SPI Mode"]
pub struct USCI_A1_SPI_MODE {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for USCI_A1_SPI_MODE {}
impl USCI_A1_SPI_MODE {
#[doc = r"Pointer to the register block"]
pub const PTR: *const usci_a1_spi_mode::RegisterBlock = 0xd0 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const usci_a1_spi_mode::RegisterBlock {
Self::PTR
}
}
impl Deref for USCI_A1_SPI_MODE {
type Target = usci_a1_spi_mode::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for USCI_A1_SPI_MODE {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("USCI_A1_SPI_MODE").finish()
}
}
#[doc = "USCI_A1 SPI Mode"]
pub mod usci_a1_spi_mode;
#[doc = "USCI_B1 I2C Mode"]
pub struct USCI_B1_I2C_MODE {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for USCI_B1_I2C_MODE {}
impl USCI_B1_I2C_MODE {
#[doc = r"Pointer to the register block"]
pub const PTR: *const usci_b1_i2c_mode::RegisterBlock = 0xd8 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const usci_b1_i2c_mode::RegisterBlock {
Self::PTR
}
}
impl Deref for USCI_B1_I2C_MODE {
type Target = usci_b1_i2c_mode::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for USCI_B1_I2C_MODE {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("USCI_B1_I2C_MODE").finish()
}
}
#[doc = "USCI_B1 I2C Mode"]
pub mod usci_b1_i2c_mode;
#[doc = "USCI_B1 SPI Mode"]
pub struct USCI_B1_SPI_MODE {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for USCI_B1_SPI_MODE {}
impl USCI_B1_SPI_MODE {
#[doc = r"Pointer to the register block"]
pub const PTR: *const usci_b1_spi_mode::RegisterBlock = 0xd8 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const usci_b1_spi_mode::RegisterBlock {
Self::PTR
}
}
impl Deref for USCI_B1_SPI_MODE {
type Target = usci_b1_spi_mode::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for USCI_B1_SPI_MODE {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("USCI_B1_SPI_MODE").finish()
}
}
#[doc = "USCI_B1 SPI Mode"]
pub mod usci_b1_spi_mode;
#[doc = "TLV Calibration Data"]
pub struct TLV_CALIBRATION_DATA {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TLV_CALIBRATION_DATA {}
impl TLV_CALIBRATION_DATA {
#[doc = r"Pointer to the register block"]
pub const PTR: *const tlv_calibration_data::RegisterBlock = 0x10c0 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const tlv_calibration_data::RegisterBlock {
Self::PTR
}
}
impl Deref for TLV_CALIBRATION_DATA {
type Target = tlv_calibration_data::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for TLV_CALIBRATION_DATA {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TLV_CALIBRATION_DATA").finish()
}
}
#[doc = "TLV Calibration Data"]
pub mod tlv_calibration_data;
#[doc = "Calibration Data"]
pub struct CALIBRATION_DATA {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for CALIBRATION_DATA {}
impl CALIBRATION_DATA {
#[doc = r"Pointer to the register block"]
pub const PTR: *const calibration_data::RegisterBlock = 0x10f8 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const calibration_data::RegisterBlock {
Self::PTR
}
}
impl Deref for CALIBRATION_DATA {
type Target = calibration_data::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for CALIBRATION_DATA {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CALIBRATION_DATA").finish()
}
}
#[doc = "Calibration Data"]
pub mod calibration_data;
#[doc = "Timer B7"]
pub struct TIMER_B7 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIMER_B7 {}
impl TIMER_B7 {
#[doc = r"Pointer to the register block"]
pub const PTR: *const timer_b7::RegisterBlock = 0x011e as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const timer_b7::RegisterBlock {
Self::PTR
}
}
impl Deref for TIMER_B7 {
type Target = timer_b7::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for TIMER_B7 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TIMER_B7").finish()
}
}
#[doc = "Timer B7"]
pub mod timer_b7;
#[doc = "Watchdog Timer"]
pub struct WATCHDOG_TIMER {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for WATCHDOG_TIMER {}
impl WATCHDOG_TIMER {
#[doc = r"Pointer to the register block"]
pub const PTR: *const watchdog_timer::RegisterBlock = 0x0120 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const watchdog_timer::RegisterBlock {
Self::PTR
}
}
impl Deref for WATCHDOG_TIMER {
type Target = watchdog_timer::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for WATCHDOG_TIMER {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("WATCHDOG_TIMER").finish()
}
}
#[doc = "Watchdog Timer"]
pub mod watchdog_timer;
#[doc = "Flash"]
pub struct FLASH {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for FLASH {}
impl FLASH {
#[doc = r"Pointer to the register block"]
pub const PTR: *const flash::RegisterBlock = 0x0128 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const flash::RegisterBlock {
Self::PTR
}
}
impl Deref for FLASH {
type Target = flash::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for FLASH {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("FLASH").finish()
}
}
#[doc = "Flash"]
pub mod flash;
#[doc = "Timer A3"]
pub struct TIMER_A3 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for TIMER_A3 {}
impl TIMER_A3 {
#[doc = r"Pointer to the register block"]
pub const PTR: *const timer_a3::RegisterBlock = 0x012e as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const timer_a3::RegisterBlock {
Self::PTR
}
}
impl Deref for TIMER_A3 {
type Target = timer_a3::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for TIMER_A3 {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("TIMER_A3").finish()
}
}
#[doc = "Timer A3"]
pub mod timer_a3;
#[doc = "Multiplier"]
pub struct MULTIPLIER {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for MULTIPLIER {}
impl MULTIPLIER {
#[doc = r"Pointer to the register block"]
pub const PTR: *const multiplier::RegisterBlock = 0x0130 as *const _;
#[doc = r"Return the pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const multiplier::RegisterBlock {
Self::PTR
}
}
impl Deref for MULTIPLIER {
type Target = multiplier::RegisterBlock;
#[inline(always)]
fn deref(&self) -> &Self::Target {
unsafe { &*Self::PTR }
}
}
impl core::fmt::Debug for MULTIPLIER {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("MULTIPLIER").finish()
}
}
#[doc = "Multiplier"]
pub mod multiplier;
#[no_mangle]
static mut DEVICE_PERIPHERALS: bool = false;
#[doc = r" All the peripherals."]
#[allow(non_snake_case)]
pub struct Peripherals {
#[doc = "SPECIAL_FUNCTION"]
pub SPECIAL_FUNCTION: SPECIAL_FUNCTION,
#[doc = "PORT_3_4"]
pub PORT_3_4: PORT_3_4,
#[doc = "PORT_5_6"]
pub PORT_5_6: PORT_5_6,
#[doc = "PORT_1_2"]
pub PORT_1_2: PORT_1_2,
#[doc = "SYSTEM_CLOCK"]
pub SYSTEM_CLOCK: SYSTEM_CLOCK,
#[doc = "SUPPLY_VOLTAGE_SUPERVISOR"]
pub SUPPLY_VOLTAGE_SUPERVISOR: SUPPLY_VOLTAGE_SUPERVISOR,
#[doc = "COMPARATOR_A"]
pub COMPARATOR_A: COMPARATOR_A,
#[doc = "USCI_A0_UART_MODE"]
pub USCI_A0_UART_MODE: USCI_A0_UART_MODE,
#[doc = "USCI_A0_SPI_MODE"]
pub USCI_A0_SPI_MODE: USCI_A0_SPI_MODE,
#[doc = "USCI_B0_I2C_MODE"]
pub USCI_B0_I2C_MODE: USCI_B0_I2C_MODE,
#[doc = "USCI_B0_SPI_MODE"]
pub USCI_B0_SPI_MODE: USCI_B0_SPI_MODE,
#[doc = "ADC12"]
pub ADC12: ADC12,
#[doc = "USCI_A1_UART_MODE"]
pub USCI_A1_UART_MODE: USCI_A1_UART_MODE,
#[doc = "USCI_A1_SPI_MODE"]
pub USCI_A1_SPI_MODE: USCI_A1_SPI_MODE,
#[doc = "USCI_B1_I2C_MODE"]
pub USCI_B1_I2C_MODE: USCI_B1_I2C_MODE,
#[doc = "USCI_B1_SPI_MODE"]
pub USCI_B1_SPI_MODE: USCI_B1_SPI_MODE,
#[doc = "TLV_CALIBRATION_DATA"]
pub TLV_CALIBRATION_DATA: TLV_CALIBRATION_DATA,
#[doc = "CALIBRATION_DATA"]
pub CALIBRATION_DATA: CALIBRATION_DATA,
#[doc = "TIMER_B7"]
pub TIMER_B7: TIMER_B7,
#[doc = "WATCHDOG_TIMER"]
pub WATCHDOG_TIMER: WATCHDOG_TIMER,
#[doc = "FLASH"]
pub FLASH: FLASH,
#[doc = "TIMER_A3"]
pub TIMER_A3: TIMER_A3,
#[doc = "MULTIPLIER"]
pub MULTIPLIER: MULTIPLIER,
}
impl Peripherals {
#[doc = r" Returns all the peripherals *once*."]
#[cfg(feature = "critical-section")]
#[inline]
pub fn take() -> Option<Self> {
critical_section::with(|_| {
if unsafe { DEVICE_PERIPHERALS } {
return None;
}
Some(unsafe { Peripherals::steal() })
})
}
#[doc = r" Unchecked version of `Peripherals::take`."]
#[doc = r""]
#[doc = r" # Safety"]
#[doc = r""]
#[doc = r" Each of the returned peripherals must be used at most once."]
#[inline]
pub unsafe fn steal() -> Self {
DEVICE_PERIPHERALS = true;
Peripherals {
SPECIAL_FUNCTION: SPECIAL_FUNCTION {
_marker: PhantomData,
},
PORT_3_4: PORT_3_4 {
_marker: PhantomData,
},
PORT_5_6: PORT_5_6 {
_marker: PhantomData,
},
PORT_1_2: PORT_1_2 {
_marker: PhantomData,
},
SYSTEM_CLOCK: SYSTEM_CLOCK {
_marker: PhantomData,
},
SUPPLY_VOLTAGE_SUPERVISOR: SUPPLY_VOLTAGE_SUPERVISOR {
_marker: PhantomData,
},
COMPARATOR_A: COMPARATOR_A {
_marker: PhantomData,
},
USCI_A0_UART_MODE: USCI_A0_UART_MODE {
_marker: PhantomData,
},
USCI_A0_SPI_MODE: USCI_A0_SPI_MODE {
_marker: PhantomData,
},
USCI_B0_I2C_MODE: USCI_B0_I2C_MODE {
_marker: PhantomData,
},
USCI_B0_SPI_MODE: USCI_B0_SPI_MODE {
_marker: PhantomData,
},
ADC12: ADC12 {
_marker: PhantomData,
},
USCI_A1_UART_MODE: USCI_A1_UART_MODE {
_marker: PhantomData,
},
USCI_A1_SPI_MODE: USCI_A1_SPI_MODE {
_marker: PhantomData,
},
USCI_B1_I2C_MODE: USCI_B1_I2C_MODE {
_marker: PhantomData,
},
USCI_B1_SPI_MODE: USCI_B1_SPI_MODE {
_marker: PhantomData,
},
TLV_CALIBRATION_DATA: TLV_CALIBRATION_DATA {
_marker: PhantomData,
},
CALIBRATION_DATA: CALIBRATION_DATA {
_marker: PhantomData,
},
TIMER_B7: TIMER_B7 {
_marker: PhantomData,
},
WATCHDOG_TIMER: WATCHDOG_TIMER {
_marker: PhantomData,
},
FLASH: FLASH {
_marker: PhantomData,
},
TIMER_A3: TIMER_A3 {
_marker: PhantomData,
},
MULTIPLIER: MULTIPLIER {
_marker: PhantomData,
},
}
}
}