From 98ee23f4268dbb1395aa0b2cbfad9f53d1092b33 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 30 May 2009 23:24:11 +0000 Subject: Add initial callback/timer API. Subversion-branch: /branches/opl-branch Subversion-revision: 1538 --- opl/opl.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'opl/opl.h') diff --git a/opl/opl.h b/opl/opl.h index 352e6696..515950b1 100644 --- a/opl/opl.h +++ b/opl/opl.h @@ -27,6 +27,8 @@ #ifndef OPL_OPL_H #define OPL_OPL_H +typedef void (*opl_callback_t)(void *data); + typedef enum { OPL_REGISTER_PORT = 0, @@ -72,5 +74,19 @@ void OPL_WritePort(opl_port_t port, unsigned int value); unsigned int OPL_ReadPort(opl_port_t port); +// Set a timer callback. After the specified number of milliseconds +// have elapsed, the callback will be invoked. + +void OPL_SetCallback(unsigned int ms, opl_callback_t callback, void *data); + +// Begin critical section, during which, OPL callbacks will not be +// invoked. + +void OPL_Lock(void); + +// End critical section. + +void OPL_Unlock(void); + #endif -- cgit v1.2.3