Mikroelektronika MIKROE-442 데이터 시트
284
mikoBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
Cf_Read_Init
Cf_Read_Byte
Cf_Write_Init
Prototype
sub procedure Cf_Read_Init(dim address as longword, dim sectcnt as byte)
Description Initializes CF card for reading.
Parameters -
Parameters -
address
: the first sector to be prepared for reading operation.
-
sector_count
: number of sectors to be prepared for reading operation.
Returns
Nothing.
Requires
The corresponding MCU ports must be appropriately initialized for CF card. See Cf_Init.
Example
‘ initialize compact flash for reading from sector 590
Cf_Read_Init(590, 1)
Notes
None.
Prototype
sub function CF_Read_Byte() as byte
Description Reads one byte from Compact Flash sector buffer location currently pointed to by internal read
pointers. These pointers will be autoicremented upon reading.
Parameters None.
Returns
Returns
Returns a byte read from Compact Flash sector buffer.
Requires
The corresponding MCU ports must be appropriately initialized for CF card. See Cf_Init.
CF card must be initialized for reading operation. See Cf_Read_Init.
Example
‘ Read a byte from compact flash:
dim data_ as byte
...
data_ = Cf_Read_Byte()
Notes
Higher byte of the
unsigned
return value is cleared.
Prototype
sub procedure Cf_Write_Init(dim address as longword, dim sectcnt as word)
Description Initializes CF card for writing.
Parameters -
Parameters -
address
: the first sector to be prepared for writing operation.
-
sectcnt
: number of sectors to be prepared for writing operation.
Returns
Nothing.
Requires
The corresponding MCU ports must be appropriately initialized for CF card. See Cf_Init.
Example
‘ initialize compact flash for writing to sector 590
Cf_Write_Init(590, 1)
Notes
None.