Skip to content

Commit 94ae091

Browse files
authored
Clarify the exact behavior of RW1C setters (#160)
1 parent c167ee6 commit 94ae091

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/macros.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,18 +113,18 @@ macro_rules! rw1c_bit {
113113
([$offset:literal]($bit:literal),$method:ident,$name:literal) => {
114114
bit_getter!([$offset]($bit), $method, $name);
115115
paste::paste! {
116-
#[doc = "Clears the"]
116+
#[doc = "Assigns 1 to the"]
117117
#[doc = $name]
118-
#[doc = "bit."]
118+
#[doc = "bit. On register write, this results in clearing the bit."]
119119
pub fn [<clear_ $method>](&mut self)->&mut Self{
120120
use bit_field::BitField;
121121
self.0[$offset].set_bit($bit,true);
122122
self
123123
}
124124

125-
#[doc = "Set the "]
125+
#[doc = "Assigns 0 to the"]
126126
#[doc = $name]
127-
#[doc = " bit to 0, preventing the bit from being cleared on write."]
127+
#[doc = "bit, preventing the bit from being cleared on write."]
128128
pub fn [<set_0_ $method>](&mut self) -> &mut Self {
129129
use bit_field::BitField;
130130
self.0[$offset].set_bit($bit,false);
@@ -135,18 +135,18 @@ macro_rules! rw1c_bit {
135135
($bit:literal,$method:ident,$name:literal) => {
136136
bit_getter!($bit, $method, $name);
137137
paste::paste! {
138-
#[doc = "Clears the"]
138+
#[doc = "Assigns 1 to the"]
139139
#[doc = $name]
140-
#[doc = "bit."]
140+
#[doc = "bit. On register write, this results in clearing the bit."]
141141
pub fn [<clear_ $method>](&mut self)->&mut Self{
142142
use bit_field::BitField;
143143
self.0.set_bit($bit,true);
144144
self
145145
}
146146

147-
#[doc = "Set the "]
147+
#[doc = "Assigns 0 to the"]
148148
#[doc = $name]
149-
#[doc = " bit to 0, preventing the bit from being cleared on write."]
149+
#[doc = "bit, preventing the bit from being cleared on write."]
150150
pub fn [<set_0_ $method>](&mut self) -> &mut Self {
151151
use bit_field::BitField;
152152
self.0.set_bit($bit,false);

0 commit comments

Comments
 (0)