5. API¶
5.1. DesignSpark.Pmod.AD1
¶
Interface for PmodAD1 module (AD7476A).
Note
Only a single channel (A1) is supported at present due to the way that SPI is configured.
5.2. DesignSpark.Pmod.Error
¶
-
exception
DesignSpark.Pmod.Error.
Error
[source]¶ Bases:
exceptions.Exception
Base class for exceptions in this library.
-
exception
DesignSpark.Pmod.Error.
incorrectModuleName
[source]¶ Bases:
DesignSpark.Pmod.Error.Error
Exception raised when the module name given does not exist in the module map.
-
exception
DesignSpark.Pmod.Error.
incorrectPortName
[source]¶ Bases:
DesignSpark.Pmod.Error.Error
Exception raised when the port name given does not exist in the port map.
-
exception
DesignSpark.Pmod.Error.
portCapabilityConflict
[source]¶ Bases:
DesignSpark.Pmod.Error.Error
Exception raised when the port is already using shared GPIO pins.
-
exception
DesignSpark.Pmod.Error.
portCapabilitySupport
[source]¶ Bases:
DesignSpark.Pmod.Error.Error
Exception raised when a port does not support the module type.
-
exception
DesignSpark.Pmod.Error.
portInUse
[source]¶ Bases:
DesignSpark.Pmod.Error.Error
Exception raised when the port is already assigned.
5.3. DesignSpark.Pmod.HAT
¶
Manages Pmod HAT port resources, enforcing correct usage and avoiding conflicts.
5.4. DesignSpark.Pmod.HB3
¶
Interface for PmodHB3 module.
5.5. DesignSpark.Pmod.ISNS20
¶
Interface for PmodISNS20 module (ADC7476 + Allegro ACS722).
5.6. DesignSpark.Pmod.MIC3
¶
Interface for PmodMIC3 (ADCS7476 + Knowles Acoustics SPA2410LR5H-B).
5.7. DesignSpark.Pmod.OLEDrgb
¶
Interface for PmodOLEDrgb module (ssd1331).
Note
Depends on luma.oled and luma.core.
5.8. DesignSpark.Pmod.TC1
¶
Interface for PmodTC1 module (MAX31855).
5.9. DesignSpark.Pmod.ACL2
¶
Interface for Pmod ACL2 module.
5.10. DesignSpark.Pmod.GPS
¶
Interface for PmodGPS
-
class
DesignSpark.Pmod.GPS.
MicropyGPS
(local_offset=0, location_formatting='ddm')[source]¶ GPS NMEA Sentence Parser. Creates object that stores all relevant GPS data and statistics. Parses sentences one character at a time using update().
-
SENTENCE_LIMIT
= 90¶
-
compass_direction
()[source]¶ Determine a cardinal or inter-cardinal direction based on current course. :return: string
-
date_string
(formatting='s_mdy', century='20')[source]¶ Creates a readable string of the current date. Can select between long format: Januray 1st, 2014 or two short formats: 11/01/2014 (MM/DD/YYYY) 01/11/2014 (DD/MM/YYYY) :param formatting: string ‘s_mdy’, ‘s_dmy’, or ‘long’ :param century: int delineating the century the GPS data is from (19 for 19XX, 20 for 20XX) :return: date_string string with long or short format date
-
gpgga
()[source]¶ Parse Global Positioning System Fix Data (GGA) Sentence. Updates UTC timestamp, latitude, longitude, fix status, satellites in use, Horizontal Dilution of Precision (HDOP), altitude, geoid height and fix status
-
gpgll
()[source]¶ Parse Geographic Latitude and Longitude (GLL)Sentence. Updates UTC timestamp, latitude, longitude, and fix status
-
gpgsa
()[source]¶ Parse GNSS DOP and Active Satellites (GSA) sentence. Updates GPS fix type, list of satellites used in fix calculation, Position Dilution of Precision (PDOP), Horizontal Dilution of Precision (HDOP), Vertical Dilution of Precision, and fix status
-
gpgsv
()[source]¶ Parse Satellites in View (GSV) sentence. Updates number of SV Sentences,the number of the last SV sentence parsed, and data on each satellite present in the sentence
-
gprmc
()[source]¶ Parse Recommended Minimum Specific GPS/Transit data (RMC)Sentence. Updates UTC timestamp, latitude, longitude, Course, Speed, Date, and fix status
-
latitude
¶ Format Latitude Data Correctly
-
longitude
¶ Format Longitude Data Correctly
-
new_fix_time
()[source]¶ Updates a high resolution counter with current time when fix is updated. Currently only triggered from GGA, GSA and RMC sentences
-
satellite_data_updated
()[source]¶ Checks if the all the GSV sentences in a group have been read, making satellite data complete :return: boolean
-
satellites_visible
()[source]¶ Returns a list of of the satellite PRNs currently visible to the receiver :return: list
-
speed_string
(unit='kph')[source]¶ Creates a readable string of the current speed data in one of three units :param unit: string of ‘kph’,’mph, or ‘knot’ :return:
-
supported_sentences
= {'GLGGA': <function gpgga>, 'GLGLL': <function gpgll>, 'GLGSA': <function gpgsa>, 'GLGSV': <function gpgsv>, 'GLRMC': <function gprmc>, 'GLVTG': <function gpvtg>, 'GNGGA': <function gpgga>, 'GNGLL': <function gpgll>, 'GNGSA': <function gpgsa>, 'GNRMC': <function gprmc>, 'GNVTG': <function gpvtg>, 'GPGGA': <function gpgga>, 'GPGLL': <function gpgll>, 'GPGSA': <function gpgsa>, 'GPGSV': <function gpgsv>, 'GPRMC': <function gprmc>, 'GPVTG': <function gpvtg>}¶
-
time_since_fix
()[source]¶ Returns number of millisecond since the last sentence with a valid fix was parsed. Returns 0 if no fix has been found
-
update
(new_char)[source]¶ Process a new input char and updates GPS object if necessary based on special characters (‘$’, ‘,’, ‘*’) Function builds a list of received string that are validate by CRC prior to parsing by the appropriate sentence function. Returns sentence type on successful parse, None otherwise
-
5.11. DesignSpark.Pmod.SWT
¶
Interface for Pmod_SWT
5.12. DesignSpark.Pmod.LS1
¶
Interface for Pmod_LS1