I'm an embedded developer with a lot of experience with M4s in the shape of STM32s, but I'm completely new to mbed. I'm a bit curious about what the API does under the hood, and how capable it is.
Take Serial for instance. You give it a TX and RX pin, and it automatically works out which USART peripheral each pin for those functions, and raises an error if there is no match or the pins are attached to different peripherals. Neat! But which peripheral is actually used? Is it USART2 or USART3 or whatever? Should I care? I think I'd like to know that sort of thing.
Now suppose I want to use DMA for the transfers. I guess it looks up the relevant DMA streams and sorts it all out for me. But the DMA channel table has redundancy, but can start to get crowded if you have several devices using DMA. I've had to jiggle things around in the past to avoid clashes. Are clashes detected? i.e. does mbed know that a stream (or other peripheral) is already in use?
Suppose I want to use a timer to check the NDTR register of the RX DMA stream rather than wait for transfer complete. I don't want to hang around waiting if the received message is not long enough to trigger the interrupt.
Sorry if these are dumb questions. I'm used to understanding the parts I'm programming quite intimately, and having to go through the sometimes painful process of constraint solving with pins, peripherals, IRQs and DMA. I suppose the question is, to what extent can mbed do this for me?
UnicycleBloke
I'm an embedded developer with a lot of experience with M4s in the shape of STM32s, but I'm completely new to mbed. I'm a bit curious about what the API does under the hood, and how capable it is.
Take Serial for instance. You give it a TX and RX pin, and it automatically works out which USART peripheral each pin for those functions, and raises an error if there is no match or the pins are attached to different peripherals. Neat! But which peripheral is actually used? Is it USART2 or USART3 or whatever? Should I care? I think I'd like to know that sort of thing.
Now suppose I want to use DMA for the transfers. I guess it looks up the relevant DMA streams and sorts it all out for me. But the DMA channel table has redundancy, but can start to get crowded if you have several devices using DMA. I've had to jiggle things around in the past to avoid clashes. Are clashes detected? i.e. does mbed know that a stream (or other peripheral) is already in use?
Suppose I want to use a timer to check the NDTR register of the RX DMA stream rather than wait for transfer complete. I don't want to hang around waiting if the received message is not long enough to trigger the interrupt.
Sorry if these are dumb questions. I'm used to understanding the parts I'm programming quite intimately, and having to go through the sometimes painful process of constraint solving with pins, peripherals, IRQs and DMA. I suppose the question is, to what extent can mbed do this for me?
UnicycleBloke