forked from M-Labs/zynq-rs
1
0
Fork 0

libboard_zynq: improve i2c doc

This commit is contained in:
Astro 2020-11-19 20:26:48 +01:00
parent a62ca507d0
commit 3172aba1a8
1 changed files with 43 additions and 30 deletions

View File

@ -40,53 +40,66 @@ impl RegisterBlock {
} }
} }
// MASK_DATA_1_MSW: register!(gpio_output_mask,
// Maskable output data for MIO[53:48] /// MASK_DATA_1_MSW:
register!(gpio_output_mask, GPIOOutputMask, RW, u32); /// 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"))]
register_at!(GPIOOutputMask, 0xE000A00C, new); register_at!(GPIOOutputMask, 0xE000A00C, new);
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc"))] #[cfg(any(feature = "target_zc706", feature = "target_kasli_soc"))]
// Output for SCL register_bit!(gpio_output_mask,
register_bit!(gpio_output_mask, scl_o, 2); /// Output for SCL
// Output for SDA scl_o, 2);
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc"))] #[cfg(any(feature = "target_zc706", feature = "target_kasli_soc"))]
register_bit!(gpio_output_mask, sda_o, 3); register_bit!(gpio_output_mask,
// Mask for keeping bits except SCL and SDA unchanged /// Output for SDA
sda_o, 3);
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc"))] #[cfg(any(feature = "target_zc706", feature = "target_kasli_soc"))]
register_bits!(gpio_output_mask, mask, u16, 16, 31); register_bits!(gpio_output_mask,
/// Mask for keeping bits except SCL and SDA unchanged
mask, u16, 16, 31);
// DATA_1_RO: register!(gpio_input,
// Input data for MIO[53:32] /// DATA_1_RO:
register!(gpio_input, GPIOInput, RO, u32); /// 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"))]
register_at!(GPIOInput, 0xE000A064, new); register_at!(GPIOInput, 0xE000A064, new);
// Input for SCL
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc"))] #[cfg(any(feature = "target_zc706", feature = "target_kasli_soc"))]
register_bit!(gpio_input, scl, 18); register_bit!(gpio_input,
// Input for SDA /// Input for SCL
scl, 18);
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc"))] #[cfg(any(feature = "target_zc706", feature = "target_kasli_soc"))]
register_bit!(gpio_input, sda, 19); register_bit!(gpio_input,
/// Input for SDA
sda, 19);
// DIRM_1: register!(gpio_direction,
// Direction mode for MIO[53:32]; 0/1 = in/out /// DIRM_1:
register!(gpio_direction, GPIODirection, RW, u32); /// 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"))]
register_at!(GPIODirection, 0xE000A244, new); register_at!(GPIODirection, 0xE000A244, new);
// Direction for SCL
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc"))] #[cfg(any(feature = "target_zc706", feature = "target_kasli_soc"))]
register_bit!(gpio_direction, scl, 18); register_bit!(gpio_direction,
// Direction for SDA /// Direction for SCL
scl, 18);
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc"))] #[cfg(any(feature = "target_zc706", feature = "target_kasli_soc"))]
register_bit!(gpio_direction, sda, 19); register_bit!(gpio_direction,
/// Direction for SDA
sda, 19);
// OEN_1: register!(gpio_output_enable,
// Output enable for MIO[53:32] /// OEN_1:
register!(gpio_output_enable, GPIOOutputEnable, RW, u32); /// 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"))]
register_at!(GPIOOutputEnable, 0xE000A248, new); register_at!(GPIOOutputEnable, 0xE000A248, new);
// Output enable for SCL
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc"))] #[cfg(any(feature = "target_zc706", feature = "target_kasli_soc"))]
register_bit!(gpio_output_enable, scl, 18); register_bit!(gpio_output_enable,
// Output enable for SDA /// Output enable for SCL
scl, 18);
#[cfg(any(feature = "target_zc706", feature = "target_kasli_soc"))] #[cfg(any(feature = "target_zc706", feature = "target_kasli_soc"))]
register_bit!(gpio_output_enable, sda, 19); register_bit!(gpio_output_enable,
/// Output enable for SDA
sda, 19);