This is a simple driver for manipulating LEDs and reading buttons on any number of OLED1 Xplained Pro wing boards.
The display is not supported by this driver. To operate the display, see Monochrome graphical display system.
|
#define | _OLED1_CREATE_INSTANCE(name, ext_header) |
|
#define | _OLED1_CREATE_INSTANCE(name, ext_header) |
|
#define | _OLED1_CREATE_INSTANCE(name, ext_header) |
|
#define | _OLED1_CREATE_INSTANCE(name, ext_header) |
|
#define | OLED1_CREATE_INSTANCE(name, ext_header) _OLED1_CREATE_INSTANCE(name, ext_header) |
| Create a driver instance. More...
|
|
#define | OLED1_CREATE_INSTANCE(name, ext_header) _OLED1_CREATE_INSTANCE(name, ext_header) |
| Create a driver instance. More...
|
|
#define | OLED1_CREATE_INSTANCE(name, ext_header) _OLED1_CREATE_INSTANCE(name, ext_header) |
| Create a driver instance. More...
|
|
#define | OLED1_CREATE_INSTANCE(name, ext_header) _OLED1_CREATE_INSTANCE(name, ext_header) |
| Create a driver instance. More...
|
|
|
enum | oled1_button_id {
OLED1_BUTTON1_ID,
OLED1_BUTTON2_ID,
OLED1_BUTTON3_ID,
OLED1_BUTTON1_ID,
OLED1_BUTTON2_ID,
OLED1_BUTTON3_ID,
OLED1_BUTTON1_ID,
OLED1_BUTTON2_ID,
OLED1_BUTTON3_ID,
OLED1_BUTTON1_ID,
OLED1_BUTTON2_ID,
OLED1_BUTTON3_ID
} |
| IDs for each of the on-board buttons. More...
|
|
enum | oled1_button_id {
OLED1_BUTTON1_ID,
OLED1_BUTTON2_ID,
OLED1_BUTTON3_ID,
OLED1_BUTTON1_ID,
OLED1_BUTTON2_ID,
OLED1_BUTTON3_ID,
OLED1_BUTTON1_ID,
OLED1_BUTTON2_ID,
OLED1_BUTTON3_ID,
OLED1_BUTTON1_ID,
OLED1_BUTTON2_ID,
OLED1_BUTTON3_ID
} |
| IDs for each of the on-board buttons. More...
|
|
enum | oled1_button_id {
OLED1_BUTTON1_ID,
OLED1_BUTTON2_ID,
OLED1_BUTTON3_ID,
OLED1_BUTTON1_ID,
OLED1_BUTTON2_ID,
OLED1_BUTTON3_ID,
OLED1_BUTTON1_ID,
OLED1_BUTTON2_ID,
OLED1_BUTTON3_ID,
OLED1_BUTTON1_ID,
OLED1_BUTTON2_ID,
OLED1_BUTTON3_ID
} |
| IDs for each of the on-board buttons. More...
|
|
enum | oled1_button_id {
OLED1_BUTTON1_ID,
OLED1_BUTTON2_ID,
OLED1_BUTTON3_ID,
OLED1_BUTTON1_ID,
OLED1_BUTTON2_ID,
OLED1_BUTTON3_ID,
OLED1_BUTTON1_ID,
OLED1_BUTTON2_ID,
OLED1_BUTTON3_ID,
OLED1_BUTTON1_ID,
OLED1_BUTTON2_ID,
OLED1_BUTTON3_ID
} |
| IDs for each of the on-board buttons. More...
|
|
enum | oled1_led_id {
OLED1_LED1_ID,
OLED1_LED2_ID,
OLED1_LED3_ID,
OLED1_LED1_ID,
OLED1_LED2_ID,
OLED1_LED3_ID,
OLED1_LED1_ID,
OLED1_LED2_ID,
OLED1_LED3_ID,
OLED1_LED1_ID,
OLED1_LED2_ID,
OLED1_LED3_ID
} |
| IDs for each of the on-board LEDs. More...
|
|
enum | oled1_led_id {
OLED1_LED1_ID,
OLED1_LED2_ID,
OLED1_LED3_ID,
OLED1_LED1_ID,
OLED1_LED2_ID,
OLED1_LED3_ID,
OLED1_LED1_ID,
OLED1_LED2_ID,
OLED1_LED3_ID,
OLED1_LED1_ID,
OLED1_LED2_ID,
OLED1_LED3_ID
} |
| IDs for each of the on-board LEDs. More...
|
|
enum | oled1_led_id {
OLED1_LED1_ID,
OLED1_LED2_ID,
OLED1_LED3_ID,
OLED1_LED1_ID,
OLED1_LED2_ID,
OLED1_LED3_ID,
OLED1_LED1_ID,
OLED1_LED2_ID,
OLED1_LED3_ID,
OLED1_LED1_ID,
OLED1_LED2_ID,
OLED1_LED3_ID
} |
| IDs for each of the on-board LEDs. More...
|
|
enum | oled1_led_id {
OLED1_LED1_ID,
OLED1_LED2_ID,
OLED1_LED3_ID,
OLED1_LED1_ID,
OLED1_LED2_ID,
OLED1_LED3_ID,
OLED1_LED1_ID,
OLED1_LED2_ID,
OLED1_LED3_ID,
OLED1_LED1_ID,
OLED1_LED2_ID,
OLED1_LED3_ID
} |
| IDs for each of the on-board LEDs. More...
|
|
#define _OLED1_CREATE_INSTANCE |
( |
|
name, |
|
|
|
ext_header |
|
) |
| |
Value:
.led1_pin = ext_header ## _PIN_8, \
.led2_pin = ext_header ## _PIN_6, \
.button0_pin = ext_header ## _PIN_9, \
.button1_pin = ext_header ## _PIN_3, \
.button2_pin = ext_header ## _PIN_4, \
}
uint8_t led0_pin
Pin identifier for first LED.
Definition: oled1_co_routine_xpro_example/oled1.h:104
Driver instance struct.
Definition: oled1_co_routine_xpro_example/oled1.h:102
#define _OLED1_CREATE_INSTANCE |
( |
|
name, |
|
|
|
ext_header |
|
) |
| |
Value:
.led1_pin = ext_header ## _PIN_8, \
.led2_pin = ext_header ## _PIN_6, \
.button0_pin = ext_header ## _PIN_9, \
.button1_pin = ext_header ## _PIN_3, \
.button2_pin = ext_header ## _PIN_4, \
}
uint8_t led0_pin
Pin identifier for first LED.
Definition: oled1_co_routine_xpro_example/oled1.h:104
Driver instance struct.
Definition: oled1_co_routine_xpro_example/oled1.h:102
#define _OLED1_CREATE_INSTANCE |
( |
|
name, |
|
|
|
ext_header |
|
) |
| |
Value:
.led1_pin = ext_header ## _PIN_8, \
.led2_pin = ext_header ## _PIN_6, \
.button0_pin = ext_header ## _PIN_9, \
.button1_pin = ext_header ## _PIN_3, \
.button2_pin = ext_header ## _PIN_4, \
}
uint8_t led0_pin
Pin identifier for first LED.
Definition: oled1_co_routine_xpro_example/oled1.h:104
Driver instance struct.
Definition: oled1_co_routine_xpro_example/oled1.h:102
#define _OLED1_CREATE_INSTANCE |
( |
|
name, |
|
|
|
ext_header |
|
) |
| |
Value:
.led1_pin = ext_header ## _PIN_8, \
.led2_pin = ext_header ## _PIN_6, \
.button0_pin = ext_header ## _PIN_9, \
.button1_pin = ext_header ## _PIN_3, \
.button2_pin = ext_header ## _PIN_4, \
}
uint8_t led0_pin
Pin identifier for first LED.
Definition: oled1_co_routine_xpro_example/oled1.h:104
Driver instance struct.
Definition: oled1_co_routine_xpro_example/oled1.h:102
#define OLED1_BUTTON_ACTIVE false |
#define OLED1_BUTTON_ACTIVE false |
#define OLED1_BUTTON_ACTIVE false |
#define OLED1_BUTTON_ACTIVE false |
Create a driver instance.
This macro creates a oled1_instance struct with the specified name, and populates it with pin identifiers that correspond to the specified extension header.
This macro is created for Xplained Pro-style board definitions as it makes use of the EXT_PIN_x macros.
To initialize the hardware, the function oled1_init() must be called on each driver instance.
- Parameters
-
name | Name to use for driver instance. |
ext_header | Extension header to use, on the form EXTn (f.ex. EXT1). |
Create a driver instance.
This macro creates a oled1_instance struct with the specified name, and populates it with pin identifiers that correspond to the specified extension header.
This macro is created for Xplained Pro-style board definitions as it makes use of the EXT_PIN_x macros.
To initialize the hardware, the function oled1_init() must be called on each driver instance.
- Parameters
-
name | Name to use for driver instance. |
ext_header | Extension header to use, on the form EXTn (f.ex. EXT1). |
Create a driver instance.
This macro creates a oled1_instance struct with the specified name, and populates it with pin identifiers that correspond to the specified extension header.
This macro is created for Xplained Pro-style board definitions as it makes use of the EXT_PIN_x macros.
To initialize the hardware, the function oled1_init() must be called on each driver instance.
- Parameters
-
name | Name to use for driver instance. |
ext_header | Extension header to use, on the form EXTn (f.ex. EXT1). |
Create a driver instance.
This macro creates a oled1_instance struct with the specified name, and populates it with pin identifiers that correspond to the specified extension header.
This macro is created for Xplained Pro-style board definitions as it makes use of the EXT_PIN_x macros.
To initialize the hardware, the function oled1_init() must be called on each driver instance.
- Parameters
-
name | Name to use for driver instance. |
ext_header | Extension header to use, on the form EXTn (f.ex. EXT1). |
#define OLED1_LED_ACTIVE false |
#define OLED1_LED_ACTIVE false |
#define OLED1_LED_ACTIVE false |
#define OLED1_LED_ACTIVE false |
IDs for each of the on-board buttons.
Enumerator |
---|
OLED1_BUTTON1_ID |
|
OLED1_BUTTON2_ID |
|
OLED1_BUTTON3_ID |
|
OLED1_BUTTON1_ID |
|
OLED1_BUTTON2_ID |
|
OLED1_BUTTON3_ID |
|
OLED1_BUTTON1_ID |
|
OLED1_BUTTON2_ID |
|
OLED1_BUTTON3_ID |
|
OLED1_BUTTON1_ID |
|
OLED1_BUTTON2_ID |
|
OLED1_BUTTON3_ID |
|
IDs for each of the on-board buttons.
Enumerator |
---|
OLED1_BUTTON1_ID |
|
OLED1_BUTTON2_ID |
|
OLED1_BUTTON3_ID |
|
OLED1_BUTTON1_ID |
|
OLED1_BUTTON2_ID |
|
OLED1_BUTTON3_ID |
|
OLED1_BUTTON1_ID |
|
OLED1_BUTTON2_ID |
|
OLED1_BUTTON3_ID |
|
OLED1_BUTTON1_ID |
|
OLED1_BUTTON2_ID |
|
OLED1_BUTTON3_ID |
|
IDs for each of the on-board buttons.
Enumerator |
---|
OLED1_BUTTON1_ID |
|
OLED1_BUTTON2_ID |
|
OLED1_BUTTON3_ID |
|
OLED1_BUTTON1_ID |
|
OLED1_BUTTON2_ID |
|
OLED1_BUTTON3_ID |
|
OLED1_BUTTON1_ID |
|
OLED1_BUTTON2_ID |
|
OLED1_BUTTON3_ID |
|
OLED1_BUTTON1_ID |
|
OLED1_BUTTON2_ID |
|
OLED1_BUTTON3_ID |
|
IDs for each of the on-board buttons.
Enumerator |
---|
OLED1_BUTTON1_ID |
|
OLED1_BUTTON2_ID |
|
OLED1_BUTTON3_ID |
|
OLED1_BUTTON1_ID |
|
OLED1_BUTTON2_ID |
|
OLED1_BUTTON3_ID |
|
OLED1_BUTTON1_ID |
|
OLED1_BUTTON2_ID |
|
OLED1_BUTTON3_ID |
|
OLED1_BUTTON1_ID |
|
OLED1_BUTTON2_ID |
|
OLED1_BUTTON3_ID |
|
IDs for each of the on-board LEDs.
Enumerator |
---|
OLED1_LED1_ID |
|
OLED1_LED2_ID |
|
OLED1_LED3_ID |
|
OLED1_LED1_ID |
|
OLED1_LED2_ID |
|
OLED1_LED3_ID |
|
OLED1_LED1_ID |
|
OLED1_LED2_ID |
|
OLED1_LED3_ID |
|
OLED1_LED1_ID |
|
OLED1_LED2_ID |
|
OLED1_LED3_ID |
|
IDs for each of the on-board LEDs.
Enumerator |
---|
OLED1_LED1_ID |
|
OLED1_LED2_ID |
|
OLED1_LED3_ID |
|
OLED1_LED1_ID |
|
OLED1_LED2_ID |
|
OLED1_LED3_ID |
|
OLED1_LED1_ID |
|
OLED1_LED2_ID |
|
OLED1_LED3_ID |
|
OLED1_LED1_ID |
|
OLED1_LED2_ID |
|
OLED1_LED3_ID |
|
IDs for each of the on-board LEDs.
Enumerator |
---|
OLED1_LED1_ID |
|
OLED1_LED2_ID |
|
OLED1_LED3_ID |
|
OLED1_LED1_ID |
|
OLED1_LED2_ID |
|
OLED1_LED3_ID |
|
OLED1_LED1_ID |
|
OLED1_LED2_ID |
|
OLED1_LED3_ID |
|
OLED1_LED1_ID |
|
OLED1_LED2_ID |
|
OLED1_LED3_ID |
|
IDs for each of the on-board LEDs.
Enumerator |
---|
OLED1_LED1_ID |
|
OLED1_LED2_ID |
|
OLED1_LED3_ID |
|
OLED1_LED1_ID |
|
OLED1_LED2_ID |
|
OLED1_LED3_ID |
|
OLED1_LED1_ID |
|
OLED1_LED2_ID |
|
OLED1_LED3_ID |
|
OLED1_LED1_ID |
|
OLED1_LED2_ID |
|
OLED1_LED3_ID |
|
Initialize hardware for driver instance.
This function initializes the hardware (pins) that belong to the specified driver instance.
- Parameters
-
oled1 | Address of driver instance to initialize hardware for. |
References oled1_instance::button0_pin, oled1_instance::button1_pin, oled1_instance::button2_pin, port_config::direction, port_config::input_pull, oled1_instance::led0_pin, oled1_instance::led1_pin, oled1_instance::led2_pin, OLED1_LED_ACTIVE, port_get_config_defaults(), PORT_PIN_DIR_INPUT, PORT_PIN_DIR_OUTPUT_WTH_READBACK, PORT_PIN_PULL_NONE, PORT_PIN_PULL_UP, port_pin_set_config(), and port_pin_set_output_level().