|
|
|
@ -21,6 +21,7 @@ use libregister::{
|
|
|
|
|
// Current compatibility:
|
|
|
|
|
// zc706: GPIO 50, 51 == SCL, SDA
|
|
|
|
|
// kasli_soc: GPIO 50, 51 == SCL, SDA; GPIO 33 == I2C_SW_RESET
|
|
|
|
|
// ebaz4205: GPIO (EMIO)
|
|
|
|
|
|
|
|
|
|
pub struct RegisterBlock {
|
|
|
|
|
pub gpio_output_mask: &'static mut GPIOOutputMask,
|
|
|
|
@ -48,17 +49,17 @@ register!(gpio_output_mask,
|
|
|
|
|
/// MASK_DATA_1_MSW:
|
|
|
|
|
/// Maskable output data for MIO[53:48]
|
|
|
|
|
GPIOOutputMask, RW, u32);
|
|
|
|
|
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc"))]
|
|
|
|
|
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc", feature = "target_ebaz4205"))]
|
|
|
|
|
register_at!(GPIOOutputMask, 0xE000A00C, new);
|
|
|
|
|
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc"))]
|
|
|
|
|
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc", feature = "target_ebaz4205"))]
|
|
|
|
|
register_bit!(gpio_output_mask,
|
|
|
|
|
/// Output for SCL
|
|
|
|
|
scl_o, 2);
|
|
|
|
|
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc"))]
|
|
|
|
|
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc", feature = "target_ebaz4205"))]
|
|
|
|
|
register_bit!(gpio_output_mask,
|
|
|
|
|
/// Output for SDA
|
|
|
|
|
sda_o, 3);
|
|
|
|
|
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc"))]
|
|
|
|
|
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc", feature = "target_ebaz4205"))]
|
|
|
|
|
register_bits!(gpio_output_mask,
|
|
|
|
|
/// Mask for keeping bits except SCL and SDA unchanged
|
|
|
|
|
mask, u16, 16, 31);
|
|
|
|
@ -82,13 +83,13 @@ register!(gpio_input,
|
|
|
|
|
/// DATA_1_RO:
|
|
|
|
|
/// Input data for MIO[53:32]
|
|
|
|
|
GPIOInput, RO, u32);
|
|
|
|
|
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc"))]
|
|
|
|
|
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc", feature = "target_ebaz4205"))]
|
|
|
|
|
register_at!(GPIOInput, 0xE000A064, new);
|
|
|
|
|
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc"))]
|
|
|
|
|
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc", feature = "target_ebaz4205"))]
|
|
|
|
|
register_bit!(gpio_input,
|
|
|
|
|
/// Input for SCL
|
|
|
|
|
scl, 18);
|
|
|
|
|
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc"))]
|
|
|
|
|
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc", feature = "target_ebaz4205"))]
|
|
|
|
|
register_bit!(gpio_input,
|
|
|
|
|
/// Input for SDA
|
|
|
|
|
sda, 19);
|
|
|
|
@ -98,13 +99,13 @@ register!(gpio_direction,
|
|
|
|
|
/// DIRM_1:
|
|
|
|
|
/// Direction mode for MIO[53:32]; 0/1 = in/out
|
|
|
|
|
GPIODirection, RW, u32);
|
|
|
|
|
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc"))]
|
|
|
|
|
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc", feature = "target_ebaz4205"))]
|
|
|
|
|
register_at!(GPIODirection, 0xE000A244, new);
|
|
|
|
|
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc"))]
|
|
|
|
|
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc", feature = "target_ebaz4205"))]
|
|
|
|
|
register_bit!(gpio_direction,
|
|
|
|
|
/// Direction for SCL
|
|
|
|
|
scl, 18);
|
|
|
|
|
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc"))]
|
|
|
|
|
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc", feature = "target_ebaz4205"))]
|
|
|
|
|
register_bit!(gpio_direction,
|
|
|
|
|
/// Direction for SDA
|
|
|
|
|
sda, 19);
|
|
|
|
@ -117,13 +118,13 @@ register!(gpio_output_enable,
|
|
|
|
|
/// OEN_1:
|
|
|
|
|
/// Output enable for MIO[53:32]
|
|
|
|
|
GPIOOutputEnable, RW, u32);
|
|
|
|
|
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc"))]
|
|
|
|
|
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc", feature = "target_ebaz4205"))]
|
|
|
|
|
register_at!(GPIOOutputEnable, 0xE000A248, new);
|
|
|
|
|
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc"))]
|
|
|
|
|
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc", feature = "target_ebaz4205"))]
|
|
|
|
|
register_bit!(gpio_output_enable,
|
|
|
|
|
/// Output enable for SCL
|
|
|
|
|
scl, 18);
|
|
|
|
|
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc"))]
|
|
|
|
|
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc", feature = "target_ebaz4205"))]
|
|
|
|
|
register_bit!(gpio_output_enable,
|
|
|
|
|
/// Output enable for SDA
|
|
|
|
|
sda, 19);
|
|
|
|
|