| 1 | package VIC::PIC::P18F252; | ||
| 2 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | our $VERSION = '0.32'; | |
| 5 | 1 | $VERSION = eval $VERSION; | |
| 6 | 1 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 1 | extends 'VIC::PIC::P18F242'; | |
| 8 | |||
| 9 | # role CodeGen | ||
| 10 | 1 | has type => (is => 'ro', default => 'p18f252'); | |
| 11 | 1 | has include => (is => 'ro', default => 'p18f252.inc'); | |
| 12 | |||
| 13 | # all memory is in bytes | ||
| 14 | 1 | ▶ | has memory => (is => 'ro', default => sub { |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 15 | { | ||
| 16 | 1 | flash => 16384, # words | |
| 17 | SRAM => 1536, | ||
| 18 | EEPROM => 256, | ||
| 19 | } | ||
| 20 | 1 | }); | |
| 21 | |||
| 22 | 1 | ▶ | has address => (is => 'ro', default => sub { |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 23 | { | ||
| 24 | # high # low | ||
| 25 | 1 | isr => [ 0x0008, 0x0018 ], | |
| 26 | reset => [ 0x0000 ], | ||
| 27 | range => [ 0x0000, 0x7FFF ], | ||
| 28 | } | ||
| 29 | 1 | }); | |
| 30 | |||
| 31 | 1 | ▶ | has banks => (is => 'ro', default => sub { |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 32 | { | ||
| 33 | 1 | count => 16, | |
| 34 | size => 0x100, | ||
| 35 | gpr => { | ||
| 36 | 0 => [ 0x000, 0x0FF], | ||
| 37 | 1 => [ 0x100, 0x1FF], | ||
| 38 | 2 => [ 0x200, 0x2FF], | ||
| 39 | 3 => [ 0x300, 0x3FF], | ||
| 40 | 4 => [ 0x400, 0x4FF], | ||
| 41 | 5 => [ 0x500, 0x5FF], | ||
| 42 | }, | ||
| 43 | # remapping of these addresses automatically done by chip | ||
| 44 | common => [ [0x000, 0x07F], [0xF80, 0xFFF] ], | ||
| 45 | remap => [], | ||
| 46 | } | ||
| 47 | 1 | }); | |
| 48 | |||
| 49 | 1 | 1; | |
| 50 | |||
| 51 | =encoding utf8 | ||
| 52 | |||
| 53 | =head1 NAME | ||
| 54 | |||
| 55 | VIC::PIC::P18F252 | ||
| 56 | |||
| 57 | =head1 SYNOPSIS | ||
| 58 | |||
| 59 | A class that describes the code to be generated for each specific | ||
| 60 | microcontroller that maps the VIC syntax back into assembly. This is the | ||
| 61 | back-end to VIC's front-end. | ||
| 62 | |||
| 63 | =head1 DESCRIPTION | ||
| 64 | |||
| 65 | INTERNAL CLASS. | ||
| 66 | |||
| 67 | =head1 AUTHOR | ||
| 68 | |||
| 69 | Vikas N Kumar <vikas@cpan.org> | ||
| 70 | |||
| 71 | =head1 COPYRIGHT | ||
| 72 | |||
| 73 | Copyright (c) 2014. Vikas N Kumar | ||
| 74 | |||
| 75 | This program is free software; you can redistribute it and/or modify it | ||
| 76 | under the same terms as Perl itself. | ||
| 77 | |||
| 78 | See http://www.perl.com/perl/misc/Artistic.html | ||
| 79 | |||
| 80 | =cut | ||