PropWare  3.0.0.229
C++ objects and CMake build system for Parallax Propeller
badgealpha.c
1 #include "simpletools.h"
2 #include "badgetools.h"
3 
4 volatile int32_t cpcog;
5 int i2cLock = 0;
6 
8 int st_eeInitFlag;
9 volatile int bt_accelInitFlag;
10 volatile int eei2cLock;
11 volatile int eei2cLockFlag;
12 
13 unsigned char TPCount = 7;
14 unsigned char TPPins[] = {BTN_OS, BTN_5, BTN_4, BTN_3, BTN_2, BTN_1, BTN_0};
15 unsigned char TPDischarge = 15;
16 
17 volatile int eeHome = 32768;
18 volatile int eeRecCount, eeNextAddr, eeBadgeOk = 0,
19  eeNext, eeRecsAddr, eeRecs,
20  eeRecHome, eeRecOffice;
21 
22 volatile int inbox = 0;
23 
24 //info my;
25 
26 int cogIRcom;
27 
28 //__attribute__((constructor))
29 int32_t badge_setup(void)
30 {
31  touch_start(TPCount, TPPins, TPDischarge);
32  if(!eei2cLockFlag)
33  {
34  eei2cLock = locknew();
35  lockclr(eei2cLock);
36  eei2cLockFlag = 1;
37  }
38  init_MMA7660FC();
39  if(!st_eeInitFlag) ee_init();
40  cpcog = light_start();
41  cogIRcom = ircom_start(IR_IN, IR_OUT, 2400, 38500);
42  screen_init(OLED_CS, OLED_DC, OLED_DAT, OLED_CLK, OLED_RST, SSD1306_SWITCHCAPVCC, TYPE_128X64);
43  screen_auto(ON);
44  clear();
46  return 0;
47 }
48 
49 /*
50  TERMS OF USE: MIT License
51 
52  Permission is hereby granted, free of charge, to any person obtaining a
53  copy of this software and associated documentation files (the "Software"),
54  to deal in the Software without restriction, including without limitation
55  the rights to use, copy, modify, merge, publish, distribute, sublicense,
56  and/or sell copies of the Software, and to permit persons to whom the
57  Software is furnished to do so, subject to the following conditions:
58 
59  The above copyright notice and this permission notice shall be included in
60  all copies or substantial portions of the Software.
61 
62  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
63  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
64  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
65  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
66  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
67  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
68  DEALINGS IN THE SOFTWARE.
69 */
70 
LARGE
#define LARGE
For setting oLED character size to 32x16 pixels. Example: text_size(LARGE).
Definition: badgetools.h:192
clear
int clear(void)
Clear the display.
Definition: oled_clear.c:7
st_eeprom
i2c * st_eeprom
The busID for the Propeller Activity Board's EEPROM bus.
Definition: accel_shaken.c:9
simpletools.h
This library provides convenient functions for a variety of microcontroller I/O, timing,...
badge_setup
int badge_setup(void)
Set up all available badge drivers. Call this function at the start of any given program to allow acc...
Definition: badgealpha.c:29
i2c_st
Definition: simplei2c.h:25
lockclr
#define lockclr(lockid)
Clear lock.
Definition: propeller.h:170
screen_auto
void screen_auto(int state)
Cause function calls like oledprint, point, and others to appear immediately after the function is ca...
Definition: oled_auto.c:7
badgetools.h
This library provides convenient functions for a variety of Parallax eBadge operations.
st_eeInitFlag
int st_eeInitFlag
Initialization flag used by ee_ functions.
Definition: accel_shaken.c:10
locknew
#define locknew()
Get a new lock from the pool of Propeller hardware locks.
Definition: propeller.h:147
text_size
void text_size(int size)
Set the text size to either 32x16 pixel (LARGE) or 7x5 (SMALL) characters. Examples: text_size(LARGE)...
Definition: oled_text_size.c:7
ON
#define ON
ON can be used in place of a nonzero value to enabled parameters in functions like drive_feedback and...
Definition: abdrive.h:212