Trident IoT SDK
 
Loading...
Searching...
No Matches
T32CZ20_spi.h
Go to the documentation of this file.
1
16
17#ifndef T32CZ20_SPI_H_
18#define T32CZ20_SPI_H_
19
20#include "tr_hal_platform.h"
21
22
28
29
30#define TR_HAL_NUM_SPI 2
31
32// SPI IDs
33typedef enum
34{
37
39
75
76// this is used to set the SPI mode
77// this enum uses the same values as the chip registers (section 19.4)
85
86
87// used to set the data transfer amount - 8 bits or 32 bits
88// this enum uses the same values as the chip registers (section 19.4)
95
96
97// FIFO sizes - this is a chip limitation
98#define TR_HAL_SPI_TX_FIFO_SIZE 32
99#define TR_HAL_SPI_RX_FIFO_SIZE 32
100
101// for setting the peripheral clock
102#define SPI0_CLK_BIT 20
103#define SPI1_CLK_BIT 21
104#define SPI0_CLK_ENABLE_VALUE 0x100000
105#define SPI1_CLK_ENABLE_VALUE 0x200000
106
112
113#define SPI_INVALID_PIN 0xFF
114
115// TODO: pick defaults here, these were just picked to avoid LEDs and buttons
116#define DEFAULT_SPI_CLK_PIN 22
117#define DEFAULT_SPI_CS_PIN 23
118#define DEFAULT_SPI_IO_0_PIN 28
119#define DEFAULT_SPI_IO_1_PIN 29
120
121
133#ifdef QSPI0_SECURE_EN
134 #define CHIP_MEMORY_MAP_SPI0_BASE (0x50020000UL)
135#else
136 #define CHIP_MEMORY_MAP_SPI0_BASE (0x40020000UL)
137#endif //QSPI0_SECURE_EN
138
139#ifdef QSPI0_SECURE_EN
140 #define CHIP_MEMORY_MAP_SPI1_BASE (0x50021000UL)
141#else
142 #define CHIP_MEMORY_MAP_SPI1_BASE (0x40021000UL)
143#endif //QSPI1_SECURE_EN
144
145
146
150typedef struct
151{
152 // when sending data, write it here
153 __IO uint32_t spi_tx_data; // 0x00
154
155 // received data comes in from this register
156 __I uint32_t spi_rx_data; // 0x04
157
158 // configuration of SPI peripheral, incl Controller/Peripheral setting
159 __IO uint32_t spi_control; // 0x08
160 __IO uint32_t spi_aux_control; // 0x0C
161
162 // in Controller mode, configure the CS pins
163 __IO uint32_t peripheral_select; // 0x10
164
165 // this is used to change the Controller's clock to a different frequency
166 // normally it is 32 MHz, but this can bring it down to 16 Mhz, 8, 5.33, 4, etc
167 __IO uint32_t controller_clock_divider; // 0x14
168
169 // TODO: this is not documented, look into it
170 __IO uint32_t epd_function; // 0x18
171
172 // if running as SPI Controller: configure delay
173 __IO uint32_t controller_delay_setting; // 0x1C
174
175 // interrupt enable/status/clear
176 __IO uint32_t interrupt_enable; // 0x20
177 __I uint32_t interrupt_status; // 0x24
178 __IO uint32_t interrupt_clear; // 0x28
179
180 // enable and disable the SPI peripheral
181 __IO uint32_t spi_enable_disable; // 0x2C
182
183 // status of SPI peripheral
184 __I uint32_t spi_status; // 0x30
185
186 // can read the current levels of the TX and RX FIFOs
187 __I uint32_t tx_fifo_current_level; // 0x34
188 __I uint32_t rx_fifo_current_level; // 0x38
189
190 // reserved space
191 __I uint32_t reserved_1; // 0x3C
192
193 // setup for DMA receive
194 __IO uint32_t DMA_rx_buffer_addr; // 0x40
195 __IO uint32_t DMA_rx_buffer_len; // 0x44
196
197 // setup for DMA transmit
198 __IO uint32_t DMA_tx_buffer_addr; // 0x48
199 __IO uint32_t DMA_tx_buffer_len; // 0x4C
200
201 __I uint32_t DMA_rx_xfer_len_remaining; // 0x50
202 __I uint32_t DMA_tx_xfer_len_remaining; // 0x54
203
204 // using DMA - interrupt enable, status, and DMA RX start and DMA TX start
205 __IO uint32_t DMA_interrupt_enable; // 0x58
206 __IO uint32_t DMA_interrupt_status; // 0x5C
207 __IO uint32_t DMA_rx_enable; // 0x60
208 __IO uint32_t DMA_tx_enable; // 0x64
209
211
212
213// *****************************************************************
214// this orients the SPIx_REGISTERS struct with the correct addresses
215// so referencing a field will now read/write the correct SPI
216// register chip address
217#define SPI0_REGISTERS ((SPI_REGISTERS_T *) CHIP_MEMORY_MAP_SPI0_BASE)
218#define SPI1_REGISTERS ((SPI_REGISTERS_T *) CHIP_MEMORY_MAP_SPI1_BASE)
219
220// *****************************************************************
221// helper defines for SPI STATUS REGISTER (0x30)
222#define SPI_STATUS_TX_IN_PROGRESS 0x01
223#define SPI_STATUS_TX_FIFO_EMPTY 0x04
224#define SPI_STATUS_TX_FIFO_FULL 0x10
225#define SPI_STATUS_RX_FIFO_EMPTY 0x20
226#define SPI_STATUS_RX_FIFO_FULL 0x80
227
228
229// *****************************************************************
230// helper defines for SPI CONTROL REGISTER (0x08)
231
232// bit 0 = set=controller, clear=peripheral
233#define SPI_CONTROL_REG_SET_AS_CONTROLLER 0x01
234#define SPI_CONTROL_REG_SET_AS_PERIPHERAL 0x00
235// bit 1 = cpha (clock phase)
236#define SPI_CONTROL_REG_CPHA_HIGH 0x02
237#define SPI_CONTROL_REG_CPHA_LOW 0x00
238// bit 2 = cpol (clock polarity)
239#define SPI_CONTROL_REG_CPOL_HIGH 0x04
240#define SPI_CONTROL_REG_CPOL_LOW 0x00
241// bit 3 = sdata0or1, set to 0 for controller and 1 for peripheral
242#define SPI_CONTROL_REG_SDATA_FOR_CROSSED 0x08
243// bit 4 = byte swap
244#define SPI_CONTROL_REG_BYTE_SWAP 0x10
245// bit 5 = MSB first
246#define SPI_CONTROL_REG_MSB_FIRST 0x20
247// bit 6 = continuous transfer
248#define SPI_CONTROL_REG_CONTINUOUS_TRANSFER 0x40
249// bit 7 = reserved
250
251// TODO: handle these functions
252// bit 8 - pre delay enable
253// bit 9 - inter delay enable
254// bit 10 - post delay enable
255// bit 14-15 = txf_th
256
257
258// *****************************************************************
259// helper defines for SPI AUX CONTROL REGISTER (0x0C)
260
261// bits 0,1 are SPI MODE
262#define SPI_AUX_CTRL_REG_MODE_MASK 0x03
263
264// bit 2 = setting this bit prevents transmitting
265#define SPI_AUX_CTRL_REG_PREVENT_TX_BIT 0x04
266
267// bit 3 = setting this bit prevents receiving
268// this can be useful to set when transmitting, so you don't receive
269// the bytes you just sent
270#define SPI_AUX_CTRL_REG_PREVENT_RX_BIT 0x08
271
272// bits 4,5,6 = bitsize
273#define SPI_AUX_CTRL_REG_BITSIZE_MASK 0x70
274
275// used to extend the transfer, like if using dual SPI mode and
276// wanting the Controller to be able to receive
277#define SPI_AUX_CTRL_REG_TRANSFER_EXTEND 0x80
278
279
280// *****************************************************************
281// helper defines for SPI INTERRUPT ENABLE REGISTER (0x20)
282// and SPI INTERRUPT STATUS REGISTER (0x24)
283// and SPI INTERRUPT CLEAR REGISTER (0x28)
284#define SPI_INTERRUPT_TX_EMPTY 0x01
285#define SPI_INTERRUPT_RX_FULL 0x08
286#define SPI_INTERRUPT_TRANSFER_DONE 0x10
287#define SPI_INTERRUPT_RX_NOT_EMPTY 0x20
288// all and none
289#define SPI_INTERRUPT_ALL 0x39
290#define SPI_INTERRUPT_NONE 0x00
291
292// *****************************************************************
293// helper defines for SPI PERIPHERAL SELECT REGISTER (0x10)
294// which CS line to select
295#define SPI_PERIPH_SELECT_NONE 0x00
296#define SPI_PERIPH_SELECT_0 0x01
297#define SPI_PERIPH_SELECT_1 0x02
298#define SPI_PERIPH_SELECT_2 0x04
299#define SPI_PERIPH_SELECT_3 0x08
300// polarity for CS lines
301#define SPI_PERIPH_SEL_0_ACTIVE_HIGH 0x100
302#define SPI_PERIPH_SEL_0_ACTIVE_LOW 0x000
303#define SPI_PERIPH_SEL_1_ACTIVE_HIGH 0x200
304#define SPI_PERIPH_SEL_1_ACTIVE_LOW 0x000
305#define SPI_PERIPH_SEL_2_ACTIVE_HIGH 0x400
306#define SPI_PERIPH_SEL_2_ACTIVE_LOW 0x000
307#define SPI_PERIPH_SEL_3_ACTIVE_HIGH 0x800
308#define SPI_PERIPH_SEL_3_ACTIVE_LOW 0x000
309// if CS is set for manual mode, this controls it
310#define SPI_PERIPH_SEL_0_SET_HIGH 0x10000
311#define SPI_PERIPH_SEL_0_SET_LOW 0x00000
312#define SPI_PERIPH_SEL_1_SET_HIGH 0x20000
313#define SPI_PERIPH_SEL_1_SET_LOW 0x00000
314#define SPI_PERIPH_SEL_2_SET_HIGH 0x40000
315#define SPI_PERIPH_SEL_2_SET_LOW 0x00000
316#define SPI_PERIPH_SEL_3_SET_HIGH 0x80000
317#define SPI_PERIPH_SEL_3_SET_LOW 0x00000
318// these set CS for manual mode
319#define SPI_PERIPH_SEL_0_MANUAL_MODE 0x1000000
320#define SPI_PERIPH_SEL_1_MANUAL_MODE 0x2000000
321#define SPI_PERIPH_SEL_2_MANUAL_MODE 0x4000000
322#define SPI_PERIPH_SEL_3_MANUAL_MODE 0x8000000
323
324
325
326// *****************************************************************
327// helper defines for SPI ENABLE DISABLE REGISTER (0x2C)
328#define SPI_ENABLE 0x01
329#define SPI_DISABLE 0x00
330
331// *****************************************************************
332// helper enums for SPI CONTROLLER CLOCK REGISTER (0x14)
333// note: this register has two fields that determine clock
334// the first field can be OFF (32 MHZ) or ON (bit 8 = 0x100 when set)
335// If ON then the 2nd field determines the clock by creating a divider
336// for the 32 MHz clock. It uses bits 0 to 7 (a full byte) to determine
337// the divider like this: ((setting +1) *2)
338// meaning 0 is 0 +1=1 *2 = 2 --> 32 MHz / 2 = 16 MHz
339// meaning 1 is 1 +1=2 *2 = 4 --> 32 MHz / 4 = 8 MHz
340// meaning 3 is 3 +1=4 *2 = 8 --> 32 MHz / 8 = 4 MHz
341// meaning 7 is 7 +1=8 *2 =16 --> 32 MHz / 16= 2 MHz
342// meaning 15 is 15 +1=16 *2 =32 --> 32 MHz / 32= 1 MHz
343// meaning 31 is 31 +1=32 *2 =64 --> 32 MHz / 64= 500 KHz
344// meaning 63 is 63 +1=64 *2 =128--> 32 MHz / 128= 250 KHz
345// meaning 127is 127+1=128*2 =256--> 32 MHz / 256= 125 KHz
346// etc
347// up to 0xFF = 255+1=256*2 = 512 --> 32 MHz / 512 = 1/16th MHz = 62.5 KHz
348//
349// these enums COMBINES the 2 fields so there is only one enum needed
350// to set each clock rate desired in the controller_clock_divider register.
351// This set of enums is NOT exhaustive (there would 256)
365
366
367// *****************************************************************
368// helper defines for SPI DMA INTERRUPT ENABLE REGISTER (0x58)
369#define SPI_DMA_INTERRUPTS_DISABLE 0x00
370#define SPI_DMA_RX_INTERRUPT_ENABLE 0x01
371#define SPI_DMA_TX_INTERRUPT_ENABLE 0x02
372
373// *****************************************************************
374// helper defines for SPI DMA INTERRUPT STATUS REGISTER (0x5C)
375#define SPI_DMA_RX_INTERRUPT_ACTIVE 0x01
376#define SPI_DMA_TX_INTERRUPT_ACTIVE 0x02
377
378// *****************************************************************
379// helper defines for DMA_rx_enable (0x60) and DMA_tx_enable(0x64) REGISTERs
380#define SPI_DMA_ENABLE 0x01
381#define SPI_DMA_DISABLE 0x00
382
383// if using DMA for RX we require a minimum for the buffer
384#define SPI_DMA_RX_BUFF_MINIMUM_SIZE 16
385
386
393
394
400#define TR_HAL_SPI_EVENT_TX_EMPTY 0x00000001
401#define TR_HAL_SPI_EVENT_RX_FULL 0x00000008
402#define TR_HAL_SPI_EVENT_RX_HAS_MORE_DATA 0x00000010
403#define TR_HAL_SPI_EVENT_TRANSFER_DONE 0x00000020
404#define TR_HAL_SPI_EVENT_RX_TO_USER_FX 0x00000040
405#define TR_HAL_SPI_EVENT_RX_READY 0x00000080
406#define TR_HAL_SPI_EVENT_DMA_RX_TO_USER_FX 0x00000100
407#define TR_HAL_SPI_EVENT_DMA_RX_READY 0x00000200
408#define TR_HAL_SPI_EVENT_DMA_TX_COMPLETE 0x00000400
409
410
414
415// prototype for callback from the Trident HAL to the app when a byte is received
416typedef void (*tr_hal_spi_receive_callback_t) (uint8_t num_received_bytes, uint8_t* byte_buffer);
417
418// prototype for callback from the Trident HAL to the app when an event happens
419typedef void (*tr_hal_spi_event_callback_t) (tr_hal_spi_id_t spi_id, uint32_t event_bitmask);
420
421
428typedef struct
429{
430 // **** high level settings ****
431
432 // true=SPI Controller, false=SPI Peripheral
433 // (maps to bit 5 in CONTROL register, and also controls bit 6)
434 bool run_as_controller;
435
436 // Normal SPI, Dual SPI, or Quad SPI
437 tr_hal_spi_mode_t spi_mode;
438
439
440 // **** pins used ****
441
442 // pins to use for the SPI
443 tr_hal_gpio_pin_t clock_pin;
444 // this is also known as SDO
445 tr_hal_gpio_pin_t io_0_pin;
446 // this is also known as SDI
447 tr_hal_gpio_pin_t io_1_pin;
448 // ony valid if spi_mode=TR_HAL_SPI_MODE_QUAD
449 tr_hal_gpio_pin_t io_2_pin;
450 tr_hal_gpio_pin_t io_3_pin;
451
452 // chip select - SPI0 can have up to 4
453 uint8_t num_chip_select_pins;
454 tr_hal_gpio_pin_t chip_select_0;
455 tr_hal_gpio_pin_t chip_select_1;
456 tr_hal_gpio_pin_t chip_select_2;
457 tr_hal_gpio_pin_t chip_select_3;
458
459 // C = SPI Controller, P = SPI Peripheral
460 // normally, SDO on C is wired to SDO on P, and SDI on C is wired to SDI on P
461 // but sometimes these pins are crossed. if the pins are crossed (SDO wired to SDI)
462 // then set this option to TRUE. This controls how the value of sdat0or1 in the
463 // control register is set. If sdo_sdi_pins_crossed=T and the device is a Peripheral
464 // then the sdat0or1 gets set to 1
465 bool sdo_sdi_pins_crossed;
466
467
468 // **** SPI Clock Settings ****
469
470 // NOTE: SPI mode 0 is most common, this is:
471 // CPOL = 0
472 // CPHA = 0
473
474 // (CPOL = CLOCK POLARITY) SPI clock rests high? (maps to bit 4 in CONTROL register)
475 // true=clock rests high, false=clock rests low
476 bool cpol_bit;
477
478 // (CPHA = CLOCK PHASE) first bit on SS (maps to bit 3 in CONTROL register)
479 // true=first TX bit as SS is asserted, false=first TX bit on first clk edge after SS
480 bool cpha_bit;
481
482 // for the Controller only: set the clock speed
483 tr_hal_spi_clock_rate_t controller_clock_rate;
484
485
486 // **** TX/RX settings ****
487
488 // bit size of TX and RX FIFO
489 tr_hal_spi_bit_size_t bit_size;
490
491 // if this is set to false (0) then chip select deasserts after each byte
492 // if this is set to true(1) then chip select STAYS asserted until all bytes are done
493 // most SPI devices getting multiple bytes will expect CS to remain asserted
494 // only matters when run_as_controller=true (maps to bit 0 in CONTROL register)
495 bool continuous_transfer;
496
497 // Byte swap in bitsize = 16/32 bit for TX/RX FIFO
498 bool byte_swap;
499
500 // (MSB/LSB) true=MSB, false=LSB (maps to bit 2 in CONTROL register)
501 bool most_significant_bit_first;
502
503 // do we enable inter transfer delays
504 // only matters when run_as_controller=true (maps to bit 11 in CONTROL register)
505 bool enable_inter_transfer_delay;
506
507 // if enable_inter_transfer_delay=T, this sets the delay
508 uint16_t delay_in_clock_cycles;
509
510
511 // **** DMA settings ****
512
513 bool rx_dma_enabled;
514 bool tx_dma_enabled;
515 // note: RX buffer must STAY allocated
516 uint8_t* rx_dma_buffer;
517 uint16_t rx_dma_buff_length;
518 // note: TX buffers are passed when transmitting
519
520
521 // **** non-DMA transmit ****
522
523 // if transmit is not done with DMA, then the app needs to allocate a
524 // transmit buffer and set a pointer to that transmit buffer here
525 uint8_t* raw_tx_buffer;
526 uint16_t raw_tx_buff_length;
527
528
529 // **** receive and event handler functions ****
530
531 // callback from HAL to App when a byte is received
532 // if the app doesn't want this, then set it to NULL
533 tr_hal_spi_receive_callback_t rx_handler_function;
534
535 // callback from HAL to App when an event happens
536 // if the app doesn't want this, then set it to NULL
537 tr_hal_spi_event_callback_t event_handler_fx;
538
539
540 // **** chip behavior settings ****
541
542
543 // are the chip interrupts enabled?
544 bool enable_chip_interrupts;
545
546 // set the INT priority
547 tr_hal_int_pri_t interrupt_priority;
548
549 // when the device is sleeping, we can choose to DISABLE interrupts,
550 // or leave them enabled which would allow the device to wake on
551 // an interrupt from this peripheral
552 bool wake_on_interrupt;
553
555
556
568
569
575#define SPI_CONFIG_CONTROLLER_NORMAL_MODE \
576 { \
577 .run_as_controller = true, \
578 .spi_mode = TR_HAL_SPI_MODE_NORMAL, \
579 .clock_pin = (tr_hal_gpio_pin_t) { DEFAULT_SPI_CLK_PIN }, \
580 .io_0_pin = (tr_hal_gpio_pin_t) { DEFAULT_SPI_IO_0_PIN }, \
581 .io_1_pin = (tr_hal_gpio_pin_t) { DEFAULT_SPI_IO_1_PIN }, \
582 .io_2_pin = (tr_hal_gpio_pin_t) { SPI_INVALID_PIN }, \
583 .io_3_pin = (tr_hal_gpio_pin_t) { SPI_INVALID_PIN }, \
584 .num_chip_select_pins = 1, \
585 .chip_select_0 = (tr_hal_gpio_pin_t) { DEFAULT_SPI_CS_PIN },\
586 .chip_select_1 = (tr_hal_gpio_pin_t) { SPI_INVALID_PIN }, \
587 .chip_select_2 = (tr_hal_gpio_pin_t) { SPI_INVALID_PIN }, \
588 .chip_select_3 = (tr_hal_gpio_pin_t) { SPI_INVALID_PIN }, \
589 .sdo_sdi_pins_crossed = false, \
590 .cpol_bit = false, \
591 .cpha_bit = false, \
592 .controller_clock_rate = SPI_CTRL_CLOCK_1_MHZ, \
593 .bit_size = TR_HAL_SPI_BIT_SIZE_8, \
594 .continuous_transfer = true, \
595 .byte_swap = false, \
596 .most_significant_bit_first = true, \
597 .enable_inter_transfer_delay = false, \
598 .delay_in_clock_cycles = 0, \
599 .rx_dma_enabled = false, \
600 .tx_dma_enabled = false, \
601 .rx_dma_buffer = NULL, \
602 .rx_dma_buff_length = 0, \
603 .raw_tx_buffer = NULL, \
604 .raw_tx_buff_length = 0, \
605 .rx_handler_function = NULL, \
606 .event_handler_fx = NULL, \
607 .enable_chip_interrupts = true, \
608 .interrupt_priority = TR_HAL_INTERRUPT_PRIORITY_5, \
609 .wake_on_interrupt = false, \
610 }
611
612
617
618// SPI power on/off - these are called from init and uninit - the app should not need to call these
620
622
623
628
629// function for setting the pins for a standard SPI
630// this also checks that the pin choices are VALID for that particular SPI
632 tr_hal_gpio_pin_t clk_pin,
633 tr_hal_gpio_pin_t chip_select_0_pin,
634 tr_hal_gpio_pin_t sdo_pin,
635 tr_hal_gpio_pin_t sdi_pin);
636
637// *** Quad SPI mode is not currently supported ***
638// function for setting the pins for a quad SPI which requires 2 more pins
639// this also checks that the pin choices are VALID for that particular SPI
647
648// function for setting additional chip select pins beyond the 1 already set
649// either tr_hal_spi_set_standard_pins or ..set_quad_pins needs to have been called
650// this also checks that the pin choices are VALID for that particular SPI
652 uint8_t num_chip_select,
653 tr_hal_gpio_pin_t chip_select_1_pin,
654 tr_hal_gpio_pin_t chip_select_2_pin,
655 tr_hal_gpio_pin_t chip_select_3_pin);
656
657
664 uint32_t* transmit_started,
665 uint32_t* transmit_completed,
666 uint32_t* bytes_received);
667
669
670
672// *** these APIs are experimental and have not been proven to work ***
673// for sending using DUAL mode. start enables contXfer and sets it for dual mode
674// stop puts mode and contXfer back. These modifications happen to the AUX CTRL
675// register
679
680
684
685
686#endif // T32CZ20_SPI_H_
tr_hal_int_pri_t
values and a range checking function for setting the interrupt priority in the Trident HAL APIs
Definition tr_hal_platform.h:34
This file contains the CHIP SPECIFIC types and defines for the T32CZ20.
tr_hal_status_t
Definition tr_hal_common.h:25
tr_hal_spi_bit_size_t
Definition T32CM11_spi.h:89
tr_hal_spi_mode_t
Normal SPI vs Dual SPI vs Quad SPI modes.
Definition T32CM11_spi.h:78
tr_hal_spi_id_t
Definition T32CM11_spi.h:33
tr_hal_spi_clock_rate_t
Definition T32CM11_spi.h:406
tr_hal_status_t tr_hal_spi_clear_tx_busy(tr_hal_spi_id_t spi_id)
tr_hal_spi_bit_size_t
Definition T32CZ20_spi.h:90
tr_hal_status_t tr_hal_spi_set_standard_pins(tr_hal_spi_id_t spi_id, tr_hal_gpio_pin_t clk_pin, tr_hal_gpio_pin_t chip_select_0_pin, tr_hal_gpio_pin_t sdo_pin, tr_hal_gpio_pin_t sdi_pin)
tr_hal_status_t tr_hal_spi_read_stats(tr_hal_spi_id_t spi_id, uint32_t *transmit_started, uint32_t *transmit_completed, uint32_t *bytes_received)
tr_hal_status_t tr_hal_spi_power_off(tr_hal_spi_id_t spi_id)
void(* tr_hal_spi_receive_callback_t)(uint8_t num_received_bytes, uint8_t *byte_buffer)
Definition T32CZ20_spi.h:416
tr_hal_spi_mode_t
Normal SPI vs Dual SPI vs Quad SPI modes.
Definition T32CZ20_spi.h:79
tr_hal_spi_id_t
Definition T32CZ20_spi.h:34
tr_hal_status_t tr_hal_spi_power_on(tr_hal_spi_id_t spi_id)
void(* tr_hal_spi_event_callback_t)(tr_hal_spi_id_t spi_id, uint32_t event_bitmask)
Definition T32CZ20_spi.h:419
SPI_REGISTERS_T * tr_hal_spi_get_register_address(tr_hal_spi_id_t spi_id)
tr_hal_spi_clock_rate_t
Definition T32CZ20_spi.h:353
tr_hal_status_t tr_hal_spi_set_addl_cs_pins(tr_hal_spi_id_t spi_id, uint8_t num_chip_select, tr_hal_gpio_pin_t chip_select_1_pin, tr_hal_gpio_pin_t chip_select_2_pin, tr_hal_gpio_pin_t chip_select_3_pin)
@ TR_HAL_SPI_BIT_SIZE_32
Definition T32CZ20_spi.h:92
@ TR_HAL_SPI_BIT_SIZE_8
Definition T32CZ20_spi.h:91
@ TR_HAL_SPI_MODE_NORMAL
Definition T32CZ20_spi.h:80
@ TR_HAL_SPI_MODE_DUAL
Definition T32CZ20_spi.h:81
@ TR_HAL_SPI_MODE_QUAD
Definition T32CZ20_spi.h:82
@ SPI_1_ID
Definition T32CZ20_spi.h:36
@ SPI_0_ID
Definition T32CZ20_spi.h:35
@ SPI_CTRL_CLOCK_250_KHZ
Definition T32CZ20_spi.h:361
@ SPI_CTRL_CLOCK_32_MHZ
Definition T32CZ20_spi.h:354
@ SPI_CTRL_CLOCK_16_MHZ
Definition T32CZ20_spi.h:355
@ SPI_CTRL_CLOCK_125_KHZ
Definition T32CZ20_spi.h:362
@ SPI_CTRL_CLOCK_4_MHZ
Definition T32CZ20_spi.h:357
@ SPI_CTRL_CLOCK_8_MHZ
Definition T32CZ20_spi.h:356
@ SPI_CTRL_CLOCK_500_KHZ
Definition T32CZ20_spi.h:360
@ SPI_CTRL_CLOCK_2_MHZ
Definition T32CZ20_spi.h:358
@ SPI_CTRL_CLOCK_1_MHZ
Definition T32CZ20_spi.h:359
the struct we use so we can address registers using field names
Definition T32CM11_spi.h:224
__IO uint32_t epd_function
Definition T32CZ20_spi.h:170
__IO uint32_t interrupt_clear
Definition T32CZ20_spi.h:178
__I uint32_t reserved_1
Definition T32CZ20_spi.h:191
pin type
Definition tr_hal_platform.h:23
Definition T32CM11_spi.h:484