From cf09a4dfc60f5f973f28a48c9f9638df3bb5b60e Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Sat, 30 Nov 2019 10:55:32 +0200 Subject: feat: add more GPIO ports close #3 --- src/gpio.ts | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'src/gpio.ts') diff --git a/src/gpio.ts b/src/gpio.ts index 7fdc915..d39a918 100644 --- a/src/gpio.ts +++ b/src/gpio.ts @@ -17,6 +17,12 @@ export interface AVRPortConfig { export type GPIOListener = (value: u8, oldValue: u8) => void; +export const portAConfig: AVRPortConfig = { + PIN: 0x20, + DDR: 0x21, + PORT: 0x22 +}; + export const portBConfig: AVRPortConfig = { PIN: 0x23, DDR: 0x24, @@ -35,6 +41,48 @@ export const portDConfig: AVRPortConfig = { PORT: 0x2b }; +export const portEConfig: AVRPortConfig = { + PIN: 0x2c, + DDR: 0x2d, + PORT: 0x2e +}; + +export const portFConfig: AVRPortConfig = { + PIN: 0x2f, + DDR: 0x30, + PORT: 0x31 +}; + +export const portGConfig: AVRPortConfig = { + PIN: 0x32, + DDR: 0x33, + PORT: 0x34 +}; + +export const portHConfig: AVRPortConfig = { + PIN: 0x100, + DDR: 0x101, + PORT: 0x102 +}; + +export const portJConfig: AVRPortConfig = { + PIN: 0x103, + DDR: 0x104, + PORT: 0x105 +}; + +export const portKConfig: AVRPortConfig = { + PIN: 0x106, + DDR: 0x107, + PORT: 0x108 +}; + +export const portLConfig: AVRPortConfig = { + PIN: 0x109, + DDR: 0x10a, + PORT: 0x10b +}; + export class AVRIOPort { private listeners: GPIOListener[] = []; -- cgit v1.2.3