ucg_riotos.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Bas Stottelaar <basstottelaar@gmail.com>
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
9 #pragma once
10 
24 #include "ucg.h"
25 
26 #include "periph/gpio.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
41 typedef struct {
42  void *user_ptr;
44  unsigned int device_index;
45  gpio_t pin_cs;
46  gpio_t pin_cd;
47  gpio_t pin_reset;
48 } ucg_riotos_t;
49 
53 int16_t ucg_com_hw_spi_riotos(ucg_t *ucg, int16_t msg, uint16_t arg, uint8_t *data);
54 
58 ucg_int_t ucg_dev_dummy_riotos(ucg_t *ucg, ucg_int_t msg, void *data);
59 
60 #ifdef __cplusplus
61 }
62 #endif
Low-level GPIO peripheral driver interface definitions.
Holds RIOT-OS specific peripheral data.
Definition: ucg_riotos.h:41
gpio_t pin_cs
Pin for SPI CS, GPIO_UNDEF if not used.
Definition: ucg_riotos.h:45
void * user_ptr
Pointer to optionally store any additional user-data.
Definition: ucg_riotos.h:42
gpio_t pin_reset
Pin for RESET, GPIO_UNDEF if not used.
Definition: ucg_riotos.h:47
gpio_t pin_cd
Pin for SPI CD, GPIO_UNDEF if not used.
Definition: ucg_riotos.h:46
unsigned int device_index
Index of the SPI device.
Definition: ucg_riotos.h:44
ucg_int_t ucg_dev_dummy_riotos(ucg_t *ucg, ucg_int_t msg, void *data)
To be used as the u8x8_msg_cb as gpio_and_delay_cb in u8x8_Setup() for use with RIOT-OS.
int16_t ucg_com_hw_spi_riotos(ucg_t *ucg, int16_t msg, uint16_t arg, uint8_t *data)
To be used as the u8x8_msg_cb as gpio_and_delay_cb in u8x8_Setup() for use with RIOT-OS.