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 
22 #ifndef UCG_RIOTOS_H
23 #define UCG_RIOTOS_H
24 
25 #include "ucg.h"
26 
27 #include "periph/gpio.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
42 typedef struct {
43  void *user_ptr;
45  unsigned int device_index;
46  gpio_t pin_cs;
47  gpio_t pin_cd;
48  gpio_t pin_reset;
49 } ucg_riotos_t;
50 
54 int16_t ucg_com_hw_spi_riotos(ucg_t *ucg, int16_t msg, uint16_t arg, uint8_t *data);
55 
59 ucg_int_t ucg_dev_dummy_riotos(ucg_t *ucg, ucg_int_t msg, void *data);
60 
61 #ifdef __cplusplus
62 }
63 #endif
64 
65 #endif /* UCG_RIOTOS_H */
ucg_riotos_t
Holds RIOT-OS specific peripheral data.
Definition: ucg_riotos.h:42
ucg_riotos_t::pin_cs
gpio_t pin_cs
Pin for SPI CS, GPIO_UNDEF if not used.
Definition: ucg_riotos.h:46
ucg_riotos_t::user_ptr
void * user_ptr
Pointer to optionally store any additional user-data.
Definition: ucg_riotos.h:43
ucg_riotos_t::pin_reset
gpio_t pin_reset
Pin for RESET, GPIO_UNDEF if not used.
Definition: ucg_riotos.h:48
ucg_riotos_t::device_index
unsigned int device_index
Index of the SPI device.
Definition: ucg_riotos.h:45
ucg_com_hw_spi_riotos
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.
ucg_riotos_t::pin_cd
gpio_t pin_cd
Pin for SPI CD, GPIO_UNDEF if not used.
Definition: ucg_riotos.h:47
gpio.h
Low-level GPIO peripheral driver interface definitions.
ucg_dev_dummy_riotos
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.