Move defines into header for keypad encoder
This commit is contained in:
parent
2c4a1b1565
commit
8f47841b72
2 changed files with 12 additions and 11 deletions
10
74C922.c
10
74C922.c
|
@ -1,16 +1,8 @@
|
|||
#include "config.h"
|
||||
#include "74C922.h"
|
||||
#include <avr/io.h>
|
||||
#include <stdbool.h>
|
||||
#include <util/delay.h>
|
||||
|
||||
// Pin Definitions
|
||||
#define ENCODER_A_PIN PD6
|
||||
#define ENCODER_B_PIN PD5
|
||||
#define ENCODER_C_PIN PD4
|
||||
#define ENCODER_D_PIN PD3
|
||||
#define ENCODER_OE_PIN PD2
|
||||
#define ENCODER_DA_PIN PD1
|
||||
|
||||
void prepare_interrupt() {
|
||||
EICRA |= (1 << ISC00); // Any logical change triggers interrupt
|
||||
EIMSK |= (1 << INT0); // INT0 external interrupt
|
||||
|
|
9
74C922.h
9
74C922.h
|
@ -1,5 +1,14 @@
|
|||
#ifndef H74C922_H
|
||||
#define H74C922_H
|
||||
#include <stdint.h>
|
||||
|
||||
// Pin Definitions
|
||||
#define ENCODER_A_PIN PD6
|
||||
#define ENCODER_B_PIN PD5
|
||||
#define ENCODER_C_PIN PD4
|
||||
#define ENCODER_D_PIN PD3
|
||||
#define ENCODER_OE_PIN PD2
|
||||
#define ENCODER_DA_PIN PD1
|
||||
|
||||
void encoder_init();
|
||||
uint8_t encoder_read();
|
||||
|
|
Loading…
Add table
Reference in a new issue