Laurent Huot
/
SPI
drtgddf
UART.h@0:aab1f335cf6b, 2016-01-11 (annotated)
- Committer:
- larryspaghetti
- Date:
- Mon Jan 11 19:10:09 2016 +0000
- Revision:
- 0:aab1f335cf6b
- Child:
- 1:2b2be189b4db
allo
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
larryspaghetti | 0:aab1f335cf6b | 1 | class UART |
larryspaghetti | 0:aab1f335cf6b | 2 | { |
larryspaghetti | 0:aab1f335cf6b | 3 | public: |
larryspaghetti | 0:aab1f335cf6b | 4 | //Le constructeur prend en parametre des valeurs de REGISTRES pour les pins, pas les "pin names" |
larryspaghetti | 0:aab1f335cf6b | 5 | UART(int registreTx, int registreRx); |
larryspaghetti | 0:aab1f335cf6b | 6 | //Ecrit un caractere |
larryspaghetti | 0:aab1f335cf6b | 7 | int putc(int c); |
larryspaghetti | 0:aab1f335cf6b | 8 | //Sert a savoir si un bit peut etre ecrit dans le registre |
larryspaghetti | 0:aab1f335cf6b | 9 | int writeable(); |
larryspaghetti | 0:aab1f335cf6b | 10 | |
larryspaghetti | 0:aab1f335cf6b | 11 | private: |
larryspaghetti | 0:aab1f335cf6b | 12 | //Registre du POWER |
larryspaghetti | 0:aab1f335cf6b | 13 | int * PCOMP; |
larryspaghetti | 0:aab1f335cf6b | 14 | PCOMP = 0x400FC0C4; |
larryspaghetti | 0:aab1f335cf6b | 15 | //Registre du CLOCK |
larryspaghetti | 0:aab1f335cf6b | 16 | int * PCLKSEL0; |
larryspaghetti | 0:aab1f335cf6b | 17 | PCLKSEL0 = 0x400FC1A8; |
larryspaghetti | 0:aab1f335cf6b | 18 | //Registre pour le BAUD RATE |
larryspaghetti | 0:aab1f335cf6b | 19 | int * U0LCR; |
larryspaghetti | 0:aab1f335cf6b | 20 | U0LCR = 0x4000C00C; |
larryspaghetti | 0:aab1f335cf6b | 21 | //Registre pour le BAUD RATE |
larryspaghetti | 0:aab1f335cf6b | 22 | int * U0DLL; |
larryspaghetti | 0:aab1f335cf6b | 23 | U0DLL = 0x4000C000; |
larryspaghetti | 0:aab1f335cf6b | 24 | //Registre pour le BAUD RATE |
larryspaghetti | 0:aab1f335cf6b | 25 | int * U0DLM; |
larryspaghetti | 0:aab1f335cf6b | 26 | U0DLM = 0x4000C004; |
larryspaghetti | 0:aab1f335cf6b | 27 | //Registre du FIFO |
larryspaghetti | 0:aab1f335cf6b | 28 | int * U0FCR; |
larryspaghetti | 0:aab1f335cf6b | 29 | U0FCR = 0x4000C008; |
larryspaghetti | 0:aab1f335cf6b | 30 | int * PINSEL0; |
larryspaghetti | 0:aab1f335cf6b | 31 | PINSEL0 = 0x4002C000; |
larryspaghetti | 0:aab1f335cf6b | 32 | } |