HP85 GPIB Disk Emulator  1.0
HP85GPIBDiskEmulator
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros | Functions
mmc_hal.h File Reference

Go to the source code of this file.

Macros

#define MEMSPACE
 
#define WEAK_ATR   __attribute__((weak))
 
#define mmc_cli()   cli() /*< interrupt disable */
 
#define mmc_sei()   sei() /*< interrupt enable */
 

Functions

MEMSPACE void mmc_install_timer (void)
 Install MMC timer task: mmc_task() More...
 
void mmc_spi_init (void)
 MMC SPI setup and chip select. More...
 
void mmc_spi_begin (void)
 MMC SPI setup and chip select. More...
 
void mmc_spi_end (void)
 MMC SPI end and chip deselect. More...
 
void mmc_slow (void)
 MMC set slow SPI bus speed Only called when deselected. More...
 
void mmc_fast (void)
 MMC fast SPI bus speed Only called when deselected. More...
 
void mmc_spi_TX_buffer (const uint8_t *data, int count)
 SPI write buffer. More...
 
void mmc_spi_RX_buffer (const uint8_t *data, int count)
 SPI read buffer. More...
 
uint8_t mmc_spi_TXRX (uint8_t data)
 SPI read and write 1 byte. More...
 
MEMSPACE void mmc_set_ms_timeout (uint16_t ms)
 Set MMC timeout timer in Milliseconds. More...
 
MEMSPACE int mmc_test_timeout (void)
 Wait for timeout. More...
 
MEMSPACE void mmc_ms_wait (int ms)
 Wait for time in milliseconds. More...
 
MEMSPACE int mmc_init (int verbose)
 Initialize MMC and FatFs interface, display diagnostics. More...
 
MEMSPACE void mmc_power_on (void)
 MMC Power ON. More...
 
MEMSPACE void mmc_power_off (void)
 MMC Power OFF. More...
 
MEMSPACE int mmc_ins_status (void)
 MMC Card Inserted status. More...
 
MEMSPACE int mmc_wp_status (void)
 MMC Card Write Protect status. More...
 

Macro Definition Documentation

◆ MEMSPACE

#define MEMSPACE

Definition at line 20 of file mmc_hal.h.

◆ mmc_cli

#define mmc_cli ( )    cli() /*< interrupt disable */

Definition at line 34 of file mmc_hal.h.

◆ mmc_sei

#define mmc_sei ( )    sei() /*< interrupt enable */

Definition at line 35 of file mmc_hal.h.

◆ WEAK_ATR

#define WEAK_ATR   __attribute__((weak))

Definition at line 25 of file mmc_hal.h.

Function Documentation

◆ mmc_fast()

void mmc_fast ( )

MMC fast SPI bus speed Only called when deselected.

  • Used during normal file IO phases
    Returns
    void

Definition at line 129 of file mmc_hal.c.

◆ mmc_init()

MEMSPACE int mmc_init ( int  verbose)

Initialize MMC and FatFs interface, display diagnostics.

Parameters
[in]verbosedisplay initialisation messages
Returns

Definition at line 219 of file mmc_hal.c.

Referenced by fatfs_tests(), main(), and open().

◆ mmc_ins_status()

MEMSPACE int mmc_ins_status ( )

MMC Card Inserted status.

  • We do not detect card insert status in this project.
    Returns
    1 card inserted

Definition at line 328 of file mmc_hal.c.

Referenced by gpib_error_test(), mmc_init(), and mmc_task().

◆ mmc_install_timer()

MEMSPACE void mmc_install_timer ( void  )

Install MMC timer task: mmc_task()

See also
mmc_task()
Returns
void

Definition at line 82 of file mmc_hal.c.

Referenced by mmc_init().

◆ mmc_ms_wait()

MEMSPACE void mmc_ms_wait ( int  ms)

Wait for time in milliseconds.

Parameters
[in]mstimeout in Milliseconds

Definition at line 204 of file mmc_hal.c.

◆ mmc_power_off()

MEMSPACE void mmc_power_off ( )

MMC Power OFF.

Returns
void

Definition at line 317 of file mmc_hal.c.

Referenced by power_off().

◆ mmc_power_on()

MEMSPACE void mmc_power_on ( )

MMC Power ON.

Returns
void

Definition at line 308 of file mmc_hal.c.

Referenced by power_on().

◆ mmc_set_ms_timeout()

MEMSPACE void mmc_set_ms_timeout ( uint16_t  ms)

Set MMC timeout timer in Milliseconds.

Parameters
[in]mstimeout in Milliseconds
See also
mmc_test_timeout ( )
Returns
void

Definition at line 169 of file mmc_hal.c.

Referenced by mmc_disk_initialize(), mmc_ms_wait(), rcvr_datablock(), and wait_ready().

◆ mmc_slow()

void mmc_slow ( )

MMC set slow SPI bus speed Only called when deselected.

  • Used during card detect phase
    Returns
    void

Definition at line 119 of file mmc_hal.c.

Referenced by mmc_spi_init().

◆ mmc_spi_begin()

void mmc_spi_begin ( )

MMC SPI setup and chip select.

Returns
void

Definition at line 101 of file mmc_hal.c.

◆ mmc_spi_end()

void mmc_spi_end ( )

MMC SPI end and chip deselect.

Returns
void

Definition at line 109 of file mmc_hal.c.

◆ mmc_spi_init()

void mmc_spi_init ( )

MMC SPI setup and chip select.

Returns
void

Definition at line 92 of file mmc_hal.c.

Referenced by mmc_init().

◆ mmc_spi_RX_buffer()

void mmc_spi_RX_buffer ( const uint8_t *  data,
int  count 
)

SPI read buffer.

Parameters
[in]*datatransmit buffer
[in]countnumber of bytes to write
Returns
void

Definition at line 149 of file mmc_hal.c.

Referenced by rcvr_spi_multi().

◆ mmc_spi_TX_buffer()

void mmc_spi_TX_buffer ( const uint8_t *  data,
int  count 
)

SPI write buffer.

Parameters
[in]*datatransmit buffer
[in]countnumber of bytes to write
Returns
void

Definition at line 139 of file mmc_hal.c.

Referenced by xmit_spi_multi().

◆ mmc_spi_TXRX()

uint8_t mmc_spi_TXRX ( uint8_t  data)

SPI read and write 1 byte.

Parameters
[in]datavalue to transmit
Returns
uint8_t value read

Definition at line 158 of file mmc_hal.c.

Referenced by xchg_spi().

◆ mmc_test_timeout()

MEMSPACE int mmc_test_timeout ( )

Wait for timeout.

Returns
1 ready
0 timeout

Definition at line 181 of file mmc_hal.c.

Referenced by mmc_disk_initialize(), mmc_ms_wait(), rcvr_datablock(), and wait_ready().

◆ mmc_wp_status()

MEMSPACE int mmc_wp_status ( )

MMC Card Write Protect status.

  • We do not detect card write protect status in this project.
    Returns
    0 == not write protected

Definition at line 344 of file mmc_hal.c.

Referenced by gpib_file_init(), and SS80_locate_and_write().