BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mangoh-drivers
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
mangoh-drivers
Commits
ea504b05
Commit
ea504b05
authored
Jan 16, 2017
by
David Frey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert mangOH Red tutorials to unix line endings
parent
78dacffe
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
364 additions
and
356 deletions
+364
-356
cf3GpioControl.adef
...orials/mangOH_Red/gpio/Cf3GpioControl/cf3GpioControl.adef
+29
-28
Component.cdef
...pio/Cf3GpioControl/cf3GpioControlComponent/Component.cdef
+13
-12
cf3GpioControl.c
...o/Cf3GpioControl/cf3GpioControlComponent/cf3GpioControl.c
+83
-83
timerLed.adef
samples/tutorials/mangOH_Red/gpio/TimerLed/timerLed.adef
+28
-27
Component.cdef
...mangOH_Red/gpio/TimerLed/timerLedComponent/Component.cdef
+12
-11
timerLed.c
...als/mangOH_Red/gpio/TimerLed/timerLedComponent/timerLed.c
+73
-72
touchData.adef
samples/tutorials/mangOH_Red/gpio/TouchSensor/touchData.adef
+29
-28
Component.cdef
...OH_Red/gpio/TouchSensor/touchDataComponent/Component.cdef
+13
-12
touchData.c
...angOH_Red/gpio/TouchSensor/touchDataComponent/touchData.c
+84
-83
No files found.
samples/tutorials/mangOH_Red/gpio/Cf3GpioControl/cf3GpioControl.adef
View file @
ea504b05
sandboxed: true
version: 1.0.0
maxFileSystemBytes: 512K
start: manual
executables:
{
cf3GpioControl = ( cf3GpioControlComponent )
}
processes:
{
envVars:
{
LE_LOG_LEVEL = DEBUG
}
run:
{
( cf3GpioControl )
}
faultAction: restart
}
bindings:
{
cf3GpioControl.cf3GpioControlComponent.le_sensorGpio -> <root>.le_gpioPin7
cf3GpioControl.cf3GpioControlComponent.mangoh_ledGpio -> gpioExpanderServiceRed.mangoh_gpioExpPin4
sandboxed: true
version: 1.0.0
maxFileSystemBytes: 512K
start: manual
executables:
{
cf3GpioControl = ( cf3GpioControlComponent )
}
processes:
{
envVars:
{
LE_LOG_LEVEL = DEBUG
}
run:
{
( cf3GpioControl )
}
faultAction: restart
}
bindings:
{
cf3GpioControl.cf3GpioControlComponent.le_sensorGpio -> <root>.le_gpioPin7
cf3GpioControl.cf3GpioControlComponent.mangoh_ledGpio -> gpioExpanderServiceRed.mangoh_gpioExpPin4
}
\ No newline at end of file
samples/tutorials/mangOH_Red/gpio/Cf3GpioControl/cf3GpioControlComponent/Component.cdef
View file @
ea504b05
requires:
{
api:
{
le_sensorGpio = ${LEGATO_ROOT}/interfaces/le_gpio.api
mangoh_ledGpio = ${LEGATO_ROOT}/interfaces/le_gpio.api
}
}
sources:
{
cf3GpioControl.c
requires:
{
api:
{
le_sensorGpio = ${LEGATO_ROOT}/interfaces/le_gpio.api
mangoh_ledGpio = ${LEGATO_ROOT}/interfaces/le_gpio.api
}
}
sources:
{
cf3GpioControl.c
}
\ No newline at end of file
samples/tutorials/mangOH_Red/gpio/Cf3GpioControl/cf3GpioControlComponent/cf3GpioControl.c
View file @
ea504b05
/**
* @file
*
* This sample app reads state of IoT1_GPIO1 (gpio25). If state change is detected, it makes
* corresponding change in state of LED D750. Use this sample to understand how to configure a gpio
* as an input or output and use call back function.
*
* <HR>
*
* Copyright (C) Sierra Wireless, Inc. Use of this work is subject to license.
*/
#include "legato.h"
#include "interfaces.h"
//--------------------------------------------------------------------------------------------------
/**
* Sets default configuration LED D750 as on
*/
//--------------------------------------------------------------------------------------------------
static
void
ConfigureLed
(
void
)
{
// Configure initial value as LED on
LE_FATAL_IF
(
mangoh_ledGpio_SetPushPullOutput
(
MANGOH_LEDGPIO_ACTIVE_HIGH
,
true
)
!=
LE_OK
,
"Couldn't configure LED PLAY as a push pull output"
);
}
//--------------------------------------------------------------------------------------------------
/**
* Performs initial configuration of the CF3 gpio (IoT1_GPIO1)
*/
//--------------------------------------------------------------------------------------------------
static
void
ConfigureSensorGpio
(
void
)
{
// Configure IoT1_GPIO1 as input and set its initial value as high
LE_FATAL_IF
(
le_sensorGpio_SetInput
(
LE_SENSORGPIO_ACTIVE_HIGH
)
!=
LE_OK
,
"Couldn't configure cf3 gpio as default input high"
);
}
//--------------------------------------------------------------------------------------------------
/**
* LED D750 changes state when IoT1_GPIO1 changes state
*/
//--------------------------------------------------------------------------------------------------
static
void
touch_ledGpio_ChangeHandler
(
bool
state
,
void
*
ctx
)
{
if
(
state
)
{
mangoh_ledGpio_Activate
();
}
else
{
mangoh_ledGpio_Deactivate
();
}
}
//--------------------------------------------------------------------------------------------------
/**
* Main program starts here
*/
//--------------------------------------------------------------------------------------------------
COMPONENT_INIT
{
LE_INFO
(
"=============== CF3 gpio application has started"
);
ConfigureLed
();
ConfigureSensorGpio
();
le_sensorGpio_AddChangeEventHandler
(
LE_SENSORGPIO_EDGE_BOTH
,
touch_ledGpio_ChangeHandler
,
NULL
,
0
);
}
/**
* @file
*
* This sample app reads state of IoT1_GPIO1 (gpio25). If state change is detected, it makes
* corresponding change in state of LED D750. Use this sample to understand how to configure a gpio
* as an input or output and use call back function.
*
* <HR>
*
* Copyright (C) Sierra Wireless, Inc. Use of this work is subject to license.
*/
#include "legato.h"
#include "interfaces.h"
//--------------------------------------------------------------------------------------------------
/**
* Sets default configuration LED D750 as on
*/
//--------------------------------------------------------------------------------------------------
static
void
ConfigureLed
(
void
)
{
// Configure initial value as LED on
LE_FATAL_IF
(
mangoh_ledGpio_SetPushPullOutput
(
MANGOH_LEDGPIO_ACTIVE_HIGH
,
true
)
!=
LE_OK
,
"Couldn't configure LED PLAY as a push pull output"
);
}
//--------------------------------------------------------------------------------------------------
/**
* Performs initial configuration of the CF3 gpio (IoT1_GPIO1)
*/
//--------------------------------------------------------------------------------------------------
static
void
ConfigureSensorGpio
(
void
)
{
// Configure IoT1_GPIO1 as input and set its initial value as high
LE_FATAL_IF
(
le_sensorGpio_SetInput
(
LE_SENSORGPIO_ACTIVE_HIGH
)
!=
LE_OK
,
"Couldn't configure cf3 gpio as default input high"
);
}
//--------------------------------------------------------------------------------------------------
/**
* LED D750 changes state when IoT1_GPIO1 changes state
*/
//--------------------------------------------------------------------------------------------------
static
void
touch_ledGpio_ChangeHandler
(
bool
state
,
void
*
ctx
)
{
if
(
state
)
{
mangoh_ledGpio_Activate
();
}
else
{
mangoh_ledGpio_Deactivate
();
}
}
//--------------------------------------------------------------------------------------------------
/**
* Main program starts here
*/
//--------------------------------------------------------------------------------------------------
COMPONENT_INIT
{
LE_INFO
(
"=============== CF3 gpio application has started"
);
ConfigureLed
();
ConfigureSensorGpio
();
le_sensorGpio_AddChangeEventHandler
(
LE_SENSORGPIO_EDGE_BOTH
,
touch_ledGpio_ChangeHandler
,
NULL
,
0
);
}
samples/tutorials/mangOH_Red/gpio/TimerLed/timerLed.adef
View file @
ea504b05
sandboxed: true
version: 1.0.0
maxFileSystemBytes: 512K
start: manual
executables:
{
timerLed = ( timerLedComponent )
}
processes:
{
envVars:
{
LE_LOG_LEVEL = DEBUG
}
run:
{
( timerLed )
}
faultAction: restart
}
bindings:
{
timerLed.timerLedComponent.mangoh_ledGpio -> gpioExpanderServiceRed.mangoh_gpioExpPin4
sandboxed: true
version: 1.0.0
maxFileSystemBytes: 512K
start: manual
executables:
{
timerLed = ( timerLedComponent )
}
processes:
{
envVars:
{
LE_LOG_LEVEL = DEBUG
}
run:
{
( timerLed )
}
faultAction: restart
}
bindings:
{
timerLed.timerLedComponent.mangoh_ledGpio -> gpioExpanderServiceRed.mangoh_gpioExpPin4
}
\ No newline at end of file
samples/tutorials/mangOH_Red/gpio/TimerLed/timerLedComponent/Component.cdef
View file @
ea504b05
requires:
{
api:
{
mangoh_ledGpio = ${LEGATO_ROOT}/interfaces/le_gpio.api
}
}
sources:
{
timerLed.c
requires:
{
api:
{
mangoh_ledGpio = ${LEGATO_ROOT}/interfaces/le_gpio.api
}
}
sources:
{
timerLed.c
}
\ No newline at end of file
samples/tutorials/mangOH_Red/gpio/TimerLed/timerLedComponent/timerLed.c
View file @
ea504b05
/**
* @file
*
* This sample app is a blinking LED at 1 second interval
*
* <HR>
*
* Copyright (C) Sierra Wireless, Inc. Use of this work is subject to license.
*/
#include "legato.h"
#include "interfaces.h"
#define LED_SAMPLE_INTERVAL_IN_MILLISECONDS (1000)
static
int8_t
state
=
0
;
//--------------------------------------------------------------------------------------------------
/**
* Sets default configuration LED D750 as on
*/
//--------------------------------------------------------------------------------------------------
static
void
ConfigureLed
(
void
)
{
// Configure initial value as LED off
LE_FATAL_IF
(
mangoh_ledGpio_SetPushPullOutput
(
MANGOH_LEDGPIO_ACTIVE_HIGH
,
true
)
!=
LE_OK
,
"Couldn't configure LED PLAY as a push pull output"
);
}
//--------------------------------------------------------------------------------------------------
/**
* LED D750 changes state as defined by LED_SAMPLE_INTERVAL_IN_SECONDS
*/
//--------------------------------------------------------------------------------------------------
static
void
ledTimer
(
le_timer_Ref_t
ledTimerRef
)
{
mangoh_ledGpio_SetEdgeSense
(
MANGOH_LEDGPIO_EDGE_BOTH
);
if
(
state
)
{
mangoh_ledGpio_Activate
();
state
=
false
;
}
else
{
mangoh_ledGpio_Deactivate
();
state
=
true
;
}
}
//--------------------------------------------------------------------------------------------------
/**
* Main program starts here
*/
//--------------------------------------------------------------------------------------------------
COMPONENT_INIT
{
LE_INFO
(
"===============blinking LED application has started"
);
ConfigureLed
();
le_timer_Ref_t
ledTimerRef
=
le_timer_Create
(
"LED Timer"
);
le_timer_SetMsInterval
(
ledTimerRef
,
LED_SAMPLE_INTERVAL_IN_MILLISECONDS
);
le_timer_SetRepeat
(
ledTimerRef
,
0
);
le_timer_SetHandler
(
ledTimerRef
,
ledTimer
);
le_timer_Start
(
ledTimerRef
);
/**
* @file
*
* This sample app is a blinking LED at 1 second interval
*
* <HR>
*
* Copyright (C) Sierra Wireless, Inc. Use of this work is subject to license.
*/
#include "legato.h"
#include "interfaces.h"
#define LED_SAMPLE_INTERVAL_IN_MILLISECONDS (1000)
static
int8_t
state
=
0
;
//--------------------------------------------------------------------------------------------------
/**
* Sets default configuration LED D750 as on
*/
//--------------------------------------------------------------------------------------------------
static
void
ConfigureLed
(
void
)
{
// Configure initial value as LED off
LE_FATAL_IF
(
mangoh_ledGpio_SetPushPullOutput
(
MANGOH_LEDGPIO_ACTIVE_HIGH
,
true
)
!=
LE_OK
,
"Couldn't configure LED PLAY as a push pull output"
);
}
//--------------------------------------------------------------------------------------------------
/**
* LED D750 changes state as defined by LED_SAMPLE_INTERVAL_IN_SECONDS
*/
//--------------------------------------------------------------------------------------------------
static
void
ledTimer
(
le_timer_Ref_t
ledTimerRef
)
{
mangoh_ledGpio_SetEdgeSense
(
MANGOH_LEDGPIO_EDGE_BOTH
);
if
(
state
)
{
mangoh_ledGpio_Activate
();
state
=
false
;
}
else
{
mangoh_ledGpio_Deactivate
();
state
=
true
;
}
}
//--------------------------------------------------------------------------------------------------
/**
* Main program starts here
*/
//--------------------------------------------------------------------------------------------------
COMPONENT_INIT
{
LE_INFO
(
"===============blinking LED application has started"
);
ConfigureLed
();
le_timer_Ref_t
ledTimerRef
=
le_timer_Create
(
"LED Timer"
);
le_timer_SetMsInterval
(
ledTimerRef
,
LED_SAMPLE_INTERVAL_IN_MILLISECONDS
);
le_timer_SetRepeat
(
ledTimerRef
,
0
);
le_timer_SetHandler
(
ledTimerRef
,
ledTimer
);
le_timer_Start
(
ledTimerRef
);
}
\ No newline at end of file
samples/tutorials/mangOH_Red/gpio/TouchSensor/touchData.adef
View file @
ea504b05
sandboxed: true
version: 1.0.0
maxFileSystemBytes: 512K
start: manual
executables:
{
touchData = ( touchDataComponent )
}
processes:
{
envVars:
{
LE_LOG_LEVEL = DEBUG
}
run:
{
( touchData )
}
faultAction: restart
}
bindings:
{
touchData.touchDataComponent.mangoh_pushButton -> gpioExpanderServiceRed.mangoh_gpioExpPin3
touchData.touchDataComponent.mangoh_ledGpio -> gpioExpanderServiceRed.mangoh_gpioExpPin4
sandboxed: true
version: 1.0.0
maxFileSystemBytes: 512K
start: manual
executables:
{
touchData = ( touchDataComponent )
}
processes:
{
envVars:
{
LE_LOG_LEVEL = DEBUG
}
run:
{
( touchData )
}
faultAction: restart
}
bindings:
{
touchData.touchDataComponent.mangoh_pushButton -> gpioExpanderServiceRed.mangoh_gpioExpPin3
touchData.touchDataComponent.mangoh_ledGpio -> gpioExpanderServiceRed.mangoh_gpioExpPin4
}
\ No newline at end of file
samples/tutorials/mangOH_Red/gpio/TouchSensor/touchDataComponent/Component.cdef
View file @
ea504b05
requires:
{
api:
{
mangoh_ledGpio = ${LEGATO_ROOT}/interfaces/le_gpio.api
mangoh_pushButton = ${LEGATO_ROOT}/interfaces/le_gpio.api
}
}
sources:
{
touchData.c
requires:
{
api:
{
mangoh_ledGpio = ${LEGATO_ROOT}/interfaces/le_gpio.api
mangoh_pushButton = ${LEGATO_ROOT}/interfaces/le_gpio.api
}
}
sources:
{
touchData.c
}
\ No newline at end of file
samples/tutorials/mangOH_Red/gpio/TouchSensor/touchDataComponent/touchData.c
View file @
ea504b05
/**
* @file
*
* This sample app reads state of IoT1_GPIO1 (gpio25) or Push Button SW200. If state change is
* detected, it makes corresponding change in state of LED D750. Use this sample to understand how
* to configure a gpio as an input or output and use call back function.
*
* <HR>
*
* Copyright (C) Sierra Wireless, Inc. Use of this work is subject to license.
*/
#include "legato.h"
#include "interfaces.h"
//--------------------------------------------------------------------------------------------------
/**
* Sets default configuration LED D750 as on
*/
//--------------------------------------------------------------------------------------------------
static
void
ConfigureLed
(
void
)
{
// Configure initial value as LED on
LE_FATAL_IF
(
mangoh_ledGpio_SetPushPullOutput
(
MANGOH_LEDGPIO_ACTIVE_HIGH
,
true
)
!=
LE_OK
,
"Couldn't configure LED PLAY as a push pull output"
);
}
//--------------------------------------------------------------------------------------------------
/**
* Performs initial configuration of the push button (SW200)
*/
//--------------------------------------------------------------------------------------------------
static
void
ConfigurePushButton
(
void
)
{
// Configure Push Button as input and set its initial value as high
LE_FATAL_IF
(
mangoh_pushButton_SetInput
(
MANGOH_PUSHBUTTON_ACTIVE_HIGH
)
!=
LE_OK
,
"Couldn't configure touch sensor as default input high"
);
}
//--------------------------------------------------------------------------------------------------
/**
* LED D750 changes state when Push Button changes state
*/
//--------------------------------------------------------------------------------------------------
static
void
touch_ledGpio_ChangeHandler
(
bool
state
,
void
*
ctx
)
{
if
(
state
)
{
mangoh_ledGpio_Activate
();
}
else
{
mangoh_ledGpio_Deactivate
();
}
}
//--------------------------------------------------------------------------------------------------
/**
* Main program starts here
*/
//--------------------------------------------------------------------------------------------------
COMPONENT_INIT
{
LE_INFO
(
"=============== touchsensor application has started"
);
ConfigureLed
();
ConfigurePushButton
();
mangoh_pushButton_AddChangeEventHandler
(
MANGOH_PUSHBUTTON_EDGE_BOTH
,
touch_ledGpio_ChangeHandler
,
NULL
,
0
);
/**
* @file
*
* This sample app reads state of IoT1_GPIO1 (gpio25) or Push Button SW200. If state change is
* detected, it makes corresponding change in state of LED D750. Use this sample to understand how
* to configure a gpio as an input or output and use call back function.
*
* <HR>
*
* Copyright (C) Sierra Wireless, Inc. Use of this work is subject to license.
*/
#include "legato.h"
#include "interfaces.h"
//--------------------------------------------------------------------------------------------------
/**
* Sets default configuration LED D750 as on
*/
//--------------------------------------------------------------------------------------------------
static
void
ConfigureLed
(
void
)
{
// Configure initial value as LED on
LE_FATAL_IF
(
mangoh_ledGpio_SetPushPullOutput
(
MANGOH_LEDGPIO_ACTIVE_HIGH
,
true
)
!=
LE_OK
,
"Couldn't configure LED PLAY as a push pull output"
);
}
//--------------------------------------------------------------------------------------------------
/**
* Performs initial configuration of the push button (SW200)
*/
//--------------------------------------------------------------------------------------------------
static
void
ConfigurePushButton
(
void
)
{
// Configure Push Button as input and set its initial value as high
LE_FATAL_IF
(
mangoh_pushButton_SetInput
(
MANGOH_PUSHBUTTON_ACTIVE_HIGH
)
!=
LE_OK
,
"Couldn't configure touch sensor as default input high"
);
}
//--------------------------------------------------------------------------------------------------
/**
* LED D750 changes state when Push Button changes state
*/
//--------------------------------------------------------------------------------------------------
static
void
touch_ledGpio_ChangeHandler
(
bool
state
,
void
*
ctx
)
{
if
(
state
)
{
mangoh_ledGpio_Activate
();
}
else
{
mangoh_ledGpio_Deactivate
();
}
}
//--------------------------------------------------------------------------------------------------
/**
* Main program starts here
*/
//--------------------------------------------------------------------------------------------------
COMPONENT_INIT
{
LE_INFO
(
"=============== touchsensor application has started"
);
ConfigureLed
();
ConfigurePushButton
();
mangoh_pushButton_AddChangeEventHandler
(
MANGOH_PUSHBUTTON_EDGE_BOTH
,
touch_ledGpio_ChangeHandler
,
NULL
,
0
);
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment