1
use crate::pac::rsa::RegisterBlock;
2

            
3
pub(super) fn enable_disable_interrupt(regs: &RegisterBlock, enable: bool) {
4
    regs.int_ena().write(|w| w.int_ena().bit(enable));
5
}
6

            
7
pub(super) fn ready(regs: &RegisterBlock) -> bool {
8
    regs.query_clean().read().query_clean().bit_is_set()
9
}
10

            
11
3
pub(super) fn start_modexp(regs: &RegisterBlock) {
12
    regs.set_start_modexp()
13
        .write(|w| w.set_start_modexp().set_bit());
14
3
}
15

            
16
2
pub(super) fn start_multi(regs: &RegisterBlock) {
17
    regs.set_start_mult()
18
        .write(|w| w.set_start_mult().set_bit());
19
2
}
20

            
21
2
pub(super) fn start_modmulti(regs: &RegisterBlock) {
22
    regs.set_start_modmult()
23
        .write(|w| w.set_start_modmult().set_bit());
24
2
}
25

            
26
4
pub(super) fn clear_interrupt(regs: &RegisterBlock) {
27
    regs.int_clr().write(|w| w.int_clr().set_bit());
28
4
}
29

            
30
4
pub(super) fn is_idle(regs: &RegisterBlock) -> bool {
31
    regs.query_idle().read().query_idle().bit_is_set()
32
4
}
33

            
34
4
pub(super) fn write_multi_mode(regs: &RegisterBlock, mode: u32, _modular: bool) {
35
    regs.mode().write(|w| unsafe { w.bits(mode) });
36
4
}
37

            
38
3
pub(super) fn write_modexp_mode(regs: &RegisterBlock, mode: u32) {
39
    regs.mode().write(|w| unsafe { w.bits(mode) });
40
3
}