Mercurial > hg > beaglert
comparison pru_rtaudio.p @ 45:579c86316008 newapi
Major API overhaul. Moved to a single data structure for handling render functions. Functionally, generally similar except for scheduling within PRU loop function, which now uses interrupts from the PRU rather than polling. This requires an updated kernel.
author | andrewm |
---|---|
date | Thu, 28 May 2015 14:35:55 -0400 |
parents | 419ce4ebfc4c |
children | 472e892c6e41 |
comparison
equal
deleted
inserted
replaced
40:419ce4ebfc4c | 45:579c86316008 |
---|---|
29 #define GPIO0 0x44E07000 | 29 #define GPIO0 0x44E07000 |
30 #define GPIO1 0x4804C000 | 30 #define GPIO1 0x4804C000 |
31 #define GPIO_CLEARDATAOUT 0x190 | 31 #define GPIO_CLEARDATAOUT 0x190 |
32 #define GPIO_SETDATAOUT 0x194 | 32 #define GPIO_SETDATAOUT 0x194 |
33 | 33 |
34 #define PRU0_ARM_INTERRUPT 19 | 34 #define PRU0_ARM_INTERRUPT 19 // Interrupt signalling we're done |
35 #define PRU1_ARM_INTERRUPT 20 // Interrupt signalling a block is ready | |
35 | 36 |
36 #define C_ADC_DAC_MEM C24 // PRU0 mem | 37 #define C_ADC_DAC_MEM C24 // PRU0 mem |
37 #ifdef DBOX_CAPE | 38 #ifdef DBOX_CAPE |
38 #define DAC_GPIO GPIO0 | 39 #define DAC_GPIO GPIO0 |
39 #define DAC_CS_PIN (1<<5) // GPIO0:5 = P9 pin 17 | 40 #define DAC_CS_PIN (1<<5) // GPIO0:5 = P9 pin 17 |
988 XOR reg_flags, reg_flags, (1 << FLAG_BIT_BUFFER1) //flip the buffer flag | 989 XOR reg_flags, reg_flags, (1 << FLAG_BIT_BUFFER1) //flip the buffer flag |
989 | 990 |
990 // Notify ARM of buffer swap | 991 // Notify ARM of buffer swap |
991 AND r2, reg_flags, (1 << FLAG_BIT_BUFFER1) // Mask out every but low bit | 992 AND r2, reg_flags, (1 << FLAG_BIT_BUFFER1) // Mask out every but low bit |
992 SBBO r2, reg_comm_addr, COMM_CURRENT_BUFFER, 4 | 993 SBBO r2, reg_comm_addr, COMM_CURRENT_BUFFER, 4 |
993 | 994 MOV R31.b0, PRU1_ARM_INTERRUPT + 16 // Interrupt to host loop |
995 | |
994 // Increment the frame count in the comm buffer (for status monitoring) | 996 // Increment the frame count in the comm buffer (for status monitoring) |
995 LBBO r2, reg_comm_addr, COMM_FRAME_COUNT, 4 | 997 LBBO r2, reg_comm_addr, COMM_FRAME_COUNT, 4 |
996 ADD r2, r2, reg_frame_total | 998 ADD r2, r2, reg_frame_total |
997 SBBO r2, reg_comm_addr, COMM_FRAME_COUNT, 4 | 999 SBBO r2, reg_comm_addr, COMM_FRAME_COUNT, 4 |
998 | 1000 |