PortaMob
PortaMob Class Reference

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...
 

Detailed Description

A class that provides comprehensive functionalities to interact with the PortaMob Shield components.

Definition at line 70 of file PortaMob.h.

Member Function Documentation

◆ eeprom_read()

uint8_t PortaMob::eeprom_read ( uint8_t  addr)
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.

Parameters
addrThe address in the EEPROM memory to read from.
Returns
uint8_t The byte value read from the EEPROM memory.

Definition at line 76 of file PortaMob.cpp.

◆ eeprom_write()

void PortaMob::eeprom_write ( uint8_t  addr,
uint8_t  value 
)
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.

Parameters
addrThe address in the EEPROM memory to write to.
valueThe byte value to write.

Definition at line 63 of file PortaMob.cpp.

◆ has_eeprom()

bool PortaMob::has_eeprom ( )
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.

Returns
bool Returns true if the EEPROM memory is detected, false otherwise.

Definition at line 91 of file PortaMob.cpp.

◆ init_buttons()

void PortaMob::init_buttons ( void  )
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.

◆ init_i2c()

void PortaMob::init_i2c ( )
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.

◆ is_button_pressed()

bool PortaMob::is_button_pressed ( uint8_t  button)
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.

Parameters
buttonThe button pin to check (e.g., PORTAMOB_KEY_1).
Returns
bool Returns true if the button is pressed, false otherwise.

Definition at line 55 of file PortaMob.cpp.

◆ portamob_display()

Adafruit_SSD1306 PortaMob::portamob_display ( void(*)()  on_error)
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.

Parameters
on_errorA callback function to handle display initialization errors.
Returns
Adafruit_SSD1306 An object representing the PortaMob display.

Definition at line 31 of file PortaMob.cpp.


The documentation for this class was generated from the following files: