Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00036 #ifndef HAL_SPI_H__
00037 #define HAL_SPI_H__
00038
00039 #include <stdint.h>
00040 #include <stdbool.h>
00041
00045 typedef enum
00046 {
00047 SPI_CLK_DIV2,
00048 SPI_CLK_DIV4,
00049 SPI_CLK_DIV8,
00050 SPI_CLK_DIV16,
00051 SPI_CLK_DIV32,
00052 SPI_CLK_DIV64,
00053 SPI_CLK_DIV128
00054 } hal_spi_clkdivider_t;
00055
00059 typedef enum {
00060 HAL_SPI_LSB_MSB,
00061 HAL_SPI_MSB_LSB
00062 } hal_spi_byte_order_t;
00063
00067 typedef enum {
00068 HAL_SPI_MODE_0,
00069 HAL_SPI_MODE_1,
00070 HAL_SPI_MODE_2,
00071 HAL_SPI_MODE_3
00072 } hal_spi_mode_t;
00073
00074
00077 void hal_spi_master_init(hal_spi_clkdivider_t ck, hal_spi_mode_t mode, hal_spi_byte_order_t bo);
00078
00086 uint8_t hal_spi_master_read_write(uint8_t pLoad);
00087
00088
00089 #endif // HAL_SPI_H__
00090