aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUri Shaked2019-11-30 10:55:32 +0200
committerUri Shaked2019-11-30 10:55:32 +0200
commitcf09a4dfc60f5f973f28a48c9f9638df3bb5b60e (patch)
tree8e284aa69fdfcc476a03a8d280a62ccef655a12c
parentcleanup(demo): remove unused constant (diff)
downloadavr8js-cf09a4dfc60f5f973f28a48c9f9638df3bb5b60e.tar.gz
avr8js-cf09a4dfc60f5f973f28a48c9f9638df3bb5b60e.tar.bz2
avr8js-cf09a4dfc60f5f973f28a48c9f9638df3bb5b60e.zip
feat: add more GPIO ports
close #3
-rw-r--r--src/gpio.ts48
-rw-r--r--src/index.ts10
2 files changed, 57 insertions, 1 deletions
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[] = [];
diff --git a/src/index.ts b/src/index.ts
index bb3e216..094d3a9 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -6,7 +6,15 @@ export {
AVRIOPort,
GPIOListener,
AVRPortConfig,
+ portAConfig,
portBConfig,
portCConfig,
- portDConfig
+ portDConfig,
+ portEConfig,
+ portFConfig,
+ portGConfig,
+ portHConfig,
+ portJConfig,
+ portKConfig,
+ portLConfig
} from './gpio';