#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <stdint.h>
#include <string.h>
#include <linux/fb.h>
#include <sys/ioctl.h>
#include "midas.h"
Go to the source code of this file.
◆ FILESIZE
◆ rpi_led()
Definition at line 143 of file rpi_led.c.
144{
151
154
155 switch (cmd) {
160 break;
161
165 break;
166
172 break;
173
179 break;
180
181 default:
182 break;
183 }
184
186
188}
TH1X EXPRT * h1_book(const char *name, const char *title, int bins, double min, double max)
INT rpi_led_init(HNDLE hkey, void **pinfo)
INT rpi_led_exit(RPI_LED_INFO *info)
INT rpi_led_set(RPI_LED_INFO *info, INT channel, double value)
INT rpi_led_get(RPI_LED_INFO *info, INT channel, float *pvalue)
◆ rpi_led_exit()
Definition at line 90 of file rpi_led.c.
91{
92
94 perror(
"Error un-mmapping the file");
95 }
97
98
100
102}
◆ rpi_led_get()
Definition at line 124 of file rpi_led.c.
125{
128
129
131 r = (
rgb >> 11) & 0x1F;
132 g = (
rgb >> 6) & 0x1F;
133 b = (
rgb >> 1) & 0x1F;
134
135 col = (r << 16) | (
g << 8) | b;
137
139}
◆ rpi_led_init()
Definition at line 44 of file rpi_led.c.
45{
48
49
52
53
55 if (
info->fbfd == -1) {
56 perror(
"Error (call to 'open')");
58 }
59
60
62 perror(
"Error (call to 'ioctl')");
65 }
66
67
69 printf(
"Error: RPi-Sense FB not found\n");
72 }
73
74
78 perror(
"Error mmapping the file");
80 }
81
82
84
86}
◆ rpi_led_set()
Definition at line 106 of file rpi_led.c.
107{
110
112
113 r = ((
col >> 16) & 0xFF) >> 3;
114 g = ((
col >> 8) & 0xFF) >> 3;
115 b = ((
col >> 0) & 0xFF) >> 3;
116 rgb = (r << 11) | (
g << 6) | (b << 1);
118
120}