README
Jul 27, 2014 - Using C language's low level capabilities to access registers in peripheral. For example, a serial interface (UART) might have an 8-bit register, with the bits. Although this is very neat and tidy, it renders the code somewhat.
This is my somewhat 'exotic' UART driver for the STM32F4 series ofmicroprocessors. Basically I got tired of trying to get all the variouscalls correct and wrote some code that takes a transmit pin, a receive pin,and assuming it can connect those to the same serial port it creates thenecessary calls to the chip to do so. Note, it could even split transmitand receive across USART/UARTs but that is going a bit far. If you needthat then do two USART inits and two APB inits one each for the RX and TXlines.
I borrowed the Makefiles and linkerscript from the libopencm3 projectsince they do everything I needed and I'm using libopencm3 for the otherinfrastructure.
In addition there is some number formatting code (ntoa) which, yes, isbasically a re-implementation of some of the capabilities of
printf
except that I find its harder to find just the 'formatting' code fromprintf these days. And since I have been having issues getting newlibto do what I want on a bare metal platform, I once again wrote some numberformatting code. Basically it prints numbers as either decimal, binary,octal, or hex. And it can add some decoration to indicated their base(decimals end in .0, octal starts with a leading 0, binary with 0b, andhexadecimal with 0x) The goal being a companion 'getnum' which can reversethat and process any base number. The combination being useful in thedevelopment of a small embedded monitor for the ARM chip.Comments or questions to me.
--Chuck