SIO Command $DF Set External SIO Clock - FujiNetWIFI/fujinet-firmware GitHub Wiki

This is a command for Device $70 - The FujiNet Device itself (see SIO-Commands-for-Device-ID-$70).

Set External SIO Clock Rate. ($DF)

Description

Tells FujiNet to turn on an external clock using the aux1/aux2 bytes, the rate given is in kHz. This can be used to initiate synchronous serial transfer with such routines as UHSIO.

Parameters

DCB Value
DDEVIC $70
DUNIT $01
DCOMND $DF
DSTATS $00
DBUF NULL
DTIMLO $0F
DBYT 0
DAUX 16-bit value, LSB, rate in kHz.

Examples

CC65

/**
 * Set CLOCKIN clock rate to rate.
 */
void fuji_sio_set_sio_external_clock(unsigned short rate)
{
  OS.dcb.ddevic=0x70;
  OS.dcb.dunit=1;
  OS.dcb.dcomnd=0xDF;
  OS.dcb.dstats=0x00;
  OS.dcb.dbuf=NULL;
  OS.dcb.dtimlo=0x0F;
  OS.dcb.dbyt=0;
  OS.dcb.daux=rate;
  siov();
}