diff options
Diffstat (limited to 'opl/opl.h')
-rw-r--r-- | opl/opl.h | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -19,6 +19,8 @@ #ifndef OPL_OPL_H #define OPL_OPL_H +#include <inttypes.h> + typedef void (*opl_callback_t)(void *data); typedef enum @@ -50,6 +52,12 @@ typedef enum #define OPL_REGS_FREQ_2 0xB0 #define OPL_REGS_FEEDBACK 0xC0 +// Times + +#define OPL_SECOND ((uint64_t) 1000 * 1000) +#define OPL_MS ((uint64_t) 1000) +#define OPL_US ((uint64_t) 1) + // // Low-level functions. // @@ -99,10 +107,10 @@ void OPL_InitRegisters(void); // Timer callback functions. // -// Set a timer callback. After the specified number of milliseconds +// Set a timer callback. After the specified number of microseconds // have elapsed, the callback will be invoked. -void OPL_SetCallback(unsigned int ms, opl_callback_t callback, void *data); +void OPL_SetCallback(unsigned int us, opl_callback_t callback, void *data); // Adjust callback times by the specified factor. For example, a value of // 0.5 will halve all remaining times. @@ -122,9 +130,9 @@ void OPL_Lock(void); void OPL_Unlock(void); -// Block until the specified number of milliseconds have elapsed. +// Block until the specified number of microseconds have elapsed. -void OPL_Delay(unsigned int ms); +void OPL_Delay(unsigned int us); // Pause the OPL callbacks. |