SmartSnippets DA1459x SDK
hw_gpio.h
Go to the documentation of this file.
1 
42 #ifndef HW_GPIO_H_
43 #define HW_GPIO_H_
44 
45 #if dg_configUSE_HW_GPIO
46 
47 #include <stdbool.h>
48 #include <stdint.h>
49 #include "sdk_defs.h"
50 
54 #define HW_GPIO_SET_PIN_FUNCTION(X) hw_gpio_set_pin_function(X##_PORT, X##_PIN, X##_MODE, X##_FUNC);
55 #define HW_GPIO_PAD_LATCH_ENABLE(X) hw_gpio_pad_latch_enable(X##_PORT, X##_PIN);
56 #define HW_GPIO_PAD_LATCH_DISABLE(X) hw_gpio_pad_latch_disable(X##_PORT, X##_PIN);
57 /* GPIO layout definitions */
58 
60 #define HW_GPIO_NUM_PORTS (2)
61 
62 #define HW_GPIO_NUM_PINS (HW_GPIO_PORT_0_NUM_PINS + HW_GPIO_PORT_1_NUM_PINS)
63 
64 #define HW_GPIO_PIN_BITS (4)
65 
66 #define HW_GPIO_PORT_0_NUM_PINS (16)
67 
68 #define HW_GPIO_PORT_1_NUM_PINS (16)
69 
70 #define HW_GPIO_PORT_NONE (HW_GPIO_PORT_MAX)
71 
72 #define HW_GPIO_PIN_NONE (HW_GPIO_PIN_MAX)
73 
74 #define HW_GPIO_MODE_NONE (HW_GPIO_MODE_INVALID)
75 
76 extern const uint8_t hw_gpio_port_num_pins[HW_GPIO_NUM_PORTS];
77 
82 typedef enum {
90 } HW_GPIO_MODE;
91 
96 typedef enum {
100 } HW_GPIO_PORT;
101 
106 typedef enum {
124 } HW_GPIO_PIN;
125 
130 typedef enum {
185  HW_GPIO_FUNC_LAST,
186 } HW_GPIO_FUNC;
187 
192 typedef enum {
193  HW_GPIO_CLK_XTAL32K = 0,
194  HW_GPIO_CLK_RCLP = 1,
195  HW_GPIO_CLK_RCX = 2,
196  HW_GPIO_CLK_XTAL32M = 3,
197  HW_GPIO_CLK_RC32M = 4,
198  HW_GPIO_CLK_DIVN = 5,
199  HW_GPIO_CLK_LAST,
200 } HW_GPIO_CLK;
201 
210  uint8_t pin;
213  bool high;
214  bool reserve; /*<< true if pin should be also reserved */
215 } gpio_config;
216 
221 typedef enum {
225 
241 #define HW_GPIO_PINCONFIG(xport, xpin, xmode, xfunc, xhigh) \
242  { \
243  .pin = (xport << HW_GPIO_PIN_BITS) | (xpin & ((1 << HW_GPIO_PIN_BITS) - 1)), \
244  .mode = HW_GPIO_MODE_ ## xmode, \
245  .func = HW_GPIO_FUNC_ ## xfunc, \
246  .high = xhigh, \
247  .reserve = false, \
248  }
249 
264 #define HW_GPIO_PINCONFIG_RESERVE(xport, xpin, xmode, xfunc, xhigh) \
265  { \
266  .pin = (xport << HW_GPIO_PIN_BITS) | (xpin & ((1 << HW_GPIO_PIN_BITS) - 1)), \
267  .mode = HW_GPIO_MODE_ ## xmode, \
268  .func = HW_GPIO_FUNC_ ## xfunc, \
269  .high = xhigh, \
270  .reserve = true, \
271  }
272 
277 #define HW_GPIO_PINCONFIG_END \
278  { \
279  .pin = 0xFF, \
280  }
281 
295 void hw_gpio_configure(const gpio_config cfg[]);
296 
311 
327  HW_GPIO_FUNC function, bool high);
328 
348 
349 #if (DEBUG_GPIO_ALLOC_MONITOR_ENABLED == 1)
350 
370 #define RESERVE_GPIO(name, port, pin, func) \
371  do { \
372  if (!hw_gpio_reserve_pin((port), (pin))) { \
373  /* If debugger stops at this line, there is configuration problem */ \
374  /* pin is used without being reserved first */ \
375  __BKPT(0); /* this pin has not been previously reserved! */ \
376  } \
377  } while (0)
378 
379 #else
380 
381 #define RESERVE_GPIO( name, port, pin, func ) \
382  do { \
383  \
384  } while (0)
385 
386 #endif // (DEBUG_GPIO_ALLOC_MONITOR_ENABLED == 1)
387 
398  HW_GPIO_FUNC function);
399 
410  HW_GPIO_FUNC* function);
411 
427 
437 
449  HW_GPIO_FUNC function, const bool high);
450 
451 
462 
473 
486 
494 void hw_gpio_toggle(HW_GPIO_PORT port, HW_GPIO_PIN pin);
495 
513 int hw_gpio_get_pins_with_function(HW_GPIO_FUNC func, uint8_t *buf, int buf_size);
514 
519 __STATIC_FORCEINLINE void hw_gpio_pad_latch_disable_all(void)
520 {
522  REG_SETF(CRG_TOP, P0_RESET_PAD_LATCH_REG, P0_RESET_LATCH_EN, CRG_TOP_P0_RESET_PAD_LATCH_REG_P0_RESET_LATCH_EN_Msk);
523  REG_SETF(CRG_TOP, P1_RESET_PAD_LATCH_REG, P1_RESET_LATCH_EN, CRG_TOP_P1_RESET_PAD_LATCH_REG_P1_RESET_LATCH_EN_Msk);
525 }
526 
531 __STATIC_FORCEINLINE void hw_gpio_pad_latch_enable_all(void)
532 {
534  REG_SETF(CRG_TOP, P0_SET_PAD_LATCH_REG, P0_SET_LATCH_EN, CRG_TOP_P0_SET_PAD_LATCH_REG_P0_SET_LATCH_EN_Msk);
535  REG_SETF(CRG_TOP, P1_SET_PAD_LATCH_REG, P1_SET_LATCH_EN, CRG_TOP_P1_SET_PAD_LATCH_REG_P1_SET_LATCH_EN_Msk);
537 }
538 
545 __STATIC_FORCEINLINE void hw_gpio_pad_latch_enable(HW_GPIO_PORT port, HW_GPIO_PIN pin)
546 {
547  ASSERT_WARNING((port == HW_GPIO_PORT_0) || (port == HW_GPIO_PORT_1));
548 
549  if (port == HW_GPIO_PORT_0) {
550  ASSERT_WARNING(pin < HW_GPIO_PORT_0_NUM_PINS);
551  CRG_TOP->P0_SET_PAD_LATCH_REG = 1 << pin;
552  } else if (port == HW_GPIO_PORT_1) {
553  ASSERT_WARNING(pin < HW_GPIO_PORT_1_NUM_PINS);
554  CRG_TOP->P1_SET_PAD_LATCH_REG = 1 << pin;
555  }
556 }
557 
564 __STATIC_FORCEINLINE void hw_gpio_pad_latch_disable(HW_GPIO_PORT port, HW_GPIO_PIN pin)
565 {
566  ASSERT_WARNING((port == HW_GPIO_PORT_0) || (port == HW_GPIO_PORT_1));
567 
568  if (port == HW_GPIO_PORT_0) {
569  ASSERT_WARNING(pin < HW_GPIO_PORT_0_NUM_PINS);
570  CRG_TOP->P0_RESET_PAD_LATCH_REG = 1 << pin;
571  } else if (port == HW_GPIO_PORT_1) {
572  ASSERT_WARNING(pin < HW_GPIO_PORT_1_NUM_PINS);
573  CRG_TOP->P1_RESET_PAD_LATCH_REG = 1 << pin;
574  }
575 }
576 
583 __STATIC_FORCEINLINE bool hw_gpio_pad_latch_is_enabled(HW_GPIO_PORT port, HW_GPIO_PIN pin)
584 {
585  ASSERT_WARNING((port == HW_GPIO_PORT_0) || (port == HW_GPIO_PORT_1));
586 
587  if (port == HW_GPIO_PORT_0) {
588  ASSERT_WARNING(pin < HW_GPIO_PORT_0_NUM_PINS);
589  return (CRG_TOP->P0_PAD_LATCH_REG & (1 << pin));
590  } else if (port == HW_GPIO_PORT_1) {
591  ASSERT_WARNING(pin < HW_GPIO_PORT_1_NUM_PINS);
592  return (CRG_TOP->P1_PAD_LATCH_REG & (1 << pin));
593  }
594 
595  return false;
596 }
597 
608 
609 
619 __STATIC_INLINE void hw_gpio_clk_output_enable(HW_GPIO_CLK clk)
620 {
621  switch (clk) {
622  case HW_GPIO_CLK_XTAL32M:
623  REG_SET_BIT(GPIO, GPIO_CLK_SEL_REG, XTAL32M_OUTPUT_EN);
624  break;
625  case HW_GPIO_CLK_RC32M:
626  REG_SET_BIT(GPIO, GPIO_CLK_SEL_REG, RC32M_OUTPUT_EN);
627  break;
628  case HW_GPIO_CLK_DIVN:
629  REG_SET_BIT(GPIO, GPIO_CLK_SEL_REG, DIVN_OUTPUT_EN);
630  break;
631  default:
632  ASSERT_WARNING(0);
633  break;
634  }
635 }
636 
643 __STATIC_INLINE void hw_gpio_clk_output_disable(HW_GPIO_CLK clk)
644 {
645  switch (clk) {
646  case HW_GPIO_CLK_XTAL32M:
647  REG_CLR_BIT(GPIO, GPIO_CLK_SEL_REG, XTAL32M_OUTPUT_EN);
648  break;
649  case HW_GPIO_CLK_RC32M:
650  REG_CLR_BIT(GPIO, GPIO_CLK_SEL_REG, RC32M_OUTPUT_EN);
651  break;
652  case HW_GPIO_CLK_DIVN:
653  REG_CLR_BIT(GPIO, GPIO_CLK_SEL_REG, DIVN_OUTPUT_EN);
654  break;
655  default:
656  ASSERT_WARNING(0);
657  break;
658  }
659 }
660 
665 __STATIC_INLINE void hw_gpio_clk_func_enable(void)
666 {
667  REG_SET_BIT(GPIO, GPIO_CLK_SEL_REG, FUNC_CLOCK_EN);
668 }
669 
674 __STATIC_INLINE void hw_gpio_clk_func_disable(void)
675 {
676  REG_CLR_BIT(GPIO, GPIO_CLK_SEL_REG, FUNC_CLOCK_EN);
677 }
678 
683 __STATIC_INLINE void hw_gpio_clk_func_sel(HW_GPIO_CLK clk_src)
684 {
685  REG_SETF(GPIO, GPIO_CLK_SEL_REG, FUNC_CLOCK_SEL, clk_src);
686 }
687 
708 __STATIC_INLINE void hw_gpio_configure_por_pin(HW_GPIO_PORT port, HW_GPIO_PIN pin, bool polarity)
709 {
710  uint8_t pin_select = REG_MSK(CRG_TOP, POR_PIN_REG, POR_PIN_SELECT);
711  if (port == HW_GPIO_PORT_0) {
712  if (pin < HW_GPIO_PORT_0_NUM_PINS) {
713  pin_select = pin;
714  }
715  } else if (port == HW_GPIO_PORT_1) {
716  if (pin < HW_GPIO_PORT_1_NUM_PINS) {
717  pin_select = HW_GPIO_PORT_0_NUM_PINS + pin;
718  }
719  }
720  CRG_TOP->POR_PIN_REG = BITS32(CRG_TOP, POR_PIN_REG, POR_PIN_POLARITY, polarity) |
721  BITS32(CRG_TOP, POR_PIN_REG, POR_PIN_SELECT, pin_select);
722 }
723 #endif /* dg_configUSE_HW_GPIO */
724 #endif /* HW_GPIO_H_ */
725 
hw_gpio_set_pin_function
void hw_gpio_set_pin_function(HW_GPIO_PORT port, HW_GPIO_PIN pin, HW_GPIO_MODE mode, HW_GPIO_FUNC function)
Set the pin type and mode.
HW_GPIO_FUNC_UART_RX
Definition: hw_gpio.h:132
HW_GPIO_FUNC_SPI_EN
Definition: hw_gpio.h:143
HW_GPIO_FUNC_CMAC_DIAG13
Definition: hw_gpio.h:182
HW_GPIO_FUNC_PORT4_DCF
Definition: hw_gpio.h:168
HW_GPIO_PIN_14
Definition: hw_gpio.h:121
REG_SETF
#define REG_SETF(base, reg, field, new_val)
Set the value of a register field.
Definition: sdk_defs.h:738
REG_CLR_BIT
#define REG_CLR_BIT(base, reg, field)
Clear a bit of a register.
Definition: sdk_defs.h:781
hw_gpio_pad_latch_disable
__STATIC_FORCEINLINE void hw_gpio_pad_latch_disable(HW_GPIO_PORT port, HW_GPIO_PIN pin)
Disables the latch for the specific gpio.
Definition: hw_gpio.h:564
CRG_TOP_P0_RESET_PAD_LATCH_REG_P0_RESET_LATCH_EN_Msk
#define CRG_TOP_P0_RESET_PAD_LATCH_REG_P0_RESET_LATCH_EN_Msk
Definition: DA1459x-00.h:2053
REG_SET_BIT
#define REG_SET_BIT(base, reg, field)
Set a bit of a register.
Definition: sdk_defs.h:766
HW_GPIO_PIN_4
Definition: hw_gpio.h:111
HW_GPIO_PIN_1
Definition: hw_gpio.h:108
HW_GPIO_NUM_PORTS
#define HW_GPIO_NUM_PORTS
Definition: hw_gpio.h:60
HW_GPIO_MODE_INPUT_PULLDOWN
Definition: hw_gpio.h:85
HW_GPIO_FUNC_UART2_TX
Definition: hw_gpio.h:135
HW_GPIO_FUNC_COEX_SMART_ACT
Definition: hw_gpio.h:162
HW_GPIO_FUNC_CMAC_DIAG12
Definition: hw_gpio.h:181
hw_gpio_get_pin_status
bool hw_gpio_get_pin_status(HW_GPIO_PORT port, HW_GPIO_PIN pin)
Get the GPIO status.
HW_GPIO_FUNC_UART_TX
Definition: hw_gpio.h:133
HW_GPIO_FUNC_TIM_PWM
Definition: hw_gpio.h:155
HW_GPIO_FUNC_TIM_1SHOT
Definition: hw_gpio.h:157
hw_gpio_set_pin_drive_strength
void hw_gpio_set_pin_drive_strength(HW_GPIO_PORT port, HW_GPIO_PIN pin, HW_GPIO_DRIVE_STRENGTH strength)
Set the pin drive strength.
hw_gpio_reserve_and_configure_pin
bool hw_gpio_reserve_and_configure_pin(HW_GPIO_PORT port, HW_GPIO_PIN pin, HW_GPIO_MODE mode, HW_GPIO_FUNC function, bool high)
Reserve GPIO pin and set pin function.
HW_GPIO_MODE_OUTPUT_PUSH_PULL
Definition: hw_gpio.h:87
CRG_TOP_P1_RESET_PAD_LATCH_REG_P1_RESET_LATCH_EN_Msk
#define CRG_TOP_P1_RESET_PAD_LATCH_REG_P1_RESET_LATCH_EN_Msk
Definition: DA1459x-00.h:2062
HW_GPIO_PORT_1
Definition: hw_gpio.h:98
HW_GPIO_FUNC_CMAC_DIAG6
Definition: hw_gpio.h:175
sdk_defs.h
Central include header file with platform definitions.
HW_GPIO_FUNC_TIM2_1SHOT
Definition: hw_gpio.h:158
HW_GPIO_PIN_5
Definition: hw_gpio.h:112
HW_GPIO_FUNC_PDM_DATA
Definition: hw_gpio.h:152
hw_gpio_set_active
void hw_gpio_set_active(HW_GPIO_PORT port, HW_GPIO_PIN pin)
Set a GPIO in high state.
HW_GPIO_FUNC_SPI_DO
Definition: hw_gpio.h:141
HW_GPIO_MODE_INPUT
Definition: hw_gpio.h:83
HW_GPIO_FUNC_PCM_DO
Definition: hw_gpio.h:149
BITS32
#define BITS32(base, reg, field, v)
Sets 32-bit wide register bits, indicated by the field, to a value v.
Definition: sdk_defs.h:822
HW_GPIO_FUNC_GPIO
Definition: hw_gpio.h:131
HW_GPIO_PORT_1_NUM_PINS
#define HW_GPIO_PORT_1_NUM_PINS
Definition: hw_gpio.h:68
HW_GPIO_FUNC_PCM_CLK
Definition: hw_gpio.h:151
HW_GPIO_FUNC_PCM_FSC
Definition: hw_gpio.h:150
HW_GPIO_PIN_7
Definition: hw_gpio.h:114
HW_GPIO_PIN_13
Definition: hw_gpio.h:120
hw_gpio_get_pins_with_function
int hw_gpio_get_pins_with_function(HW_GPIO_FUNC func, uint8_t *buf, int buf_size)
Find pins with specific function.
HW_GPIO_MODE_OUTPUT
Definition: hw_gpio.h:86
HW_GPIO_FUNC_PDM_CLK
Definition: hw_gpio.h:153
HW_GPIO_PIN
HW_GPIO_PIN
GPIO pin number.
Definition: hw_gpio.h:106
HW_GPIO_FUNC_COEX_EXT_ACT
Definition: hw_gpio.h:161
HW_GPIO_FUNC_COEX_SMART_PRI
Definition: hw_gpio.h:163
HW_GPIO_FUNC_CMAC_DIAG11
Definition: hw_gpio.h:180
HW_GPIO_FUNC_PCM_DI
Definition: hw_gpio.h:148
HW_GPIO_FUNC_CMAC_DIAG14
Definition: hw_gpio.h:183
HW_GPIO_FUNC_I2C_SCL
Definition: hw_gpio.h:145
HW_GPIO_PORT
HW_GPIO_PORT
GPIO port number.
Definition: hw_gpio.h:96
HW_GPIO_PIN_2
Definition: hw_gpio.h:109
__PACKED_STRUCT
typedef __PACKED_STRUCT
GPIO pin configuration.
Definition: hw_gpio.h:209
HW_GPIO_PIN_6
Definition: hw_gpio.h:113
HW_GPIO_PORT_MAX
Definition: hw_gpio.h:99
HW_GPIO_FUNC_PORT3_DCF
Definition: hw_gpio.h:167
hw_gpio_clk_output_disable
__STATIC_INLINE void hw_gpio_clk_output_disable(HW_GPIO_CLK clk)
Disable mapping of selected clock to the respective GPIO.
Definition: hw_gpio.h:643
HW_GPIO_PIN_MAX
Definition: hw_gpio.h:123
hw_gpio_set_inactive
void hw_gpio_set_inactive(HW_GPIO_PORT port, HW_GPIO_PIN pin)
Set a GPIO in low state.
HW_GPIO_FUNC
HW_GPIO_FUNC
GPIO function.
Definition: hw_gpio.h:130
hw_gpio_configure_por_pin
__STATIC_INLINE void hw_gpio_configure_por_pin(HW_GPIO_PORT port, HW_GPIO_PIN pin, bool polarity)
Select a pin as a POR trigger source.
Definition: hw_gpio.h:708
HW_GPIO_PIN_15
Definition: hw_gpio.h:122
HW_GPIO_FUNC_SPI_DI
Definition: hw_gpio.h:140
hw_gpio_clk_output_enable
__STATIC_INLINE void hw_gpio_clk_output_enable(HW_GPIO_CLK clk)
Enable mapping of selected clock to the respective GPIO.
Definition: hw_gpio.h:619
hw_gpio_configure
void hw_gpio_configure(const gpio_config cfg[])
GPIO configuration.
HW_GPIO_FUNC_PORT0_DCF
Definition: hw_gpio.h:164
HW_GPIO_FUNC_CMAC_DIAG2
Definition: hw_gpio.h:171
HW_GPIO_FUNC_SPI_CLK
Definition: hw_gpio.h:142
hw_gpio_configure_pin
void hw_gpio_configure_pin(HW_GPIO_PORT port, HW_GPIO_PIN pin, HW_GPIO_MODE mode, HW_GPIO_FUNC function, const bool high)
Combined function to set the state and the type and mode of the GPIO pin.
HW_GPIO_FUNC_CMAC_DIAG3
Definition: hw_gpio.h:172
HW_GPIO_MODE_OUTPUT_OPEN_DRAIN
Definition: hw_gpio.h:88
func
HW_GPIO_FUNC func
Definition: hw_gpio.h:212
hw_gpio_pad_latch_is_enabled
__STATIC_FORCEINLINE bool hw_gpio_pad_latch_is_enabled(HW_GPIO_PORT port, HW_GPIO_PIN pin)
Checks if the specific GPIO is latched or not.
Definition: hw_gpio.h:583
HW_GPIO_PIN_9
Definition: hw_gpio.h:116
hw_gpio_reserve_pin
bool hw_gpio_reserve_pin(HW_GPIO_PORT port, HW_GPIO_PIN pin)
Reserve GPIO pin.
REG_MSK
#define REG_MSK(base, reg, field)
Access register field mask.
Definition: sdk_defs.h:583
mode
HW_GPIO_MODE mode
Definition: hw_gpio.h:211
HW_GPIO_FUNC_UART2_RX
Definition: hw_gpio.h:134
HW_GPIO_FUNC_CMAC_DIAG0
Definition: hw_gpio.h:169
hw_gpio_get_pin_function
void hw_gpio_get_pin_function(HW_GPIO_PORT port, HW_GPIO_PIN pin, HW_GPIO_MODE *mode, HW_GPIO_FUNC *function)
Get the pin type and mode.
CRG_TOP_P0_SET_PAD_LATCH_REG_P0_SET_LATCH_EN_Msk
#define CRG_TOP_P0_SET_PAD_LATCH_REG_P0_SET_LATCH_EN_Msk
Definition: DA1459x-00.h:2056
hw_gpio_get_pin_with_function
bool hw_gpio_get_pin_with_function(HW_GPIO_FUNC func, HW_GPIO_PORT *port, HW_GPIO_PIN *pin)
Find GPIO with specific function.
HW_GPIO_PIN_8
Definition: hw_gpio.h:115
HW_GPIO_PIN_11
Definition: hw_gpio.h:118
HW_GPIO_PORT_0_NUM_PINS
#define HW_GPIO_PORT_0_NUM_PINS
Definition: hw_gpio.h:66
hw_gpio_pad_latch_enable_all
__STATIC_FORCEINLINE void hw_gpio_pad_latch_enable_all(void)
Enables the latches of all gpios.
Definition: hw_gpio.h:531
HW_GPIO_FUNC_UART2_CTSN
Definition: hw_gpio.h:136
HW_GPIO_PIN_3
Definition: hw_gpio.h:110
hw_gpio_unreserve_pin
void hw_gpio_unreserve_pin(HW_GPIO_PORT port, HW_GPIO_PIN pin)
Unreserve GPIO pin.
HW_GPIO_FUNC_CMAC_DIAG4
Definition: hw_gpio.h:173
GLOBAL_INT_RESTORE
#define GLOBAL_INT_RESTORE()
Macro to restore all interrupts.
Definition: sdk_defs.h:477
hw_gpio_clk_func_enable
__STATIC_INLINE void hw_gpio_clk_func_enable(void)
Enable the mapping of the selected clock signal, according to FUNC_CLOCK_SEL bit-field.
Definition: hw_gpio.h:665
HW_GPIO_FUNC_ISO_DATA
Definition: hw_gpio.h:139
HW_GPIO_FUNC_CMAC_DIAG15
Definition: hw_gpio.h:184
HW_GPIO_FUNC_CMAC_DIAG5
Definition: hw_gpio.h:174
HW_GPIO_DRIVE_STRENGTH
HW_GPIO_DRIVE_STRENGTH
GPIOs Drive Strength.
Definition: hw_gpio.h:221
HW_GPIO_FUNC_TIM3_PWM
Definition: hw_gpio.h:159
HW_GPIO_FUNC_SPI_EN2
Definition: hw_gpio.h:144
HW_GPIO_FUNC_PORT2_DCF
Definition: hw_gpio.h:166
hw_gpio_pad_latch_enable
__STATIC_FORCEINLINE void hw_gpio_pad_latch_enable(HW_GPIO_PORT port, HW_GPIO_PIN pin)
Enables the latch for the specific gpio.
Definition: hw_gpio.h:545
HW_GPIO_FUNC_UART2_RTSN
Definition: hw_gpio.h:137
HW_GPIO_FUNC_PORT1_DCF
Definition: hw_gpio.h:165
HW_GPIO_FUNC_CLOCK
Definition: hw_gpio.h:154
HW_GPIO_FUNC_CMAC_DIAG1
Definition: hw_gpio.h:170
HW_GPIO_FUNC_CMAC_DIAG9
Definition: hw_gpio.h:178
HW_GPIO_FUNC_TIM2_PWM
Definition: hw_gpio.h:156
HW_GPIO_FUNC_ADC
Definition: hw_gpio.h:147
HW_GPIO_MODE_INPUT_PULLUP
Definition: hw_gpio.h:84
hw_gpio_toggle
void hw_gpio_toggle(HW_GPIO_PORT port, HW_GPIO_PIN pin)
Toggle GPIO pin state.
HW_GPIO_FUNC_ISO_CLK
Definition: hw_gpio.h:138
HW_GPIO_DRIVE_STRENGTH_WEAK
Definition: hw_gpio.h:223
HW_GPIO_FUNC_CMAC_DIAG8
Definition: hw_gpio.h:177
HW_GPIO_CLK
HW_GPIO_CLK
Clocks that can be mapped to GPIOs.
Definition: hw_gpio.h:192
HW_GPIO_MODE
HW_GPIO_MODE
GPIO input/output mode.
Definition: hw_gpio.h:82
hw_gpio_get_pin_drive_strength
HW_GPIO_DRIVE_STRENGTH hw_gpio_get_pin_drive_strength(HW_GPIO_PORT port, HW_GPIO_PIN pin)
Get the pin drive strength.
HW_GPIO_PORT_0
Definition: hw_gpio.h:97
HW_GPIO_FUNC_CMAC_DIAG10
Definition: hw_gpio.h:179
HW_GPIO_FUNC_I2C_SDA
Definition: hw_gpio.h:146
HW_GPIO_MODE_INVALID
Definition: hw_gpio.h:89
HW_GPIO_DRIVE_STRENGTH_NORMAL
Definition: hw_gpio.h:222
HW_GPIO_PIN_0
Definition: hw_gpio.h:107
HW_GPIO_PIN_12
Definition: hw_gpio.h:119
high
bool high
Definition: hw_gpio.h:213
GLOBAL_INT_DISABLE
#define GLOBAL_INT_DISABLE()
Macro to disable all interrupts.
Definition: sdk_defs.h:452
hw_gpio_clk_func_sel
__STATIC_INLINE void hw_gpio_clk_func_sel(HW_GPIO_CLK clk_src)
Select which clock to map when GPIO function is FUNC_CLOCK.
Definition: hw_gpio.h:683
CRG_TOP_P1_SET_PAD_LATCH_REG_P1_SET_LATCH_EN_Msk
#define CRG_TOP_P1_SET_PAD_LATCH_REG_P1_SET_LATCH_EN_Msk
Definition: DA1459x-00.h:2065
hw_gpio_pad_latch_disable_all
__STATIC_FORCEINLINE void hw_gpio_pad_latch_disable_all(void)
Disables the latches of all gpios.
Definition: hw_gpio.h:519
hw_gpio_clk_func_disable
__STATIC_INLINE void hw_gpio_clk_func_disable(void)
Disable the mapping of the selected clock signal, according to FUNC_CLOCK_SEL bit-field.
Definition: hw_gpio.h:674
HW_GPIO_PIN_10
Definition: hw_gpio.h:117
HW_GPIO_FUNC_TIM4_PWM
Definition: hw_gpio.h:160
HW_GPIO_FUNC_CMAC_DIAG7
Definition: hw_gpio.h:176