50 static void SSP_ISR(
void) __attribute__((naked));
53 #define SSP_DDS 0x07 << 0
55 #define SSP_FRF 0x00 << 4
56 #define SSP_CPOL 0x00 << 6
57 #define SSP_CPHA 0x00 << 7
58 #define SSP_SCR 0x00 << 8
60 #define SSPCR0_VAL (SSP_DDS | SSP_FRF | SSP_CPOL | SSP_CPHA | SSP_SCR )
63 #define SSP_LBM 0x00 << 0
64 #define SSP_SSE 0x00 << 1
65 #define SSP_MS 0x01 << 2
66 #define SSP_SOD 0x00 << 3
68 #define SSPCR1_VAL (SSP_LBM | SSP_SSE | SSP_MS | SSP_SOD )
74 #if (PCLK == 15000000)
78 #if (PCLK == 30000000)
82 #if (PCLK == 60000000)
86 #error unknown PCLK frequency
91 #define SSP_PINSEL1_SCK (2<<2)
92 #define SSP_PINSEL1_MISO (2<<4)
93 #define SSP_PINSEL1_MOSI (2<<6)
94 #define SSP_PINSEL1_SSEL (2<<8)
97 #define SSP_Write(X) SSPDR=(X)
98 #define SSP_Read() SSPDR
99 #define SSP_Status() SSPSR
102 #ifndef SPI1_VIC_SLOT
103 #define SPI1_VIC_SLOT 7
126 for (i = 0; i < len; i++) {
#define SPI1_VIC_SLOT
default initial settings
uint8_t spi_slave_hs_rx_buffer[SPI_SLAVE_HS_RX_BUFFER_SIZE]
static void spi_slave_hs_transmit(struct spi_slave_hs *p, long fd, uint8_t byte)
void spi_slave_hs_init(void)
uint16_t spi_slave_hs_rx_extract_idx
static int spi_slave_hs_char_available(struct spi_slave_hs *p)
Architecture independent SPI (Serial Peripheral Interface) API.
static void spi_slave_hs_send(struct spi_slave_hs *p, long fd)
#define SPI_SLAVE_HS_TX_BUFFER_SIZE
static void SSP_ISR(void)
static int spi_slave_hs_check_free_space(struct spi_slave_hs *p, long *fd, uint16_t len)
uint8_t spi_slave_hs_tx_extract_idx
static void spi_slave_hs_transmit_buffer(struct spi_slave_hs *p, long fd, uint8_t *data, uint16_t len)
uint8_t spi_slave_hs_tx_insert_idx
Arch independent mcu ( Micro Controller Unit ) utilities.
#define SPI_SLAVE_HS_RX_BUFFER_SIZE
struct link_device device
Generic device interface.
static uint8_t spi_slave_hs_getch(struct spi_slave_hs *p)
uint8_t spi_slave_hs_tx_buffer[SPI_SLAVE_HS_TX_BUFFER_SIZE]
arch independent LED (Light Emitting Diodes) API
Highspeed SPI Slave Interface.
uint16_t spi_slave_hs_rx_insert_idx