[riot-notifications] [RIOT-OS/RIOT] cpu/qn908x: Implement blocking SPI support (#15689)

iosabi notifications at github.com
Sun Jan 17 17:26:11 CET 2021

@iosabi commented on this pull request.

> @@ -56,6 +56,16 @@ extern "C" {
 #error "GPIO_T_ADDR(GPIO_PIN(1, x)) must be the GPIOB address"
+ * @brief   Return whether the given pin is a CSHW pin.
+ */
+#define GPIO_T_IS_HWCS(pin) (((pin) & 0xff00u) == 0x8000)

Yes, "hardware" (meaning, automatic) is only supported on certain pins, depending on the SPI bus used. With the current implementation this is not that important because you can always toggle the CS GPIO pin, run a SPI transaction and toggle it back (which is done when non-HWCS values of gpio_t are used). However, this will be more relevant when we can do DMA to SPI.

I'm using the same "gpio_t" type to store two types of values:
 * a regular GPIO pins (port + number), and
 * a "hardware CS", which are values with the 0x8000 mask.

As before, any other value of gpio_t is invalid. This patch makes the few 0x8000 .. 0x8003 values valid ones and representing the HW CS function / pin.

This macro in particular tell whether a "GPIO_T" is a HWCS.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210117/b6b7cafb/attachment.htm>

More information about the notifications mailing list