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
#define SPI1_VIC_SLOT
default initial settings
put_byte_t put_byte
put one byte
uint8_t(* get_byte_t)(void *)
check_free_space_t check_free_space
check if transmit buffer is not full
uint8_t spi_slave_hs_rx_buffer[SPI_SLAVE_HS_RX_BUFFER_SIZE]
void spi_slave_hs_init(void)
void * periph
pointer to parent implementation
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.
#define SPI_SLAVE_HS_TX_BUFFER_SIZE
get_byte_t get_byte
get a new char
static void SSP_ISR(void)
int(* char_available_t)(void *)
uint8_t spi_slave_hs_tx_extract_idx
uint8_t spi_slave_hs_tx_insert_idx
void(* put_byte_t)(void *, uint8_t)
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]
void(* send_message_t)(void *)
static void spi_slave_hs_send(struct spi_slave_hs *p)
arch independent LED (Light Emitting Diodes) API
int(* check_free_space_t)(void *, uint8_t)
Function pointers definition.
char_available_t char_available
check if a new character is available
Highspeed SPI Slave Interface.
static int spi_slave_hs_check_free_space(struct spi_slave_hs *p, uint8_t len)
uint16_t spi_slave_hs_rx_insert_idx
send_message_t send_message
send completed buffer
static void spi_slave_hs_transmit(struct spi_slave_hs *p, uint8_t byte)