Skip to content

Commit

Permalink
Turn PM_* #defines into an enum
Browse files Browse the repository at this point in the history
This helps the SWIG wrapper to define them as well.
  • Loading branch information
dl8dtl committed Mar 7, 2024
1 parent 9567f96 commit 377d3f3
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions src/libavrdude.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,20 +215,22 @@ typedef struct opcode {
#define AVRPART_IS_AT90S1200 32 // Part is an AT90S1200, needs special treatment

// Programming modes for parts and programmers: reflect changes in lexer.l, developer_opts.c and config.c
#define PM_SPM 1 // Bootloaders, self-programming with SPM opcodes or NVM Controllers
#define PM_TPI 2 // Tiny Programming Interface (t4, t5, t9, t10, t20, t40, t102, t104)
#define PM_ISP 4 // SPI programming for In-System Programming (almost all classic parts)
#define PM_PDI 8 // Program and Debug Interface (xmega parts)
#define PM_UPDI 16 // Unified Program and Debug Interface
#define PM_HVSP 32 // High Voltage Serial Programming (some classic parts)
#define PM_HVPP 64 // High Voltage Parallel Programming (most non-HVSP classic parts)
#define PM_debugWIRE 128 // Simpler alternative to JTAG (a subset of HVPP/HVSP parts)
#define PM_JTAG 256 // Joint Test Action Group standard (some classic parts)
#define PM_JTAGmkI 512 // Subset of PM_JTAG, older parts, Atmel ICE mkI
#define PM_XMEGAJTAG 1024 // JTAG, some XMEGA parts
#define PM_AVR32JTAG 2048 // JTAG for 32-bit AVRs
#define PM_aWire 4096 // For 32-bit AVRs
#define PM_ALL 0x1fff // All programming interfaces
enum prog_modes {
PM_SPM = 1, // Bootloaders, self-programming with SPM opcodes or NVM Controllers
PM_TPI = 2, // Tiny Programming Interface (t4, t5, t9, t10, t20, t40, t102, t104)
PM_ISP = 4, // SPI programming for In-System Programming (almost all classic parts)
PM_PDI = 8, // Program and Debug Interface (xmega parts)
PM_UPDI = 16, // Unified Program and Debug Interface
PM_HVSP = 32, // High Voltage Serial Programming (some classic parts)
PM_HVPP = 64, // High Voltage Parallel Programming (most non-HVSP classic parts)
PM_debugWIRE = 128, // Simpler alternative to JTAG (a subset of HVPP/HVSP parts)
PM_JTAG = 256, // Joint Test Action Group standard (some classic parts)
PM_JTAGmkI = 512, // Subset of PM_JTAG, older parts, Atmel ICE mkI
PM_XMEGAJTAG = 1024, // JTAG, some XMEGA parts
PM_AVR32JTAG = 2048, // JTAG for 32-bit AVRs
PM_aWire = 4096, // For 32-bit AVRs
PM_ALL = 0x1fff // All programming interfaces
};

#define HV_UPDI_VARIANT_0 0 /* Shared UPDI/GPIO/RESET pin, HV on UPDI pin (tinyAVR0/1/2)*/
#define HV_UPDI_VARIANT_1 1 /* Dedicated UPDI pin, no HV (megaAVR0/AVR-Dx) */
Expand Down

0 comments on commit 377d3f3

Please sign in to comment.