From 1a27327b1632e733cc3abdb3b5133e65af7203c7 Mon Sep 17 00:00:00 2001 From: unknown <71151164+ZERICO2005@users.noreply.github.com> Date: Mon, 10 Jun 2024 19:47:36 -0600 Subject: [PATCH 1/3] Add macros/constants to sys/lcd.h and created sys/spi.h --- src/ce/include/sys/lcd.h | 32 +++++++++++- src/ce/include/sys/spi.h | 104 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 134 insertions(+), 2 deletions(-) create mode 100644 src/ce/include/sys/spi.h diff --git a/src/ce/include/sys/lcd.h b/src/ce/include/sys/lcd.h index 2ce432266..f59a50d96 100644 --- a/src/ce/include/sys/lcd.h +++ b/src/ce/include/sys/lcd.h @@ -29,6 +29,34 @@ extern "C" { /* @endcond */ /** LCD Control register */ #define lcd_Control (*(volatile uint24_t*)0xE30018) +/** LCD RGB/BGR and Bits per pixel */ +#define lcd_VideoMode (*(volatile uint16_t*)0xE30018) +#define LCD_RGB1bit (0x821) /**< RGB 1bit indexed color */ +#define LCD_RGB2bit (0x823) /**< RGB 2bit indexed color */ +#define LCD_RGB4bit (0x825) /**< RGB 4bit indexed color */ +#define LCD_RGB8bit (0x827) /**< RGB 8bit indexed color */ +#define LCD_RGB1555 (0x829) /**< RGB 1555 16bit */ +#define LCD_RGB565 (0x82D) /**< RGB 565 16bit */ +#define LCD_RGB444 (0x82F) /**< RGB 444 16bit */ +#define LCD_RGB16bit (LCD_RGB565) /**< TI-OS Default */ +#define LCD_BGR1bit (0x921) /**< BGR 1bit indexed color */ +#define LCD_BGR2bit (0x923) /**< BGR 2bit indexed color */ +#define LCD_BGR4bit (0x925) /**< BGR 4bit indexed color */ +#define LCD_BGR8bit (0x927) /**< BGR 8bit indexed color */ +#define LCD_BGR1555 (0x929) /**< BGR 1555 16bit */ +#define LCD_BGR565 (0x92D) /**< BGR 565 16bit */ +#define LCD_BGR444 (0x92F) /**< BGR 444 16bit */ +#define LCD_BGR16bit (LCD_BGR565) /**< TI-OS Default */ +/** LCD Bits per pixel */ +#define lcd_VideoBPP (*(volatile uint8_t*)0xE30018) +#define LCD_INDEXED1 (0x21) /**< 1bit indexed color */ +#define LCD_INDEXED2 (0x23) /**< 2bit indexed color */ +#define LCD_INDEXED4 (0x25) /**< 4bit indexed color */ +#define LCD_INDEXED8 (0x27) /**< 8bit indexed color */ +#define LCD_COLOR1555 (0x29) /**< 1555 16bit */ +#define LCD_COLOR565 (0x2D) /**< 565 16bit */ +#define LCD_COLOR444 (0x2F) /**< 444 16bit */ +#define LCD_COLOR16 (LCD_COLOR565) /**< TI-OS Default */ /* @cond */ #define lcd_EnableInt (*(volatile uint8_t*)0xE3001C) #define lcd_IntStatus (*(volatile uint8_t*)0xE30020) @@ -42,8 +70,8 @@ extern "C" { /** LCD palette registers, 512 bytes */ #define lcd_Palette ((uint16_t*)0xE30200) /* @cond */ -#define lcd_CrsrImageLen32 256 -#define lcd_CrsrImageLen64 1024 +#define lcd_CrsrImageLen32 (256) +#define lcd_CrsrImageLen64 (1024) #define lcd_CrsrImage ((uint8_t*)0xE30800) #define lcd_CrsrCtrl (*(volatile uint8_t*)0xE30C00) #define lcd_CrsrConfig (*(volatile uint8_t*)0xE30C04) diff --git a/src/ce/include/sys/spi.h b/src/ce/include/sys/spi.h new file mode 100644 index 000000000..c04349c39 --- /dev/null +++ b/src/ce/include/sys/spi.h @@ -0,0 +1,104 @@ +/** + * @file + * @authors + * @brief FTSSP010 SPI controller define file + */ + +#ifndef SYS_SPI_H +#define SYS_SPI_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* @cond */ +#define spi_ControlRegister0 ((volatile void*)0xF80000) +#define spi_ControlRegister1 ((volatile void*)0xF80004) +#define spi_ControlRegister2 ((volatile void*)0xF80008) +#define spi_StatusBits ((const volatile void*)0xF8000C) +#define spi_InterruptControl ((volatile void*)0xF80010) +#define spi_InterruptStatus ((const volatile void*)0xF80014) +#define spi_FIFO ((volatile void*)0xF80018) +#define spi_InsideReservedRange ((volatile void*)0xF8001C) +#define spi_Revision ((const volatile void*)0xF80060) +#define spi_Features (*(const volatile uint32_t*)0xF80064) +/* @endcond */ + +/** + * In order to reliably use the LCD interface, the + * boot_InitializeHardware routine should be called at the start of a program + * to select the LCD interface and reset its configuration to the default. + */ +#define boot_InitializeHardware() ((void(*)(void))0x384)(); + +/** + * Sends a Command to the SPI controller using the 9bit FIFO protocol. + * + * @param[in] x 8bit parameter. + */ +#define SPI_COMMAND(x) \ +do { \ + *(volatile uint8_t*)spi_FIFO = ((x) >> 6) & 0b111; \ + *(volatile uint8_t*)spi_FIFO = ((x) >> 3) & 0b111; \ + *(volatile uint8_t*)spi_FIFO = (x) & 0b111; \ + *(volatile uint8_t*)spi_ControlRegister2 = 0x1; \ + while ( ((const volatile uint8_t*)spi_StatusBits)[1] & 0xF0) {}; \ + while ( ((const volatile uint8_t*)spi_StatusBits)[0] & (1 << 2)) {}; \ + *(volatile uint8_t*)spi_ControlRegister2 = 0x0; \ +} while(0) + +/** + * Sends a Parameter to the SPI controller using the 9bit FIFO protocol. + * + * @param[in] x 8bit parameter. + */ +#define SPI_PARAMETER(x) \ +do { \ + *(volatile uint8_t*)spi_FIFO = (((x) >> 6) & 0b111) | 0b100; \ + *(volatile uint8_t*)spi_FIFO = ((x) >> 3) & 0b111; \ + *(volatile uint8_t*)spi_FIFO = (x) & 0b111; \ + *(volatile uint8_t*)spi_ControlRegister2 = 0x1; \ + while ( ((const volatile uint8_t*)spi_StatusBits)[1] & 0xF0) {}; \ + while ( ((const volatile uint8_t*)spi_StatusBits)[0] & (1 << 2)) {}; \ + *(volatile uint8_t*)spi_ControlRegister2 = 0x0; \ +} while(0) + +/** @todo Implement vsync */ +#define SPI_UNINVERT_COLORS() SPI_COMMAND(0x20) + +/** @todo Implement vsync */ +#define SPI_INVERT_COLORS() SPI_COMMAND(0x21) + +/** Sets the LCD to BGR Row-Major mode (TI-OS default) */ +#define SPI_ROW_MAJOR() \ +do { \ + SPI_COMMAND(0x36); \ + SPI_PARAMETER(0b00001000); \ + SPI_COMMAND(0x2A); \ + SPI_PARAMETER(0x00); SPI_PARAMETER(0x00); \ + SPI_PARAMETER(0x01); SPI_PARAMETER(0x3F); \ + SPI_COMMAND(0x2B); \ + SPI_PARAMETER(0x00); SPI_PARAMETER(0x00); \ + SPI_PARAMETER(0x00); SPI_PARAMETER(0xEF); \ +} while(0) + +/** Sets the LCD to BGR Column-Major mode */ +#define SPI_COLUMN_MAJOR() \ +do { \ + SPI_COMMAND(0x36); \ + SPI_PARAMETER(0b00101000); \ + SPI_COMMAND(0x2A); \ + SPI_PARAMETER(0x00); SPI_PARAMETER(0x00); \ + SPI_PARAMETER(0x00); SPI_PARAMETER(0xEF); \ + SPI_COMMAND(0x2B); \ + SPI_PARAMETER(0x00); SPI_PARAMETER(0x00); \ + SPI_PARAMETER(0x01); SPI_PARAMETER(0x3F); \ +} while(0) + +#ifdef __cplusplus +} +#endif + +#endif \ No newline at end of file From 2fa35133c362eccca41c9ad1b59734f40e3e98f7 Mon Sep 17 00:00:00 2001 From: unknown <71151164+ZERICO2005@users.noreply.github.com> Date: Mon, 10 Jun 2024 20:30:02 -0600 Subject: [PATCH 2/3] Fix doxygen documentation --- src/ce/include/sys/lcd.h | 2 +- src/ce/include/sys/spi.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ce/include/sys/lcd.h b/src/ce/include/sys/lcd.h index f59a50d96..1e2b16281 100644 --- a/src/ce/include/sys/lcd.h +++ b/src/ce/include/sys/lcd.h @@ -29,6 +29,7 @@ extern "C" { /* @endcond */ /** LCD Control register */ #define lcd_Control (*(volatile uint24_t*)0xE30018) +/* @cond */ /** LCD RGB/BGR and Bits per pixel */ #define lcd_VideoMode (*(volatile uint16_t*)0xE30018) #define LCD_RGB1bit (0x821) /**< RGB 1bit indexed color */ @@ -57,7 +58,6 @@ extern "C" { #define LCD_COLOR565 (0x2D) /**< 565 16bit */ #define LCD_COLOR444 (0x2F) /**< 444 16bit */ #define LCD_COLOR16 (LCD_COLOR565) /**< TI-OS Default */ -/* @cond */ #define lcd_EnableInt (*(volatile uint8_t*)0xE3001C) #define lcd_IntStatus (*(volatile uint8_t*)0xE30020) #define lcd_IntStatusMasked (*(volatile uint8_t*)0xE30024) diff --git a/src/ce/include/sys/spi.h b/src/ce/include/sys/spi.h index c04349c39..62a7a76f9 100644 --- a/src/ce/include/sys/spi.h +++ b/src/ce/include/sys/spi.h @@ -1,7 +1,7 @@ /** * @file * @authors - * @brief FTSSP010 SPI controller define file + * @brief CE SPI controller define file */ #ifndef SYS_SPI_H @@ -36,7 +36,7 @@ extern "C" { /** * Sends a Command to the SPI controller using the 9bit FIFO protocol. * - * @param[in] x 8bit parameter. + * @param[in] x 8bit command. */ #define SPI_COMMAND(x) \ do { \ From ae471c4fd4cc89649340d4c0ba26c7e311b5f631 Mon Sep 17 00:00:00 2001 From: unknown <71151164+ZERICO2005@users.noreply.github.com> Date: Wed, 15 Jan 2025 16:05:15 -0700 Subject: [PATCH 3/3] Refactored sys/lcd.h and sys/spi.h --- src/ce/include/sys/lcd.h | 74 ++++++++++++-------- src/ce/include/sys/spi.h | 142 +++++++++++++++++---------------------- 2 files changed, 110 insertions(+), 106 deletions(-) diff --git a/src/ce/include/sys/lcd.h b/src/ce/include/sys/lcd.h index 1e2b16281..9a2dabb2d 100644 --- a/src/ce/include/sys/lcd.h +++ b/src/ce/include/sys/lcd.h @@ -30,34 +30,7 @@ extern "C" { /** LCD Control register */ #define lcd_Control (*(volatile uint24_t*)0xE30018) /* @cond */ -/** LCD RGB/BGR and Bits per pixel */ -#define lcd_VideoMode (*(volatile uint16_t*)0xE30018) -#define LCD_RGB1bit (0x821) /**< RGB 1bit indexed color */ -#define LCD_RGB2bit (0x823) /**< RGB 2bit indexed color */ -#define LCD_RGB4bit (0x825) /**< RGB 4bit indexed color */ -#define LCD_RGB8bit (0x827) /**< RGB 8bit indexed color */ -#define LCD_RGB1555 (0x829) /**< RGB 1555 16bit */ -#define LCD_RGB565 (0x82D) /**< RGB 565 16bit */ -#define LCD_RGB444 (0x82F) /**< RGB 444 16bit */ -#define LCD_RGB16bit (LCD_RGB565) /**< TI-OS Default */ -#define LCD_BGR1bit (0x921) /**< BGR 1bit indexed color */ -#define LCD_BGR2bit (0x923) /**< BGR 2bit indexed color */ -#define LCD_BGR4bit (0x925) /**< BGR 4bit indexed color */ -#define LCD_BGR8bit (0x927) /**< BGR 8bit indexed color */ -#define LCD_BGR1555 (0x929) /**< BGR 1555 16bit */ -#define LCD_BGR565 (0x92D) /**< BGR 565 16bit */ -#define LCD_BGR444 (0x92F) /**< BGR 444 16bit */ -#define LCD_BGR16bit (LCD_BGR565) /**< TI-OS Default */ /** LCD Bits per pixel */ -#define lcd_VideoBPP (*(volatile uint8_t*)0xE30018) -#define LCD_INDEXED1 (0x21) /**< 1bit indexed color */ -#define LCD_INDEXED2 (0x23) /**< 2bit indexed color */ -#define LCD_INDEXED4 (0x25) /**< 4bit indexed color */ -#define LCD_INDEXED8 (0x27) /**< 8bit indexed color */ -#define LCD_COLOR1555 (0x29) /**< 1555 16bit */ -#define LCD_COLOR565 (0x2D) /**< 565 16bit */ -#define LCD_COLOR444 (0x2F) /**< 444 16bit */ -#define LCD_COLOR16 (LCD_COLOR565) /**< TI-OS Default */ #define lcd_EnableInt (*(volatile uint8_t*)0xE3001C) #define lcd_IntStatus (*(volatile uint8_t*)0xE30020) #define lcd_IntStatusMasked (*(volatile uint8_t*)0xE30024) @@ -100,6 +73,53 @@ extern "C" { /** Total size of VRAM in bytes */ #define LCD_SIZE (LCD_WIDTH*LCD_HEIGHT*2) +#define LCD_BGR (0x100) +#define LCD_RGB (0x000) + +#define LCD_INDEXED1 (0x21) /**< 1bit indexed color */ +#define LCD_INDEXED2 (0x23) /**< 2bit indexed color */ +#define LCD_INDEXED4 (0x25) /**< 4bit indexed color */ +#define LCD_INDEXED8 (0x27) /**< 8bit indexed color */ +#define LCD_COLOR1555 (0x29) /**< 1555 16bit */ +#define LCD_COLOR565 (0x2D) /**< 565 16bit */ +#define LCD_COLOR444 (0x2F) /**< 444 16bit */ +#define LCD_COLOR16 (LCD_COLOR565) /**< TI-OS Default */ + +#define LCD_BGR1bit (LCD_INDEXED1 | LCD_BGR) /**< BGR 1bit indexed color */ +#define LCD_BGR2bit (LCD_INDEXED2 | LCD_BGR) /**< BGR 2bit indexed color */ +#define LCD_BGR4bit (LCD_INDEXED4 | LCD_BGR) /**< BGR 4bit indexed color */ +#define LCD_BGR8bit (LCD_INDEXED8 | LCD_BGR) /**< BGR 8bit indexed color */ +#define LCD_BGR1555 (LCD_COLOR1555 | LCD_BGR) /**< BGR 1555 16bit */ +#define LCD_BGR565 (LCD_COLOR565 | LCD_BGR) /**< BGR 565 16bit */ +#define LCD_BGR444 (LCD_COLOR444 | LCD_BGR) /**< BGR 444 16bit */ +#define LCD_BGR16bit (LCD_COLOR16 | LCD_BGR) /**< BGR 565 16bit (TI-OS Default) */ + +#define LCD_RGB1bit (LCD_INDEXED1 | LCD_RGB) /**< RGB 1bit indexed color */ +#define LCD_RGB2bit (LCD_INDEXED2 | LCD_RGB) /**< RGB 2bit indexed color */ +#define LCD_RGB4bit (LCD_INDEXED4 | LCD_RGB) /**< RGB 4bit indexed color */ +#define LCD_RGB8bit (LCD_INDEXED8 | LCD_RGB) /**< RGB 8bit indexed color */ +#define LCD_RGB1555 (LCD_COLOR1555 | LCD_RGB) /**< RGB 1555 16bit */ +#define LCD_RGB565 (LCD_COLOR565 | LCD_RGB) /**< RGB 565 16bit */ +#define LCD_RGB444 (LCD_COLOR444 | LCD_RGB) /**< RGB 444 16bit */ +#define LCD_RGB16bit (LCD_COLOR16 | LCD_RGB) /**< RGB 565 16bit */ + +/** + * Sets the color order (RGB/BGR) and the bits per pixel on the LCD without + * modifying other bits. + */ +#define lcd_SetVideoMode(VideoMode) \ +do { \ + lcd_Control = (lcd_Control & ~0x10E) | ((VideoMode) & 0x10E); \ +} while(0) + +/** + * Resets lcd_Control to TI-OS defaults + */ +#define lcd_ResetVideoMode() \ +do { \ + lcd_Control = LCD_BGR16bit; \ +} while(0) + #ifdef __cplusplus } #endif diff --git a/src/ce/include/sys/spi.h b/src/ce/include/sys/spi.h index 62a7a76f9..2618d5bba 100644 --- a/src/ce/include/sys/spi.h +++ b/src/ce/include/sys/spi.h @@ -14,91 +14,75 @@ extern "C" { #endif /* @cond */ -#define spi_ControlRegister0 ((volatile void*)0xF80000) -#define spi_ControlRegister1 ((volatile void*)0xF80004) -#define spi_ControlRegister2 ((volatile void*)0xF80008) -#define spi_StatusBits ((const volatile void*)0xF8000C) -#define spi_InterruptControl ((volatile void*)0xF80010) -#define spi_InterruptStatus ((const volatile void*)0xF80014) -#define spi_FIFO ((volatile void*)0xF80018) -#define spi_InsideReservedRange ((volatile void*)0xF8001C) -#define spi_Revision ((const volatile void*)0xF80060) -#define spi_Features (*(const volatile uint32_t*)0xF80064) +#define spi_ControlRegister0 ((volatile uint16_t*)0xF80000) +#define spi_ControlRegister1 ((volatile uint24_t*)0xF80004) +#define spi_ControlRegister2 ((volatile uint16_t*)0xF80008) + +#define spi_ClockDivider ((volatile uint16_t*)0xF80004) +#define spi_DataWidth ((volatile uint8_t*)0xF80006) +#define spi_PadWidth ((volatile uint8_t*)0xF80007) + +#define spi_StatusBits ((const volatile uint24_t*)0xF8000C) +#define spi_InterruptControl ((volatile uint24_t*)0xF80010) +#define spi_InterruptStatus ((const volatile uint8_t*)0xF80014) + +#define spi_Fifo8 ((volatile uint8_t*)0xF80018) +#define spi_Fifo16 ((volatile uint16_t*)0xF80018) +#define spi_Fifo24 ((volatile uint24_t*)0xF80018) +#define spi_Fifo32 ((volatile uint32_t*)0xF80018) + +#define spi_InsideReservedRange (*((const volatile uint32_t*)0xF8001C)) +#define spi_Revision (*((const volatile uint32_t*)0xF80060)) +#define spi_Features (*((const volatile uint32_t*)0xF80064)) /* @endcond */ -/** - * In order to reliably use the LCD interface, the - * boot_InitializeHardware routine should be called at the start of a program - * to select the LCD interface and reset its configuration to the default. - */ -#define boot_InitializeHardware() ((void(*)(void))0x384)(); +/* spi_ControlRegister0 */ -/** - * Sends a Command to the SPI controller using the 9bit FIFO protocol. - * - * @param[in] x 8bit command. - */ -#define SPI_COMMAND(x) \ -do { \ - *(volatile uint8_t*)spi_FIFO = ((x) >> 6) & 0b111; \ - *(volatile uint8_t*)spi_FIFO = ((x) >> 3) & 0b111; \ - *(volatile uint8_t*)spi_FIFO = (x) & 0b111; \ - *(volatile uint8_t*)spi_ControlRegister2 = 0x1; \ - while ( ((const volatile uint8_t*)spi_StatusBits)[1] & 0xF0) {}; \ - while ( ((const volatile uint8_t*)spi_StatusBits)[0] & (1 << 2)) {}; \ - *(volatile uint8_t*)spi_ControlRegister2 = 0x0; \ -} while(0) +#define SPI_CLOCK_POLARITY (1 << 0) +#define SPI_CLOCK_PHASE (1 << 1) +#define SPI_SLAVE (0 << 2) +#define SPI_MASTER (3 << 2) +#define SPI_SLAVE_MONO (0 << 2) +#define SPI_SLAVE_STEREO (1 << 2) +#define SPI_MASTER_MONO (2 << 2) +#define SPI_MASTER_STEREO (3 << 2) +#define SPI_OP_MODE (3 << 2) +#define SPI_FS_JUSTIFY (1 << 4) +#define SPI_FS_POLARITY (1 << 5) +#define SPI_LSB (1 << 6) +#define SPI_LOOP_BACK (1 << 7) +#define SPI_FS_DIST (3 << 8) +#define SPI_FLASH (1 << 11) +#define SPI_FR_FORMAT (1 << 12) -/** - * Sends a Parameter to the SPI controller using the 9bit FIFO protocol. - * - * @param[in] x 8bit parameter. - */ -#define SPI_PARAMETER(x) \ -do { \ - *(volatile uint8_t*)spi_FIFO = (((x) >> 6) & 0b111) | 0b100; \ - *(volatile uint8_t*)spi_FIFO = ((x) >> 3) & 0b111; \ - *(volatile uint8_t*)spi_FIFO = (x) & 0b111; \ - *(volatile uint8_t*)spi_ControlRegister2 = 0x1; \ - while ( ((const volatile uint8_t*)spi_StatusBits)[1] & 0xF0) {}; \ - while ( ((const volatile uint8_t*)spi_StatusBits)[0] & (1 << 2)) {}; \ - *(volatile uint8_t*)spi_ControlRegister2 = 0x0; \ -} while(0) - -/** @todo Implement vsync */ -#define SPI_UNINVERT_COLORS() SPI_COMMAND(0x20) - -/** @todo Implement vsync */ -#define SPI_INVERT_COLORS() SPI_COMMAND(0x21) - -/** Sets the LCD to BGR Row-Major mode (TI-OS default) */ -#define SPI_ROW_MAJOR() \ -do { \ - SPI_COMMAND(0x36); \ - SPI_PARAMETER(0b00001000); \ - SPI_COMMAND(0x2A); \ - SPI_PARAMETER(0x00); SPI_PARAMETER(0x00); \ - SPI_PARAMETER(0x01); SPI_PARAMETER(0x3F); \ - SPI_COMMAND(0x2B); \ - SPI_PARAMETER(0x00); SPI_PARAMETER(0x00); \ - SPI_PARAMETER(0x00); SPI_PARAMETER(0xEF); \ -} while(0) - -/** Sets the LCD to BGR Column-Major mode */ -#define SPI_COLUMN_MAJOR() \ -do { \ - SPI_COMMAND(0x36); \ - SPI_PARAMETER(0b00101000); \ - SPI_COMMAND(0x2A); \ - SPI_PARAMETER(0x00); SPI_PARAMETER(0x00); \ - SPI_PARAMETER(0x00); SPI_PARAMETER(0xEF); \ - SPI_COMMAND(0x2B); \ - SPI_PARAMETER(0x00); SPI_PARAMETER(0x00); \ - SPI_PARAMETER(0x01); SPI_PARAMETER(0x3F); \ -} while(0) +/* spi_ControlRegister1 */ + +#define SPI_CLOCK_DIV (0xFFFF << 0) +#define SPI_DATA_WIDTH (0x1F << 0) +#define SPI_PAD_WIDTH (0xFF << 0) + +/* spi_ControlRegister2 */ + +#define SPI_CHIP_ENABLE (1 << 0) +#define SPI_TX_DATA_OUT_ENABLE (1 << 1) +#define SPI_RX_CLEAR (1 << 2) +#define SPI_TX_CLEAR (1 << 3) +#define SPI_CHIP_RESET (1 << 6) +#define SPI_RX_ENABLE (1 << 7) +#define SPI_TX_ENABLE (1 << 8) +#define SPI_FS (1 << 9) +#define SPI_CHIP_SELECT (3 << 10) + +/* spi_Fifo */ + +#define SPI_RX_FIFO_FULL (1 << 0) +#define SPI_TX_FIFO_NOT_FULL (1 << 1) +#define SPI_CHIP_BUSY (1 << 2) +#define SPI_RX_FIFO_BYTES (0x1F << 4) +#define SPI_TX_FIFO_BYTES (0x1F << 12) #ifdef __cplusplus } #endif -#endif \ No newline at end of file +#endif