-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathTypes.ts
More file actions
34 lines (28 loc) · 956 Bytes
/
Types.ts
File metadata and controls
34 lines (28 loc) · 956 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
export const ALL_FIRMWARE_FLASH_TYPE = ['flash', 'eeprom'] as const;
type firmwareFlashTypeTuple = typeof ALL_FIRMWARE_FLASH_TYPE;
export type FirmwareFlashType = firmwareFlashTypeTuple[number];
export type IMcu = {
signature: number;
flashMemorySize: number;
eepromSize: number;
bootAddress: number;
};
export const ALL_MCU_TYPE = ['atmega32u4'] as const;
type mcuTypeTuple = typeof ALL_MCU_TYPE;
export type IMcuType = mcuTypeTuple[number];
export interface IMcuMap {
atmega32u4: IMcu;
}
export const MCU: IMcuMap = {
atmega32u4: {
signature: 0x1e9587,
flashMemorySize: 32768,
eepromSize: 1024,
bootAddress: 0x7000,
},
};
export const ALL_BOOTLOADER_TYPE = ['caterina', 'dfu', 'copy'] as const;
type bootloaderTypeTuple = typeof ALL_BOOTLOADER_TYPE;
export type IBootloaderType = bootloaderTypeTuple[number];
// eslint-disable-next-line no-unused-vars
export type IErrorHandler = (error: string, cause?: any) => void;