-
Notifications
You must be signed in to change notification settings - Fork 2
/
ay3891x.h
49 lines (38 loc) · 1.26 KB
/
ay3891x.h
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
SignalDEV SoundBoard
Library for playing VGM music using legacy AY-3-891x and SN76489 with an Arduino
Created by Cecil Meeks (cbmeeks)
http://signaldev.com
http://meeks.co
BSD license, all text above must be included in any redistribution
*/
/******************************************************************************
Library for the AY-3-8910 (or variants such as 8912/8913)
This library assumes you are connecting via a 74595 shift register.
Other connections methods may come in the future.
Written by Cecil Meeks ( [email protected] | @cbmeeks | http://meeks.co )
BSD license, all text above must be included in any redistribution
******************************************************************************/
#ifndef AY3891X_H
#define AY3891X_H
#include <Arduino.h>
#include "SPI.h"
class AY3891x {
public:
AY3891x();
void enable();
void disable();
void setSDSSPin(uint8_t pin);
void write(uint8_t data, uint8_t address);
private:
// SD Slave Select Pin (used for streaming VGM off SD card)
uint8_t sdSS_PIN;
// Enter the appropriate pin values below
uint8_t AY3891x_SS = 9;
// AY-3-8910/2/3 PSG (BC2 is usually HIGH at least on 8912)
uint8_t AY38912_BC1 = 6;
uint8_t AY38912_BDIR = 5;
uint8_t AY38912_RESET = 4;
};
#endif