Class: LinkDemo::Flash

Inherits:
Object
  • Object
show all
Includes:
Origen::Model
Defined in:
lib/link_demo/flash.rb

Instance Method Summary (collapse)

Constructor Details

- (Flash) initialize(options = {})

Returns a new instance of Flash



5
6
7
# File 'lib/link_demo/flash.rb', line 5

def initialize(options = {})
  instantiate_registers
end

Instance Method Details

- (Object) instantiate_registers



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/link_demo/flash.rb', line 9

def instantiate_registers
  reg :fstat, 0 do |reg|
    reg.bits 31..24, :fopt, reset: :memory, access: :ro
    reg.bits 23..22, :keyen, reset: :memory, access: :ro
    reg.bits 21..20, :meen, reset: :memory, access: :ro
    reg.bits 19..18, :fslacc, reset: :memory, access: :ro
    reg.bits 17..16, :sec, reset: :memory, access: :ro
    reg.bit 15, :ccie
    reg.bit 14, :rdcollie
    reg.bit 13, :ersareq
    reg.bit 12, :erssusp
    reg.bit 7, :ccif, access: :w1c
    reg.bit 6, :rdcolerr, access: :w1c
    reg.bit 5, :accerr, access: :w1c
    reg.bit 4, :fpviol, access: :w1c
    reg.bit 0, :mgstat0, access: :ro
  end

  add_reg :fccob0, 4
  add_reg :fccob1, 8
  add_reg :fccob2, 0xC
end