PortaMob
|
A class that provides comprehensive functionalities to interact with the PortaMob Shield components. More...
#include <PortaMob.h>
Static Public Member Functions | |
static Adafruit_SSD1306 | portamob_display (void(*on_error)()) |
Initializes the PortaMob display. More... | |
static void | init_buttons (void) |
Initializes the push buttons on the PortaMob Shield. More... | |
static bool | is_button_pressed (uint8_t button) |
Checks if a specific button is pressed. More... | |
static void | init_i2c () |
Initializes the I2C communication. More... | |
static void | eeprom_write (uint8_t addr, uint8_t value) |
Writes a value to the EEPROM memory. More... | |
static uint8_t | eeprom_read (uint8_t addr) |
Reads a value from the EEPROM memory. More... | |
static bool | has_eeprom () |
Checks if the EEPROM memory is present. More... | |
A class that provides comprehensive functionalities to interact with the PortaMob Shield components.
Definition at line 70 of file PortaMob.h.
|
static |
Reads a value from the EEPROM memory.
This function reads a single byte value from the specified address in the EEPROM memory. It takes the memory address as a parameter and returns the byte value read from the EEPROM.
addr | The address in the EEPROM memory to read from. |
Definition at line 76 of file PortaMob.cpp.
|
static |
Writes a value to the EEPROM memory.
This function writes a single byte value to the specified address in the EEPROM memory. It takes the memory address and the value to be written as parameters.
addr | The address in the EEPROM memory to write to. |
value | The byte value to write. |
Definition at line 63 of file PortaMob.cpp.
|
static |
Checks if the EEPROM memory is present.
This function checks if the EEPROM memory is detected on the I2C bus by attempting to communicate with it. It returns true
if the EEPROM is detected, otherwise false
.
true
if the EEPROM memory is detected, false
otherwise. Definition at line 91 of file PortaMob.cpp.
|
static |
Initializes the push buttons on the PortaMob Shield.
This function initializes the digital pins for the push buttons, preparing them for input detection. Once initialized, the buttons can be checked for their status using the is_button_pressed()
function.
Definition at line 43 of file PortaMob.cpp.
|
static |
Initializes the I2C communication.
This function initializes the I2C communication for the PortaMob Shield, enabling communication with external devices such as EEPROM and the OLED display.
Definition at line 59 of file PortaMob.cpp.
|
static |
Checks if a specific button is pressed.
This function checks the status of a specified button and returns a boolean indicating whether the button is currently pressed or not. It takes the pin number of the button as a parameter (e.g., PORTAMOB_KEY_1
) and returns true
if the button is pressed, otherwise false
.
button | The button pin to check (e.g., PORTAMOB_KEY_1). |
true
if the button is pressed, false
otherwise. Definition at line 55 of file PortaMob.cpp.
|
static |
Initializes the PortaMob display.
This function initializes the monochromatic OLED display and sets up a display callback function to handle initialization errors. Then, it returns an Adafruit_SSD1306
object representing the PortaMob display, which can be further configured for various visual outputs.
on_error | A callback function to handle display initialization errors. |
Adafruit_SSD1306
An object representing the PortaMob display. Definition at line 31 of file PortaMob.cpp.