ArchXT_Device Class Reference

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

Implementation of a device model for Mega0/Mega1 series. More...

#include <arch_xt_device.h>

Inheritance diagram for ArchXT_Device:
Device

Public Types

enum  FlashSection { Section_Boot = 0 , Section_AppCode , Section_AppData , Section_Count }
 
- 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

 ArchXT_Device (const ArchXT_DeviceConfig &config)
 
virtual ~ArchXT_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
 

Static Public Attributes

static const size_t SECTION_PAGE_SIZE = 256
 

Protected Member Functions

virtual bool core_ctlreq (ctlreq_id_t req, ctlreq_data_t *reqdata) override
 Override to provide access to EEPROM and USERROW via AVR_CTLREQ_CORE_NVM.
 
virtual bool program (const Firmware &firmware) override
 Override to load the EEPROM and the USERROW.
 
- Protected Member Functions inherited from Device
virtual bool arch_init ()
 
void erase_peripherals ()
 
virtual flash_addr_t reset_vector ()
 

Detailed Description

Implementation of a device model for Mega0/Mega1 series.

Member Enumeration Documentation

◆ FlashSection

Enumerator
Section_Boot 
Section_AppCode 
Section_AppData 
Section_Count 

Constructor & Destructor Documentation

◆ ArchXT_Device()

ArchXT_Device::ArchXT_Device ( const ArchXT_DeviceConfig config)
explicit

◆ ~ArchXT_Device()

ArchXT_Device::~ArchXT_Device ( )
virtual

Member Function Documentation

◆ core_ctlreq()

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

Override to provide access to EEPROM and USERROW via AVR_CTLREQ_CORE_NVM.

Reimplemented from Device.

◆ program()

bool ArchXT_Device::program ( const Firmware firmware)
overrideprotectedvirtual

Override to load the EEPROM and the USERROW.

Reimplemented from Device.

Member Data Documentation

◆ SECTION_PAGE_SIZE

const size_t ArchXT_Device::SECTION_PAGE_SIZE = 256
static

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