ArchAVR_Device Class Reference

yasimavr: ArchAVR_Device Class Reference
yasimavr
Loading...
Searching...
No Matches

Implementation of a MCU for AVR series. More...

#include <arch_avr_device.h>

Inheritance diagram for ArchAVR_Device:
Device

Public Types

enum  FlashSection { Section_AppRWW = 0 , Section_AppNRWW , Section_Boot , Section_Count }
 
enum  FlashSectionFlags { Access_RWW = 0x04 , Access_IntDisabled = 0x08 }
 
- Public Types inherited from Device
enum  State {
  State_Limbo = 0x00 , State_Ready = 0x10 , State_Running = 0x21 , State_Sleeping = 0x31 ,
  State_Halted = 0x41 , State_Reset = 0x51 , State_Break = 0x60 , State_Done = 0x70 ,
  State_Crashed = 0x80 , State_Destroying = 0xFF
}
 
enum  ResetFlag {
  Reset_PowerOn = 0x00000001 , Reset_WDT = 0x00000002 , Reset_BOD = 0x00000004 , Reset_SW = 0x00000008 ,
  Reset_Ext = 0x00000010 , Reset_Halt = 0x00010000
}
 
enum  Option {
  Option_ResetOnPinShorting = 0x01 , Option_IgnoreBadCpuIO = 0x02 , Option_IgnoreBadCpuLPM = 0x04 , Option_DisablePseudoSleep = 0x08 ,
  Option_InfiniteLoopDetect = 0x10
}
 

Public Member Functions

 ArchAVR_Device (const ArchAVR_DeviceConfig &config)
 
virtual ~ArchAVR_Device ()
 
- Public Member Functions inherited from Device
 Device (Core &core, const DeviceConfiguration &config)
 
virtual ~Device ()=default
 
Corecore () const
 
void set_option (Option option, bool value)
 
bool test_option (Option option) const
 
const DeviceConfigurationconfig () const
 
State state () const
 
cycle_count_t cycle () const
 
SleepMode sleep_mode () const
 
unsigned long frequency () const
 
bool init (CycleManager &cycle_manager)
 
bool load_firmware (const Firmware &firmware)
 
void reset (int reset_flags=Reset_PowerOn)
 
cycle_count_t exec_cycle ()
 
void attach_peripheral (Peripheral &ctl)
 
void add_ioreg_handler (reg_addr_t addr, IORegHandler &handler, bitmask_t bits, IORegister::BitMode bitmode)
 
Peripheralfind_peripheral (ctl_id_t id)
 
bool ctlreq (ctl_id_t id, ctlreq_id_t req, ctlreq_data_t *reqdata=nullptr)
 
CycleManagercycle_manager ()
 
Pinfind_pin (pin_id_t id)
 
PinManagerpin_manager ()
 
LogHandlerlog_handler ()
 
Loggerlogger ()
 
void crash (uint16_t reason, const char *text)
 
 Device (const Device &)=delete
 
Deviceoperator= (const Device &)=delete
 

Protected Member Functions

virtual bool core_ctlreq (ctlreq_id_t req, ctlreq_data_t *reqdata) override
 
virtual bool program (const Firmware &firmware) override
 Override to load the EEPROM.
 
virtual flash_addr_t reset_vector () override
 Override to provide the reset vector depending on fuse settings. The FUSE peripheral is queried for the value of the fuse BOOTRST.
If BOOTRST is 1, 0x0000 is returned.
If BOOTRST is 0, the 1st address of the Boot section is returned.
 
- Protected Member Functions inherited from Device
virtual bool arch_init ()
 
void erase_peripherals ()
 

Detailed Description

Implementation of a MCU for AVR series.

Member Enumeration Documentation

◆ FlashSection

Enumerator
Section_AppRWW 
Section_AppNRWW 
Section_Boot 
Section_Count 

◆ FlashSectionFlags

Enumerator
Access_RWW 
Access_IntDisabled 

Constructor & Destructor Documentation

◆ ArchAVR_Device()

ArchAVR_Device::ArchAVR_Device ( const ArchAVR_DeviceConfig config)
explicit

◆ ~ArchAVR_Device()

ArchAVR_Device::~ArchAVR_Device ( )
virtual

Member Function Documentation

◆ core_ctlreq()

bool ArchAVR_Device::core_ctlreq ( ctlreq_id_t  req,
ctlreq_data_t reqdata 
)
overrideprotectedvirtual

Callback for processing the requests to the core.

See also
ctlreq()

Reimplemented from Device.

◆ program()

bool ArchAVR_Device::program ( const Firmware firmware)
overrideprotectedvirtual

Override to load the EEPROM.

Reimplemented from Device.

◆ reset_vector()

flash_addr_t ArchAVR_Device::reset_vector ( )
overrideprotectedvirtual

Override to provide the reset vector depending on fuse settings. The FUSE peripheral is queried for the value of the fuse BOOTRST.
If BOOTRST is 1, 0x0000 is returned.
If BOOTRST is 0, the 1st address of the Boot section is returned.

Reimplemented from Device.


The documentation for this class was generated from the following files: