![]() |
M471M/R1/S BSP V3.01.000
The Board Support Package for M4521
|
Macros | |
#define | GPIO_CLR_INT_FLAG(port, u32PinMask) ((port)->INTSRC = (u32PinMask)) |
Clear GPIO Pin Interrupt Flag. More... | |
#define | GPIO_DISABLE_DEBOUNCE(port, u32PinMask) ((port)->DBEN &= ~(u32PinMask)) |
Disable Pin De-bounce Function. More... | |
#define | GPIO_ENABLE_DEBOUNCE(port, u32PinMask) ((port)->DBEN |= (u32PinMask)) |
Enable Pin De-bounce Function. More... | |
#define | GPIO_DISABLE_DIGITAL_PATH(port, u32PinMask) ((port)->DINOFF |= ((u32PinMask)<<16)) |
Disable I/O Digital Input Path. More... | |
#define | GPIO_ENABLE_DIGITAL_PATH(port, u32PinMask) ((port)->DINOFF &= ~((u32PinMask)<<16)) |
Enable I/O Digital Input Path. More... | |
#define | GPIO_DISABLE_DOUT_MASK(port, u32PinMask) ((port)->DATMSK &= ~(u32PinMask)) |
Disable I/O DOUT mask. More... | |
#define | GPIO_ENABLE_DOUT_MASK(port, u32PinMask) ((port)->DATMSK |= (u32PinMask)) |
Enable I/O DOUT mask. More... | |
#define | GPIO_GET_INT_FLAG(port, u32PinMask) ((port)->INTSRC & (u32PinMask)) |
Get GPIO Pin Interrupt Flag. More... | |
#define | GPIO_SET_DEBOUNCE_TIME(u32ClkSrc, u32ClkSel) (GPIO->DBCTL = (GPIO_DBCTL_ICLKON_Msk | (u32ClkSrc) | (u32ClkSel))) |
Set De-bounce Sampling Cycle Time. More... | |
#define | GPIO_GET_IN_DATA(port) ((port)->PIN) |
Get GPIO Port IN Data. More... | |
#define | GPIO_SET_OUT_DATA(port, u32Data) ((port)->DOUT = (u32Data)) |
Set GPIO Port OUT Data. More... | |
#define | GPIO_TOGGLE(u32Pin) ((u32Pin) ^= 1) |
Toggle Specified GPIO pin. More... | |
#define | GPIO_EnableEINT GPIO_EnableInt |
Enable External GPIO interrupt. More... | |
#define | GPIO_DisableEINT GPIO_DisableInt |
Disable External GPIO interrupt. More... | |
Functions | |
void | GPIO_SetMode (GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode) |
Set GPIO operation mode. More... | |
void | GPIO_EnableInt (GPIO_T *port, uint32_t u32Pin, uint32_t u32IntAttribs) |
Enable GPIO interrupt. More... | |
void | GPIO_DisableInt (GPIO_T *port, uint32_t u32Pin) |
Disable GPIO interrupt. More... | |
#define GPIO_CLR_INT_FLAG | ( | port, | |
u32PinMask | |||
) | ((port)->INTSRC = (u32PinMask)) |
Clear GPIO Pin Interrupt Flag.
[in] | port | GPIO port. It could be PA, PB, PC, PD, PE or PF. |
[in] | u32PinMask | The single or multiple pins of specified GPIO port. It could be BIT0 ~ BIT15 for PA, PB, PC and PD. It could be BIT0 ~ BIT14 for PE. It could be BIT0 ~ BIT7 for PF. |
Clear the interrupt status of specified GPIO pin.
#define GPIO_DISABLE_DEBOUNCE | ( | port, | |
u32PinMask | |||
) | ((port)->DBEN &= ~(u32PinMask)) |
Disable Pin De-bounce Function.
[in] | port | GPIO port. It could be PA, PB, PC, PD, PE or PF. |
[in] | u32PinMask | The single or multiple pins of specified GPIO port. It could be BIT0 ~ BIT15 for PA, PB, PC and PD. It could be BIT0 ~ BIT14 for PE. It could be BIT0 ~ BIT7 for PF. |
Disable the interrupt de-bounce function of specified GPIO pin.
#define GPIO_DISABLE_DIGITAL_PATH | ( | port, | |
u32PinMask | |||
) | ((port)->DINOFF |= ((u32PinMask)<<16)) |
Disable I/O Digital Input Path.
[in] | port | GPIO port. It could be PA, PB, PC, PD, PE or PF. |
[in] | u32PinMask | The single or multiple pins of specified GPIO port. It could be BIT0 ~ BIT15 for PA, PB, PC and PD. It could be BIT0 ~ BIT14 for PE. It could be BIT0 ~ BIT7 for PF. |
Disable I/O digital input path of specified GPIO pin.
#define GPIO_DISABLE_DOUT_MASK | ( | port, | |
u32PinMask | |||
) | ((port)->DATMSK &= ~(u32PinMask)) |
Disable I/O DOUT mask.
[in] | port | GPIO port. It could be PA, PB, PC, PD, PE or PF. |
[in] | u32PinMask | The single or multiple pins of specified GPIO port. It could be BIT0 ~ BIT15 for PA, PB, PC and PD. It could be BIT0 ~ BIT14 for PE. It could be BIT0 ~ BIT7 for PF. |
Disable I/O DOUT mask of specified GPIO pin.
#define GPIO_DisableEINT GPIO_DisableInt |
Disable External GPIO interrupt.
[in] | port | GPIO port. It could be PA, PB, PC, PD, PE or PF. |
[in] | u32Pin | The pin of specified GPIO port. It could be 0 ~ 15 for PA, PB, PC and PD GPIO port. It could be 0 ~ 14 for PE GPIO port. It could be 0 ~ 7 for PF GPIO port. |
This function is used to enable specified GPIO pin interrupt.
#define GPIO_ENABLE_DEBOUNCE | ( | port, | |
u32PinMask | |||
) | ((port)->DBEN |= (u32PinMask)) |
Enable Pin De-bounce Function.
[in] | port | GPIO port. It could be PA, PB, PC, PD, PE or PF. |
[in] | u32PinMask | The single or multiple pins of specified GPIO port. It could be BIT0 ~ BIT15 for PA, PB, PC and PD. It could be BIT0 ~ BIT14 for PE. It could be BIT0 ~ BIT7 for PF. |
Enable the interrupt de-bounce function of specified GPIO pin.
#define GPIO_ENABLE_DIGITAL_PATH | ( | port, | |
u32PinMask | |||
) | ((port)->DINOFF &= ~((u32PinMask)<<16)) |
Enable I/O Digital Input Path.
[in] | port | GPIO port. It could be PA, PB, PC, PD, PE or PF. |
[in] | u32PinMask | The single or multiple pins of specified GPIO port. It could be BIT0 ~ BIT15 for PA, PB, PC and PD. It could be BIT0 ~ BIT14 for PE. It could be BIT0 ~ BIT7 for PF. |
Enable I/O digital input path of specified GPIO pin.
#define GPIO_ENABLE_DOUT_MASK | ( | port, | |
u32PinMask | |||
) | ((port)->DATMSK |= (u32PinMask)) |
Enable I/O DOUT mask.
[in] | port | GPIO port. It could be PA, PB, PC, PD, PE or PF. |
[in] | u32PinMask | The single or multiple pins of specified GPIO port. It could be BIT0 ~ BIT15 for PA, PB, PC and PD. It could be BIT0 ~ BIT14 for PE. It could be BIT0 ~ BIT7 for PF. |
Enable I/O DOUT mask of specified GPIO pin.
#define GPIO_EnableEINT GPIO_EnableInt |
Enable External GPIO interrupt.
[in] | port | GPIO port. It could be PA, PB, PC, PD, PE or PF. |
[in] | u32Pin | The pin of specified GPIO port. It could be 0 ~ 15 for PA, PB, PC and PD GPIO port. It could be 0 ~ 14 for PE GPIO port. It could be 0 ~ 7 for PF GPIO port. |
[in] | u32IntAttribs | The interrupt attribute of specified GPIO pin. It could be GPIO_INT_RISING, GPIO_INT_FALLING, GPIO_INT_BOTH_EDGE, GPIO_INT_HIGH, GPIO_INT_LOW. |
This function is used to enable specified GPIO pin interrupt.
#define GPIO_GET_IN_DATA | ( | port | ) | ((port)->PIN) |
#define GPIO_GET_INT_FLAG | ( | port, | |
u32PinMask | |||
) | ((port)->INTSRC & (u32PinMask)) |
Get GPIO Pin Interrupt Flag.
[in] | port | GPIO port. It could be PA, PB, PC, PD, PE or PF. |
[in] | u32PinMask | The single or multiple pins of specified GPIO port. It could be BIT0 ~ BIT15 for PA, PB, PC and PD. It could be BIT0 ~ BIT14 for PE. It could be BIT0 ~ BIT7 for PF. |
0 | No interrupt at specified GPIO pin |
1 | The specified GPIO pin generate an interrupt |
Get the interrupt status of specified GPIO pin.
#define GPIO_SET_DEBOUNCE_TIME | ( | u32ClkSrc, | |
u32ClkSel | |||
) | (GPIO->DBCTL = (GPIO_DBCTL_ICLKON_Msk | (u32ClkSrc) | (u32ClkSel))) |
Set De-bounce Sampling Cycle Time.
[in] | u32ClkSrc | The de-bounce counter clock source. It could be GPIO_DBCTL_DBCLKSRC_HCLK or GPIO_DBCTL_DBCLKSRC_LIRC. |
[in] | u32ClkSel | The de-bounce sampling cycle selection. It could be
|
Set the interrupt de-bounce sampling cycle time based on the debounce counter clock source.
Example: _GPIO_SET_DEBOUNCE_TIME(GPIO_DBCTL_DBCLKSRC_LIRC, GPIO_DBCTL_DBCLKSEL_4).
It's meaning the De-debounce counter clock source is internal 10 KHz and sampling cycle selection is 4.
Then the target de-bounce sampling cycle time is (4)*(1/(10*1000)) s = 4*0.0001 s = 400 us, and system will sampling interrupt input once per 00 us.
#define GPIO_SET_OUT_DATA | ( | port, | |
u32Data | |||
) | ((port)->DOUT = (u32Data)) |
#define GPIO_TOGGLE | ( | u32Pin | ) | ((u32Pin) ^= 1) |
void GPIO_DisableInt | ( | GPIO_T * | port, |
uint32_t | u32Pin | ||
) |
Disable GPIO interrupt.
[in] | port | GPIO port. It could be PA, PB, PC, PD, PE or PF. |
[in] | u32Pin | The pin of specified GPIO port. It could be 0 ~ 15 for PA, PB, PC and PD GPIO port. It could be 0 ~ 14 for PE GPIO port. It could be 0 ~ 7 for PF GPIO port. |
This function is used to enable specified GPIO pin interrupt.
void GPIO_EnableInt | ( | GPIO_T * | port, |
uint32_t | u32Pin, | ||
uint32_t | u32IntAttribs | ||
) |
Enable GPIO interrupt.
[in] | port | GPIO port. It could be PA, PB, PC, PD, PE or PF. |
[in] | u32Pin | The pin of specified GPIO port. It could be 0 ~ 15 for PA, PB, PC and PD GPIO port. It could be 0 ~ 14 for PE GPIO port. It could be 0 ~ 7 for PF GPIO port. |
[in] | u32IntAttribs | The interrupt attribute of specified GPIO pin. It could be GPIO_INT_RISING, GPIO_INT_FALLING, GPIO_INT_BOTH_EDGE, GPIO_INT_HIGH, GPIO_INT_LOW. |
This function is used to enable specified GPIO pin interrupt.
void GPIO_SetMode | ( | GPIO_T * | port, |
uint32_t | u32PinMask, | ||
uint32_t | u32Mode | ||
) |
Set GPIO operation mode.
[in] | port | GPIO port. It could be PA, PB, PC, PD, PE or PF. |
[in] | u32PinMask | The single or multiple pins of specified GPIO port. It could be BIT0 ~ BIT15 for PA, PB, PC and PD GPIO port. It could be BIT0 ~ BIT14 for PE GPIO port. It could be BIT0 ~ BIT7 for PF GPIO port. |
[in] | u32Mode | Operation mode. It could be GPIO_MODE_INPUT, GPIO_MODE_OUTPUT, GPIO_MODE_OPEN_DRAIN, GPIO_MODE_QUASI. |
This function is used to set specified GPIO operation mode.