David Kaplan

LPC Open 1.19 LPC824 possible problems

Discussion created by David Kaplan on Nov 2, 2016
Latest reply on Nov 3, 2016 by David E Seymour

In the lpcopen_2_19_lpcxpresso_nxp_lpcxpresso_824 zip, in the uart_8xx.h, the UART_CFG_TXPOL should be 23 if the user manual is correct!.

 

#define UART_CFG_RXPOL          (0x01 << 22)    /*!< Receive data polarity */
#define UART_CFG_TXPOL          (0x01 << 22)    /*!< Transmit data polarity */

 

In the gpio_8xx.h file there are three inline functions which take a byte bit parameter value and do not convert the bit to a byte. I would expect a 32 bit mask as the parameter or a bit to mask conversion for a single bit.

 

STATIC INLINE void Chip_GPIO_SetPortDIROutput(LPC_GPIO_T *pGPIO, uint8_t port, uint8_t pinMask)
{
#ifdef CHIP_LPC82X
    pGPIO->DIRSET[port] = pinMask;

// ?!? Should be maybe uint32_t pinMask or (1L<<pinMask)

 

STATIC INLINE void Chip_GPIO_SetPortDIRInput(LPC_GPIO_T *pGPIO, uint8_t port, uint8_t pinMask)
{
#ifdef CHIP_LPC82X
    pGPIO->DIRCLR[port] = pinMask;

 

STATIC INLINE void Chip_GPIO_TogglePortDIR(LPC_GPIO_T *pGPIO, uint8_t port, uint8_t pinMask)
{
#ifdef CHIP_LPC82X
    pGPIO->DIRNOT[port] = pinMask;

Outcomes