Go to the documentation of this file.
27#ifndef _SPI_SPECIFICS_
28#define _SPI_SPECIFICS_
34#include "mcu_definitions.h"
37#if defined(__MIKROC_AI_FOR_PIC__) || defined(__MIKROC_AI_FOR_DSPIC__) || \
38 defined(__MIKROC_AI_FOR_PIC32__)
40#ifdef __MIKROC_AI_FOR_PIC__
42#elif defined(__MIKROC_AI_FOR_PIC32__)
44#elif defined(__MIKROC_AI_FOR_DSPIC__)
45 #ifdef HAL_LL_SPI1_CONTROL_REG_ADDRESS
52#ifdef SAMPLE_REG_CASE_1
53 #ifdef __MIKROC_AI_FOR_PIC32__
54 #define SAMPLE_REG_ADDRESS(index) HAL_LL_SPI ## index ## CON_ADDRESS
55 #elif defined (__MIKROC_AI_FOR_PIC__)
56 #define SAMPLE_REG_ADDRESS(index) HAL_LL_SPI ## index ## CON1_ADDRESS
58 #define SAMPLE_REG_ADDRESS(index) HAL_LL_SPI ## index ## _CONTROL_REG_ADDRESS
61 #define SAMPLE_REG_ADDRESS(index) HAL_LL_SSP ## index ## STAT_ADDRESS
64#if defined(SPI_MODULE) || defined(SPI_MODULE_1)
65 #define SET_SPI_DATA_SAMPLE_MIDDLE1 clear_reg_bit(SAMPLE_REG_ADDRESS(1), BIT_INDEX);
66 #define SET_SPI_DATA_SAMPLE_EDGE1 set_reg_bit(SAMPLE_REG_ADDRESS(1), BIT_INDEX);
68 #define SET_SPI_DATA_SAMPLE_MIDDLE1
69 #define SET_SPI_DATA_SAMPLE_EDGE1
73 #define SET_SPI_DATA_SAMPLE_MIDDLE2 clear_reg_bit(SAMPLE_REG_ADDRESS(2), BIT_INDEX);
74 #define SET_SPI_DATA_SAMPLE_EDGE2 set_reg_bit(SAMPLE_REG_ADDRESS(2), BIT_INDEX);
76 #define SET_SPI_DATA_SAMPLE_MIDDLE2
77 #define SET_SPI_DATA_SAMPLE_EDGE2
81 #define SET_SPI_DATA_SAMPLE_MIDDLE3 clear_reg_bit(SAMPLE_REG_ADDRESS(3), BIT_INDEX);
82 #define SET_SPI_DATA_SAMPLE_EDGE3 set_reg_bit(SAMPLE_REG_ADDRESS(3), BIT_INDEX);
84 #define SET_SPI_DATA_SAMPLE_MIDDLE3
85 #define SET_SPI_DATA_SAMPLE_EDGE3
89 #define SET_SPI_DATA_SAMPLE_MIDDLE4 clear_reg_bit(SAMPLE_REG_ADDRESS(4), BIT_INDEX);
90 #define SET_SPI_DATA_SAMPLE_EDGE4 set_reg_bit(SAMPLE_REG_ADDRESS(4), BIT_INDEX);
92 #define SET_SPI_DATA_SAMPLE_MIDDLE4
93 #define SET_SPI_DATA_SAMPLE_EDGE4
97 #define SET_SPI_DATA_SAMPLE_MIDDLE5 clear_reg_bit(SAMPLE_REG_ADDRESS(5), BIT_INDEX);
98 #define SET_SPI_DATA_SAMPLE_EDGE5 set_reg_bit(SAMPLE_REG_ADDRESS(5), BIT_INDEX);
100 #define SET_SPI_DATA_SAMPLE_MIDDLE5
101 #define SET_SPI_DATA_SAMPLE_EDGE5
105 #define SET_SPI_DATA_SAMPLE_MIDDLE6 clear_reg_bit(SAMPLE_REG_ADDRESS(6), BIT_INDEX);
106 #define SET_SPI_DATA_SAMPLE_EDGE6 set_reg_bit(SAMPLE_REG_ADDRESS(6), BIT_INDEX);
108 #define SET_SPI_DATA_SAMPLE_MIDDLE6
109 #define SET_SPI_DATA_SAMPLE_EDGE6
113#define SET_SPI_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE1 SET_SPI_DATA_SAMPLE_MIDDLE2 \
114 SET_SPI_DATA_SAMPLE_MIDDLE3 SET_SPI_DATA_SAMPLE_MIDDLE4 \
115 SET_SPI_DATA_SAMPLE_MIDDLE5 SET_SPI_DATA_SAMPLE_MIDDLE6
116#define SET_SPI_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE1 SET_SPI_DATA_SAMPLE_EDGE2 \
117 SET_SPI_DATA_SAMPLE_EDGE3 SET_SPI_DATA_SAMPLE_EDGE4 \
118 SET_SPI_DATA_SAMPLE_EDGE5 SET_SPI_DATA_SAMPLE_EDGE6
120 #define SET_SPI_DATA_SAMPLE_MIDDLE
121 #define SET_SPI_DATA_SAMPLE_EDGE