Skip to content

Commit

Permalink
add pullup and pulldown options to suli's digital input functions
Browse files Browse the repository at this point in the history
  • Loading branch information
KillingJacky committed Sep 21, 2016
1 parent 377b7f8 commit 09d10e5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion suli/suli2.h
Expand Up @@ -65,7 +65,9 @@ long suli_map(long x, long in_min, long in_max, long out_min, long out_max);

typedef int IO_T;

#define SULI_INPUT INPUT
#define SULI_INPUT INPUT // the default high resistance input
#define SULI_INPUT_PULLUP INPUT_PULLUP
#define SULI_INPUT_PULLDOWN INPUT_PULLDOWN
#define SULI_OUTPUT OUTPUT
#define SULI_HIGH 0x01
#define SULI_LOW 0x00
Expand Down Expand Up @@ -107,6 +109,9 @@ typedef void (*interrupt_handler)(void *para);
extern "C"
void attachInterruptEx(uint8_t pin, interrupt_handler userFunc, int mode, void *para);

/**
* with the arduino implementation, we can attach only 1 handler to 1 pin.
*/
void suli_pin_attach_interrupt_handler(IO_T *pio, interrupt_handler handler, int mode, void *para);


Expand Down

0 comments on commit 09d10e5

Please sign in to comment.