};
/* Simple copy function. */
-void pio_copy(struct pio* dst, struct pio* src)
+void pio_copy(struct pio* dst, const struct pio* src)
{
if ((dst == NULL) || (src == NULL)) {
return;
}
/* Configure the pin in the requested function and mode. */
-void config_pio(struct pio* pp, uint32_t mode)
+void config_pio(const struct pio* pp, uint32_t mode)
{
volatile uint32_t* handle = NULL;
* This function calls the config_pio() function for the gpio with the given
* mode, configures the direction of the pin and sets the initial state.
*/
-void config_gpio(struct pio* gpio, uint32_t mode, uint8_t dir, uint8_t ini_val)
+void config_gpio(const struct pio* gpio, uint32_t mode, uint8_t dir, uint8_t ini_val)
{
struct lpc_gpio* gpio_port = LPC_GPIO_REGS(gpio->port);
static void (*gpio_calbacks_port1[PORT1_NB_PINS]) (uint32_t);
static void (*gpio_calbacks_port2[PORT2_NB_PINS]) (uint32_t);
-int set_gpio_callback(void (*callback) (uint32_t), struct pio* gpio, uint8_t sense)
+int set_gpio_callback(void (*callback) (uint32_t), const struct pio* gpio, uint8_t sense)
{
struct lpc_gpio* gpio_port = LPC_GPIO_REGS(gpio->port);
uint32_t irq = 0;
NVIC_EnableIRQ(irq);
return 0;
}
-void remove_gpio_callback(struct pio* gpio)
+void remove_gpio_callback(const struct pio* gpio)
{
struct lpc_gpio* gpio_port = LPC_GPIO_REGS(gpio->port);
uint32_t irq = 0;
#define PORT2_NB_PINS 16
/* Simple copy function. */
-void pio_copy(struct pio* dst, struct pio* src);
+void pio_copy(struct pio* dst, const struct pio* src);
/* Configure the pin in the requested function and mode. */
-void config_pio(struct pio* pp, uint32_t mode);
+void config_pio(const struct pio* pp, uint32_t mode);
/****************************************************************************/
};
/* GPIO Interrupts */
-int set_gpio_callback(void (*callback) (uint32_t), struct pio* gpio, uint8_t sense);
-void remove_gpio_callback(struct pio* gpio);
+int set_gpio_callback(void (*callback) (uint32_t), const struct pio* gpio, uint8_t sense);
+void remove_gpio_callback(const struct pio* gpio);
/* GPIO Activation */
* This function calls the config_pio() function for the gpio with the given
* mode, configures the direction of the pin and sets the initial state.
*/
-void config_gpio(struct pio* gpio, uint32_t mode, uint8_t dir, uint8_t ini_val);
+void config_gpio(const struct pio* gpio, uint32_t mode, uint8_t dir, uint8_t ini_val);
#endif /* DRIVERS_GPIO_H */