Skip to content

Commit 6387aad

Browse files
committed
Rename Register sub-traits
1 parent 5d6c2e7 commit 6387aad

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/generate/generic.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ pub trait Register {
99
/// Trait implemented by readable registers to enable the `read` method.
1010
///
1111
/// Registers marked with `Writable` can be also `modify`'ed.
12-
pub trait ReadableRegister: Register {}
12+
pub trait Readable: Register {}
1313

1414
/// Trait implemented by writeable registers.
1515
///
1616
/// This enables the `write`, `write_with_zero` and `reset` methods.
1717
///
1818
/// Registers marked with `Readable` can be also `modify`'ed.
19-
pub trait WritableRegister: Register {}
19+
pub trait Writable: Register {}
2020

2121
/// Reset value of the register.
2222
///
2323
/// This value is the initial value for the `write` method. It can also be directly written to the
2424
/// register by using the `reset` method.
25-
pub trait ResettableRegister: Register {
25+
pub trait Resettable: Register {
2626
/// Reset value of the register.
2727
fn reset_value() -> Self::Ux;
2828
}
@@ -50,7 +50,7 @@ where
5050
}
5151
}
5252

53-
impl<REG: ReadableRegister> Reg<REG>
53+
impl<REG: Readable> Reg<REG>
5454
where
5555
REG::Ux: Copy,
5656
{
@@ -75,7 +75,7 @@ where
7575
}
7676
}
7777

78-
impl<REG: ResettableRegister + WritableRegister> Reg<REG>
78+
impl<REG: Resettable + Writable> Reg<REG>
7979
where
8080
REG::Ux: Copy,
8181
{
@@ -117,7 +117,7 @@ where
117117
}
118118
}
119119

120-
impl<REG: WritableRegister> Reg<REG>
120+
impl<REG: Writable> Reg<REG>
121121
where
122122
REG::Ux: Copy + Default,
123123
{
@@ -139,7 +139,7 @@ where
139139
}
140140
}
141141

142-
impl<REG: ReadableRegister + WritableRegister> Reg<REG>
142+
impl<REG: Readable + Writable> Reg<REG>
143143
where
144144
REG::Ux: Copy,
145145
{

src/generate/register.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ pub fn render(
7171
let doc = format!("Register {} `reset()`'s with value {}", register.name, &rv);
7272
mod_items.extend(quote! {
7373
#[doc = #doc]
74-
impl crate::ResettableRegister for super::#u_name_pc {
74+
impl crate::Resettable for super::#u_name_pc {
7575
#[inline(always)]
7676
fn reset_value() -> Self::Ux { #rv }
7777
}
@@ -170,7 +170,7 @@ pub fn render(
170170
);
171171
out.extend(quote! {
172172
#[doc = #doc]
173-
impl crate::ReadableRegister for #u_name_pc {}
173+
impl crate::Readable for #u_name_pc {}
174174
});
175175
}
176176
if can_write {
@@ -180,7 +180,7 @@ pub fn render(
180180
);
181181
out.extend(quote! {
182182
#[doc = #doc]
183-
impl crate::WritableRegister for #u_name_pc {}
183+
impl crate::Writable for #u_name_pc {}
184184
});
185185
}
186186

0 commit comments

Comments
 (0)