HapticLib  0.7
Haptic Feedback Library for embedded systems
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
hapticLib.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012, Leonardo Guardati <leonardo@guardati.it>
3  *
4  * Permission to use, copy, modify, and/or distribute this
5  * software for any purpose with or without fee is hereby
6  * granted, provided that the above copyright notice and this
7  * permission notice appear in all copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS
10  * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
11  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
12  * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
13  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
15  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
17  * USE OR PERFORMANCE OF THIS SOFTWARE.
18  *
19  */
1832 #include <stdint.h>
1833 #include <stdlib.h>
1834 
1835 #ifdef HL_DEBUG
1836 #include "hl_debug.h"
1837 #endif
1838 
1839 #include "hl_patterns.h"
1840 
1872 #ifndef HL_DEBUG
1873 #define HL_DEBUG
1874 #undef HL_DEBUG
1875 #endif
1876 
1886 #ifndef STM32VLDISCOVERY
1887 #define STM32VLDISCOVERY
1888 #endif
1889 
1890 /*
1891  * Platform Specific Hardware Level
1892  */
1893 #ifdef STM32VLDISCOVERY
1894 #include "hl_STM32VLDISCOVERY.h"
1895 #elif OTHERS
1896 #include "hl_OTHERS.h"
1897 #endif
1898 
1909 struct haptor_desc;
1910 
1921  typedef struct haptor_desc {
1922  uint8_t id;
1931  uint16_t min_duty;
1934  uint16_t max_duty;
1955  } haptor_desc;
1956 
1957 
1958 #ifdef HL_SYSTEM_FILE
1959 
1968  typedef struct system_desc {
1969  uint8_t num_haptors;
1988  haptor_desc haptors[MAX_HAPTORS];
2009  pattern_desc patterns[MAX_HAPTORS];
2031  uint32_t pwm_freq;
2042  uint8_t samples_delay;
2053  } system_desc;
2054 #endif
2055 
2056 haptor_desc *hl_configure(uint32_t, uint8_t, uint8_t);
2059 uint8_t hl_startPattern(pattern_desc *);
2060 uint8_t hl_stopPattern(pattern_desc *);
2061