pub struct Div { /* private fields */ }
Implementations§
Source§impl Div
impl Div
pub const unsafe fn from_ptr(ptr: *mut ()) -> Self
pub const fn as_ptr(&self) -> *mut ()
Sourcepub const fn udividend(self) -> Reg<u32, RW>
pub const fn udividend(self) -> Reg<u32, RW>
Divider unsigned dividend Write to the DIVIDEND operand of the divider, i.e. the p in p / q
. Any operand write starts a new calculation. The results appear in QUOTIENT, REMAINDER. UDIVIDEND/SDIVIDEND are aliases of the same internal register. The U alias starts an unsigned calculation, and the S alias starts a signed calculation.
Sourcepub const fn udivisor(self) -> Reg<u32, RW>
pub const fn udivisor(self) -> Reg<u32, RW>
Divider unsigned divisor Write to the DIVISOR operand of the divider, i.e. the q in p / q
. Any operand write starts a new calculation. The results appear in QUOTIENT, REMAINDER. UDIVISOR/SDIVISOR are aliases of the same internal register. The U alias starts an unsigned calculation, and the S alias starts a signed calculation.
Sourcepub const fn sdividend(self) -> Reg<u32, RW>
pub const fn sdividend(self) -> Reg<u32, RW>
Divider signed dividend The same as UDIVIDEND, but starts a signed calculation, rather than unsigned.
Sourcepub const fn sdivisor(self) -> Reg<u32, RW>
pub const fn sdivisor(self) -> Reg<u32, RW>
Divider signed divisor The same as UDIVISOR, but starts a signed calculation, rather than unsigned.
Sourcepub const fn quotient(self) -> Reg<u32, RW>
pub const fn quotient(self) -> Reg<u32, RW>
Divider result quotient The result of DIVIDEND / DIVISOR
(division). Contents undefined while CSR_READY is low. For signed calculations, QUOTIENT is negative when the signs of DIVIDEND and DIVISOR differ. This register can be written to directly, for context save/restore purposes. This halts any in-progress calculation and sets the CSR_READY and CSR_DIRTY flags. Reading from QUOTIENT clears the CSR_DIRTY flag, so should read results in the order REMAINDER, QUOTIENT if CSR_DIRTY is used.
Sourcepub const fn remainder(self) -> Reg<u32, RW>
pub const fn remainder(self) -> Reg<u32, RW>
Divider result remainder The result of DIVIDEND % DIVISOR
(modulo). Contents undefined while CSR_READY is low. For signed calculations, REMAINDER is negative only when DIVIDEND is negative. This register can be written to directly, for context save/restore purposes. This halts any in-progress calculation and sets the CSR_READY and CSR_DIRTY flags.