API Reference¶
top_phat_button¶
Python module for the[SparkFun Qwiic Joystick](https://www.sparkfun.com/products/15168)
This python package is a port of the existing [SparkFun Qwiic Joystick Arduino Library](https://github.com/sparkfun/SparkFun_Qwiic_Joystick_Arduino_Library)
This package can be used in conjunction with the overall [SparkFun qwiic Python Package](https://github.com/sparkfun/Qwiic_Py)
New to qwiic? Take a look at the entire [SparkFun qwiic ecosystem](https://www.sparkfun.com/qwiic).
Parameters: - address – The I2C address to use for the device. If not provided, the default address is used.
- i2c_driver – An existing i2c driver object. If not provided a driver object is created.
Returns: The ToppHATButton device object.
Return type: Object
Initialize the operation of the button module
Returns: Returns true of the initializtion was successful, otherwise False. Return type: bool
Returns 1 when a button has received a full click cycle (press and release). The interrupt must be cleared by the user. 7(MSB) 6 5 4 3 2 1 0(LSB)
INT CTR RGT LFT DWN UP B AReturns: Clicked status of all buttons in a byte Return type: integer
Updates and returns buffer for all buttons and whether or not they are pressed as well as the pressed interrupt flag Reading this register also clears it. 7(MSB) 6 5 4 3 2 1 0(LSB)
INT CTR RGT LFT DWN UP B AReturns: button status Return type: integer
Returns the status of the clicked interrupt enable
Returns: The clicked interrupt enable bit Return type: bool
Determine if the Top pHAT Buttons are connected to the system..
Returns: True if the device is connected, otherwise False. Return type: bool
Returns 1 when a button has received a full click cycle (press and release). The interrupt must be cleared by the user. 7(MSB) 6 5 4 3 2 1 0(LSB)
INT CTR RGT LFT DWN UP B AReturns: Clicked status of all buttons in a byte Return type: integer
Updates and returns buffer for all buttons and whether or not they are pressed as well as the pressed interrupt flag Reading this register also clears it. 7(MSB) 6 5 4 3 2 1 0(LSB)
INT CTR RGT LFT DWN UP B AReturns: button status Return type: integer
Returns the status of the clicked interrupt enable
Returns: The clicked interrupt enable bit Return type: bool
Returns the status of the pressed interrupt enable
Returns: The pressed interrupt enable bit Return type: bool
Returns a string of the firmware version number
Returns: The firmware version Return type: string
Determine if the Top pHAT Buttons are connected to the system..
Returns: True if the device is connected, otherwise False. Return type: bool
Returns the status of the pressed interrupt enable
Returns: The pressed interrupt enable bit Return type: bool
Sets the status of the clicked interrupt enable bit
Param: The clicked interrupt enable bit Returns: The status of the I2C transaction Return type: bool
Sets the status of the pressed interrupt enable bit
Param: The pressed interrupt enable bit Returns: The status of the I2C transaction Return type: bool
Returns a string of the firmware version number
Returns: The firmware version Return type: string