Hi Tim,

Normally an arch CAN driver doesn't have this enable pin or other similar
GPIO.

But if you plan to do it for your custom driver, it is better to use a
generic solution, like the CAN TX/RX pins do. Also UART, SPI and I2C uses
this solution.

Creating an #ifdef for each board inside your driver is not a good/right
solution.

You can use some GPIO_CANXYZ_EN_PIN in your driver and inside your board
you #define GPIO_CANXYZ_EN_PIN GPIO_PIN_Px

BR,

Alan

On Sunday, May 30, 2021, TimH <t...@jti.uk.com.invalid> wrote:

> Hi all,
>
> My custom board has a number of GPIOs that are related to more generic
> drivers. For example, the CAN implementation uses an arch. CAN driver
> appropriate for the processor, but has custom GPOs associated to
> enable/disable the CAN transceivers, and to enable/disable termination
> resistors.
>
> Is the right/best method to extend the CAN driver with these - but perhaps
> #ifdef them so they only relate to this board (which may end up being
> submitted to the repositiry - haven't decided yet!) - or handle them in
> some other way?
>
> I hope those with lots of experience of Nuttx can offer an opinion?
>
> Thanks,
>
> Tim.
>
>

Reply via email to