Here are some sample includes for samples that I use. Alias takes few extra lines and is quite effective for generic libs.
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 spi_master is spi_master_hw ----------------------------------- alias spi_master_sw_sdi is pin_sdi alias spi_master_sw_sdi_direction is pin_sdi_direction alias spi_master_sw_sdo is pin_sdo alias spi_master_sw_sdo_direction is pin_sdo_direction alias spi_master_sw_sck is pin_sck alias spi_master_sw_sck_direction is pin_sck_direction -- define spi inputs/outputs spi_master_sw_sdi_direction = input -- spi input spi_master_sw_sdo_direction = output -- spi output spi_master_sw_sck_direction = output -- spi clock -- include spi_master_sw spi_init(SPI_MODE_11) -- init spi, choose mode alias spi_master is spi_master_sw ------------------------------------- -- setup uart for communication const serial_hw_baudrate = 115200 -- set the baudrate include serial_hardware serial_hw_init() -- some aliases so it is easy to change from serial hw to serial sw. alias serial_write is serial_hw_write alias serial_read is serial_hw_read alias serial_data is serial_hw_data alias serial_data_available is serial_hw_data_available -------------------------------------- -- setup serial software const serial_sw_baudrate = 115200 alias serial_sw_tx_pin is pin_B4 alias serial_sw_rx_pin is pin_B5 pin_B4_direction = output pin_B5_direction = input include serial_software serial_sw_init() -- some aliases so it is easy to change from serial hw to serial sw. alias serial_write is serial_sw_write alias serial_read is serial_sw_read alias serial_data is serial_sw_data PS: I have many of these snippets made up if you need them for Jaluino IDE. PS#2: Let me know when you get more Jaluino boards :) 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.
