1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
-
- #include <avr/io.h>
- #include <stdint.h>
- #include <stdlib.h>
-
- #include "twi.h"
- #include "audio.h"
- #ifdef DEBUG
- #include "serial.h"
- #endif
-
- uint8_t ret[7];
-
-
- uint8_t *getAudioData(void) {
-
- uint8_t i;
-
- if (i2c_start(TWIADDRESSAUDIO | I2C_READ) == 0) {
- for (i = 0; i < 6; i++) {
- ret[i] = i2c_readAck();
- }
- ret[6] = i2c_readNak();
- i2c_stop();
- return ret;
- } else {
- return NULL;
- }
- }
|