2018-05-08 04:32:27 +03:00
|
|
|
#ifndef __LPC176X_INTERNAL_H
|
|
|
|
#define __LPC176X_INTERNAL_H
|
|
|
|
// Local definitions for lpc176x code
|
|
|
|
|
2019-01-04 18:41:46 +03:00
|
|
|
#define GPIO(PORT, NUM) ((PORT) * 32 + (NUM))
|
|
|
|
#define GPIO2PORT(PIN) ((PIN) / 32)
|
|
|
|
#define GPIO2BIT(PIN) (1<<((PIN) % 32))
|
|
|
|
|
2018-11-22 04:33:44 +03:00
|
|
|
#define PCLK_TIMER0 1
|
|
|
|
#define PCLK_UART0 3
|
|
|
|
#define PCLK_ADC 12
|
2018-11-22 04:40:34 +03:00
|
|
|
#define PCLK_I2C1 19
|
|
|
|
#define PCLK_SSP0 21
|
2018-11-22 04:33:44 +03:00
|
|
|
void enable_peripheral_clock(uint32_t pclk);
|
2018-05-08 04:32:27 +03:00
|
|
|
void gpio_peripheral(int bank, int pin, int func, int pullup);
|
|
|
|
|
|
|
|
#endif // internal.h
|