Actually this is what Seb and I currently do, but maybe in a different
way?? We put the alias in the sample when including SPI. Just alias
whatever you need, then you can use SD card for spi_master_hw,
spi_master_hw2 or spi_master_sw. This is what Seb needed to use
spi_master_hw2 lib. Is this what you are suggesting William?

include spi_master_hw         -- includes the spi library
-- define spi inputs/outputs
pin_sdi_direction = input    -- spi input
pin_sdo_direction = output   -- spi output
pin_sck_direction = output   -- spi clock
--
spi_init(SPI_MODE_11,SPI_RATE_FOSC_4) -- init spi, choose mode and
speed
--
-- alias whatever you may need for sd card:
alias spi_master is spi_master_hw
alias spi_master_set_mode is spi_master_hw_set_mode
alias spi_master_set_mode_11 is spi_master_hw_set_mode_11

-- now include the sd card lib
const bit SD_ALWAYS_SET_SPI_MODE = TRUE
include sd_card

You could of course change your libs to use this generic approach.
Instead of calling spi_master_hw, call spi_master. Hex output will be
the same, I'm unsure if that still matters to you.

Matt.

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en.

Reply via email to