0.3.1
|
Data Structures | |
struct | scu_dsp_status |
SCU-DSP status. More... | |
Macros | |
#define | DSP_PROGRAM_SIZE 0x0400 |
SCU-DSP program size in bytes. | |
#define | DSP_PROGRAM_WORD_COUNT (DSP_PROGRAM_SIZE / 4) |
SCU-DSP program word count. | |
#define | DSP_RAM_PAGE_SIZE 0x0100 |
SCU-DSP RAM page size in bytes. | |
#define | DSP_RAM_PAGE_WORD_COUNT (DSP_RAM_PAGE_SIZE / 4) |
SCU-DSP RAM page word count. | |
Typedefs | |
typedef enum scu_dsp_ram | scu_dsp_ram_t |
SCU-DSP RAM pages. | |
typedef void(* | scu_dsp_ihr_t) (void) |
Callback type. | |
typedef uint8_t | scu_dsp_pc_t |
Program counter to reference 256 instructions. | |
typedef struct scu_dsp_status | scu_dsp_status_t |
SCU-DSP status. | |
Enumerations | |
enum | scu_dsp_ram |
SCU-DSP RAM pages. More... | |
Functions | |
static void | scu_dsp_program_pause (bool pause) |
Pause SCU-DSP execution. | |
void | scu_dsp_program_load (const void *program, uint32_t count) |
Load program onto SCU-DSP. | |
void | scu_dsp_program_clear (void) |
Completely clear program memory. | |
void | scu_dsp_program_pc_set (scu_dsp_pc_t pc) |
Set the SCU-DSP program counter. | |
void | scu_dsp_program_start (void) |
Start SCU-DSP execution. | |
void | scu_dsp_program_stop (void) |
Stop SCU-DSP execution. | |
scu_dsp_pc_t | scu_dsp_program_step (void) |
Step one instruction excecution. | |
bool | scu_dsp_dma_busy (void) |
Determine if the SCU-DSP DMA transfer is occurring. | |
void | scu_dsp_dma_wait (void) |
Wait until a SCU-DSP DMA transfer is complet. | |
bool | scu_dsp_program_end (void) |
Determine if SCU-DSP program has ended. | |
void | scu_dsp_program_end_wait (void) |
Wait until the SCU-DSP program has ended. | |
void | scu_dsp_data_read (scu_dsp_ram_t ram_page, uint8_t offset, void *data, uint32_t count) |
Read from one of the SCU-DSP RAM page. | |
void | scu_dsp_data_write (scu_dsp_ram_t ram_page, uint8_t offset, void *data, uint32_t count) |
Write to one of the SCU-DSP RAM page. | |
void | scu_dsp_status_get (scu_dsp_status_t *status) |
Obtain SCU-DSP operation status. | |
Description goes here.
struct scu_dsp_status |
SCU-DSP status.
Data Fields | ||
---|---|---|
bool | t0:1 | D0-Bus DMA execution flag. |
bool | s:1 | SCU-DSP S (sine) flag. |
bool | z:1 | SCU-DSP Z (zero) flag. |
bool | c:1 | SCU-DSP C (carry) flag. |
bool | v:1 | SCU-DSP V (overflow) flag. |
bool | e:1 | SCU-DSP E (program end interrupt) flag. |
bool | ex:1 | Flag to indicate whether execution is in progress or stopped. |
scu_dsp_pc_t | pc:8 | Not yet documented. |
enum scu_dsp_ram |
|
inlinestatic |
Pause SCU-DSP execution.
pause | Pause or unpause. |
void scu_dsp_program_load | ( | const void * | program, |
uint32_t | count | ||
) |
Load program onto SCU-DSP.
The PC is reset back to zero after loading the program. Should the count
be zero, nothing is copied. If the count
exceeds DSP_PROGRAM_WORD_COUNT, the count
is clamped.
Does not start SCU-DSP execution. For that, use scu_dsp_program_start.
program | Pointer to buffer containing the SCU-DSP program. |
count | Number of instructions. |
void scu_dsp_program_clear | ( | void | ) |
Completely clear program memory.
This function is heavy handed. The following is performed: Program memory is cleared, the Z, S, and C flags are cleared, and the PC is reset.
void scu_dsp_program_pc_set | ( | scu_dsp_pc_t | pc | ) |
Set the SCU-DSP program counter.
pc | The program counter. |
scu_dsp_pc_t scu_dsp_program_step | ( | void | ) |
Step one instruction excecution.
The function blocks until that execution of one instruction is complete.
This function should be used to debug on real hardware.
bool scu_dsp_dma_busy | ( | void | ) |
Determine if the SCU-DSP DMA transfer is occurring.
true
if SCU-DSP DMA transfer is occurring. Otherwise, false
. bool scu_dsp_program_end | ( | void | ) |
Determine if SCU-DSP program has ended.
true
if the SCU-DSP has ended. Otherwise, false
. void scu_dsp_data_read | ( | scu_dsp_ram_t | ram_page, |
uint8_t | offset, | ||
void * | data, | ||
uint32_t | count | ||
) |
Read from one of the SCU-DSP RAM page.
If offset
+ count
exceeds DSP_RAM_PAGE_WORD_COUNT, the function returns without copying.
ram_page | The RAM page. | |
offset | The offset in the RAM page. | |
[out] | data | The pointer to the buffer to write to. |
count | The number of words. |
void scu_dsp_data_write | ( | scu_dsp_ram_t | ram_page, |
uint8_t | offset, | ||
void * | data, | ||
uint32_t | count | ||
) |
Write to one of the SCU-DSP RAM page.
If offset
+ count
exceeds DSP_RAM_PAGE_WORD_COUNT, the function returns without copying.
ram_page | The RAM page. | |
offset | The offset in the RAM page. | |
[in] | data | The pointer to the buffer to write to. |
count | The number of words. |
void scu_dsp_status_get | ( | scu_dsp_status_t * | status | ) |
Obtain SCU-DSP operation status.
If status
is NULL
, the status will not be updated.
[out] | status | The pointer to scu_dsp_status. |