circuitpython/ports/atmel-samd/common-hal/_pew/PewPew.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

50 lines
1.7 KiB
C
Raw Permalink Normal View History

2018-08-01 09:29:26 -04:00
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2019 Radomir Dopieralski
2018-08-01 09:29:26 -04:00
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef MICROPY_INCLUDED_PEW_PEWPEW_H
#define MICROPY_INCLUDED_PEW_PEWPEW_H
#include <stdint.h>
2018-08-23 17:22:47 -04:00
#include "shared-bindings/digitalio/DigitalInOut.h"
2018-08-01 09:29:26 -04:00
typedef struct {
mp_obj_base_t base;
2021-03-15 09:57:36 -04:00
uint8_t *buffer;
mp_obj_t *rows;
mp_obj_t *cols;
2018-08-23 17:22:47 -04:00
digitalio_digitalinout_obj_t *buttons;
2018-08-09 16:35:26 -04:00
uint8_t rows_size;
uint8_t cols_size;
2018-08-23 17:22:47 -04:00
uint8_t pressed;
2018-08-01 09:29:26 -04:00
} pew_obj_t;
void pew_init(void);
2018-08-09 16:35:26 -04:00
void pewpew_interrupt_handler(uint8_t index);
void pew_reset(void);
uint16_t pew_get_ticks(void);
2018-08-01 09:29:26 -04:00
#endif // MICROPY_INCLUDED_PEW_PEWPEW_H