Author | William Welch Copyright (c) 2009, all rights reserved. |
Adapted-by | |
Compiler | 2.4l |
SPI Master hardware control. Routines for sending and receiving through the SPI in master mode
good overview of SPI at http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus also at: http://elm-chan.org/docs/spi_e.html
No dependency found
const SPI_MODE_01 = 1
const SPI_RATE_FOSC_4 = 0
const SPI_RATE_FOSC_16 = 1
const SPI_MODE_10 = 2
const SPI_RATE_TMR = 3
const SPI_MODE_00 = 0
const SPI_MODE_11 = 3
const SPI_RATE_FOSC_64 = 2
const SPI_MODE_01 = 1
No documentation found
const SPI_RATE_FOSC_4 = 0
Use these when calling the spi_init() routine below ( SPI clock frequency )
const SPI_RATE_FOSC_16 = 1
No documentation found
const SPI_MODE_10 = 2
No documentation found
const SPI_RATE_TMR = 3
No documentation found
const SPI_MODE_00 = 0
Use these when calling the spi_init() routine below ( SPI master mode, see sources above )
const SPI_MODE_11 = 3
No documentation found
const SPI_RATE_FOSC_64 = 2
No documentation found
spi_master_hw'put(byte in data)
half-duplex convenience function. send data to slave, discard reply
spi_init(byte in spi_mode, byte in spi_rate)
Initialize the SPI registers. Note: check your datasheet -- TRIS settings, any SPI errata?
spi_master_hw_exchange(byte in m_data) return byte
SPI is full-duplex, so we exchange master and slave data byte
spi_master_hw'get() return byte
half-duplex convenience function. send 0xFF, get slave data
16f877 | 16f877_23k256.jal |
16f877 | 16f877_sd_card.jal |
18f452 | 18f452_sd_card.jal |
18f452 | 18f452_fat32_pata_hard_disk.jal |
18f452 | 18f452_23k256.jal |
18f452 | 18f452_fat32_sd_card.jal |