Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Thank You for your continued support and contributions!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Plugins/Viewers
| | |-+  External Input for LUA
« previous next »
  • Print
Pages: [1]

Author Topic: External Input for LUA  (Read 1960 times)

Offline LoneWolf_Recon

  • Member
  • *
  • Posts: 10
External Input for LUA
« on: July 08, 2011, 10:57:34 PM »
Hey guys,

  Sorry for two threads in the same section but this one is pretty deep. What I'm planning is making my Fuze as a microcomputer for a few possible robots and "embedded systems" projects in the future. All the internal processing I can do in LUA. But I'm just tossing ideas around for possible external input/output besides the buttons and the LCD.

I've read one thread that USB communications isn't fully implemented(Besides the USB HID), so could the HID Header work for USB I/O? I've seen a few functions in the file that look like get/send HID commands..

But if that's not possible I can do audio signals for I/O. Like Mic for input, Headphone jack for output and encoding the data as audio signals. The audio out I've worked, but is there a file for getting Mic input and/or determining frequencies coming in through the Mic?

Thanks again guys(I'm done talking  :D)
,LoneWolf
Logged
Building crap since 2004.. ;D         Sansa Fuze v2

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8974
Re: External Input for LUA
« Reply #1 on: July 08, 2011, 11:23:37 PM »
Quote from: LoneWolf_Recon on July 08, 2011, 10:57:34 PM
I've read one thread that USB communications isn't fully implemented(Besides the USB HID), so could the HID Header work for USB I/O? I've seen a few functions in the file that look like get/send HID commands..

Assuming you have the FuzeV2, we don't even have a fully working USB driver.

Quote from: LoneWolf_Recon on July 08, 2011, 10:57:34 PM
But if that's not possible I can do audio signals for I/O. Like Mic for input, Headphone jack for output and encoding the data as audio signals. The audio out I've worked, but is there a file for getting Mic input and/or determining frequencies coming in through the Mic?



Have you looked at plugin.h?  It exposes all the API functions for plugins (of course you can add more if you need them...):

Code: [Select]
#ifdef HAVE_RECORDING
    const unsigned long *rec_freq_sampr;
    void (*pcm_init_recording)(void);
    void (*pcm_close_recording)(void);
    void (*pcm_record_data)(pcm_rec_callback_type more_ready,
                            void *start, size_t size);
    void (*pcm_stop_recording)(void);
    void (*pcm_calculate_rec_peaks)(int *left, int *right);
    void (*audio_set_recording_gain)(int left, int right, int type);
#endif /* HAVE_RECORDING */
Logged

Offline LoneWolf_Recon

  • Member
  • *
  • Posts: 10
Re: External Input for LUA
« Reply #2 on: July 08, 2011, 11:54:56 PM »
Thanks Saratoga  ;D

Post Merge: July 09, 2011, 11:04:08 PM
I'm still having problems with the pcmbuf_beep command. I've tried including the pcmbuf file into the main lua program but it wont work. And what is the limits to the beep command on amplitude? Thanks again  :D
« Last Edit: July 09, 2011, 11:04:08 PM by LoneWolf_Recon »
Logged
Building crap since 2004.. ;D         Sansa Fuze v2

Offline LoneWolf_Recon

  • Member
  • *
  • Posts: 10
Re: External Input for LUA
« Reply #3 on: July 19, 2011, 04:30:08 PM »
Has anyone worked with the pcmbuf_beep command or the other PCM commands? LUA runs the program perfectly except no beep..  :-\

I've tried to directly include the pcmbuf header into the LUA program but no dice...
Logged
Building crap since 2004.. ;D         Sansa Fuze v2

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Plugins/Viewers
| | |-+  External Input for LUA
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.064 seconds with 15 queries.