-
Notifications
You must be signed in to change notification settings - Fork 8
/
device.h
executable file
·69 lines (56 loc) · 1.64 KB
/
device.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//(c) uARM project https://github.com/uARM-Palm/uARM uARM@dmitry.gr
#ifndef _DEVICE_H_
#define _DEVICE_H_
#include "soc_uWire.h"
#include "soc_GPIO.h"
#include "soc_UART.h"
#include "soc_AC97.h"
#include "soc_SSP.h"
#include "soc_I2C.h"
#include "soc_I2S.h"
#include <stdbool.h>
#include <stdio.h>
#include "keys.h"
#include "nand.h"
#include "SoC.h"
#include "ROM.h"
#include "vSD.h"
#include "mem.h"
struct SocPeriphs {
//in to deviceSetup
struct SocAC97 *ac97;
struct SocGpio *gpio;
struct SocUwire *uw;
struct SocI2c *i2c;
struct SocI2s *i2s;
struct SocSsp *ssp;
struct SocSsp *ssp2; //assp for xscale
struct SocSsp *ssp3; //nssp for scale
struct ArmMem *mem;
struct SoC *soc;
//PXA order: ffUart, hwUart, stUart, btUart
struct SocUart *uarts[4];
void *adc; //some cases need this
void *kpc; //some cases need this
//out from deviceSetup
struct NAND *nand;
struct SocUart *dbgUart;
};
enum RamTermination { //what's after ram in phys map? (some devices probe)
RamTerminationMirror,
RamTerminationWriteIgnore,
RamTerminationNone,
};
struct Device;
//simple queries
bool deviceHasGrafArea(void);
uint32_t deviceGetRamSize(void);
enum RamTermination deviceGetRamTerminationStyle(void);
enum RomChipType deviceGetRomMemType(void);
uint_fast8_t deviceGetSocRev(void);
//device handling
struct Device* deviceSetup(struct SocPeriphs *sp, struct Keypad *kp, struct VSD *vsd, FILE* nandFile);
void deviceKey(struct Device *dev, uint32_t key, bool down);
void devicePeriodic(struct Device *dev, uint32_t cycles);
void deviceTouch(struct Device *dev, int x, int y);
#endif